|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.ps.PsObjectComposite
org.foray.ps.PsArray
org.foray.ps.PsMatrix
public class PsMatrix
A PostScript matrix, which is a specialized PostScript array.
Field Summary | |
---|---|
static byte[] |
IDENTITY_ELEMENTS
The non-zero elements of an identity array. |
static byte |
QTY_PS_MATRIX_ELEMENTS
The number of elements in a PostScript matrix. |
Constructor Summary | |
---|---|
PsMatrix(PsNumber[] value,
boolean executable)
Constructor. |
Method Summary | |
---|---|
static PsMatrix |
concatMatrices(PsInterpreter4a interpreter,
PsMatrix matrix1,
PsMatrix matrix2)
Multiplies the two matrices together and returns the product matrix. |
Dimension2D |
deltaTransform(Dimension2D distanceVector)
Performs a delta transform on a distance vector based on this matrix. |
protected static PsMatrix |
identMatrix(PsMatrix matrix)
Create an ident matrix. |
Dimension2D |
inverseDeltaTransform(Dimension2D distanceVector)
Performs an inverse delta transform on a distance vector based on this matrix. |
Point2D |
inverseTransform(Point2D point)
Performs an inverse transform on a point based on this matrix. |
boolean |
isIdentityMatrix()
Indicates whether this matrix is an identity matrix, that is {1, 0, 0, 1, 0, 0}. |
static PsMatrix |
makeTranslateMatrix(PsInterpreter4a interpreter,
PsNumber x,
PsNumber y)
Create a new translate matrix. |
void |
setMatrixValue(PsMatrix newMatrixValue)
Sets the matrix value. |
Point2D |
transform(Point2D point)
Transforms a point based on this matrix. |
Methods inherited from class org.foray.ps.PsArray |
---|
convertToMatrix, duplicate, get, getTypeName, isComparable, isComposite, isExecutable, set, setExecutable, size |
Methods inherited from class org.foray.ps.PsObjectComposite |
---|
getAccess, setAccess |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte QTY_PS_MATRIX_ELEMENTS
public static final byte[] IDENTITY_ELEMENTS
Constructor Detail |
---|
public PsMatrix(PsNumber[] value, boolean executable)
value
- The initial matrix value.executable
- Indicates whether this matrix is executable or not.Method Detail |
---|
public void setMatrixValue(PsMatrix newMatrixValue)
newMatrixValue
- The new matrix value.protected static PsMatrix identMatrix(PsMatrix matrix)
matrix
- The matrix into which the ident values should be placed, or
null if a new one should be created.
public Point2D transform(Point2D point)
point
- The point to be transformed.
public Point2D inverseTransform(Point2D point)
point
- The point to be inverse transformed.
public Dimension2D deltaTransform(Dimension2D distanceVector)
distanceVector
- The distance vector to be delta transformed.
public Dimension2D inverseDeltaTransform(Dimension2D distanceVector)
distanceVector
- The distance vector to be delta transformed.
public static PsMatrix concatMatrices(PsInterpreter4a interpreter, PsMatrix matrix1, PsMatrix matrix2) throws PsInterpreterException4a
interpreter
- The PsInterpreter controlling error messages.matrix1
- The first matrix.matrix2
- The second matrix.
PsInterpreterException4a
- If either matrix1 or matrix2 are not exactly 6
elements long.public static PsMatrix makeTranslateMatrix(PsInterpreter4a interpreter, PsNumber x, PsNumber y)
interpreter
- The parent interpreter.x
- The x value.y
- The y value.
public boolean isIdentityMatrix()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |