Matrix.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 #include <system/details/array_view.h>
5 #include <system/array.h>
6 #include <cstdint>
7 
8 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
9 
10 namespace Aspose
11 {
12 namespace Font
13 {
14 class TransformationMatrix;
15 } // namespace Font
16 namespace Pdf
17 {
18 namespace Annotations
19 {
20 class FixedPrint;
21 } // namespace Annotations
22 class ApsToPdfConverter;
23 namespace Drawing
24 {
25 class Graph;
26 } // namespace Drawing
27 namespace Engine
28 {
29 namespace CommonData
30 {
31 namespace Text
32 {
33 namespace Segmenting
34 {
35 class PhysicalTextSegment;
36 class TextSegmenter;
37 } // namespace Segmenting
38 } // namespace Text
39 } // namespace CommonData
40 namespace Data
41 {
42 class IPdfArray;
43 class ITrailerable;
44 } // namespace Data
45 } // namespace Engine
46 namespace Facades
47 {
48 class PdfFileEditor;
49 } // namespace Facades
50 class ImagePlacementAbsorber;
51 class Point;
52 class Rectangle;
53 enum class Rotation;
54 namespace Text
55 {
56 class TextFragment;
57 class TextFragmentState;
58 class TextPostReplaceFixer;
59 } // namespace Text
60 namespace Vector
61 {
62 class GraphicAppender;
63 class GraphicElement;
64 class GraphicsAbsorber;
65 class GraphicState;
66 class PositionSetter;
67 class XFormPlacement;
68 } // namespace Vector
69 class XForm;
70 } // namespace Pdf
71 } // namespace Aspose
72 namespace System
73 {
74 namespace Drawing
75 {
76 namespace Drawing2D
77 {
78 class Matrix;
79 } // namespace Drawing2D
80 } // namespace Drawing
81 } // namespace System
82 
83 namespace Aspose {
84 
85 namespace Pdf {
86 
87 /*
91  [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
92  class NamespaceDoc
93  {
94  } */
98 class ASPOSE_PDF_SHARED_CLASS Matrix final : public System::Object
99 {
100  typedef Matrix ThisType;
101  typedef System::Object BaseType;
102 
103  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
104  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
105 
106  friend class Aspose::Pdf::ApsToPdfConverter;
109  friend class Aspose::Pdf::Engine::CommonData::Text::Segmenting::PhysicalTextSegment;
110  friend class Aspose::Pdf::Engine::CommonData::Text::Segmenting::TextSegmenter;
111  friend class Aspose::Pdf::Text::TextPostReplaceFixer;
116  friend class Aspose::Pdf::XForm;
121  friend class Aspose::Pdf::Vector::PositionSetter;
122  friend class Aspose::Pdf::Vector::GraphicAppender;
123 
124 public:
125 
129  ASPOSE_PDF_SHARED_API System::ArrayPtr<double> get_Data() const;
133  ASPOSE_PDF_SHARED_API double get_A();
137  ASPOSE_PDF_SHARED_API void set_A(double value);
141  ASPOSE_PDF_SHARED_API double get_B();
145  ASPOSE_PDF_SHARED_API void set_B(double value);
149  ASPOSE_PDF_SHARED_API double get_C();
153  ASPOSE_PDF_SHARED_API void set_C(double value);
157  ASPOSE_PDF_SHARED_API double get_D();
161  ASPOSE_PDF_SHARED_API void set_D(double value);
165  ASPOSE_PDF_SHARED_API double get_E();
169  ASPOSE_PDF_SHARED_API void set_E(double value);
173  ASPOSE_PDF_SHARED_API double get_F();
177  ASPOSE_PDF_SHARED_API void set_F(double value);
181  ASPOSE_PDF_SHARED_API System::ArrayPtr<float> get_Elements();
182 
190  ASPOSE_PDF_SHARED_API Matrix();
199  ASPOSE_PDF_SHARED_API Matrix(System::ArrayPtr<double> matrixArray);
206  ASPOSE_PDF_SHARED_API Matrix(System::Details::ArrayView<float> matrixArray);
212  ASPOSE_PDF_SHARED_API Matrix(System::SharedPtr<Matrix> matrix);
213 
219  ASPOSE_PDF_SHARED_API bool Equals(System::SharedPtr<System::Object> obj) override;
227  static ASPOSE_PDF_SHARED_API System::SharedPtr<Matrix> Rotation(double alpha);
233  static ASPOSE_PDF_SHARED_API System::SharedPtr<Matrix> Rotation(Aspose::Pdf::Rotation rotation);
242  static ASPOSE_PDF_SHARED_API System::SharedPtr<Matrix> Skew(double alpha, double beta);
252  ASPOSE_PDF_SHARED_API void Scale(double x, double y, double& x1, double& y1);
262  ASPOSE_PDF_SHARED_API void UnScale(double x1, double y1, double& x, double& y);
270  static ASPOSE_PDF_SHARED_API double GetAngle(Aspose::Pdf::Rotation rotation);
278  ASPOSE_PDF_SHARED_API System::SharedPtr<Matrix> Multiply(System::SharedPtr<Matrix> other);
284  ASPOSE_PDF_SHARED_API System::SharedPtr<Matrix> Add(System::SharedPtr<Matrix> other);
292  ASPOSE_PDF_SHARED_API System::SharedPtr<Point> Transform(System::SharedPtr<Point> p);
302  ASPOSE_PDF_SHARED_API void Transform(double x, double y, double& x1, double& y1);
312  ASPOSE_PDF_SHARED_API void UnTransform(double x1, double y1, double& x, double& y);
322 
334  ASPOSE_PDF_SHARED_API Matrix(double a, double b, double c, double d, double e, double f);
335 
342  ASPOSE_PDF_SHARED_API System::SharedPtr<Matrix> Reverse();
347  ASPOSE_PDF_SHARED_API int32_t GetHashCode() const override;
352  ASPOSE_PDF_SHARED_API System::String ToString() const override;
353 
354 protected:
355 
359  bool get_IsIdentity();
360 
362 
363  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(Matrix, CODEPORTING_ARGS(System::SharedPtr<System::Drawing::Drawing2D::Matrix> matrix));
378  static System::SharedPtr<Matrix> Scale(double x, double y);
387  static System::SharedPtr<Matrix> Translate(double x, double y);
393  static double GetAngleExactValue(System::SharedPtr<Matrix> matrix);
396 
398 
399  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(Matrix, CODEPORTING_ARGS(System::SharedPtr<Engine::Data::IPdfArray> data));
417  static System::SharedPtr<Matrix> GetRotationMatrix(System::SharedPtr<Matrix> matrix);
418  static bool IsInt16(double value);
419  bool IsInt16Values();
420 
421 private:
422 
423  static const int32_t MatrixArrayLength;
424  System::ArrayPtr<double> matrixArray;
425 
426  System::String ToString_NonConst();
431  System::ArrayPtr<double> getFullMatrix();
432 
433 };
434 
435 } // namespace Pdf
436 } // namespace Aspose
437 
438 
Represents graph - graphics generator paragraph.
Definition: Graph.h:53
String class used across the library. Is a substitute for C# System.String when translating code...
Definition: string.h:121
Rotation
Enumeration of possible rotation values.
Definition: Rotation.h:16
Represents fragment of Pdf text.
Definition: TextFragment.h:173
Represent Fixed print data of Watermark Annotation.
Definition: FixedPrint.h:36
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:64
Definition: Artifact.h:67
Represents a 3x3 matrix that defines transform operations. Objects of this class should only be alloc...
Definition: matrix.h:46
Represents graphic state of the current GraphicElement.
Definition: GraphicState.h:51
Represents XForm placement. If the XForm is displayed on the page more than 1 time, all XformPlacements associated with this XForm will have common graphical elements, but different graphical states.
Definition: XFormPlacement.h:54
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: fwd.h:22
Represents base class for graphics object on the page.
Definition: GraphicElement.h:56
Represents an absorber object of image placement objects. Performs search of image usages and provide...
Definition: ImagePlacementAbsorber.h:77
Definition: AFRelationship.h:4
A printer&#39;s point (1/72 of an inch).
Implements operations with PDF file: concatenation, splitting, extracting pages, making booklet...
Definition: PdfFileEditor.h:105
Represents a text state of a text fragment.
Definition: TextFragmentState.h:97
Class represent XForm
Definition: XForm.h:185
Class represents transformation matrix.
Definition: Matrix.h:98
Represents an absorber object of graphics elements. Performs graphics search and provides access to s...
Definition: GraphicsAbsorber.h:71
Whole PDF file will be submitted.