Class AffineTransform

java.lang.Object
com.itextpdf.kernel.geom.AffineTransform
All Implemented Interfaces:
Cloneable

public class AffineTransform extends Object implements Cloneable
  • Field Details

  • Constructor Details

    • AffineTransform

      public AffineTransform()
    • AffineTransform

      public AffineTransform (AffineTransform t)
    • 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 Details

    • getType

      public int getType()
      Method returns type of affine transformation.

      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:

      Returns:
      the type of this AffineTransform
    • 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 (float[] matrix)
    • getMatrix

      public void getMatrix (double[] matrix)
    • getDeterminant

      public double getDeterminant()
    • setTransform

      public void setTransform (float m00, float m10, float m01, float m11, float m02, float m12)
    • 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)
      Set this affine transformation to represent a rotation over the passed angle
      Parameters:
      angle - angle to rotate over in radians
    • setToRotation

      public 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
      Parameters:
      angle - angle to rotate over in radians
      px - x-coordinate of center of rotation
      py - y-coordinate of center of rotation
    • 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)
      Get an affine transformation representing a counter-clockwise rotation over the passed angle
      Parameters:
      angle - angle in radians to rotate over
      Returns:
      AffineTransform representing the rotation
    • getRotateInstance

      public 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
      Parameters:
      angle - angle in radians to rotate over
      x - x-coordinate of center of rotation
      y - y-coordinate of center of rotation
      Returns:
      AffineTransform representing the rotation
    • 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)
      Add a counter-clockwise rotation to this transformation
      Parameters:
      angle - angle in radians to rotate over
    • rotate

      public 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
      Parameters:
      angle - angle in radians to rotate over
      px - x-coordinate of center of rotation
      py - y-coordinate of center of rotation
    • concatenate

      public void concatenate (AffineTransform t)
    • preConcatenate

      public void preConcatenate (AffineTransform t)
    • createInverse

      public AffineTransform createInverse() throws NoninvertibleTransformException
      Throws:
      NoninvertibleTransformException
    • transform

      public Point transform (Point src, Point dst)
    • transform

      public void transform (Point[] src, int srcOff, Point[] dst, int dstOff, int length)
    • 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 Point deltaTransform (Point src, Point dst)
    • deltaTransform

      public void deltaTransform (double[] src, int srcOff, double[] dst, int dstOff, int length)
    • inverseTransform

      public Point inverseTransform (Point src, Point 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
    • clone

      Creates a "deep copy" of this AffineTransform, meaning the object returned by this method will be independent of the object being cloned.
      Overrides:
      clone in class Object
      Returns:
      the copied AffineTransform.
      Throws:
      CloneNotSupportedException
    • equals

      public boolean equals (Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object