| Modifier and Type | Field and Description |
|---|---|
static int |
SIZE |
| Constructor and Description |
|---|
Matrix()
Constructor.
|
Matrix(AffineTransform at)
Creates a matrix with the same elements as the given AffineTransform.
|
Matrix(float a,
float b,
float c,
float d,
float e,
float f)
Creates a transformation matrix with the given 6 elements.
|
| Modifier and Type | Method and Description |
|---|---|
Matrix |
clone()
Clones this object.
|
void |
concatenate(Matrix matrix)
Concatenates (premultiplies) the given matrix to this matrix.
|
static Matrix |
concatenate(Matrix a,
Matrix b)
Produces a copy of the first matrix, with the second matrix concatenated.
|
AffineTransform |
createAffineTransform()
Create an affine transform from this matrix's values.
|
static Matrix |
createMatrix(COSBase base)
Convenience method to be used when creating a matrix from unverified data.
|
boolean |
equals(Object obj) |
static Matrix |
getRotateInstance(double theta,
float tx,
float ty)
Convenience method to create a rotated instance.
|
static Matrix |
getScaleInstance(float x,
float y)
Convenience method to create a scaled instance.
|
float |
getScaleX()
Returns the x-scaling element of this matrix.
|
float |
getScaleY()
Returns the y-scaling element of this matrix.
|
float |
getScalingFactorX()
Returns the x-scaling factor of this matrix.
|
float |
getScalingFactorY()
Returns the y-scaling factor of this matrix.
|
float |
getShearX()
Returns the x-shear element of this matrix.
|
float |
getShearY()
Returns the y-shear element of this matrix.
|
static Matrix |
getTranslateInstance(float x,
float y)
Convenience method to create a translating instance.
|
float |
getTranslateX()
Returns the x-translation element of this matrix.
|
float |
getTranslateY()
Returns the y-translation element of this matrix.
|
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.
|
int |
hashCode() |
Matrix |
multiply(Matrix other)
This method multiplies this Matrix with the specified other Matrix, storing the product in a
new instance.
|
void |
rotate(double theta)
Rotates this matrix by the given factors.
|
void |
scale(float sx,
float sy)
Scales this matrix by the given factors.
|
void |
setValue(int row,
int column,
float value)
This will set a value at a position.
|
COSArray |
toCOSArray()
Returns a COS array which represent the geometric relevant components of the matrix.
|
String |
toString() |
void |
transform(Point2D point)
Transforms the given point by this matrix.
|
Vector |
transform(Vector vector)
Transforms the given vector by this matrix.
|
Point2D.Float |
transformPoint(float x,
float y)
Transforms the given point by this matrix.
|
void |
translate(float tx,
float ty)
Translates this matrix by the given amount.
|
void |
translate(Vector vector)
Translates this matrix by the given vector.
|
public static final int SIZE
public Matrix()
public Matrix(float a,
float b,
float c,
float d,
float e,
float f)
a - the X coordinate scaling element (m00) of the 3x3 matrixb - the Y coordinate shearing element (m10) of the 3x3 matrixc - the X coordinate shearing element (m01) of the 3x3 matrixd - the Y coordinate scaling element (m11) of the 3x3 matrixe - the X coordinate translation element (m02) of the 3x3 matrixf - the Y coordinate translation element (m12) of the 3x3 matrixgetRotateInstance(double, float, float),
getScaleInstance(float, float),
getTranslateInstance(float, float)public Matrix(AffineTransform at)
at - matrix elements will be initialize with the values from this affine transformation, as follows:
scaleX shearY 0
shearX scaleY 0
transX transY 1public static Matrix createMatrix(COSBase base)
base - a COS object, preferably a COSArray with six numbers.public AffineTransform createAffineTransform()
public float getValue(int row,
int column)
row - The row to get the value from.column - The column to get the value from.public void setValue(int row,
int column,
float value)
row - The row to set the value at.column - the column to set the value at.value - The value to set at the position.public float[][] getValues()
public void concatenate(Matrix matrix)
matrix - The matrix to concatenate.public void translate(Vector vector)
vector - 2D vectorpublic void translate(float tx,
float ty)
tx - x-translationty - y-translationpublic void scale(float sx,
float sy)
sx - x-scalesy - y-scalepublic void rotate(double theta)
theta - The angle of rotation measured in radianspublic Matrix multiply(Matrix other)
other - the second operand Matrix in the multiplication; requiredpublic void transform(Point2D point)
point - point to transformpublic Point2D.Float transformPoint(float x, float y)
x - x-coordinatey - y-coordinatepublic Vector transform(Vector vector)
vector - 2D vectorpublic static Matrix getScaleInstance(float x, float y)
x - The xscale operator.y - The yscale operator.public static Matrix getTranslateInstance(float x, float y)
x - The x translating operator.y - The y translating operator.public static Matrix getRotateInstance(double theta, float tx, float ty)
theta - The angle of rotation measured in radianstx - The x translation.ty - The y translation.public static Matrix concatenate(Matrix a, Matrix b)
a - The matrix to copy.b - The matrix to concatenate.public Matrix clone()
public float getScalingFactorX()
public float getScalingFactorY()
public float getScaleX()
getScalingFactorX()public float getShearY()
public float getShearX()
public float getScaleY()
getScalingFactorY()public float getTranslateX()
public float getTranslateY()
public COSArray toCOSArray()
Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.