Class represents transformation matrix. More...

#include "Matrix.h"

Inherits System::Object.

Public Member Functions

ASPOSE_PDF_SHARED_API System::ArrayPtr< double > get_Data () const
 Gets data of Matrix as array. More...
 
ASPOSE_PDF_SHARED_API double get_A ()
 A member of the transformation matrix. More...
 
ASPOSE_PDF_SHARED_API void set_A (double value)
 A member of the transformation matrix. More...
 
ASPOSE_PDF_SHARED_API double get_B ()
 B member of the transformation matrix. More...
 
ASPOSE_PDF_SHARED_API void set_B (double value)
 B member of the transformation matrix. More...
 
ASPOSE_PDF_SHARED_API double get_C ()
 C member of the transformation matrix. More...
 
ASPOSE_PDF_SHARED_API void set_C (double value)
 C member of the transformation matrix. More...
 
ASPOSE_PDF_SHARED_API double get_D ()
 D member of the transformation matrix. More...
 
ASPOSE_PDF_SHARED_API void set_D (double value)
 D member of the transformation matrix. More...
 
ASPOSE_PDF_SHARED_API double get_E ()
 E member of the transformation matrix. More...
 
ASPOSE_PDF_SHARED_API void set_E (double value)
 E member of the transformation matrix. More...
 
ASPOSE_PDF_SHARED_API double get_F ()
 F member of the transformation matrix. More...
 
ASPOSE_PDF_SHARED_API void set_F (double value)
 F member of the transformation matrix. More...
 
ASPOSE_PDF_SHARED_API System::ArrayPtr< float > get_Elements ()
 Elements of the matrix. More...
 
ASPOSE_PDF_SHARED_API Matrix ()
 Constructor creates stanrard 1 to 1 matrix: [ A B C D E F ] = [ 1, 0, 0, 1, 0, 0] More...
 
ASPOSE_PDF_SHARED_API Matrix (System::ArrayPtr< double > matrixArray)
 Constructor accepts a matrix with following array representation: [ A B C D E F ] More...
 
ASPOSE_PDF_SHARED_API Matrix (System::ArrayPtr< float > matrixArray)
 Constructor accepts a matrix with following array representation: [ A B C D E F ] More...
 
ASPOSE_PDF_SHARED_API Matrix (System::SharedPtr< Matrix > matrix)
 Constructor accepts a matrix to create a copy More...
 
ASPOSE_PDF_SHARED_API bool Equals (System::SharedPtr< System::Object > obj) override
 Compares matrix agains other object. More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< MatrixMultiply (System::SharedPtr< Matrix > other)
 Multiplies the matrix by other matrix. More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< MatrixAdd (System::SharedPtr< Matrix > other)
 Adds matrix to other matrix. More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< PointTransform (System::SharedPtr< Point > p)
 Transforms point using this matrix. More...
 
ASPOSE_PDF_SHARED_API 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...
 
ASPOSE_PDF_SHARED_API Matrix (double a, double b, double c, double d, double e, double f)
 Initializes transformation matrix with specified coefficients. More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< MatrixReverse ()
 Calculates reverse matrix. More...
 
ASPOSE_PDF_SHARED_API int32_t GetHashCode () const override
 Hash-code for object. More...
 
