Foxit PDF SDK
FSMatrix2D Class Reference

Inherits NSObject.

Instance Methods

(void) - concat:b:c:d:e:f:bPrepended:
 Concatenate with another matrix.
More...
 
(void) - concatInverse:bPrepended:
 Concatenate the inverse of another matrix.
More...
 
(void) - concatWithMatrix:bPrepended:
 Concatenate with another matrix.
More...
 
(void) - copy:
 Copy coefficients from another matrix.
More...
 
(float) - getUnitArea
 Get area of the parallelogram composing two unit vectors.
More...
 
(FSRectF *) - 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...
 
(id) - init
 Construct a identity transformation matrix.

 
(id) - initWithA1:b1:c1:d1:e1:f1:
 Construct a matrix with six input coefficients.
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:src:
 Get a matrix that transforms a source rectangle to dest rectangle.
More...
 
(void) - reset
 Reset current matrix.
More...
 
(void) - rotate:bPrepended:
 Rotate the matrix.
More...
 
(void) - rotateAt:x:y:bPrepended:
 Rotate the matrix at a position.
More...
 
(void) - scale:sy:bPrepended:
 Scale the matrix.
More...
 
(void) - set:b:c:d:e:f:
 Change the coefficients in the matrix.
More...
 
(void) - setIdentity
 Set the matrix to be an identity transformation matrix.
More...
 
(void) - setReverse:
 Set the coefficients of the inverse of another matrix to this matrix.
More...
 
(void) - shear:fBetaRadian:bPrepended:
 Shear the matrix.
More...
 
(float) - transformDistance:
 Transform a distance.
More...
 
(float) - transformDistanceInFloat:dy:
 Transform distance specified by x and y value.
More...
 
(int) - transformDistanceInInteger:dy:
 Transform distance specified by x and y value.
More...
 
(void) - transformPoint:y:
 Transform point specified by x and y value.
More...
 
(void) - transformPointF:
 Transform point.
More...
 
(void) - transformRect:
 Transform a rectangle and return a bounding rectangle. The result rectangle is always normalized: left <= right, and bottom <= top.
More...
 
(void) - transformRectF:
 Transform a rectangle and return a bounding rectangle. The result rectangle is always normalized: left <= right, and bottom <= top.
More...
 
(int) - transformXDistance:
 Transform a x-distance.
More...
 
(float) - transformXDistanceInFloat:
 Transform a x-distance.
More...
 
(int) - transformYDistance:
 Transform a y-distance.
More...
 
(float) - transformYDistanceInFloat:
 Transform a y-distance.
More...
 
(void) - translate:y:bPrepended:
 Translate the matrix.
More...
 
(void) - translateI:y:bPrepended:
 Translate the matrix. using integer value.
More...
 

Properties

float a
 The coefficient a.

 
float b
 The coefficient b.

 
float c
 The coefficient c.

 
float d
 The coefficient d.

 
float e
 The coefficient e.

 
float f
 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;

Method Documentation

◆ concat:b:c:d:e:f:bPrepended:()

- (void) concat: (float)  a
b: (float)  b
c: (float)  c
d: (float)  d
e: (float)  e
f: (float)  f
bPrepended: (BOOL)  bPrepended 

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 YES, the concatenation matrix is multiplied at left side, or at right side.

Returns
None.

◆ concatInverse:bPrepended:()

- (void) concatInverse: (FSMatrix2D*)  m
bPrepended: (BOOL)  bPrepended 

Concatenate the inverse of another matrix.

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

◆ concatWithMatrix:bPrepended:()

- (void) concatWithMatrix: (FSMatrix2D*)  m
bPrepended: (BOOL)  bPrepended 

Concatenate with another matrix.

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

◆ copy:()

- (void) copy: (FSMatrix2D*)  m

Copy coefficients from another matrix.

Parameters
[in]mThe input matrix.
Returns
None.

◆ getUnitArea()

- (float) getUnitArea

Get area of the parallelogram composing two unit vectors.

Returns
The area of the parallelogram composing two unit vectors.

◆ getUnitRect()

- (FSRectF *) getUnitRect

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

Returns
The unit rect.

◆ getXUnit()

- (float) getXUnit

