|
intarsys PDF library API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.intarsys.pdf.cos.COSBasedObject
de.intarsys.pdf.cds.CDSBase
de.intarsys.pdf.cds.CDSMatrix
public class CDSMatrix
The implementation of the pdf transformation matrix.
Each matrix is represented as an array.
The transformation matrix: + + | a b 0 | | c d 0 | | e f 1 | + + is written as a COSArray in the form: [ a b c d e f ] The identity transformation has the form: [ 1 0 0 1 0 0 ]
Coordinates could be transformed by a matrix.
A coordinate transformation is defined as: + + | a b 0 | [ x' y' 1 ] = [ x y 1] * | c d 0 | | e f 1 | + + so that x' = x*a + y*c + e y' = x*b + y*d + f
Nested Class Summary |
---|
Nested classes/interfaces inherited from class de.intarsys.pdf.cos.COSBasedObject |
---|
COSBasedObject.MetaClass |
Field Summary | |
---|---|
static float[] |
MATRIX_0
Static information needed for rotation: rotate 0 degress (identity matrix) |
static float[] |
MATRIX_180
Static information needed for rotation: rotate 180 degrees |
static float[] |
MATRIX_270
Static information needed for rotation: rotate 270 degrees |
static float[] |
MATRIX_90
Static information needed for rotation: rotate 90 degrees |
Fields inherited from class de.intarsys.pdf.cos.COSBasedObject |
---|
META |
Constructor Summary | |
---|---|
CDSMatrix()
CDSMatrix constructor. |
|
CDSMatrix(float[] data)
Create a CDSMatrix based on the array in the parameter. |
Method Summary | |
---|---|
CDSMatrix |
copy()
Create a copy of the receiver |
static CDSMatrix |
createFromCOS(COSArray array)
Create a CDSMatrix from an array holding the
transformation parameters. |
float |
getA()
Return the matrix element "a". |
float |
getB()
Return the matrix element "b". |
float |
getC()
Return the matrix element "c". |
float |
getD()
Return the matrix element "d". |
float |
getE()
Return the matrix element "e". |
float |
getF()
Return the matrix element "f". |
void |
invalidateCaches()
Invalidate all local caches as the base object may have changed. |
void |
rotate(float angle)
Concatenate this transformation with a rotation transformation. |
void |
scale(float[] v)
Concatenate this transformation with a scaling transformation. |
void |
setA(float num)
Set the matrix element "a". |
void |
setB(float num)
Set the matrix element "b". |
void |
setC(float num)
Set the matrix element "c". |
void |
setD(float num)
Set the matrix element "d". |
void |
setE(float num)
Set the matrix element "e". |
void |
setF(float num)
Set the matrix element "f". |
void |
setTransformation(AffineTransform transform)
Set all matrix elements "a" - "f" |
void |
setTransformation(float[] data)
Set all matrix elements "a" - "f" |
void |
setTransformation(float a,
float b,
float c,
float d,
float e,
float f)
Set all matrix elements "a" - "f" |
AffineTransform |
toTransform()
Create an AffineTransform that corresponds to this. |
float[] |
transform(float[] v)
Transform a vector v using this. |
void |
translate(float[] v)
Concatenate this transformation with a translation transformation. |
void |
translate(float x,
float y)
Concatenate this transformation with a translation transformation. |
Methods inherited from class de.intarsys.pdf.cos.COSBasedObject |
---|
changed, cosGetArray, cosGetDict, cosGetDoc, cosGetField, cosGetObject, cosGetStream, cosHasField, cosRemoveField, cosSetField, getAttribute, getFieldBoolean, getFieldDate, getFieldFixed, getFieldFixedArray, getFieldInt, getFieldMLString, getFieldString, removeAttribute, setAttribute, setFieldBoolean, setFieldFixed, setFieldInt, setFieldMLString, setFieldName, setFieldObject, setFieldString, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static float[] MATRIX_0
public static float[] MATRIX_90
public static float[] MATRIX_180
public static float[] MATRIX_270
Constructor Detail |
---|
public CDSMatrix()
Create a new identity matrix
public CDSMatrix(float[] data)
data
- The array defining the matrix.Method Detail |
---|
public static CDSMatrix createFromCOS(COSArray array)
CDSMatrix
from an array
holding the
transformation parameters.
array
- The base COSArray
CDSMatrix
from array
public void invalidateCaches()
COSBasedObject
invalidateCaches
in class COSBasedObject
public void setA(float num)
num
- The new matrix element "a".public float getA()
public void setB(float num)
num
- The new matrix element "b".public float getB()
public void setC(float num)
num
- The new matrix element "c".public float getC()
public void setD(float num)
num
- The new matrix element "d".public float getD()
public void setE(float num)
num
- The new matrix element "e".public float getE()
public void setF(float num)
num
- The new matrix element "f".public float getF()
public void setTransformation(float a, float b, float c, float d, float e, float f)
a
- The new matrix element "a".b
- The new matrix element "b".c
- The new matrix element "c".d
- The new matrix element "d".e
- The new matrix element "e".f
- The new matrix element "f".public void setTransformation(float[] data)
data
- The array defining the new parameterspublic void setTransformation(AffineTransform transform)
transform
- The matrix defining the new parameterspublic CDSMatrix copy()
public void rotate(float angle)
angle
- Rotation angle in radianspublic void scale(float[] v)
v
- The scale factor.public float[] transform(float[] v)
v
using this.
v
- The vector that will be transformed.
public void translate(float[] v)
v
- The transaltion definitionpublic void translate(float x, float y)
x
- The translation in x directiony
- The translation in y directionpublic AffineTransform toTransform()
AffineTransform
that corresponds to this.
AffineTransform
that corresponds to this.
|
intarsys PDF library API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |