Foxit PDF SDK
foxit.common.fxcrt.Matrix2D Class Reference

Inherits SystemIDisposable.

Public Member Functions

 Matrix2D ()
 Construct a identity transformation matrix.

 
 Matrix2D (float a1, float b1, float c1, float d1, float e1, float f1)
 Construct a matrix with six input coefficients.
More...
 
void Concat (float a, float b, float c, float d, float e, float f, bool bPrepended)
 Concatenate with another matrix.
More...
 
void Concat (Matrix2D m, bool bPrepended)
 Concatenate with another matrix.
More...
 
void ConcatInverse (Matrix2D m, bool bPrepended)
 Concatenate the inverse of another matrix.
More...
 
void Copy (Matrix2D m)
 Copy coefficients from another matrix.
More...
 
float GetUnitArea ()
 Get area of the parallelogram composing two unit vectors.
More...
 
RectF GetUnitRect ()
 Get a bounding rectangle of the parallelogram composing two unit vectors.
More...
 
float GetXUnit ()
 Get the x-direction unit size.
More...
 
float GetYUnit ()
 Get the y-direction unit size.
More...
 
bool Is90Rotated ()
 Whether this matrix has rotating of 90, or -90 degrees.
More...
 
bool IsIdentity ()
 Determine whether a matrix is an identity transformation or not.
More...
 
bool IsInvertible ()
 Determine whether a matrix is invertible or not.
More...
 
bool IsScaled ()
 Whether this matrix has scaling (or translating) only. No rotating.
More...
 
void MatchRect (RectF dest, RectF src)
 Get a matrix that transforms a source rectangle to dest rectangle.
More...
 
void Reset ()
 Reset current matrix.
More...
 
void Rotate (float fRadian, bool bPrepended)
 Rotate the matrix.
More...
 
void RotateAt (float fRadian, float x, float y, bool bPrepended)
 Rotate the matrix at a position.
More...
 
void Scale (float sx, float sy, bool bPrepended)
 Scale the matrix.
More...
 
void Set (float a, float b, float c, float d, float e, float f)
 Change the coefficients in the matrix.
More...
 
void Set (float[] n)
 Change the coefficients in the matrix.
More...
 
void SetIdentity ()
 Set the matrix to be an identity transformation matrix.
More...
 
void SetReverse (Matrix2D m)
 Set the coefficients of the inverse of another matrix to this matrix.
More...
 
void Shear (float fAlphaRadian, float fBetaRadian, bool bPrepended)
 Shear the matrix.
More...
 
float TransformDistance (float dx, float dy)
 Transform distance specified by x and y value.
More...
 
int TransformDistance (int dx, int dy)
 Transform distance specified by x and y value.
More...
 
float TransformDistance (float distance)
 Transform a distance.
More...
 
void TransformPoint (ref float x, ref float y)
 Transform point specified by x and y value.
More...
 
void TransformPoint (ref int x, ref int y)
 Transform point specified by x and y value.
More...
 
void TransformRect (RectF rect)
 Transform a rectangle and return a bounding rectangle. The result rectangle is always normalized: left <= right, and bottom <= top.
More...
 
void TransformRect (RectI rect)
 Transform a rectangle and return a bounding rectangle. The result rectangle is always normalized: left <= right, and bottom <= top.
More...
 
float TransformXDistance (float dx)
 Transform a x-distance.
More...
 
int TransformXDistance (int dx)
 Transform a x-distance.
More...
 
float TransformYDistance (float dy)
 Transform a y-distance.
More...
 
int TransformYDistance (int dy)
 Transform a y-distance.
More...
 
void Translate (float x, float y, bool bPrepended)
 Translate the matrix.
More...
 
void TranslateI (int x, int y, bool bPrepended)
 Translate the matrix. using integer value.
More...
 

Properties

float a [get, set]
 The coefficient a.

 
float b [get, set]
 The coefficient b.

 
float c [get, set]
 The coefficient c.

 
float d [get, set]
 The coefficient d.

 
float e [get, set]
 The coefficient e.

 
float f [get, set]
 The coefficient f.

 

Detailed Description

Affine (linear) transformation matrix.

It defines six coefficients: a, b, c, d, e, f. The transformation equations are: dest_x = a * src_x + c * src_y + e; dest_y = b * src_x + d * src_y + f;

Constructor & Destructor Documentation

◆ Matrix2D()

foxit.common.fxcrt.Matrix2D.Matrix2D ( float  a1,
float  b1,
float  c1,
float  d1,
float  e1,
float  f1 
)
inline

Construct a matrix with six input coefficients.

Parameters
[in]a1The input coefficient a.
[in]b1The input coefficient b.
[in]c1The input coefficient c.
[in]d1The input coefficient d.
[in]e1The input coefficient e.
[in]f1The input coefficient f.

Member Function Documentation

◆ Concat() [1/2]

void foxit.common.fxcrt.Matrix2D.Concat ( float  a,
float  b,
float  c,
float  d,
float  e,
float  f,
bool  bPrepended 
)
inline

Concatenate with another matrix.

