Foxit PDF SDK

Public Member Functions | Properties | List of all members
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] | a1 | The input coefficient a.
  [in] | b1 | The input coefficient b.
  [in] | c1 | The input coefficient c.
  [in] | d1 | The input coefficient d.
  [in] | e1 | The input coefficient e.
  [in] | f1 | The 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] | a | The coefficient a of the input matrix.
  [in] | b | The coefficient b of the input matrix.
  [in] | c | The coefficient c of the input matrix.
  [in] | d | The coefficient d of the input matrix.
  [in] | e | The coefficient e of the input matrix.
  [in] | f | The coefficient f of the input matrix.
  [in] | bPrepended | If 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] | m | The input matrix.
  [in] | bPrepended | If 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] | m | The input matrix.
  [in] | bPrepended | If 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] | m | The 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] | dest | The dest rectangle.
  [in] | src | The 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] | fRadian | Rotation angle in radian.
  [in] | bPrepended | If 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] | fRadian | Rotation angle in radian.
  [in] | x | The x coordinate from which to rotate.
  [in] | y | The y coordinate from which to rotate.
  [in] | bPrepended | If 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] | sx | The x-direction scale coefficient.
  [in] | sy | The y-direction scale coefficient.
  [in] | bPrepended | If 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] | a | The input coefficient a.
  [in] | b | The input coefficient b.
  [in] | c | The input coefficient c.
  [in] | d | The input coefficient d.
  [in] | e | The input coefficient e.
  [in] | f | The 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] | n | The 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] | m | The input matrix.

Returns
  None.

## ◆ Shear()

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

Shear the matrix.

Parameters

  [in] | fAlphaRadian | Shearing angle of x axis.
  [in] | fBetaRadian | Shearing angle of y axis.
  [in] | bPrepended | If 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] | dx | The input x value.
  [in] | dy | The 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] | dx | The input x value.
  [in] | dy | The input y value.

Returns
  The transformed distance.

## ◆ TransformDistance() [3/3]

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

Transform a distance.

Parameters

  [in] | distance | The 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] | x | The input x-coordinate of the point, and it receives the output transformed x-coordinate.
  [in,out] | y | The 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] | x | The input x-coordinate of the point, and it receives the output transformed x-coordinate.
  [in,out] | y | The 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] | rect | The 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] | rect | The 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] | dx | The 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] | dx | The 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] | dy | The 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] | dy | The 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] | x | The x-direction delta value.
  [in] | y | The y-direction delta value.
  [in] | bPrepended | If 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] | x | The x-direction delta integer value.
  [in] | y | The y-direction delta integer value.
  [in] | bPrepended | If this is true, a translation matrix is multiplied at left side, or at right side.

Returns
  None.