com.adobe.acrobat.sidecar
Class AffineTransform

java.lang.Object
  |
  +--com.adobe.acrobat.sidecar.AffineTransform

public class AffineTransform
extends java.lang.Object
implements java.lang.Cloneable

Field Summary
protected  double a
          matrix that describes the affine transform.
protected  double b
          matrix that describes the affine transform.
protected  double c
          matrix that describes the affine transform.
protected  double d
          matrix that describes the affine transform.
protected  AffineTransform inverseTransform
           
protected  double x
          matrix that describes the affine transform.
protected  double y
          matrix that describes the affine transform.

 

Constructor Summary
protected AffineTransform()
          Constructs a new affine transform and sets the entries to identity.
protected AffineTransform(AffineTransform B)
          Constructs a new affine transform from another affine transform (like clone)
  AffineTransform(double a, double b, double c, double d, double x, double y)
          Constructs a new affine transform of 2 columns, 3 rows.

 

Method Summary
 AffineTransform appendTransform(AffineTransform A)
          (left) multiply new transform with this (computes X * A, where X is the current transform)
 java.lang.Object clone()
           
 boolean equals(AffineTransform t)
          Test for equality
 double geta()
           
 double getb()
           
 double getc()
           
 double getd()
           
static AffineTransform getIdentityMatrix()
           
 AffineTransform getInverse()
          Find the affine transform, B, that has the property: B * X = identity.
 double getx()
           
 double gety()
           
 int hashCode()
          Returns a hashcode for this transform.
 boolean isIdentity()
          Test for Identity of the 4x4 matrix Exclusive of translation
 boolean isInvertable()
          Test for invertability
 void mult(double px, double py, double[] output)
          Multiply a vector by our matrix.
 AffineTransform preScale(double x)
           
 AffineTransform preScale(double sx, double sy)
          Premultiply the current transform with a scale
 AffineTransform preTranslate(double h, double v)
          Premultiply the current transform with a translation
 AffineTransform rotate(double angle)
          Concatentate the current transform with a rotate
 AffineTransform scale(double x)
           
 AffineTransform scale(double sx, double sy)
          Concatentate the current transform with a scale
 AffineTransform setItalicDegrees(double angle)
          Set an italic angle
 AffineTransform setTranslate(double h, double v)
          Set an absolute translation
 java.lang.String toString()
           
 com.adobe.acrobat.sidecar.BezierPath transformPath(com.adobe.acrobat.sidecar.BezierPath bez)
          Transform an incoming path by this affine.
 void transformPoint(com.adobe.acrobat.sidecar.FloatPoint pt)
          Transform the point.
 void transformPoint(com.adobe.acrobat.sidecar.FloatPoint ptSrc, com.adobe.acrobat.sidecar.FloatPoint ptDest)
          Perform the affine transform on a point
 void transformPoints(double[] x_strip, double[] y_strip, int len)
          Perform the affine transform on a whole bunch 'o points
 void transformRectangle(java.awt.Rectangle r)
          Transform the Rectangle.
 AffineTransform translate(double h, double v)
          Concatenate the current transform with a translate

 

Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait

 

Field Detail

a

protected double a
matrix that describes the affine transform.

b

protected double b
matrix that describes the affine transform.

c

protected double c
matrix that describes the affine transform.

d

protected double d
matrix that describes the affine transform.

x

protected double x
matrix that describes the affine transform.

y

protected double y
matrix that describes the affine transform.

inverseTransform

protected AffineTransform inverseTransform
Constructor Detail

AffineTransform

protected AffineTransform()
Constructs a new affine transform and sets the entries to identity.

AffineTransform

public AffineTransform(double a,
                       double b,
                       double c,
                       double d,
                       double x,
                       double y)
Constructs a new affine transform of 2 columns, 3 rows. ( a, b, c, d, x, y )
Parameters:
x - Translation in x
y - Translation in y

AffineTransform

protected AffineTransform(AffineTransform B)
Constructs a new affine transform from another affine transform (like clone)
Parameters:
B - AffineTransform
Method Detail

getIdentityMatrix

public static AffineTransform getIdentityMatrix()

geta

public double geta()

getb

public double getb()

getc

public double getc()

getd

public double getd()

getx

public double getx()

gety

public double gety()

equals

public boolean equals(AffineTransform t)
Test for equality

isIdentity

public boolean isIdentity()
Test for Identity of the 4x4 matrix Exclusive of translation

isInvertable

public boolean isInvertable()
Test for invertability

rotate

public AffineTransform rotate(double angle)
Concatentate the current transform with a rotate
Parameters:
angle - Amount of rotation in radians.

scale

public AffineTransform scale(double sx,
                             double sy)
Concatentate the current transform with a scale

scale

public AffineTransform scale(double x)

preScale

public AffineTransform preScale(double sx,
                                double sy)
Premultiply the current transform with a scale

preScale

public AffineTransform preScale(double x)

translate

public AffineTransform translate(double h,
                                 double v)
Concatenate the current transform with a translate

preTranslate

public AffineTransform preTranslate(double h,
                                    double v)
Premultiply the current transform with a translation

setTranslate

public AffineTransform setTranslate(double h,
                                    double v)
Set an absolute translation

setItalicDegrees

public AffineTransform setItalicDegrees(double angle)
Set an italic angle

mult

public void mult(double px,
                 double py,
                 double[] output)
Multiply a vector by our matrix.
Parameters:
input - input vector -- must be at least size 2 (x is index 0, y is index 1)
output - output vector -- must be at least size 2 (x is index 0, y is index 1)

appendTransform

public AffineTransform appendTransform(AffineTransform A)
(left) multiply new transform with this (computes X * A, where X is the current transform)
Parameters:
A - new transform.

getInverse

public AffineTransform getInverse()
                           throws AffineException
Find the affine transform, B, that has the property: B * X = identity.
Throws:
AffineException - If the matrix does not have an inverse.

transformPath

public com.adobe.acrobat.sidecar.BezierPath transformPath(com.adobe.acrobat.sidecar.BezierPath bez)
Transform an incoming path by this affine.

transformPoint

public void transformPoint(com.adobe.acrobat.sidecar.FloatPoint ptSrc,
                           com.adobe.acrobat.sidecar.FloatPoint ptDest)
Perform the affine transform on a point
Parameters:
ptSrc - The source point
ptDest - The destination point

transformPoint

public void transformPoint(com.adobe.acrobat.sidecar.FloatPoint pt)
Transform the point.
Parameters:
pt - The point to be transformed.

transformRectangle

public void transformRectangle(java.awt.Rectangle r)
Transform the Rectangle.
Parameters:
pt - The Rectangle to be transformed.

transformPoints

public void transformPoints(double[] x_strip,
                            double[] y_strip,
                            int len)
Perform the affine transform on a whole bunch 'o points
Parameters:
x_strip - array of x data
y_strip - array of y data

hashCode

public int hashCode()
Returns a hashcode for this transform.
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object