Foxit PDF SDK

Instance Methods | Properties | List of all members
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] | 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 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] | m | The input matrix.
  [in] | bPrepended | If 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] | m | The input matrix.
  [in] | bPrepended | If 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] | m | The 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] | 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.

## ◆ 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] | dest | The dest rectangle.
  [in] | src | The 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] | 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:x:y:bPrepended:()

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

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 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] | sx | The x-direction scale coefficient.
  [in] | sy | The y-direction scale coefficient.
  [in] | bPrepended | If 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] | 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.

## ◆ 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] | m | The input matrix.

Returns
  None.

## ◆ shear:fBetaRadian:bPrepended:()

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

Shear the matrix.

Parameters

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

## ◆ transformPointF:()

- (void) transformPointF: |  | (FSPointF*) | point |

Transform point.

Parameters

  [in] | point | A 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] | rect | The 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] | rect | The input rectangle, and it receives the output transformed and normalized rectangle.

Returns
  None.

## ◆ transformXDistance:()

- (int) transformXDistance: |  | (int) | dx |

Transform a x-distance.

Parameters

  [in] | dx | The input x-distance.

Returns
  The transformed distance.

## ◆ transformXDistanceInFloat:()

- (float) transformXDistanceInFloat: |  | (float) | dx |

Transform a x-distance.

Parameters

  [in] | dx | The input x-distance.

Returns
  The transformed distance.

## ◆ transformYDistance:()

- (int) transformYDistance: |  | (int) | dy |

Transform a y-distance.

Parameters

  [in] | dy | The input y-distance.

Returns
  The transformed distance.

## ◆ transformYDistanceInFloat:()

- (float) transformYDistanceInFloat: |  | (float) | dy |

Transform a y-distance.

Parameters

  [in] | dy | The 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] | x | The x-direction delta value.
  [in] | y | The y-direction delta value.
  [in] | bPrepended | If 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] | x | The x-direction delta integer value.
  [in] | y | The y-direction delta integer value.
  [in] | bPrepended | If this is YES, a translation matrix is multiplied at left side, or at right side.

Returns
  None.