ASPOSE_PDF_SHARED_API System::String ToString () const override
 Returns text reporesentation of the matrix. 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 reference 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 (uint32_t argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
virtual ASPOSECPP_SHARED_API bool FastCast (const Details::FastRttiBase &helper, void **out_ptr) const
 For internal purposes only. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 
template<>
bool Equals (double const &objA, double const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 Specialization of Object::ReferenceEquals for case of string and nullptr. More...
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 Specialization of Object::ReferenceEquals for case of strings. More...
 

Static Public Member Functions

static ASPOSE_PDF_SHARED_API System::SharedPtr< MatrixRotation (double alpha)
 Creates matrix for given rotation angle. More...
 
static ASPOSE_PDF_SHARED_API System::SharedPtr< MatrixRotation (Aspose::Pdf::Rotation rotation)
 Creates matrix for given rotation. More...
 
static ASPOSE_PDF_SHARED_API System::SharedPtr< MatrixSkew (double alpha, double beta)
 Creates matrix for given rotation angle. More...
 
static ASPOSE_PDF_SHARED_API 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 ()
 Implements C# typeof(System.Object) construct. More...
 

Protected Member Functions

 Matrix (System::SharedPtr< System::Drawing::Drawing2D::Matrix > matrix)
 
 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION (Matrix, CODEPORTING_ARGS(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)
 
 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION (Matrix, CODEPORTING_ARGS(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< Font::TransformationMatrix > fontsMatrix)
 Creates matrix for given Aspose.Font.TransformationMatrix More...
 
static bool IsInt16 (double value)
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 

Detailed Description

Class represents transformation matrix.

Constructor & Destructor Documentation

◆ Matrix() [1/7]

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

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

◆ Matrix() [2/7]

ASPOSE_PDF_SHARED_API 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.

◆ Matrix() [3/7]

ASPOSE_PDF_SHARED_API 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_SHARED_API Aspose::Pdf::Matrix::Matrix ( System::SharedPtr< Matrix matrix)

Constructor accepts a matrix to create a copy

Parameters
matrixMatrix object.

◆ Matrix() [5/7]

ASPOSE_PDF_SHARED_API 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() [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()

ASPOSE_PDF_SHARED_API 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()

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

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< Font::TransformationMatrix >  fontsMatrix)
staticprotected

Creates matrix for given Aspose.Font.TransformationMatrix

Parameters
fontsMatrixAspose.Font.TransformationMatrix
Returns
Transformation matrix.

◆ get_A()

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

A member of the transformation matrix.

◆ get_B()

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

B member of the transformation matrix.

◆ get_C()

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

C member of the transformation matrix.

◆ get_D()

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

D member of the transformation matrix.

◆ get_Data()

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

Gets data of Matrix as array.

◆ get_E()

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

E member of the transformation matrix.

◆ get_Elements()

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

Elements of the matrix.

◆ get_F()

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

F member of the transformation matrix.

◆ GetAngle()

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

Transaltes rotation into angle (degrees)

Parameters
rotationRotation value.
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()

ASPOSE_PDF_SHARED_API int32_t Aspose::Pdf::Matrix::GetHashCode ( ) const
overridevirtual

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

◆ MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION() [1/2]

Aspose::Pdf::Matrix::MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION ( Matrix  ,
CODEPORTING_ARGS(System::SharedPtr< System::Drawing::Drawing2D::Matrix > matrix)   
)
protected

◆ MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION() [2/2]

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

◆ Multiply()

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

Multiplies the matrix by other matrix.

Parameters
otherMultiplier matrix.
Returns
Result of multiplication.

◆ Reverse()

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

Calculates reverse matrix.

Returns
Reverse matrix.

◆ Rotation() [1/2]

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

Creates matrix for given rotation angle.

Parameters
alphaRotation angle in radians.
Returns
Transformation matrix.

◆ Rotation() [2/2]

static ASPOSE_PDF_SHARED_API System::SharedPtr<Matrix> Aspose::Pdf::Matrix::Rotation ( Aspose::Pdf::Rotation  rotation)
static

Creates matrix for given rotation.

Parameters
rotationRotation. Valid values are: None, on90, on180, on270
Returns
Matrix with rotation.

◆ 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.

◆ set_A()

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

A member of the transformation matrix.

◆ set_B()

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

B member of the transformation matrix.

◆ set_C()

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

C member of the transformation matrix.

◆ set_D()

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

D member of the transformation matrix.

◆ set_E()

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

E member of the transformation matrix.

◆ set_F()

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

F member of the transformation matrix.

◆ Skew()

static ASPOSE_PDF_SHARED_API 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.

◆ ToPdfArray()

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

◆ ToString()

ASPOSE_PDF_SHARED_API System::String Aspose::Pdf::Matrix::ToString ( ) const
overridevirtual

Returns text reporesentation of the matrix.

Returns
String representation for the matrix

Reimplemented from System::Object.

◆ Transform() [1/2]

ASPOSE_PDF_SHARED_API 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.

◆ Transform() [2/2]

ASPOSE_PDF_SHARED_API System::SharedPtr<Aspose::Pdf::Rectangle> Aspose::Pdf::Matrix::Transform ( System::SharedPtr< Aspose::Pdf::Rectangle rect)

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

Parameters
rectRectangle to be transformed.
Returns
Transformed rectangle.