Class represents transformation matrix. More...

Inherits System::Object.

Public Member Functions

System::ArrayPtr< double > get_Data ()
 Gets data of Matrix as array. More...
 
double get_A ()
 A member of the transformation matrix. More...
 
void set_A (double value)
 A member of the transformation matrix. More...
 
double get_B ()
 B member of the transformation matrix. More...
 
void set_B (double value)
 B member of the transformation matrix. More...
 
double get_C ()
 C member of the transformation matrix. More...
 
void set_C (double value)
 C member of the transformation matrix. More...
 
double get_D ()
 D member of the transformation matrix. More...
 
void set_D (double value)
 D member of the transformation matrix. More...
 
double get_E ()
 E member of the transformation matrix. More...
 
void set_E (double value)
 E member of the transformation matrix. More...
 
double get_F ()
 F member of the transformation matrix. More...
 
void set_F (double value)
 F member of the transformation matrix. More...
 
System::ArrayPtr< float > get_Elements ()
 Elements of the matrix. More...
 
 Matrix ()
 Constructor creates stanrard 1 to 1 matrix: [ A B C D E F ] = [ 1, 0, 0, 1, 0, 0] More...
 
 Matrix (System::ArrayPtr< double > matrixArray)
 Constructor accepts a matrix with following array representation: [ A B C D E F ] More...
 
 Matrix (System::ArrayPtr< float > matrixArray)
 Constructor accepts a matrix with following array representation: [ A B C D E F ] More...
 
 Matrix (System::SharedPtr< Matrix > matrix)
 Constructor accepts a matrix to create a copy More...
 
virtual System::String ToString ()
 Returns text reporesentation of the matrix. More...
 
virtual bool Equals (System::SharedPtr< System::Object > obj)
 Compares matrix agains other object. More...
 
System::SharedPtr< MatrixMultiply (System::SharedPtr< Matrix > other)
 Multiplies the matrix by other matrix. More...
 
System::SharedPtr< MatrixAdd (System::SharedPtr< Matrix > other)
 Adds matrix to other matrix. More...
 
System::SharedPtr< PointTransform (System::SharedPtr< Point > p)
 Transforms point using this matrix. More...
 
System::SharedPtr< Aspose::Pdf::RectangleTransform (System::SharedPtr< Aspose::Pdf::Rectangle > rect)
 Transformes rectangle. If angle is not 90 * N degrees then bounding rectangle is returned. More...
 
 Matrix (double a, double b, double c, double d, double e, double f)
 Initializes transformation matrix with specified coefficients. More...
 
System::SharedPtr< MatrixReverse ()
 Calculates reverse matrix. More...
 
virtual int32_t GetHashCode () const
 Hash-code for object. More...
 
- Public Member Functions inherited from System::Object
ASPOSECPP_SHARED_API Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ASPOSECPP_SHARED_API ~Object ()
 Destroys object. Frees all internal data structures. More...
 
ASPOSECPP_SHARED_API Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared refernce counter. More...
 