Get the x-direction unit size.

Returns
The x-direction unit size.

◆ getYUnit()

- (float) getYUnit

Get the y-direction unit size.

Returns
The y-direction unit size.

◆ initWithA1:b1:c1:d1:e1:f1:()

- (id) initWithA1: (float)  a1
b1: (float)  b1
c1: (float)  c1
d1: (float)  d1
e1: (float)  e1
f1: (float)  f1 

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.

◆ is90Rotated()

- (BOOL) is90Rotated

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

Returns
YES means current matrix has rotating of 90, or -90 degrees, while NO means not.

◆ isIdentity()

- (BOOL) isIdentity

Determine whether a matrix is an identity transformation or not.

Returns
YES means current matrix is identity, while NO means not.

◆ isInvertible()

- (BOOL) isInvertible

Determine whether a matrix is invertible or not.

Returns
YES means current matrix is invertible, while NO means not.

◆ isScaled()

- (BOOL) isScaled

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

Returns
YES means current matrix has scaling (or translating) only, while NO means not.

◆ matchRect:src:()

- (void) matchRect: (FSRectF*)  dest
src: (FSRectF*)  src 

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

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

◆ reset()

- (void) reset

Reset current matrix.

Returns
None.

◆ rotate:bPrepended:()

- (void) rotate: (float)  fRadian
bPrepended: (BOOL)  bPrepended 

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:x:y:bPrepended:()

- (void) rotateAt: (float)  fRadian
x: (float)  x
y: (float)  y
bPrepended: (BOOL)  bPrepended 

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 YES, a rotation matrix is multiplied at left side, or at right side.
Returns
None.

◆ scale:sy:bPrepended:()

- (void) scale: (float)  sx
sy: (float)  sy
bPrepended: (BOOL)  bPrepended 

Scale the matrix.

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

◆ set:b:c:d:e:f:()

- (void) set: (float)  a
b: (float)  b
c: (float)  c
d: (float)  d
e: (float)  e
f: (float)  f 

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.

◆ setIdentity()

- (void) setIdentity

Set the matrix to be an identity transformation matrix.

Returns
None.

◆ setReverse:()

- (void) setReverse: (FSMatrix2D*)  m

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

Parameters
[in]mThe input matrix.
Returns
None.

◆ shear:fBetaRadian:bPrepended:()

- (void) shear: (float)  fAlphaRadian
fBetaRadian: (float)  fBetaRadian
bPrepended: (BOOL)  bPrepended 

Shear the matrix.

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

◆ transformDistance:()

- (float) transformDistance: (float)  distance

Transform a distance.

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

◆ transformDistanceInFloat:dy:()

- (float) transformDistanceInFloat: (float)  dx
dy: (float)  dy 

Transform distance specified by x and y value.

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

◆ transformDistanceInInteger:dy:()

- (int) transformDistanceInInteger: (int)  dx
dy: (int)  dy 

Transform distance specified by x and y value.

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

◆ transformPoint:y:()

- (void) transformPoint: (int *)  x
y: (int *)  y 

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.

◆ transformPointF:()

- (void) transformPointF: (FSPointF*)  point

Transform point.

Parameters
[in]pointA point.
Returns
None.

◆ transformRect:()

- (void) transformRect: (FSRectI*)  rect

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.

◆ transformRectF:()

- (void) transformRectF: (FSRectF*)  rect

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

- (int) transformXDistance: (int)  dx

Transform a x-distance.

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

◆ transformXDistanceInFloat:()

- (float) transformXDistanceInFloat: (float)  dx

Transform a x-distance.

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

◆ transformYDistance:()

- (int) transformYDistance: (int)  dy

Transform a y-distance.

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

◆ transformYDistanceInFloat:()

- (float) transformYDistanceInFloat: (float)  dy

Transform a y-distance.

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

◆ translate:y:bPrepended:()

- (void) translate: (float)  x
y: (float)  y
bPrepended: (BOOL)  bPrepended 

Translate the matrix.

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

◆ translateI:y:bPrepended:()

- (void) translateI: (int)  x
y: (int)  y
bPrepended: (BOOL)  bPrepended 

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 YES, a translation matrix is multiplied at left side, or at right side.
Returns
None.