FoxitPDFSDKforWeb  v10.0.0
Foxit PDF SDK for Web
Matrix Class Reference

PDF matrix for coordinate transformation. More...

Public Member Functions

 concat (a, b, c, d, e, f, bPrepended)
 Concatenate with another matrix. More...
 
 constructor (a=1, b=0, c=0, d=1, e=0, f=0)
 
 getA ()
 Get coefficient a. More...
 
 getAngle ()
 Get rotated angle. More...
 
 getB ()
 Get coefficient b. More...
 
 getC ()
 Get coefficient c. More...
 
 getD ()
 Get coefficient d. More...
 
 getE ()
 Get coefficient e. More...
 
 getF ()
 Get coefficient f. More...
 
 getUnitRect ()
 Get a bounding rectangle of the parallelogram composing two unit vectors. More...
 
 getXUnit ()
 Get the x-direction unit size. More...
 
 getYUnit ()
 Get the y-direction unit size. More...
 
 is90Rotated ()
 Current matrix is rotated 90 degrees.
 
 isScaled ()
 Current matrix is scaled.
 
 matchRect (dest, src)
 Get a matrix that transforms a source rectangle to dest rectangle. More...
 
 reset ()
 
 reverse (matrix=this)
 
 rotate (fRadian, bPrepended)
 Rotate the matrix. More...
 
 rotateAt (dx, dy, fRadian, bPrepended)
 Rotate the matrix at a position. More...
 
 scale (sx, sy, bPrepended)
 Scale current matrix. More...
 
 set (a, b, c, d, e, f)
 Set matrix's coefficient. More...
 
 setReverse (martix)
 Set the coefficients of the inverse of another matrix to this matrix. More...
 
 transformDistance (dx, dy)
 Transform distance. More...
 
 transformPoint (x, y)
 Transform point. More...
 
 transformRect (left, top, right, bottom)
 Transform a rectangle and return a bounding rectangle. More...
 
 transformXDistance (dx)
 Transform x-direction distance. More...
 
 transformYDistance (dy)
 Transform x-direction distance. More...
 
 translate (x, y, bPrepended)
 Translate the matrix. More...
 

Static Public Member Functions

static Concat2mt (matrix1, matrix2)
 

Detailed Description

PDF matrix for coordinate transformation.

Member Function Documentation

◆ concat()

Matrix::concat (   a,
  b,
  c,
  d,
  e,
  f,
  bPrepended 
)
inline

Concatenate with another matrix.

Parameters
anumber|Matrix|[number,number,number,number,number,number] - First parameter,should be one of input coefficient a, the matrix to be concatenated or an array with 6 number elements.
bnumber - The input coefficient b.
cnumber - The input coefficient c.
dnumber - The input coefficient d.
enumber - The input coefficient e.
fnumber - The input coefficient f.
bPrependedboolean -

◆ Concat2mt()

static Matrix::Concat2mt (   matrix1,
  matrix2 
)
inlinestatic

Concat two matrices. It means to get the result of matrix1*matrix2.

Parameters
matrix1Matrix - Matrix one.
matrix2Matrix - Matrix two.
Returns
Matrix - The result of matrix1*matrix2.

◆ constructor()

Matrix::constructor (   a = 1,
  b = 0,
  c = 0,
  d = 1,
  e = 0,
  f = 0 
)
inline

Constructors for Matrix

Parameters
anumber - First construct parameter, could be the input coefficient a, a other Matrix object or an array with 6 number elements.
bnumber - The input coefficient b.
cnumber - The input coefficient c.
dnumber - The input coefficient d.
enumber - The input coefficient e.
fnumber - The input coefficient f.
Example:
function example () {
let matrix1 = new Matrix();//default matrix which no effects.
let matrix2 = new Matrix(2,0,0,1.5,0,0);//a matrix which magnified 2 times horizontally and 1.5 times vertically
let matrix3 = new Matrix(matrix2);//a matrix copied from matrix2.
}

◆ getA()

Matrix::getA ( )
inline

Get coefficient a.

Returns
number -

◆ getAngle()

Matrix::getAngle ( )
inline

Get rotated angle.

Returns
number - Rotated angle.

◆ getB()

Matrix::getB ( )
inline

Get coefficient b.

Returns
number -

◆ getC()

Matrix::getC ( )
inline