ASPOSECPP_SHARED_API void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
ASPOSECPP_SHARED_API void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (unsigned int argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 
template<>
bool Equals (double const &objA, double const &objB)
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 

Static Public Member Functions

static System::SharedPtr< MatrixRotation (double alpha)
 Creates matrix for given rotation angle. More...
 
static System::SharedPtr< MatrixSkew (double alpha, double beta)
 Creates matrix for given rotation angle. More...
 
static double GetAngle (Aspose::Pdf::Rotation rotation)
 Transaltes rotation into angle (degrees) More...
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Impleemnts C# typeof(System.Object) construct. More...
 

Protected Member Functions

 Matrix (System::SharedPtr< System::Drawing::Drawing2D::Matrix > matrix)
 
System::SharedPtr< Engine::Data::IPdfArray > getMatrix (System::SharedPtr< Engine::Data::ITrailerable > trailer)
 Translates matrix into PDF array obect. More...
 
System::SharedPtr< Engine::Data::IPdfArray > ToPdfArray (System::SharedPtr< Engine::Data::ITrailerable > trailerable)
 
 Matrix (System::SharedPtr< Engine::Data::IPdfArray > data)
 
bool IsInt16Values ()
 

Static Protected Member Functions

static System::SharedPtr< MatrixScale (double x, double y)
 Creates matrix for given scale. More...
 
static double GetAngleExactValue (System::SharedPtr< Matrix > matrix)
 Gets angle (radians) that corresponds rotation of specified Matrix. More...
 
static System::SharedPtr< MatrixFromFontsMatrix (System::SharedPtr< Fonts::Matrix > fontsMatrix)
 Creates matrix for given Aspose.Fonts.Matrix More...
 
static bool IsInt16 (double value)
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 
typedef System::Details::SharedMembersType shared_members_type
 structure to keep list of shared pointers contained in object. More...
 

Detailed Description

Class represents transformation matrix.

Constructor & Destructor Documentation

◆ Matrix() [1/7]

Aspose::Pdf::Matrix::Matrix ( )

Constructor creates stanrard 1 to 1 matrix: [ A B C D E F ] = [ 1, 0, 0, 1, 0, 0]

Matrix m = new Matrix();

◆ Matrix() [2/7]

Aspose::Pdf::Matrix::Matrix ( System::ArrayPtr< double >  matrixArray)

Constructor accepts a matrix with following array representation: [ A B C D E F ]

Parameters
matrixArrayMatrix data array.
double[] c = new double[] { 1, 0, 0, 1, 10, 20 };
Matrix m = new Matrix(c);

◆ Matrix() [3/7]

Aspose::Pdf::Matrix::Matrix ( System::ArrayPtr< float >  matrixArray)

Constructor accepts a matrix with following array representation: [ A B C D E F ]

Parameters
matrixArrayMatrix data array.

◆ Matrix() [4/7]

Aspose::Pdf::Matrix::Matrix ( System::SharedPtr< Matrix matrix)

Constructor accepts a matrix to create a copy

Parameters
matrixMatrix object.

◆ Matrix() [5/7]

Aspose::Pdf::Matrix::Matrix ( double  a,
double  b,
double  c,
double  d,
double  e,
double  f 
)

Initializes transformation matrix with specified coefficients.

Parameters
aA matrix value.
bB matrix value.
cC matrix value.
dD matrix value.
eE matrix value.
fF matrix value.
Matrix m = new Matrix(1, 0, 0, 1, 3, 3);

◆ Matrix() [6/7]

Aspose::Pdf::Matrix::Matrix ( System::SharedPtr< System::Drawing::Drawing2D::Matrix matrix)
protected

◆ Matrix() [7/7]

Aspose::Pdf::Matrix::Matrix ( System::SharedPtr< Engine::Data::IPdfArray >  data)
protected

Member Function Documentation

◆ Add()

System::SharedPtr<Matrix> Aspose::Pdf::Matrix::Add ( System::SharedPtr< Matrix other)

Adds matrix to other matrix.

Parameters
otherMatrix to be added.
Returns
Result of matrix add.

◆ Equals()

virtual bool Aspose::Pdf::Matrix::Equals ( System::SharedPtr< System::Object obj)
virtual

Compares matrix agains other object.

Parameters
objObject to compare.
Returns
Returns true is other object is Matrix and all matrix member are equal to correspondim members of the matrix

◆ FromFontsMatrix()

static System::SharedPtr<Matrix> Aspose::Pdf::Matrix::FromFontsMatrix ( System::SharedPtr< Fonts::Matrix >  fontsMatrix)
staticprotected

Creates matrix for given Aspose.Fonts.Matrix

Parameters
fontsMatrixAspose.Fonts.Matrix
Returns
Transformation matrix.

◆ get_A()

double Aspose::Pdf::Matrix::get_A ( )

A member of the transformation matrix.

◆ get_B()

double Aspose::Pdf::Matrix::get_B ( )

B member of the transformation matrix.

◆ get_C()

double Aspose::Pdf::Matrix::get_C ( )

C member of the transformation matrix.

◆ get_D()

double Aspose::Pdf::Matrix::get_D ( )

D member of the transformation matrix.

◆ get_Data()

System::ArrayPtr<double> Aspose::Pdf::Matrix::get_Data ( )

Gets data of Matrix as array.

◆ get_E()

double Aspose::Pdf::Matrix::get_E ( )

E member of the transformation matrix.

◆ get_Elements()

System::ArrayPtr<float> Aspose::Pdf::Matrix::get_Elements ( )

Elements of the matrix.

◆ get_F()

double Aspose::Pdf::Matrix::get_F ( )

F member of the transformation matrix.

◆ GetAngle()

static double Aspose::Pdf::Matrix::GetAngle ( Aspose::Pdf::Rotation  rotation)
static

Transaltes rotation into angle (degrees)

Parameters
rotationRotation value.
double angle = Matrix.GetAngle(Rotation.on90);
Matrix m = Matrix.Rotation(angle);
Returns
Angle value.

◆ GetAngleExactValue()

static double Aspose::Pdf::Matrix::GetAngleExactValue ( System::SharedPtr< Matrix matrix)
staticprotected

Gets angle (radians) that corresponds rotation of specified Matrix.

Parameters
matrixMatrix object.
Returns
Angle value in radians.

◆ GetHashCode()

virtual int32_t Aspose::Pdf::Matrix::GetHashCode ( ) const
virtual

Hash-code for object.

Returns
Hash-code.

Reimplemented from System::Object.

◆ getMatrix()

System::SharedPtr<Engine::Data::IPdfArray> Aspose::Pdf::Matrix::getMatrix ( System::SharedPtr< Engine::Data::ITrailerable >  trailer)
protected

Translates matrix into PDF array obect.

Parameters
trailerTrailerable object
Returns
Result of converting

◆ IsInt16()

static bool Aspose::Pdf::Matrix::IsInt16 ( double  value)
staticprotected

◆ IsInt16Values()

bool Aspose::Pdf::Matrix::IsInt16Values ( )
protected

◆ Multiply()

System::SharedPtr<Matrix> Aspose::Pdf::Matrix::Multiply ( System::SharedPtr< Matrix other)

Multiplies the matrix by other matrix.

Parameters
otherMultiplier matrix.
Returns
Result of multiplication.
Matrix a = new Matrix(new double[] { 1, 0, 0, 1, 10, 20 });
Matrix b = new Matrix(new double[] { 0, -1, 1, 0, 0, 0 } );
Matrix c= a.Multiply(b);

◆ Reverse()

System::SharedPtr<Matrix> Aspose::Pdf::Matrix::Reverse ( )

Calculates reverse matrix.

Returns
Reverse matrix.
Matrix m = Matrix.Rotation(Math.PI / 2);
Matrix m1 = m.Reverse();

◆ Rotation()

static System::SharedPtr<Matrix> Aspose::Pdf::Matrix::Rotation ( double  alpha)
static

Creates matrix for given rotation angle.

Parameters
alphaRotation angle in radians.
Returns
Transformation matrix.
Matrix m = Matrix.Rotation(Math.PI / 2);

◆ Scale()

static System::SharedPtr<Matrix> Aspose::Pdf::Matrix::Scale ( double  x,
double  y 
)
staticprotected

Creates matrix for given scale.

Parameters
xScale x.
yScale y.
Returns
Transformation matrix.
Matrix m = Matrix.Scale(x, y);

◆ set_A()

void Aspose::Pdf::Matrix::set_A ( double  value)

A member of the transformation matrix.

◆ set_B()

void Aspose::Pdf::Matrix::set_B ( double  value)

B member of the transformation matrix.

◆ set_C()

void Aspose::Pdf::Matrix::set_C ( double  value)

C member of the transformation matrix.

◆ set_D()

void Aspose::Pdf::Matrix::set_D ( double  value)

D member of the transformation matrix.

◆ set_E()

void Aspose::Pdf::Matrix::set_E ( double  value)

E member of the transformation matrix.

◆ set_F()

void Aspose::Pdf::Matrix::set_F ( double  value)

F member of the transformation matrix.

◆ Skew()

static System::SharedPtr<Matrix> Aspose::Pdf::Matrix::Skew ( double  alpha,
double  beta 
)
static

Creates matrix for given rotation angle.

Parameters
alphaSkew x angle in radians.
betaSkew y angle in radians.
Returns
Transformation matrix.
Matrix m = Matrix.Skew(Math.PI / 2, Math.PI / 2);

◆ ToPdfArray()

System::SharedPtr<Engine::Data::IPdfArray> Aspose::Pdf::Matrix::ToPdfArray ( System::SharedPtr< Engine::Data::ITrailerable >  trailerable)
protected

◆ ToString()

virtual System::String Aspose::Pdf::Matrix::ToString ( )
virtual

Returns text reporesentation of the matrix.

Returns
String representation for the matrix

Reimplemented from System::Object.

◆ Transform() [1/2]

System::SharedPtr<Point> Aspose::Pdf::Matrix::Transform ( System::SharedPtr< Point p)

Transforms point using this matrix.

Parameters
pPoint which will be transformed.
Returns
Transformation result.
Aspose.Pdf.DOM.Matrix m = new Aspose.Pdf.DOM.Matrix(new double[] { 1, 0, 0, 1, 10, 20 } );
Aspose.Pdf.Rectangle r = new Aspose.Pdf.Rectangle(0, 0, 100, 100);
Aspose.Pdf.Rectangle r1 = m.Transform(r);

◆ Transform() [2/2]

Transformes rectangle. If angle is not 90 * N degrees then bounding rectangle is returned.

Parameters
rectRectangle to be transformed.
Returns
Transformed rectangle.
Matrix m = new Matrix(new double[] { 1, 0, 0, 1, 10, 20 } );
Rectangle r = new Rectangle(0, 0, 100, 100);
Rectangle r1 = m.Transform(r1);