Package com.itextpdf.awt.geom
Class AffineTransform
- java.lang.Object
-
- com.itextpdf.awt.geom.AffineTransform
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class AffineTransform extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) doublem00The values of transformation matrix(package private) doublem01(package private) doublem02(package private) doublem10(package private) doublem11(package private) doublem12private static longserialVersionUID(package private) inttypeThe transformationtypestatic intTYPE_FLIPstatic intTYPE_GENERAL_ROTATIONstatic intTYPE_GENERAL_SCALEstatic intTYPE_GENERAL_TRANSFORMstatic intTYPE_IDENTITYstatic intTYPE_MASK_ROTATIONstatic intTYPE_MASK_SCALEstatic intTYPE_QUADRANT_ROTATIONstatic intTYPE_TRANSLATIONstatic intTYPE_UNIFORM_SCALE(package private) static intTYPE_UNKNOWNTheTYPE_UNKNOWNis an initial type value(package private) static doubleZEROThe min value equivalent to zero.
-
Constructor Summary
Constructors Constructor Description AffineTransform()AffineTransform(double[] matrix)AffineTransform(double m00, double m10, double m01, double m11, double m02, double m12)AffineTransform(float[] matrix)AffineTransform(float m00, float m10, float m01, float m11, float m02, float m12)AffineTransform(AffineTransform t)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()voidconcatenate(AffineTransform t)AffineTransformcreateInverse()ShapecreateTransformedShape(Shape src)voiddeltaTransform(double[] src, int srcOff, double[] dst, int dstOff, int length)Point2DdeltaTransform(Point2D src, Point2D dst)booleanequals(java.lang.Object obj)doublegetDeterminant()voidgetMatrix(double[] matrix)static AffineTransformgetRotateInstance(double angle)static AffineTransformgetRotateInstance(double angle, double x, double y)static AffineTransformgetScaleInstance(double scx, double scY)doublegetScaleX()doublegetScaleY()static AffineTransformgetShearInstance(double shx, double shy)doublegetShearX()doublegetShearY()static AffineTransformgetTranslateInstance(double mx, double my)doublegetTranslateX()doublegetTranslateY()intgetType()inthashCode()voidinverseTransform(double[] src, int srcOff, double[] dst, int dstOff, int length)voidinverseTransform(float[] src, int srcOff, float[] dst, int dstOff, int length)Point2DinverseTransform(Point2D src, Point2D dst)booleanisIdentity()(package private) AffineTransformmultiply(AffineTransform t1, AffineTransform t2)Multiply matrix of two AffineTransform objectsvoidpreConcatenate(AffineTransform t)private voidreadObject(java.io.ObjectInputStream stream)Read AffineTransform object from the input streamvoidrotate(double angle)voidrotate(double angle, double px, double py)voidscale(double scx, double scy)voidsetToIdentity()voidsetToRotation(double angle)voidsetToRotation(double angle, double px, double py)voidsetToScale(double scx, double scy)voidsetToShear(double shx, double shy)voidsetToTranslation(double mx, double my)voidsetTransform(double m00, double m10, double m01, double m11, double m02, double m12)voidsetTransform(AffineTransform t)voidshear(double shx, double shy)java.lang.StringtoString()voidtransform(double[] src, int srcOff, double[] dst, int dstOff, int length)voidtransform(double[] src, int srcOff, float[] dst, int dstOff, int length)voidtransform(float[] src, int srcOff, double[] dst, int dstOff, int length)voidtransform(float[] src, int srcOff, float[] dst, int dstOff, int length)voidtransform(Point2D[] src, int srcOff, Point2D[] dst, int dstOff, int length)Point2Dtransform(Point2D src, Point2D dst)voidtranslate(double mx, double my)private voidwriteObject(java.io.ObjectOutputStream stream)Write AffineTrasform object to the output steam.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
TYPE_IDENTITY
public static final int TYPE_IDENTITY
- See Also:
- Constant Field Values
-
TYPE_TRANSLATION
public static final int TYPE_TRANSLATION
- See Also:
- Constant Field Values
-
TYPE_UNIFORM_SCALE
public static final int TYPE_UNIFORM_SCALE
- See Also:
- Constant Field Values
-
TYPE_GENERAL_SCALE
public static final int TYPE_GENERAL_SCALE
- See Also:
- Constant Field Values
-
TYPE_QUADRANT_ROTATION
public static final int TYPE_QUADRANT_ROTATION
- See Also:
- Constant Field Values
-
TYPE_GENERAL_ROTATION
public static final int TYPE_GENERAL_ROTATION
- See Also:
- Constant Field Values
-
TYPE_GENERAL_TRANSFORM
public static final int TYPE_GENERAL_TRANSFORM
- See Also:
- Constant Field Values
-
TYPE_FLIP
public static final int TYPE_FLIP
- See Also:
- Constant Field Values
-
TYPE_MASK_SCALE
public static final int TYPE_MASK_SCALE
- See Also:
- Constant Field Values
-
TYPE_MASK_ROTATION
public static final int TYPE_MASK_ROTATION
- See Also:
- Constant Field Values
-
TYPE_UNKNOWN
static final int TYPE_UNKNOWN
TheTYPE_UNKNOWNis an initial type value- See Also:
- Constant Field Values
-
ZERO
static final double ZERO
The min value equivalent to zero. If absolute value less then ZERO it considered as zero.- See Also:
- Constant Field Values
-
m00
double m00
The values of transformation matrix
-
m10
double m10
-
m01
double m01
-
m11
double m11
-
m02
double m02
-
m12
double m12
-
type
transient int type
The transformationtype
-
-
Constructor Detail
-
AffineTransform
public AffineTransform()
-
AffineTransform
public AffineTransform(AffineTransform t)
-
AffineTransform
public AffineTransform(float m00, float m10, float m01, float m11, float m02, float m12)
-
AffineTransform
public AffineTransform(double m00, double m10, double m01, double m11, double m02, double m12)
-
AffineTransform
public AffineTransform(float[] matrix)
-
AffineTransform
public AffineTransform(double[] matrix)
-
-
Method Detail
-
getType
public int getType()
-
getScaleX
public double getScaleX()
-
getScaleY
public double getScaleY()
-
getShearX
public double getShearX()
-
getShearY
public double getShearY()
-
getTranslateX
public double getTranslateX()
-
getTranslateY
public double getTranslateY()
-
isIdentity
public boolean isIdentity()
-
getMatrix
public void getMatrix(double[] matrix)
-
getDeterminant
public double getDeterminant()
-
setTransform
public void setTransform(double m00, double m10, double m01, double m11, double m02, double m12)
-
setTransform
public void setTransform(AffineTransform t)
-
setToIdentity
public void setToIdentity()
-
setToTranslation
public void setToTranslation(double mx, double my)
-
setToScale
public void setToScale(double scx, double scy)
-
setToShear
public void setToShear(double shx, double shy)
-
setToRotation
public void setToRotation(double angle)
-
setToRotation
public void setToRotation(double angle, double px, double py)
-
getTranslateInstance
public static AffineTransform getTranslateInstance(double mx, double my)
-
getScaleInstance
public static AffineTransform getScaleInstance(double scx, double scY)
-
getShearInstance
public static AffineTransform getShearInstance(double shx, double shy)
-
getRotateInstance
public static AffineTransform getRotateInstance(double angle)
-
getRotateInstance
public static AffineTransform getRotateInstance(double angle, double x, double y)
-
translate
public void translate(double mx, double my)
-
scale
public void scale(double scx, double scy)
-
shear
public void shear(double shx, double shy)
-
rotate
public void rotate(double angle)
-
rotate
public void rotate(double angle, double px, double py)
-
multiply
AffineTransform multiply(AffineTransform t1, AffineTransform t2)
Multiply matrix of two AffineTransform objects- Parameters:
t1- - the AffineTransform object is a multiplicandt2- - the AffineTransform object is a multiplier- Returns:
- an AffineTransform object that is a result of t1 multiplied by matrix t2.
-
concatenate
public void concatenate(AffineTransform t)
-
preConcatenate
public void preConcatenate(AffineTransform t)
-
createInverse
public AffineTransform createInverse() throws NoninvertibleTransformException
- Throws:
NoninvertibleTransformException
-
transform
public void transform(double[] src, int srcOff, double[] dst, int dstOff, int length)
-
transform
public void transform(float[] src, int srcOff, float[] dst, int dstOff, int length)
-
transform
public void transform(float[] src, int srcOff, double[] dst, int dstOff, int length)
-
transform
public void transform(double[] src, int srcOff, float[] dst, int dstOff, int length)
-
deltaTransform
public void deltaTransform(double[] src, int srcOff, double[] dst, int dstOff, int length)
-
inverseTransform
public Point2D inverseTransform(Point2D src, Point2D dst) throws NoninvertibleTransformException
- Throws:
NoninvertibleTransformException
-
inverseTransform
public void inverseTransform(double[] src, int srcOff, double[] dst, int dstOff, int length) throws NoninvertibleTransformException- Throws:
NoninvertibleTransformException
-
inverseTransform
public void inverseTransform(float[] src, int srcOff, float[] dst, int dstOff, int length) throws NoninvertibleTransformException- Throws:
NoninvertibleTransformException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
clone
public java.lang.Object clone()
- Overrides:
clonein classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
writeObject
private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOExceptionWrite AffineTrasform object to the output steam.- Parameters:
stream- - the output stream- Throws:
java.io.IOException- - if there are I/O errors while writing to the output strem
-
readObject
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundExceptionRead AffineTransform object from the input stream- Parameters:
stream- - the input steam- Throws:
java.io.IOException- - if there are I/O errors while reading from the input stremjava.lang.ClassNotFoundException- - if class could not be found
-
-