Parameters
[in]aThe coefficient a of the input matrix.
[in]bThe coefficient b of the input matrix.
[in]cThe coefficient c of the input matrix.
[in]dThe coefficient d of the input matrix.
[in]eThe coefficient e of the input matrix.
[in]fThe coefficient f of the input matrix.
[in]bPrependedIf this is true, the concatenation matrix is multiplied at left side, or at right side.

Returns
None.

◆ Concat() [2/2]

void foxit.common.fxcrt.Matrix2D.Concat ( Matrix2D  m,
bool  bPrepended 
)
inline

Concatenate with another matrix.

Parameters
[in]mThe input matrix.
[in]bPrependedIf this is true, the concatenation matrix is multiplied at left side, or at right side.
Returns
None.

◆ ConcatInverse()

void foxit.common.fxcrt.Matrix2D.ConcatInverse ( Matrix2D  m,
bool  bPrepended 
)
inline

Concatenate the inverse of another matrix.

Parameters
[in]mThe input matrix.
[in]bPrependedIf this is true, the concatenation matrix is multiplied at left side, or at right side.
Returns
None.

◆ Copy()

void foxit.common.fxcrt.Matrix2D.Copy ( Matrix2D  m)
inline

Copy coefficients from another matrix.

Parameters
[in]mThe input matrix.
Returns
None.

◆ GetUnitArea()

float foxit.common.fxcrt.Matrix2D.GetUnitArea ( )
inline

Get area of the parallelogram composing two unit vectors.

Returns
The area of the parallelogram composing two unit vectors.

◆ GetUnitRect()

RectF foxit.common.fxcrt.Matrix2D.GetUnitRect ( )
inline

Get a bounding rectangle of the parallelogram composing two unit vectors.

Returns
The unit rect.

◆ GetXUnit()

float foxit.common.fxcrt.Matrix2D.GetXUnit ( )
inline

Get the x-direction unit size.

Returns
The x-direction unit size.

◆ GetYUnit()

float foxit.common.fxcrt.Matrix2D.GetYUnit ( )
inline

Get the y-direction unit size.

Returns
The y-direction unit size.

◆ Is90Rotated()

bool foxit.common.fxcrt.Matrix2D.Is90Rotated ( )
inline

Whether this matrix has rotating of 90, or -90 degrees.

Returns
true means current matrix has rotating of 90, or -90 degrees, while false means not.

◆ IsIdentity()

bool foxit.common.fxcrt.Matrix2D.IsIdentity ( )
inline

Determine whether a matrix is an identity transformation or not.

Returns
true means current matrix is identity, while false means not.

◆ IsInvertible()

bool foxit.common.fxcrt.Matrix2D.IsInvertible ( )
inline

Determine whether a matrix is invertible or not.

Returns
true means current matrix is invertible, while false means not.

◆ IsScaled()

bool foxit.common.fxcrt.Matrix2D.IsScaled ( )
inline

Whether this matrix has scaling (or translating) only. No rotating.

Returns
true means current matrix has scaling (or translating) only, while false means not.

◆ MatchRect()

void foxit.common.fxcrt.Matrix2D.MatchRect ( RectF  dest,
RectF  src 
)
inline

Get a matrix that transforms a source rectangle to dest rectangle.

Parameters
[in]destThe dest rectangle.
[in]srcThe source rectangle.
Returns
None.

◆ Reset()

void foxit.common.fxcrt.Matrix2D.Reset ( )
inline

Reset current matrix.

Returns
None.

◆ Rotate()

void foxit.common.fxcrt.Matrix2D.Rotate ( float  fRadian,
bool  bPrepended 
)
inline

Rotate the matrix.

Parameters
[in]fRadianRotation angle in radian.
[in]bPrependedIf it's true, a rotation matrix is multiplied at left side, or at right side.
Returns
None.

◆ RotateAt()

void foxit.common.fxcrt.Matrix2D.RotateAt ( float  fRadian,
float  x,
float  y,
bool  bPrepended 
)
inline

Rotate the matrix at a position.

Parameters
[in]fRadianRotation angle in radian.
[in]xThe x coordinate from which to rotate.
[in]yThe y coordinate from which to rotate.
[in]bPrependedIf this is true, a rotation matrix is multiplied at left side, or at right side.
Returns
None.

◆ Scale()

void foxit.common.fxcrt.Matrix2D.Scale ( float  sx,
float  sy,
bool  bPrepended 
)
inline

Scale the matrix.

Parameters
[in]sxThe x-direction scale coefficient.
[in]syThe y-direction scale coefficient.
[in]bPrependedIf this is true, a scaling matrix is multiplied at left side, or at right side.
Returns
None.

◆ Set() [1/2]

void foxit.common.fxcrt.Matrix2D.Set ( float  a,
float  b,
float  c,
float  d,
float  e,
float  f 
)
inline

Change the coefficients in the matrix.

Parameters
[in]aThe input coefficient a.
[in]bThe input coefficient b.
[in]cThe input coefficient c.
[in]dThe input coefficient d.
[in]eThe input coefficient e.
[in]fThe input coefficient f.
Returns
None.

◆ Set() [2/2]