Get coefficient c.

Returns
number -

◆ getD()

Matrix::getD ( )
inline

Get coefficient d.

Returns
number -

◆ getE()

Matrix::getE ( )
inline

Get coefficient e.

Returns
number -

◆ getF()

Matrix::getF ( )
inline

Get coefficient f.

Returns
number -

◆ getUnitRect()

Matrix::getUnitRect ( )
inline

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

Returns
number[] - The unit rectangle.

◆ getXUnit()

Matrix::getXUnit ( )
inline

Get the x-direction unit size.

Returns
number - The x-direction unit size.

◆ getYUnit()

Matrix::getYUnit ( )
inline

Get the y-direction unit size.

Returns
number - The y-direction unit size.

◆ matchRect()

Matrix::matchRect (   dest,
  src 
)
inline

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

Parameters
destnumber[] - The dest rectangle.
srcnumber[] - The source rectangle.

◆ reset()

Matrix::reset ( )
inline

Reset matrix to [1,0,0,1,0,0].

◆ reverse()

Matrix::reverse (   matrix = this)
inline

Get inversed matrix of another matrix.

Parameters
matrixMatrix - Input matrix.
Returns
Matrix - Inversed matrix

◆ rotate()

Matrix::rotate (   fRadian,
  bPrepended 
)
inline

Rotate the matrix.

Parameters
fRadiannumber - Rotation angle in radian.
bPrependedboolean - If it's TRUE, a rotation matrix is multiplied at left side, or at right side.

◆ rotateAt()

Matrix::rotateAt (   dx,
  dy,
  fRadian,
  bPrepended 
)
inline

Rotate the matrix at a position.

Parameters
dxnumber - The x coordinate from which to rotate.
dynumber - The y coordinate from which to rotate.
fRadiannumber - Rotation angle in radian.
bPrependedboolean - If this is TRUE, a rotation matrix is multiplied at left side, or at right side

◆ scale()

Matrix::scale (   sx,
  sy,
  bPrepended 
)
inline

Scale current matrix.

Parameters
sxnumber - The x-direction scale coefficient.
synumber - The y-direction scale coefficient.
bPrependedboolean - If this is TRUE, a scaling matrix is multiplied at left side, or at right side.

◆ set()

Matrix::set (   a,
  b,
  c,
  d,
  e,
  f 
)
inline

Set matrix's coefficient.

Parameters
anumber - The input coefficient a.
bnumber - The input coefficient b.
cnumber - The input coefficient c.
dnumber - The input coefficient d.
enumber - The input coefficient e.
fnumber - The input coefficient f.

◆ setReverse()

Matrix::setReverse (   martix)
inline

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

Parameters
matrixMatrix - Input matrix.

◆ transformDistance()

Matrix::transformDistance (   dx,
  dy 
)
inline

Transform distance.

Parameters
dxnumber - X-direction distance
dynumber - Y-direction distance
Returns
number - The transformed distance.

◆ transformPoint()

Matrix::transformPoint (   x,
  y 
)
inline

Transform point.

Parameters
dxnumber - Horizen coordinary value of point.
dynumber - Vertical coordinary value of point.
Returns
number[] - The transformed point.

◆ transformRect()

Matrix::transformRect (   left,
  top,
  right,
  bottom 
)
inline

Transform a rectangle and return a bounding rectangle.

Parameters
leftnumber - Left of rectangle.
topnumber - Top of rectangle.
rightnumber - Right of rectangle.
bottomnumber - Bottom of rectangle.
Returns
number[] - The transformed rectangle.

◆ transformXDistance()

Matrix::transformXDistance (   dx)
inline

Transform x-direction distance.

Parameters
dxnumber - X-direction distance
Returns
number - The transformed distance.

◆ transformYDistance()

Matrix::transformYDistance (   dy)
inline

Transform x-direction distance.

Parameters
dynumber - Y-direction distance
Returns
number - The transformed distance.

◆ translate()

Matrix::translate (   x,
  y,
  bPrepended 
)
inline

Translate the matrix.

Parameters
xnumber - The x-direction delta value.
ynumber - The y-direction delta value.
bPrependedboolean - If this is TRUE, a translation matrix is multiplied at left side, or at right side.

Foxit Software Corporation Logo
@2024 Foxit Software Incorporated. All rights reserved.