gishur.x
Class AffineTransformation

java.lang.Object
  |
  +--gishur.x.AffineTransformation
All Implemented Interfaces:
java.lang.Cloneable, Cloneable, java.io.Serializable

public class AffineTransformation
extends java.lang.Object
implements Cloneable, java.io.Serializable

This class represents a 2D affine transform which performs a linear mapping from 2D coordinates to other 2D coordinates in a manner which preserves the "straightness" and "parallelness" of lines. Affine transformations can be constructed using sequences of translations, scales, flips, rotations, and shears.

Such a coordinate transformation can be represented by a 3 row by 3 column matrix with an implied last row of [ 0 0 1 ] which transforms source coordinates (x,y) into destination coordinates (x',y') by considering them to be a column vector and multiplying the coordinate vector by the matrix according to the following process.

	[ x']   [  m00  m01  m02  ] [ x ]   [ m00x + m01y + m02 ]
	[ y'] = [  m10  m11  m12  ] [ y ] = [ m10x + m11y + m12 ]
	[ 1 ]   [   0    0    1   ] [ 1 ]   [         1         ]
 
This class is a 'light' version of gishur.x2.core.AffineTransformation!

Version:
1.0
Author:
Thomas Wolf
See Also:
Serialized Form

Constructor Summary
AffineTransformation()
          Constructs a new AffineTransformation representing the Identity transformation.
AffineTransformation(AffineTransformation Tx)
          Constructs a new AffineTransformation representing a copy of another AffineTransformation object.
AffineTransformation(double[] flatmatrix)
          Constructs a new AffineTransformation from an array of double precision values representing either the 4 non-translation or the 6 specifiable entries of the 3x3 transformation matrix.
AffineTransformation(double m00, double m01, double m02, double m10, double m11, double m12)
          Constructs a new AffineTransformation from 6 double precision values representing the 6 specifiable entries of the 3x3 transformation matrix.
 
Method Summary
 java.lang.Object clone()
          Returns a copy of this AffineTransformation object.
 void concatenate(AffineTransformation Tx)
          Concatenates an AffineTransformation Tx to this AffineTransformation Cx in the most commonly useful way to provide a new user space which is mapped to the former user space by Tx.
 void concatenate(double n00, double n01, double n02, double n10, double n11, double n12)
          Concatenates the given transformation matrix to this AffineTransformation.
 AffineTransformation createInverse()
          Returns an AffineTransformation object representing the inverse transformation.
static AffineTransformation createRotation(double theta)
          Returns a transform representing a rotation transformation.
static AffineTransformation createRotation(double theta, double x, double y)
          Returns a transform that rotates coordinates around an anchor point.
static AffineTransformation createScale(double sx, double sy)
          Returns a transform representing a scaling transformation.
static AffineTransformation createShear(double shx, double shy)
          Returns a transform representing a shearing transformation.
static AffineTransformation createTranslation(double tx, double ty)
          Returns a transform representing a translation transformation.
 void deltaTransform(double[] src, int srcoff, double[] dst, int dstoff, int num)
          Transforms an array of relative distance vectors by this transform.
 double[] deltaTransform(double x, double y)
          Transforms a specified relative distance vector by this transform and returns the result as double array of length 2.
 XObject deltaTransform(XObject xobject)
          Transforms the specified XObject without applying the translation components of the affine transformation matrix using the following equations: [ x' ] [ m00 m01 (m02) ] [ x ] [ m00x + m01y ] [ y' ] = [ m10 m11 (m12) ] [ y ] = [ m10x + m11y ] [ (1) ] [ (0) (0) ( 1 ) ] [ (1) ] [ (1) ] The transformed XObject will be a new instance of the given XObject.
 XObject[] deltaTransform(XObject[] array)
          Transforms a given array of XObjects without applying the translation components of the affine transformation matrix using the following equations: [ x' ] [ m00 m01 (m02) ] [ x ] [ m00x + m01y ] [ y' ] = [ m10 m11 (m12) ] [ y ] = [ m10x + m11y ] [ (1) ] [ (0) (0) ( 1 ) ] [ (1) ] [ (1) ] The transformed XObjects will be a new instances of the given XObjects.
 XObject[] deltaTransform(XObject[] array, int off, int len)
          Transforms a given subarray of XObjects without applying the translation components of the affine transformation matrix using the following equations: [ x' ] [ m00 m01 (m02) ] [ x ] [ m00x + m01y ] [ y' ] = [ m10 m11 (m12) ] [ y ] = [ m10x + m11y ] [ (1) ] [ (0) (0) ( 1 ) ] [ (1) ] [ (1) ] The transformed XObjects will be a new instances of the given XObjects.
 double determinant()
          Returns the determinant of the matrix representation of the transform.
 double element(int i, int j)
          Returns the element with row index i and column index j (e.g.
 boolean equals(java.lang.Object obj)
          Returns true if this AffineTransformation represents the same affine coordinate transform as the given argument.
 void inverseTransform(double[] src, int srcoff, double[] dst, int dstoff, int num)
          Inverse transforms an array of double precision coordinates by this transformation.
 double[] inverseTransform(double x, double y)
          Inverse transforms the specified point and returns the result as double array of length 2.
 XObject inverseTransform(XObject xobject)
          Inverse transforms the specified XObject and returns the result.
 XObject[] inverseTransform(XObject[] array)
          Inverse transforms a given array of XObjects and returns the result.
 XObject[] inverseTransform(XObject[] array, int off, int len)
          Inverse transforms a given subarray of XObjects and returns the result.
 boolean isIdentity()
          Returns true if this AffineTransformation is an identity transform.
 double[] matrix()
          Returns the 6 specifiable values in the 3x3 affine transformation matrix as an array of double precisions values.
 void preConcatenate(AffineTransformation Tx)
          Concatenates an AffineTransformation Tx to this AffineTransformation Cx in a less commonly used way such that Tx modifies the coordinate transformation relative to the absolute pixel space rather than relative to the existing user space.
 void preConcatenate(double n00, double n01, double n02, double n10, double n11, double n12)
          Concatenates this AffineTransformation to the given transformation matrix.
 void rotate(double theta)
          Concatenates this transform with a rotation transformation.
 void rotate(double theta, double x, double y)
          Concatenates this transform with a transform that rotates coordinates around an anchor point.
 void scale(double sx, double sy)
          Concatenates this transform with a scaling transformation.
 double scaleX()
          Returns the X coordinate scaling element (m00) of the 3x3 affine transformation matrix.
 double scaleY()
          Returns the Y coordinate scaling element (m11) of the 3x3 affine transformation matrix.
 void setToIdentity()
          Resets this transform to the Identity transform.
 void setToRotation(double theta)
          Sets this transform to a rotation transformation.
 void setToRotation(double theta, double x, double y)
          Sets this transform to a translated rotation transformation.
 void setToScale(double sx, double sy)
          Sets this transform to a scaling transformation.
 void setToShear(double shx, double shy)
          Sets this transform to a shearing transformation.
 void setToTranslation(double tx, double ty)
          Sets this transform to a translation transformation.
 void setTransform(AffineTransformation Tx)
          Sets this transform to a copy of the transform in the indicated AffineTransformation object.
 void setTransform(double m00, double m01, double m02, double m10, double m11, double m12)
          Sets this transform to the matrix specified by the 6 double precision values.
 void shear(double shx, double shy)
          Concatenates this transform with a shearing transformation.
 double shearX()
          Returns the X coordinate shearing element (m01) of the 3x3 affine transformation matrix.
 double shearY()
          Returns the Y coordinate shearing element (m10) of the 3x3 affine transformation matrix.
 java.lang.String toString()
          Returns a String that represents the value of this Object.
 void transform(double[] src, int srcoff, double[] dst, int dstoff, int num)
          Transforms an array of double precision coordinates by this transformation.
 double[] transform(double x, double y)
          Transforms the specified point and returns the result as double array of length 2.
 XObject transform(XObject xobject)
          Transforms the specified XObject and returns the result.
 XObject[] transform(XObject[] array)
          Transforms a given array of XObjects and returns the result.
 XObject[] transform(XObject[] array, int off, int len)
          Transforms a given subarray of XObjects and returns the result.
 void translate(double tx, double ty)
          Concatenates this transform with a translation transformation.
 double translateX()
          Returns the X coordinate translation element (m02) of the 3x3 affine transformation matrix.
 double translateY()
          Returns the Y coordinate translation element (m12) of the 3x3 affine transformation matrix.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AffineTransformation

public AffineTransformation()
Constructs a new AffineTransformation representing the Identity transformation.

AffineTransformation

public AffineTransformation(AffineTransformation Tx)
Constructs a new AffineTransformation representing a copy of another AffineTransformation object.
Parameters:
Tx - the AffineTransformation object from which to copy the transformation

AffineTransformation

public AffineTransformation(double m00,
                            double m01,
                            double m02,
                            double m10,
                            double m11,
                            double m12)
Constructs a new AffineTransformation from 6 double precision values representing the 6 specifiable entries of the 3x3 transformation matrix.

AffineTransformation

public AffineTransformation(double[] flatmatrix)
Constructs a new AffineTransformation from an array of double precision values representing either the 4 non-translation or the 6 specifiable entries of the 3x3 transformation matrix. The values are retrieved from the array as {m01,m02,m10,m11,m12}.
Parameters:
flatmatrix - The double array containing the values to be set in the new AffineTransformation object. The length of the array is assumed to be at least 6.
Method Detail

createTranslation

public static AffineTransformation createTranslation(double tx,
                                                     double ty)
Returns a transform representing a translation transformation. The matrix representing by the returned transform transform will be:
		[   1    0    tx  ]
		[   0    1    ty  ]
		[   0    0    1   ]
 
Parameters:
tx - The distance by which coordinates are translated in the X axis direction
ty - The distance by which coordinates are translated in the Y axis direction

createRotation

public static AffineTransformation createRotation(double theta)
Returns a transform representing a rotation transformation. The matrix representing by the returned transform transform will be:
		[   cos(theta)    -sin(theta)    0   ]
		[   sin(theta)     cos(theta)    0   ]
		[       0              0         1   ]
 
Rotating with a positive angle theta rotates points on the positive x axis toward the positive y axis.
Parameters:
theta - The angle of rotation in radians.

createRotation

public static AffineTransformation createRotation(double theta,
                                                  double x,
                                                  double y)
Returns a transform that rotates coordinates around an anchor point. This operation is equivalent to translating the coordinates so that the anchor point is at the origin (S1), then rotating them about the new origin (S2), and finally translating so that the intermediate origin is restored to the coordinates of the original anchor point (S3).

The matrix representing by the returned transform transform will be:

		[   cos(theta)    -sin(theta)    x-x*cos+y*sin  ]
		[   sin(theta)     cos(theta)    y-x*sin-y*cos  ]
		[       0              0               1        ]
 
Rotating with a positive angle theta rotates points on the positive x axis toward the positive y axis.
Parameters:
theta - The angle of rotation in radians.
x - The x coordinate of the anchor point of the rotation
y - The x coordinate of the anchor point of the rotation

createScale

public static AffineTransformation createScale(double sx,
                                               double sy)
Returns a transform representing a scaling transformation. The matrix representing by the returned transform transform will be:
		[   sx   0    0   ]
		[   0    sy   0   ]
		[   0    0    1   ]
 
Parameters:
sx - The factor by which coordinates are scaled along the X axis direction
sy - The factor by which coordinates are scaled along the Y axis direction

createShear

public static AffineTransformation createShear(double shx,
                                               double shy)
Returns a transform representing a shearing transformation. The matrix representing by the returned transform transform will be:
		[   1   shx   0   ]
		[  shy   1    0   ]
		[   0    0    1   ]
 
Parameters:
shx - The multiplier by which coordinates are shifted in the direction of the positive X axis as a factor of their Y coordinate
shy - The multiplier by which coordinates are shifted in the direction of the positive Y axis as a factor of their X coordinate

determinant

public double determinant()
Returns the determinant of the matrix representation of the transform. The determinant is useful both to determine if the transform can be inverted and also to get a single value representing the combined X and Y scaling of the transform.

If the determinant is non-zero, then this transform will be invertible and the various methods which depend on the inverse transform will not need to throw a NoninvertibleTransformationException. If the determinant is zero, then this transform can not be inverted since the transform maps all input coordinates onto a line or a point. If the determinant is near enough to zero, then inverse transform operations may not carry enough precision to produce meaningful results.

Mathematically, the determinant is calculated using the formula:

		|  m00  m01  m02  |
		|  m10  m11  m12  |  =  m00 * m11 - m01 * m10
		|   0    0    1   |
 
Returns:
the determinant of the matrix used to transform the coordinates
See Also:
createInverse(), inverseTransform(double, double)

matrix

public double[] matrix()
Returns the 6 specifiable values in the 3x3 affine transformation matrix as an array of double precisions values. The values are stored into the array as {m00,m01,m02,m10,m11,m12}.
Returns:
The double array used to store the returned values.
See Also:
scaleX(), scaleY(), shearX(), shearY(), translateX(), translateY()

element

public double element(int i,
                      int j)
Returns the element with row index i and column index j (e.g. element(0,1) returns m01).
Parameters:
i - row index;
j - column index
Returns:
matrix element
Throws:
ArrayIndexOutOfBoundsException - if indizes are out of matrix bounds.

scaleX

public double scaleX()
Returns the X coordinate scaling element (m00) of the 3x3 affine transformation matrix.
See Also:
matrix()

scaleY

public double scaleY()
Returns the Y coordinate scaling element (m11) of the 3x3 affine transformation matrix.
See Also:
matrix()

shearX

public double shearX()
Returns the X coordinate shearing element (m01) of the 3x3 affine transformation matrix.
See Also:
matrix()

shearY

public double shearY()
Returns the Y coordinate shearing element (m10) of the 3x3 affine transformation matrix.
See Also:
matrix()

translateX

public double translateX()
Returns the X coordinate translation element (m02) of the 3x3 affine transformation matrix.
See Also:
matrix()

translateY

public double translateY()
Returns the Y coordinate translation element (m12) of the 3x3 affine transformation matrix.
See Also:
matrix()

concatenate

public void concatenate(AffineTransformation Tx)
Concatenates an AffineTransformation Tx to this AffineTransformation Cx in the most commonly useful way to provide a new user space which is mapped to the former user space by Tx. Cx is updated to perform the combined transformation. Transforming a point p by the updated transform Cx' is equivalent to first transforming p by Tx and then transforming the result by the original transform Cx. In other words, Cx'(p) = Cx(Tx(p)). In matrix notation, if this transform Cx is represented by the matrix [this] and Tx is represented by the matrix [Tx], then this method does the following:
		[this] = [this] x [Tx]
 
Parameters:
Tx - The AffineTransformation object to be concatenated with this AffineTransformation object.
See Also:
preConcatenate(gishur.x.AffineTransformation)

concatenate

public void concatenate(double n00,
                        double n01,
                        double n02,
                        double n10,
                        double n11,
                        double n12)
Concatenates the given transformation matrix to this AffineTransformation. The double values are interpreted as the following transformation matrix:
	[  m00  m01  m02  ]
	[  m10  m11  m12  ]
	[   0    0    1   ]
 
Parameters:
n00,n01,n02 - first row of the transformation matrix
n10,n11,n12 - second row of the transformation matrix
See Also:
preConcatenate(gishur.x.AffineTransformation)

preConcatenate

public void preConcatenate(AffineTransformation Tx)
Concatenates an AffineTransformation Tx to this AffineTransformation Cx in a less commonly used way such that Tx modifies the coordinate transformation relative to the absolute pixel space rather than relative to the existing user space. Cx is updated to perform the combined transformation. Transforming a point p by the updated transform Cx' is equivalent to first transforming p by the original transform Cx and then transforming the result by Tx. In other words, Cx'(p) = Tx(Cx(p)). In matrix notation, if this transform Cx is represented by the matrix [this] and Tx is represented by the matrix [Tx], then this method does the following:
		[this] = [Tx] x [this]
 
Parameters:
Tx - The AffineTransformation object to be concatenated with this AffineTransformation object.
See Also:
concatenate(gishur.x.AffineTransformation)

preConcatenate

public void preConcatenate(double n00,
                           double n01,
                           double n02,
                           double n10,
                           double n11,
                           double n12)
Concatenates this AffineTransformation to the given transformation matrix. The double values are interpreted as the following transformation matrix:
	[  n00  n01  n02  ]
	[  n10  n11  n12  ]
	[   0    0    1   ]
 
Parameters:
n00,n01,n02 - first row of the transformation matrix
n10,n11,n12 - second row of the transformation matrix
See Also:
preConcatenate(gishur.x.AffineTransformation)

translate

public void translate(double tx,
                      double ty)
Concatenates this transform with a translation transformation. This is equivalent to calling concatenate(T), where T is an AffineTransformation represented by the following matrix:
		[   1    0    tx  ]
		[   0    1    ty  ]
		[   0    0    1   ]
 

rotate

public void rotate(double theta)
Concatenates this transform with a rotation transformation. This is equivalent to calling concatenate(R), where R is an AffineTransformation represented by the following matrix:
		[   cos(theta)    -sin(theta)    0   ]
		[   sin(theta)     cos(theta)    0   ]
		[       0              0         1   ]
 
Rotating with a positive angle theta rotates points on the positive x axis toward the positive y axis.
Parameters:
theta - The angle of rotation in radians.

rotate

public void rotate(double theta,
                   double x,
                   double y)
Concatenates this transform with a transform that rotates coordinates around an anchor point. This operation is equivalent to translating the coordinates so that the anchor point is at the origin (S1), then rotating them about the new origin (S2), and finally translating so that the intermediate origin is restored to the coordinates of the original anchor point (S3).

This operation is equivalent to the following sequence of calls:

		translate(x, y);	// S3: final translation
		rotate(theta);		// S2: rotate around anchor
		translate(-x, -y);	// S1: translate anchor to origin
 
Rotating with a positive angle theta rotates points on the positive x axis toward the positive y axis.
Parameters:
theta - The angle of rotation in radians.
x - The x coordinate of the anchor point of the rotation
y - The x coordinate of the anchor point of the rotation

scale

public void scale(double sx,
                  double sy)
Concatenates this transform with a scaling transformation. This is equivalent to calling concatenate(S), where S is an AffineTransformation represented by the following matrix:
		[   sx   0    0   ]
		[   0    sy   0   ]
		[   0    0    1   ]
 

shear

public void shear(double shx,
                  double shy)
Concatenates this transform with a shearing transformation. This is equivalent to calling concatenate(SH), where SH is an AffineTransformation represented by the following matrix:
		[   1   shx   0   ]
		[  shy   1    0   ]
		[   0    0    1   ]
 
Parameters:
shx - The multiplier by which coordinates are shifted in the direction of the positive X axis as a factor of their Y coordinate
shy - The multiplier by which coordinates are shifted in the direction of the positive Y axis as a factor of their X coordinate

setToIdentity

public void setToIdentity()
Resets this transform to the Identity transform.

setToTranslation

public void setToTranslation(double tx,
                             double ty)
Sets this transform to a translation transformation. The matrix representing this transform becomes:
		[   1    0    tx  ]
		[   0    1    ty  ]
		[   0    0    1   ]
 
Parameters:
tx - The distance by which coordinates are translated in the X axis direction
ty - The distance by which coordinates are translated in the Y axis direction

setToRotation

public void setToRotation(double theta)
Sets this transform to a rotation transformation. The matrix representing this transform becomes:
		[   cos(theta)    -sin(theta)    0   ]
		[   sin(theta)     cos(theta)    0   ]
		[       0              0         1   ]
 
Rotating with a positive angle theta rotates points on the positive x axis toward the positive y axis.
Parameters:
theta - The angle of rotation in radians.

setToRotation

public void setToRotation(double theta,
                          double x,
                          double y)
Sets this transform to a translated rotation transformation. This operation is equivalent to translating the coordinates so that the anchor point is at the origin (S1), then rotating them about the new origin (S2), and finally translating so that the intermediate origin is restored to the coordinates of the original anchor point (S3).

This operation is equivalent to the following sequence of calls:

	    setToTranslation(x, y);	// S3: final translation
	    rotate(theta);		// S2: rotate around anchor
	    translate(-x, -y);		// S1: translate anchor to origin
 
The matrix representing this transform becomes:
		[   cos(theta)    -sin(theta)    x-x*cos+y*sin  ]
		[   sin(theta)     cos(theta)    y-x*sin-y*cos  ]
		[       0              0               1        ]
 
Rotating with a positive angle theta rotates points on the positive x axis toward the positive y axis.
Parameters:
theta - The angle of rotation in radians.
x - The x coordinate of the anchor point of the rotation
y - The x coordinate of the anchor point of the rotation

setToScale

public void setToScale(double sx,
                       double sy)
Sets this transform to a scaling transformation. The matrix representing this transform becomes:
		[   sx   0    0   ]
		[   0    sy   0   ]
		[   0    0    1   ]
 
Parameters:
sx - The factor by which coordinates are scaled along the X axis direction
sy - The factor by which coordinates are scaled along the Y axis direction

setToShear

public void setToShear(double shx,
                       double shy)
Sets this transform to a shearing transformation. The matrix representing this transform becomes:
		[   1   shx   0   ]
		[  shy   1    0   ]
		[   0    0    1   ]
 
Parameters:
shx - The multiplier by which coordinates are shifted in the direction of the positive X axis as a factor of their Y coordinate
shy - The multiplier by which coordinates are shifted in the direction of the positive Y axis as a factor of their X coordinate

setTransform

public void setTransform(AffineTransformation Tx)
Sets this transform to a copy of the transform in the indicated AffineTransformation object.
Parameters:
Tx - the AffineTransformation object from which to copy the transform

setTransform

public void setTransform(double m00,
                         double m01,
                         double m02,
                         double m10,
                         double m11,
                         double m12)
Sets this transform to the matrix specified by the 6 double precision values.

createInverse

public AffineTransformation createInverse()
Returns an AffineTransformation object representing the inverse transformation. The inverse transform Tx' of this transform Tx is the transform that maps coordinates transformed by Tx back to their original coordinates. In other words, Tx'(Tx(p)) = p = Tx(Tx'(p)).

If this transform maps all coordinates onto a point or a line then it will not have an inverse, since coordinates that do not lie on the destination point or line will not have an inverse mapping. The determinant() method can be used to determine if this transform has no inverse, in which case an exception will be thrown if the createInverse method is called.

Returns:
a new AffineTransformation object representing the inverse transformation
See Also:
determinant()

transform

public double[] transform(double x,
                          double y)
Transforms the specified point and returns the result as double array of length 2.
Parameters:
x,y - point to transform
Returns:
Transformed point as double array (index 0 contains x-coordinate, index 1 contains y-coordinate of the transformed point).

transform

public void transform(double[] src,
                      int srcoff,
                      double[] dst,
                      int dstoff,
                      int num)
Transforms an array of double precision coordinates by this transformation. The two coordinate array sections may be exactly the same or overlapping sections of the same array without affecting the validity of the results. This method will ensure that no source coordinates will be overwritten by a previous operation before they can be transformed. The coordinates are stored in the arrays starting at the indicated offset in the order [x0, y0, x1, y1, ..., xn, yn].
Parameters:
src - The array containing the source point coordinates. Each point is stored as a pair of x,y coordinates.
srcoff - The offset to the first point to be transformed in the source array.
dst - The array where the transformed point coordinates are returned. Each point is stored as a pair of x,y coordinates.
dstoff - The offset to the location where the first transformed point is stored in the destination array.
num - The number of point objects to be transformed.

inverseTransform

public double[] inverseTransform(double x,
                                 double y)
Inverse transforms the specified point and returns the result as double array of length 2.
Parameters:
x,y - point to transform
Returns:
Transformed point as double array (index 0 contains x-coordinate, index 1 contains y-coordinate of the transformed point).

inverseTransform

public void inverseTransform(double[] src,
                             int srcoff,
                             double[] dst,
                             int dstoff,
                             int num)
Inverse transforms an array of double precision coordinates by this transformation. The two coordinate array sections may be exactly the same or overlapping sections of the same array without affecting the validity of the results. This method will ensure that no source coordinates will be overwritten by a previous operation before they can be transformed. The coordinates are stored in the arrays starting at the indicated offset in the order [x0, y0, x1, y1, ..., xn, yn].
Parameters:
src - The array containing the source point coordinates. Each point is stored as a pair of x,y coordinates.
srcoff - The offset to the first point to be transformed in the source array.
dst - The array where the transformed point coordinates are returned. Each point is stored as a pair of x,y coordinates.
dstoff - The offset to the location where the first transformed point is stored in the destination array.
num - The number of point objects to be transformed.

deltaTransform

public double[] deltaTransform(double x,
                               double y)
Transforms a specified relative distance vector by this transform and returns the result as double array of length 2.
Parameters:
x,y - the relative distance vector
Returns:
The transformed relative distance vector as double array (index 0 contains x-coordinate, index 1 contains y-coordinate of the transformed relative distance vector).

deltaTransform

public void deltaTransform(double[] src,
                           int srcoff,
                           double[] dst,
                           int dstoff,
                           int num)
Transforms an array of relative distance vectors by this transform. A relative distance vector is transformed without applying the translation components of the affine transformation matrix using the following equations:
	[  x' ]   [  m00  m01 (m02) ] [  x  ]   [ m00x + m01y ]
	[  y' ] = [  m10  m11 (m12) ] [  y  ] = [ m10x + m11y ]
	[ (1) ]   [  (0)  (0) ( 1 ) ] [ (1) ]   [     (1)     ]
 
The two coordinate array sections may be exactly the same or overlapping sections of the same array without affecting the validity of the results. This method will ensure that no source coordinates will be overwritten by a previous operation before they can be transformed. The coordinates are stored in the arrays starting at the indicated offset in the order [x0, y0, x1, y1, ..., xn, yn].
Parameters:
src - The array containing the source distance vectors. Each vector is stored as a pair of relative x,y coordinates.
dst - The array where the transformed distance vectors are returned. Each vector is stored as a pair of relative x,y coordinates.
srcoff - The offset to the first vector to be transformed in the source array.
dstoff - The offset to the location where the first transformed vector is stored in the destination array.
num - The number of vector coordinate pairs to be transformed.

transform

public XObject transform(XObject xobject)
Transforms the specified XObject and returns the result. The transformed XObject will be a new instance of the given XObject.
Parameters:
xobject - XObject to transform
Returns:
Transformed instance of the given XObject

transform

public XObject[] transform(XObject[] array,
                           int off,
                           int len)
Transforms a given subarray of XObjects and returns the result. The transformed XObjects will be a new instances of the given XObjects.
Parameters:
array - array of XObjects to transform
off - start index of the subarray
len - length of the subarray interval
Returns:
Array of transformed instances of the given XObjects

transform

public XObject[] transform(XObject[] array)
Transforms a given array of XObjects and returns the result. The transformed XObjects will be a new instances of the given XObjects.
Parameters:
array - array of XObjects to transform
Returns:
Array of transformed instances of the given XObjects

inverseTransform

public XObject inverseTransform(XObject xobject)
Inverse transforms the specified XObject and returns the result. The transformed XObject will be a new instance of the given XObject.
Parameters:
xobject - XObject to transform
Returns:
Transformed instance of the given XObject

inverseTransform

public XObject[] inverseTransform(XObject[] array,
                                  int off,
                                  int len)
Inverse transforms a given subarray of XObjects and returns the result. The transformed XObjects will be a new instances of the given XObjects.
Parameters:
array - array of XObjects to transform
off - start index of the subarray
len - length of the subarray interval
Returns:
Array of inverse transformed instances of the given XObjects

inverseTransform

public XObject[] inverseTransform(XObject[] array)
Inverse transforms a given array of XObjects and returns the result. The transformed XObjects will be a new instances of the given XObjects.
Parameters:
array - array of XObjects to transform
Returns:
Array of inverse transformed instances of the given XObjects

deltaTransform

public XObject deltaTransform(XObject xobject)
Transforms the specified XObject without applying the translation components of the affine transformation matrix using the following equations:
	[  x' ]   [  m00  m01 (m02) ] [  x  ]   [ m00x + m01y ]
	[  y' ] = [  m10  m11 (m12) ] [  y  ] = [ m10x + m11y ]
	[ (1) ]   [  (0)  (0) ( 1 ) ] [ (1) ]   [     (1)     ]
 
The transformed XObject will be a new instance of the given XObject.
Parameters:
xobject - XObject to transform
Returns:
Transformed instance of the given XObject

deltaTransform

public XObject[] deltaTransform(XObject[] array,
                                int off,
                                int len)
Transforms a given subarray of XObjects without applying the translation components of the affine transformation matrix using the following equations:
	[  x' ]   [  m00  m01 (m02) ] [  x  ]   [ m00x + m01y ]
	[  y' ] = [  m10  m11 (m12) ] [  y  ] = [ m10x + m11y ]
	[ (1) ]   [  (0)  (0) ( 1 ) ] [ (1) ]   [     (1)     ]
 
The transformed XObjects will be a new instances of the given XObjects.
Parameters:
array - array of XObjects to transform
off - start index of the subarray
len - length of the subarray interval
Returns:
Array of transformed instances of the given XObjects

deltaTransform

public XObject[] deltaTransform(XObject[] array)
Transforms a given array of XObjects without applying the translation components of the affine transformation matrix using the following equations:
	[  x' ]   [  m00  m01 (m02) ] [  x  ]   [ m00x + m01y ]
	[  y' ] = [  m10  m11 (m12) ] [  y  ] = [ m10x + m11y ]
	[ (1) ]   [  (0)  (0) ( 1 ) ] [ (1) ]   [     (1)     ]
 
The transformed XObjects will be a new instances of the given XObjects.
Parameters:
array - array of XObjects to transform
Returns:
Array of transformed instances of the given XObjects

toString

public java.lang.String toString()
Returns a String that represents the value of this Object.
Overrides:
toString in class java.lang.Object

isIdentity

public boolean isIdentity()
Returns true if this AffineTransformation is an identity transform.

clone

public java.lang.Object clone()
Returns a copy of this AffineTransformation object.
Specified by:
clone in interface Cloneable
Overrides:
clone in class java.lang.Object
Following copied from interface: gishur.core.Cloneable
Returns:
a clone of this object.

equals

public boolean equals(java.lang.Object obj)
Returns true if this AffineTransformation represents the same affine coordinate transform as the given argument.
Overrides:
equals in class java.lang.Object