org.pdfbox.util
Class Matrix
- Cloneable
public class Matrix
extends java.lang.Object
implements Cloneable
This class will be used for matrix manipulation.
Object | clone() - Clones this object.
|
Matrix | copy() - This will copy the text matrix data.
|
AffineTransform | createAffineTransform() - Create an affine transform from this matrix's values.
|
Matrix | extractScaling() - Create a new matrix with just the scaling operators.
|
Matrix | extractTranslating() - Create a new matrix with just the translating operators.
|
static Matrix | getScaleInstance(float x, float y) - Convenience method to create a scaled instance.
|
static Matrix | getTranslatingInstance(float x, float y) - Convenience method to create a translating instance.
|
float | getValue(int row, int column) - This will get a matrix value at some point.
|
float[][] | getValues() - Return a single dimension array of all values in the matrix.
|
double[][] | getValuesAsDouble() - Return a single dimension array of all values in the matrix.
|
float | getXPosition() - Get the x position in the matrix.
|
float | getXScale() - Get the xscaling factor of this matrix.
|
float | getYPosition() - Get the y position.
|
float | getYScale() - Get the y scaling factor of this matrix.
|
Matrix | multiply(Matrix b) - This will take the current matrix and multipy it with a matrix that is passed in.
|
void | setFromAffineTransform(AffineTransform af) - Set the values of the matrix from the AffineTransform.
|
void | setValue(int row, int column, float value) - This will set a value at a position.
|
String | toString() - This will return a string representation of the matrix.
|
Matrix
public Matrix()
Constructor.
clone
public Object clone()
Clones this object.
- cloned matrix as an object.
copy
public Matrix copy()
This will copy the text matrix data.
- a matrix that matches this one.
createAffineTransform
public AffineTransform createAffineTransform()
Create an affine transform from this matrix's values.
- An affine transform with this matrix's values.
extractScaling
public Matrix extractScaling()
Create a new matrix with just the scaling operators.
- A new matrix with just the scaling operators.
extractTranslating
public Matrix extractTranslating()
Create a new matrix with just the translating operators.
- A new matrix with just the translating operators.
getScaleInstance
public static Matrix getScaleInstance(float x,
float y)
Convenience method to create a scaled instance.
x
- The xscale operator.y
- The yscale operator.
- A new matrix with just the x/y scaling
getTranslatingInstance
public static Matrix getTranslatingInstance(float x,
float y)
Convenience method to create a translating instance.
x
- The x translating operator.y
- The y translating operator.
- A new matrix with just the x/y translating.
getValue
public float getValue(int row,
int column)
This will get a matrix value at some point.
row
- The row to get the value from.column
- The column to get the value from.
- The value at the row/column position.
getValues
public float[][] getValues()
Return a single dimension array of all values in the matrix.
- The values ot this matrix.
getValuesAsDouble
public double[][] getValuesAsDouble()
Return a single dimension array of all values in the matrix.
- The values ot this matrix.
getXPosition
public float getXPosition()
Get the x position in the matrix.
getXScale
public float getXScale()
Get the xscaling factor of this matrix.
getYPosition
public float getYPosition()
Get the y position.
getYScale
public float getYScale()
Get the y scaling factor of this matrix.
multiply
public Matrix multiply(Matrix b)
This will take the current matrix and multipy it with a matrix that is passed in.
b
- The matrix to multiply by.
- The result of the two multiplied matrices.
setFromAffineTransform
public void setFromAffineTransform(AffineTransform af)
Set the values of the matrix from the AffineTransform.
af
- The transform to get the values from.
setValue
public void setValue(int row,
int column,
float value)
This will set a value at a position.
row
- The row to set the value at.column
- the column to set the value at.value
- The value to set at the position.
toString
public String toString()
This will return a string representation of the matrix.