public class AffineTransform extends Object implements Cloneable, Serializable
Modifier and Type | Field and Description |
---|---|
static int |
TYPE_FLIP
The type of affine transformation.
|
static int |
TYPE_GENERAL_ROTATION
The type of affine transformation.
|
static int |
TYPE_GENERAL_SCALE
The type of affine transformation.
|
static int |
TYPE_GENERAL_TRANSFORM
The type of affine transformation.
|
static int |
TYPE_IDENTITY
The type of affine transformation.
|
static int |
TYPE_MASK_ROTATION
The type of affine transformation.
|
static int |
TYPE_MASK_SCALE
The type of affine transformation.
|
static int |
TYPE_QUADRANT_ROTATION
The type of affine transformation.
|
static int |
TYPE_TRANSLATION
The type of affine transformation.
|
static int |
TYPE_UNIFORM_SCALE
The type of affine transformation.
|
Constructor and Description |
---|
AffineTransform() |
AffineTransform(AffineTransform t) |
AffineTransform(double[] matrix) |
AffineTransform(double m00, double m10, double m01, double m11, double m02, double m12) |
AffineTransform(float[] matrix) |
Modifier and Type | Method and Description |
---|---|
AffineTransform |
clone()
Creates a "deep copy" of this AffineTransform, meaning the object returned by this method will be independent of the object being cloned.
|
void |
concatenate(AffineTransform t) |
AffineTransform |
createInverse() |
void |
deltaTransform(double[] src, int srcOff, double[] dst, int dstOff, int length) |
Point |
deltaTransform(Point src, Point dst) |
boolean |
equals(Object o) |
double |
getDeterminant() |
void |
getMatrix(double[] matrix) |
void |
getMatrix(float[] matrix) |
static AffineTransform |
getRotateInstance(double angle)
Get an affine transformation representing a counter-clockwise rotation over the passed angle
|
static AffineTransform |
getRotateInstance(double angle, double x, double y)
Get an affine transformation representing a counter-clockwise rotation over the passed angle, using the passed point as the center of rotation
|
static AffineTransform |
getScaleInstance(double scx, double scY) |
double |
getScaleX() |
double |
getScaleY() |
static AffineTransform |
getShearInstance(double shx, double shy) |
double |
getShearX() |
double |
getShearY() |
static AffineTransform |
getTranslateInstance(double mx, double my) |
double |
getTranslateX() |
double |
getTranslateY() |
int |
getType()
Method returns type of affine transformation.
|
int |
hashCode() |
void |
inverseTransform(double[] src, int srcOff, double[] dst, int dstOff, int length) |
void |
inverseTransform(float[] src, int srcOff, float[] dst, int dstOff, int length) |
Point |
inverseTransform(Point src, Point dst) |
boolean |
isIdentity() |
void |
preConcatenate(AffineTransform t) |
void |
rotate(double angle)
Add a counter-clockwise rotation to this transformation
|
void |
rotate(double angle, double px, double py)
Add a counter-clockwise rotation to this transformation, using the passed point as the center of rotation
|
void |
scale(double scx, double scy) |
void |
setToIdentity() |
void |
setToRotation(double angle)
Set this affine transformation to represent a rotation over the passed angle
|
void |
setToRotation(double angle, double px, double py)
Set this affine transformation to represent a rotation over the passed angle, using the passed point as the center of rotation
|
void |
setToScale(double scx, double scy) |
void |
setToShear(double shx, double shy) |
void |
setToTranslation(double mx, double my) |
void |
setTransform(AffineTransform t) |
void |
setTransform(double m00, double m10, double m01, double m11, double m02, double m12) |
void |
setTransform(float m00, float m10, float m01, float m11, float m02, float m12) |
void |
shear(double shx, double shy) |
void |
transform(double[] src, int srcOff, double[] dst, int dstOff, int length) |
void |
transform(double[] src, int srcOff, float[] dst, int dstOff, int length) |
void |
transform(float[] src, int srcOff, double[] dst, int dstOff, int length) |
void |
transform(float[] src, int srcOff, float[] dst, int dstOff, int length) |
void |
transform(Point[] src, int srcOff, Point[] dst, int dstOff, int length) |
Point |
transform(Point src, Point dst) |
void |
translate(double mx, double my) |
public static final int TYPE_IDENTITY
getType()
.
public static final int TYPE_TRANSLATION
getType()
.
public static final int TYPE_UNIFORM_SCALE
getType()
.
public static final int TYPE_GENERAL_SCALE
getType()
.
public static final int TYPE_QUADRANT_ROTATION
getType()
.
public static final int TYPE_GENERAL_ROTATION
getType()
.
public static final int TYPE_GENERAL_TRANSFORM
getType()
.
public static final int TYPE_FLIP
getType()
.
public static final int TYPE_MASK_SCALE
getType()
.
public static final int TYPE_MASK_ROTATION
getType()
.
public AffineTransform()
public AffineTransform(AffineTransform t)
public AffineTransform(double m00, double m10, double m01, double m11, double m02, double m12)
public AffineTransform(float[] matrix)
public AffineTransform(double[] matrix)
public int getType()
Transform matrix is m00 m01 m02 m10 m11 m12
According analytic geometry new basis vectors are (m00, m01) and (m10, m11), translation vector is (m02, m12). Original basis vectors are (1, 0) and (0, 1). Type transformations classification:
TYPE_IDENTITY
- new basis equals original one and zero translation TYPE_TRANSLATION
- translation vector isn't zero TYPE_UNIFORM_SCALE
- vectors length of new basis equals TYPE_GENERAL_SCALE
- vectors length of new basis doesn't equal TYPE_FLIP
- new basis vector orientation differ from original one TYPE_QUADRANT_ROTATION
- new basis is rotated by 90, 180, 270, or 360 degrees TYPE_GENERAL_ROTATION
- new basis is rotated by arbitrary angle TYPE_GENERAL_TRANSFORM
- transformation can't be inversed public double getScaleX()
public double getScaleY()
public double getShearX()
public double getShearY()
public double getTranslateX()
public double getTranslateY()
public boolean isIdentity()
public void getMatrix(float[] matrix)
public void getMatrix(double[] matrix)
public double getDeterminant()
public void setTransform(float m00, float m10, float m01, float m11, float m02, float m12)
public void setTransform(double m00, double m10, double m01, double m11, double m02, double m12)
public void setTransform(AffineTransform t)
public void setToIdentity()
public void setToTranslation(double mx, double my)
public void setToScale(double scx, double scy)
public void setToShear(double shx, double shy)
public void setToRotation(double angle)
angle
- angle to rotate over in radians
public void setToRotation(double angle, double px, double py)
angle
- angle to rotate over in radians
px
- x-coordinate of center of rotation
py
- y-coordinate of center of rotation
public static AffineTransform getTranslateInstance(double mx, double my)
public static AffineTransform getScaleInstance(double scx, double scY)
public static AffineTransform getShearInstance(double shx, double shy)
public static AffineTransform getRotateInstance(double angle)
angle
- angle in radians to rotate over
AffineTransform
representing the rotation
public static AffineTransform getRotateInstance(double angle, double x, double y)
angle
- angle in radians to rotate over
x
- x-coordinate of center of rotation
y
- y-coordinate of center of rotation
AffineTransform
representing the rotation
public void translate(double mx, double my)
public void scale(double scx, double scy)
public void shear(double shx, double shy)
public void rotate(double angle)
angle
- angle in radians to rotate over
public void rotate(double angle, double px, double py)
angle
- angle in radians to rotate over
px
- x-coordinate of center of rotation
py
- y-coordinate of center of rotation
public void concatenate(AffineTransform t)
public void preConcatenate(AffineTransform t)
public AffineTransform createInverse() throws NoninvertibleTransformException
NoninvertibleTransformException
public void transform(double[] src, int srcOff, double[] dst, int dstOff, int length)
public void transform(float[] src, int srcOff, float[] dst, int dstOff, int length)
public void transform(float[] src, int srcOff, double[] dst, int dstOff, int length)
public void transform(double[] src, int srcOff, float[] dst, int dstOff, int length)
public void deltaTransform(double[] src, int srcOff, double[] dst, int dstOff, int length)
public Point inverseTransform(Point src, Point dst) throws NoninvertibleTransformException
NoninvertibleTransformException
public void inverseTransform(double[] src, int srcOff, double[] dst, int dstOff, int length) throws NoninvertibleTransformException
NoninvertibleTransformException
public void inverseTransform(float[] src, int srcOff, float[] dst, int dstOff, int length) throws NoninvertibleTransformException
NoninvertibleTransformException
public AffineTransform clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Copyright © 1998–2023 iText Group NV. All rights reserved.