void foxit.common.fxcrt.Matrix2D.Set ( float []  n)
inline

Change the coefficients in the matrix.

Parameters
[in]nThe input coefficient array.
Returns
None.

◆ SetIdentity()

void foxit.common.fxcrt.Matrix2D.SetIdentity ( )
inline

Set the matrix to be an identity transformation matrix.

Returns
None.

◆ SetReverse()

void foxit.common.fxcrt.Matrix2D.SetReverse ( Matrix2D  m)
inline

Set the coefficients of the inverse of another matrix to this matrix.

Parameters
[in]mThe input matrix.
Returns
None.

◆ Shear()

void foxit.common.fxcrt.Matrix2D.Shear ( float  fAlphaRadian,
float  fBetaRadian,
bool  bPrepended 
)
inline

Shear the matrix.

Parameters
[in]fAlphaRadianShearing angle of x axis.
[in]fBetaRadianShearing angle of y axis.
[in]bPrependedIf this is true, a shearing matrix is multiplied at left side, or at right side.
Returns
None.

◆ TransformDistance() [1/3]

float foxit.common.fxcrt.Matrix2D.TransformDistance ( float  dx,
float  dy 
)
inline

Transform distance specified by x and y value.

Parameters
[in]dxThe input x value.
[in]dyThe input y value.
Returns
The transformed distance.

◆ TransformDistance() [2/3]

int foxit.common.fxcrt.Matrix2D.TransformDistance ( int  dx,
int  dy 
)
inline

Transform distance specified by x and y value.

Parameters
[in]dxThe input x value.
[in]dyThe input y value.
Returns
The transformed distance.

◆ TransformDistance() [3/3]

float foxit.common.fxcrt.Matrix2D.TransformDistance ( float  distance)
inline

Transform a distance.

Parameters
[in]distanceThe input distance.
Returns
The transformed distance.

◆ TransformPoint() [1/2]

void foxit.common.fxcrt.Matrix2D.TransformPoint ( ref float  x,
ref float  y 
)
inline

Transform point specified by x and y value.

Parameters
[in,out]xThe input x-coordinate of the point, and it receives the output transformed x-coordinate.
[in,out]yThe input y-coordinate of the point, and it receives the output transformed y-coordinate.
Returns
None.

◆ TransformPoint() [2/2]

void foxit.common.fxcrt.Matrix2D.TransformPoint ( ref int  x,
ref int  y 
)
inline

Transform point specified by x and y value.

Parameters
[in,out]xThe input x-coordinate of the point, and it receives the output transformed x-coordinate.
[in,out]yThe input y-coordinate of the point, and it receives the output transformed y-coordinate.
Returns
None.

◆ TransformRect() [1/2]

void foxit.common.fxcrt.Matrix2D.TransformRect ( RectF  rect)
inline

Transform a rectangle and return a bounding rectangle. The result rectangle is always normalized: left <= right, and bottom <= top.

Parameters
[in,out]rectThe input rectangle, and it receives the output transformed and normalized rectangle.
Returns
None.

◆ TransformRect() [2/2]

void foxit.common.fxcrt.Matrix2D.TransformRect ( RectI  rect)
inline

Transform a rectangle and return a bounding rectangle. The result rectangle is always normalized: left <= right, and bottom <= top.

Parameters
[in,out]rectThe input rectangle, and it receives the output transformed and normalized rectangle.
Returns
None.

◆ TransformXDistance() [1/2]

float foxit.common.fxcrt.Matrix2D.TransformXDistance ( float  dx)
inline

Transform a x-distance.

Parameters
[in]dxThe input x-distance.
Returns
The transformed distance.

◆ TransformXDistance() [2/2]

int foxit.common.fxcrt.Matrix2D.TransformXDistance ( int  dx)
inline

Transform a x-distance.

Parameters
[in]dxThe input x-distance.
Returns
The transformed distance.

◆ TransformYDistance() [1/2]

float foxit.common.fxcrt.Matrix2D.TransformYDistance ( float  dy)
inline

Transform a y-distance.

Parameters
[in]dyThe input y-distance.
Returns
The transformed distance.

◆ TransformYDistance() [2/2]

int foxit.common.fxcrt.Matrix2D.TransformYDistance ( int  dy)
inline

Transform a y-distance.

Parameters
[in]dyThe input y-distance.
Returns
The transformed distance.

◆ Translate()

void foxit.common.fxcrt.Matrix2D.Translate ( float  x,
float  y,
bool  bPrepended 
)
inline

Translate the matrix.

Parameters
[in]xThe x-direction delta value.
[in]yThe y-direction delta value.
[in]bPrependedIf this is true, a translation matrix is multiplied at left side, or at right side.
Returns
None.

◆ TranslateI()

void foxit.common.fxcrt.Matrix2D.TranslateI ( int  x,
int  y,
bool  bPrepended 
)
inline

Translate the matrix. using integer value.

Parameters
[in]xThe x-direction delta integer value.
[in]yThe y-direction delta integer value.
[in]bPrependedIf this is true, a translation matrix is multiplied at left side, or at right side.
Returns
None.