Package com.adobe.fontengine.font
Class Matrix
java.lang.Object
com.adobe.fontengine.font.Matrix
A 2x3 "Postscript style" coordinate matrix (a 2D transformation and shift).
Synchronization
These objects are immutable.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcomputes p * this and returns the result in pdoubleapplyToXYGetX(double x, double y) computes [x y] * this and returns the resulting x valuedoubleapplyToXYGetY(double x, double y) computes [x y] * this and returns the resulting y valuebooleanReturns true iff this is very close to representing the identity transformation.booleanChecks whether 'inverse' is the inverse of this matrix.multiply(double multiplier) Computes this * multiplier and returns the resulting matrix.Computes this * multiplier and returns the resulting matrix.
-
Field Details
-
IDENTITY_MATRIX
a constant Matrix representing the identity transformation -
a
public final double a -
b
public final double b -
c
public final double c -
d
public final double d -
tx
public final double tx -
ty
public final double ty
-
-
Constructor Details
-
Matrix
public Matrix(double[] matrix) Creates a matrix from either a 4 or 6 element array representing a matrix. If there are 4 elements, tx and ty are set to 0.- Parameters:
matrix- contains the matrix elements in the following order: a, b, c, d, tx, ty
-
Matrix
public Matrix(double a, double b, double c, double d, double tx, double ty)
-
-
Method Details
-
isIdentity
public boolean isIdentity()Returns true iff this is very close to representing the identity transformation. -
isInverse
Checks whether 'inverse' is the inverse of this matrix.- Parameters:
inverse- the matrix to be compared- Returns:
- true iff this * inverse ~= IDENTITY_MATRIX
-
multiply
Computes this * multiplier and returns the resulting matrix. -
multiply
Computes this * multiplier and returns the resulting matrix. -
applyToPoint
computes p * this and returns the result in p -
applyToXYGetX
public double applyToXYGetX(double x, double y) computes [x y] * this and returns the resulting x value -
applyToXYGetY
public double applyToXYGetY(double x, double y) computes [x y] * this and returns the resulting y value
-