javax.media.jai
Class PerspectiveTransform

java.lang.Object
  |
  +--javax.media.jai.PerspectiveTransform
All Implemented Interfaces:
Cloneable, Serializable

public final class PerspectiveTransform
extends Object
implements Cloneable, Serializable

A 2D perspective (or projective) transform, used by various OpImages.

A perspective transformation is capable of mapping an arbitrary quadrilateral into another arbitrary quadrilateral, while preserving the straightness of lines. Unlike an affine transformation, the parallelism of lines in the source is not necessarily preserved in the output.

Such a coordinate transformation can be represented by a 3x3 matrix which transforms homogenous source coordinates (x, y, 1) into destination coordinates (x', y', w). To convert back into non-homogenous coordinates (X, Y), x' and y' are divided by w.

	[ x']   [  m00  m01  m02  ] [ x ]   [ m00x + m01y + m02 ]
	[ y'] = [  m10  m11  m12  ] [ y ] = [ m10x + m11y + m12 ]
	[ w ]   [  m20  m21  m22  ] [ 1 ]   [ m20x + m21y + m22 ]

	  x' = (m00x + m01y + m02)
	  y' = (m10x + m11y + m12)

        w  = (m20x + m21y + m22)

        X = x' / w
        Y = y' / w
 

See Also:
Serialized Form

Constructor Summary
PerspectiveTransform()
          Constructs an identity PerspectiveTransform.
PerspectiveTransform(AffineTransform transform)
          Constructs a new PerspectiveTransform with the same effect as an existing AffineTransform.
PerspectiveTransform(double[] flatmatrix)
          Deprecated. as of JAI 1.1 Use PerspectiveTransform(double[][]) instead.
PerspectiveTransform(double[][] matrix)
          Constructs a new PerspectiveTransform from a two-dimensional array of doubles.
PerspectiveTransform(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)
          Deprecated. as of JAI 1.1 Use PerspectiveTransform(double[][]) instead.
PerspectiveTransform(float[] flatmatrix)
          Deprecated. as of JAI 1.1 Use PerspectiveTransform(double[][]) instead.
PerspectiveTransform(float[][] matrix)
          Deprecated. as of JAI 1.1 Use PerspectiveTransform(double[][]) instead.
PerspectiveTransform(float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22)
          Deprecated. as of JAI 1.1 Use PerspectiveTransform(double[][]) instead.
 
Method Summary
 Object clone()
          Returns a copy of this PerspectiveTransform object.
 void concatenate(AffineTransform Tx)
          Post-concatenates a given AffineTransform to this transform.
 void concatenate(PerspectiveTransform Tx)
          Post-concatenates a given PerspectiveTransform to this transform.
 PerspectiveTransform createAdjoint()
          Returns a new PerpectiveTransform that is the adjoint, of the current transform.
 PerspectiveTransform createInverse()
          Returns a new PerpectiveTransform that is the inverse of the current transform.
 boolean equals(Object obj)
          Tests if this PerspectiveTransform equals a supplied one.
 double getDeterminant()
          Returns the determinant of the matrix representation of the transform.
 double[] getMatrix(double[] flatmatrix)
          Deprecated. as of JAI 1.1 Use double[][] getMatrix(double[][] matrix) instead.
 double[][] getMatrix(double[][] matrix)
          Retrieves the 9 specifiable values in the 3x3 affine transformation matrix into a 2-dimensional array of double precision values.
static PerspectiveTransform getQuadToQuad(double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3, double x0p, double y0p, double x1p, double y1p, double x2p, double y2p, double x3p, double y3p)
          Creates a PerspectiveTransform that maps an arbitrary quadrilateral onto another arbitrary quadrilateral.
static PerspectiveTransform getQuadToQuad(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3, float x0p, float y0p, float x1p, float y1p, float x2p, float y2p, float x3p, float y3p)
          Creates a PerspectiveTransform that maps an arbitrary quadrilateral onto another arbitrary quadrilateral.
static PerspectiveTransform getQuadToSquare(double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3)
          Creates a PerspectiveTransform that maps an arbitrary quadrilateral onto the unit square.
static PerspectiveTransform getQuadToSquare(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)
          Creates a PerspectiveTransform that maps an arbitrary quadrilateral onto the unit square.
static PerspectiveTransform getSquareToQuad(double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3)
          Creates a PerspectiveTransform that maps the unit square onto an arbitrary quadrilateral.
static PerspectiveTransform getSquareToQuad(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)
          Creates a PerspectiveTransform that maps the unit square onto an arbitrary quadrilateral.
 void inverseTransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
          Inverse transforms an array of double precision coordinates by this transform.
 Point2D inverseTransform(Point2D ptSrc, Point2D ptDst)
          Inverse transforms the specified ptSrc and stores the result in ptDst.
 boolean isIdentity()
          Returns the boolean true value if this PerspectiveTransform is an identity transform.
 void preConcatenate(AffineTransform Tx)
          Pre-concatenates a given AffineTransform to this transform.
 void preConcatenate(PerspectiveTransform Tx)
          Pre-concatenates a given PerspectiveTransform to this transform.
 void rotate(double theta)
          Concatenates this transform with a rotation transformation.
 void rotate(double theta, double x, double y)
          Concatenates this transform with a translated rotation transformation.
 void scale(double sx, double sy)
          Concatenates this transform with a scaling transformation.
 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 rotation transformation about a specified point (x, y).
 void setToScale(double sx, double sy)
          Sets this transform to a scale transformation with scale factors sx and sy.
 void setToShear(double shx, double shy)
          Sets this transform to a shearing transformation with shear factors sx and sy.
 void setToTranslation(double tx, double ty)
          Sets this transform to a translation transformation.
 void setTransform(AffineTransform Tx)
          Sets this transform to a given AffineTransform.
 void setTransform(double[][] matrix)
          Sets this transform using a two-dimensional array of double precision values.
 void setTransform(float m00, float m10, float m20, float m01, float m11, float m21, float m02, float m12, float m22)
          Deprecated. as of JAI 1.1 Use double[][] getMatrix(double[][] matrix) instead.
 void setTransform(PerspectiveTransform Tx)
          Sets this transform to a given PerspectiveTransform.
 void shear(double shx, double shy)
          Concatenates this transform with a shearing transformation.
 String toString()
          Returns a String that represents the value of this Object.
 void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
          Transforms an array of double precision coordinates by this transform.
 void transform(double[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
          Transforms an array of double precision coordinates by this transform, storing the results into an array of floats.
 void transform(float[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
          Transforms an array of floating point coordinates by this transform, storing the results into an array of doubles.
 void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
          Transforms an array of floating point coordinates by this transform.
 void transform(Point2D[] ptSrc, int srcOff, Point2D[] ptDst, int dstOff, int numPts)
          Transforms an array of point objects by this transform.
 Point2D transform(Point2D ptSrc, Point2D ptDst)
          Transforms the specified ptSrc and stores the result in ptDst.
 void translate(double tx, double ty)
          Concatenates this transform with a translation transformation.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PerspectiveTransform

public PerspectiveTransform()
Constructs an identity PerspectiveTransform.

PerspectiveTransform

public PerspectiveTransform(float m00,
                            float m01,
                            float m02,
                            float m10,
                            float m11,
                            float m12,
                            float m20,
                            float m21,
                            float m22)
Deprecated. as of JAI 1.1 Use PerspectiveTransform(double[][]) instead.

Constructs a new PerspectiveTransform from 9 floats.

PerspectiveTransform

public PerspectiveTransform(double m00,
                            double m01,
                            double m02,
                            double m10,
                            double m11,
                            double m12,
                            double m20,
                            double m21,
                            double m22)
Deprecated. as of JAI 1.1 Use PerspectiveTransform(double[][]) instead.

Constructs a new PerspectiveTransform from 9 doubles.

PerspectiveTransform

public PerspectiveTransform(float[] flatmatrix)
Deprecated. as of JAI 1.1 Use PerspectiveTransform(double[][]) instead.

Constructs a new PerspectiveTransform from a one-dimensional array of 9 floats, in row-major order. The values in the array are assumed to be { m00 m01 m02 m10 m11 m12 m20 m21 m22 }.
Throws:
IllegalArgumentException - if flatmatrix is null
ArrayIndexOutOfBoundsException - if flatmatrix is too small

PerspectiveTransform

public PerspectiveTransform(float[][] matrix)
Deprecated. as of JAI 1.1 Use PerspectiveTransform(double[][]) instead.

Constructs a new PerspectiveTransform from a two-dimensional array of floats.
Throws:
IllegalArgumentException - if matrix is null
ArrayIndexOutOfBoundsException - if matrix is too small

PerspectiveTransform

public PerspectiveTransform(double[] flatmatrix)
Deprecated. as of JAI 1.1 Use PerspectiveTransform(double[][]) instead.

Constructs a new PerspectiveTransform from a one-dimensional array of 9 doubles, in row-major order. The values in the array are assumed to be { m00 m01 m02 m10 m11 m12 m20 m21 m22 }.
Throws:
IllegalArgumentException - if flatmatrix is null
ArrayIndexOutOfBoundsException - if flatmatrix is too small

PerspectiveTransform

public PerspectiveTransform(double[][] matrix)
Constructs a new PerspectiveTransform from a two-dimensional array of doubles.
Throws:
IllegalArgumentException - if matrix is null
ArrayIndexOutOfBoundsException - if matrix is too small

PerspectiveTransform

public PerspectiveTransform(AffineTransform transform)
Constructs a new PerspectiveTransform with the same effect as an existing AffineTransform.
Throws:
IllegalArgumentException - if transform is null
Method Detail

getSquareToQuad

public static PerspectiveTransform getSquareToQuad(double x0,
                                                   double y0,
                                                   double x1,
                                                   double y1,
                                                   double x2,
                                                   double y2,
                                                   double x3,
                                                   double y3)
Creates a PerspectiveTransform that maps the unit square onto an arbitrary quadrilateral.
 (0, 0) -> (x0, y0)
 (1, 0) -> (x1, y1)
 (1, 1) -> (x2, y2)
 (0, 1) -> (x3, y3)
 

getSquareToQuad

public static PerspectiveTransform getSquareToQuad(float x0,
                                                   float y0,
                                                   float x1,
                                                   float y1,
                                                   float x2,
                                                   float y2,
                                                   float x3,
                                                   float y3)
Creates a PerspectiveTransform that maps the unit square onto an arbitrary quadrilateral.
 (0, 0) -> (x0, y0)
 (1, 0) -> (x1, y1)
 (1, 1) -> (x2, y2)
 (0, 1) -> (x3, y3)
 

getQuadToSquare

public static PerspectiveTransform getQuadToSquare(double x0,
                                                   double y0,
                                                   double x1,
                                                   double y1,
                                                   double x2,
                                                   double y2,
                                                   double x3,
                                                   double y3)
Creates a PerspectiveTransform that maps an arbitrary quadrilateral onto the unit square.
 (x0, y0) -> (0, 0)
 (x1, y1) -> (1, 0)
 (x2, y2) -> (1, 1)
 (x3, y3) -> (0, 1)
 

getQuadToSquare

public static PerspectiveTransform getQuadToSquare(float x0,
                                                   float y0,
                                                   float x1,
                                                   float y1,
                                                   float x2,
                                                   float y2,
                                                   float x3,
                                                   float y3)
Creates a PerspectiveTransform that maps an arbitrary quadrilateral onto the unit square.
 (x0, y0) -> (0, 0)
 (x1, y1) -> (1, 0)
 (x2, y2) -> (1, 1)
 (x3, y3) -> (0, 1)
 

getQuadToQuad

public static PerspectiveTransform getQuadToQuad(double x0,
                                                 double y0,
                                                 double x1,
                                                 double y1,
                                                 double x2,
                                                 double y2,
                                                 double x3,
                                                 double y3,
                                                 double x0p,
                                                 double y0p,
                                                 double x1p,
                                                 double y1p,
                                                 double x2p,
                                                 double y2p,
                                                 double x3p,
                                                 double y3p)
Creates a PerspectiveTransform that maps an arbitrary quadrilateral onto another arbitrary quadrilateral.
 (x0, y0) -> (x0p, y0p)
 (x1, y1) -> (x1p, y1p)
 (x2, y2) -> (x2p, y2p)
 (x3, y3) -> (x3p, y3p)
 

getQuadToQuad

public static PerspectiveTransform getQuadToQuad(float x0,
                                                 float y0,
                                                 float x1,
                                                 float y1,
                                                 float x2,
                                                 float y2,
                                                 float x3,
                                                 float y3,
                                                 float x0p,
                                                 float y0p,
                                                 float x1p,
                                                 float y1p,
                                                 float x2p,
                                                 float y2p,
                                                 float x3p,
                                                 float y3p)
Creates a PerspectiveTransform that maps an arbitrary quadrilateral onto another arbitrary quadrilateral.
 (x0, y0) -> (x0p, y0p)
 (x1, y1) -> (x1p, y1p)
 (x2, y2) -> (x2p, y2p)
 (x3, y3) -> (x3p, y3p)
 

getDeterminant

public double getDeterminant()
Returns the determinant of the matrix representation of the transform.

getMatrix

public double[] getMatrix(double[] flatmatrix)
Deprecated. as of JAI 1.1 Use double[][] getMatrix(double[][] matrix) instead.

Retrieves the 9 specifiable values in the 3x3 affine transformation matrix into an array of double precision values. The values are stored into the array as { m00 m01 m02 m10 m11 m12 m20 m21 m22 }.
Parameters:
flatmatrix - The double array used to store the returned values. The length of the array is assumed to be at least 9.
Throws:
ArrayIndexOutOfBoundsException - if flatmatrix is too small

getMatrix

public double[][] getMatrix(double[][] matrix)
Retrieves the 9 specifiable values in the 3x3 affine transformation matrix into a 2-dimensional array of double precision values. The values are stored into the 2-dimensional array using the row index as the first subscript and the column index as the second.
Parameters:
matrix - The 2-dimensional double array to store the returned values. The array is assumed to be at least 3x3.
Throws:
ArrayIndexOutOfBoundsException - if matrix is too small

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 PerspectiveTransform 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 PerspectiveTransform 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 translated rotation transformation. This is equivalent to the following sequence of calls:
		translate(x, y);
		rotate(theta);
		translate(-x, -y);
 
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 origin of the rotation
y - The Y coordinate of the origin 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 PerspectiveTransform represented by the following matrix:
		[   sx   0    0   ]
		[   0    sy   0   ]
		[   0    0    1   ]
 
Parameters:
sx - The X axis scale factor.
sy - The Y axis scale factor.

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 PerspectiveTransform represented by the following matrix:
		[   1   shx   0   ]
		[  shy   1    0   ]
		[   0    0    1   ]
 
Parameters:
shx - The factor by which coordinates are shifted towards the positive X axis direction according to their Y coordinate.
shy - The factor by which coordinates are shifted towards the positive Y axis direction according to 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 rotation transformation about a specified point (x, y). This is equivalent to the following sequence of calls:
		setToTranslate(x, y);
		rotate(theta);
		translate(-x, -y);
 
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 origin of the rotation
y - The Y coordinate of the origin of the rotation

setToScale

public void setToScale(double sx,
                       double sy)
Sets this transform to a scale transformation with scale factors sx and sy. The matrix representing this transform becomes:
		[   sx   0    0   ]
		[   0    sy   0   ]
		[   0    0    1   ]
 
Parameters:
sx - The X axis scale factor.
sy - The Y axis scale factor.

setToShear

public void setToShear(double shx,
                       double shy)
Sets this transform to a shearing transformation with shear factors sx and sy. The matrix representing this transform becomes:
		[   1  shx    0   ]
		[ shy    1    0   ]
		[   0    0    1   ]
 
Parameters:
shx - The factor by which coordinates are shifted towards the positive X axis direction according to their Y coordinate.
shy - The factor by which coordinates are shifted towards the positive Y axis direction according to their X coordinate.

setTransform

public void setTransform(AffineTransform Tx)
Sets this transform to a given AffineTransform.
Throws:
IllegalArgumentException - if Tx is null

setTransform

public void setTransform(PerspectiveTransform Tx)
Sets this transform to a given PerspectiveTransform.
Throws:
IllegalArgumentException - if Tx is null

setTransform

public void setTransform(float m00,
                         float m10,
                         float m20,
                         float m01,
                         float m11,
                         float m21,
                         float m02,
                         float m12,
                         float m22)
Deprecated. as of JAI 1.1 Use double[][] getMatrix(double[][] matrix) instead.

Sets this transform to a given PerspectiveTransform, expressed by the elements of its matrix. Important Note: The matrix elements in the argument list are in column-major order unlike those of the constructor, which are in row-major order.

setTransform

public void setTransform(double[][] matrix)
Sets this transform using a two-dimensional array of double precision values. The row index is first, and the column index is second.
Parameters:
matrix - The 2D double array to be used for setting this transform. The array is assumed to be at least 3x3.
Throws:
IllegalArgumentException - if matrix is null
ArrayIndexOutOfBoundsException - if matrix is too small
Since:
JAI 1.1

concatenate

public void concatenate(AffineTransform Tx)
Post-concatenates a given AffineTransform to this transform.
Throws:
IllegalArgumentException - if Tx is null

concatenate

public void concatenate(PerspectiveTransform Tx)
Post-concatenates a given PerspectiveTransform to this transform.
Throws:
IllegalArgumentException - if Tx is null

preConcatenate

public void preConcatenate(AffineTransform Tx)
Pre-concatenates a given AffineTransform to this transform.
Throws:
IllegalArgumentException - if Tx is null

preConcatenate

public void preConcatenate(PerspectiveTransform Tx)
Pre-concatenates a given PerspectiveTransform to this transform.
Throws:
IllegalArgumentException - if Tx is null

createInverse

public PerspectiveTransform createInverse()
                                   throws NoninvertibleTransformException,
                                          CloneNotSupportedException
Returns a new PerpectiveTransform that is the inverse of the current transform.
Throws:
NoninvertibleTransformException - if transform cannot be inverted

createAdjoint

public PerspectiveTransform createAdjoint()
                                   throws CloneNotSupportedException
Returns a new PerpectiveTransform that is the adjoint, of the current transform. The adjoint is defined as the matrix of cofactors, which in turn are the determinants of the submatrices defined by removing the row and column of each element from the original matrix in turn.

The adjoint is a scalar multiple of the inverse matrix. Because points to be transformed are converted into homogeneous coordinates, where scalar factors are irrelevant, the adjoint may be used in place of the true inverse. Since it is unnecessary to normalize the adjoint, it is both faster to compute and more numerically stable than the true inverse.


transform

public Point2D transform(Point2D ptSrc,
                         Point2D ptDst)
Transforms the specified ptSrc and stores the result in ptDst. If ptDst is null, a new Point2D object will be allocated before storing. In either case, ptDst containing the transformed point is returned for convenience. Note that ptSrc and ptDst can the same. In this case, the input point will be overwritten with the transformed point.
Parameters:
ptSrc - The array containing the source point objects.
ptDst - The array where the transform point objects are returned.
Throws:
IllegalArgumentException - if ptSrc is null

transform

public void transform(Point2D[] ptSrc,
                      int srcOff,
                      Point2D[] ptDst,
                      int dstOff,
                      int numPts)
Transforms an array of point objects by this transform.
Parameters:
ptSrc - The array containing the source point objects.
ptDst - The array where the transform point objects are returned.
srcOff - The offset to the first point object to be transformed in the source array.
dstOff - The offset to the location where the first transformed point object is stored in the destination array.
numPts - The number of point objects to be transformed.
Throws:
IllegalArgumentException - if ptSrc is null
IllegalArgumentException - if ptDst is null
ArrayIndexOutOfBoundsException - if ptSrc is too small

transform

public void transform(float[] srcPts,
                      int srcOff,
                      float[] dstPts,
                      int dstOff,
                      int numPts)
Transforms an array of floating point coordinates by this transform.
Parameters:
srcPts - 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.
dstPts - 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.
numPts - The number of points to be transformed.
Throws:
IllegalArgumentException - if srcPts is null
ArrayIndexOutOfBoundsException - if srcPts is too small

transform

public void transform(double[] srcPts,
                      int srcOff,
                      double[] dstPts,
                      int dstOff,
                      int numPts)
Transforms an array of double precision coordinates by this transform.
Parameters:
srcPts - The array containing the source point coordinates. Each point is stored as a pair of x,y coordinates.
dstPts - The array where the transformed point coordinates are returned. 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.
dstOff - The offset to the location where the first transformed point is stored in the destination array.
numPts - The number of point objects to be transformed.
Throws:
IllegalArgumentException - if srcPts is null
ArrayIndexOutOfBoundsException - if srcPts is too small

transform

public void transform(float[] srcPts,
                      int srcOff,
                      double[] dstPts,
                      int dstOff,
                      int numPts)
Transforms an array of floating point coordinates by this transform, storing the results into an array of doubles.
Parameters:
srcPts - 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.
dstPts - 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.
numPts - The number of points to be transformed.
Throws:
IllegalArgumentException - if srcPts is null
ArrayIndexOutOfBoundsException - if srcPts is too small

transform

public void transform(double[] srcPts,
                      int srcOff,
                      float[] dstPts,
                      int dstOff,
                      int numPts)
Transforms an array of double precision coordinates by this transform, storing the results into an array of floats.
Parameters:
srcPts - The array containing the source point coordinates. Each point is stored as a pair of x,y coordinates.
dstPts - The array where the transformed point coordinates are returned. 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.
dstOff - The offset to the location where the first transformed point is stored in the destination array.
numPts - The number of point objects to be transformed.
Throws:
IllegalArgumentException - if srcPts is null
ArrayIndexOutOfBoundsException - if srcPts is too small

inverseTransform

public Point2D inverseTransform(Point2D ptSrc,
                                Point2D ptDst)
                         throws NoninvertibleTransformException
Inverse transforms the specified ptSrc and stores the result in ptDst. If ptDst is null, a new Point2D object will be allocated before storing. In either case, ptDst containing the transformed point is returned for convenience. Note that ptSrc and ptDst can the same. In this case, the input point will be overwritten with the transformed point.
Parameters:
ptSrc - The point to be inverse transformed.
ptDst - The resulting transformed point.
Throws:
NoninvertibleTransformException - if the matrix cannot be inverted.
IllegalArgumentException - if ptSrc is null

inverseTransform

public void inverseTransform(double[] srcPts,
                             int srcOff,
                             double[] dstPts,
                             int dstOff,
                             int numPts)
                      throws NoninvertibleTransformException
Inverse transforms an array of double precision coordinates by this transform.
Parameters:
srcPts - The array containing the source point coordinates. Each point is stored as a pair of x,y coordinates.
dstPts - The array where the transformed point coordinates are returned. 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.
dstOff - The offset to the location where the first transformed point is stored in the destination array.
numPts - The number of point objects to be transformed.
Throws:
NoninvertibleTransformException - if the matrix cannot be inverted.
IllegalArgumentException - if srcPts is null
ArrayIndexOutOfBoundsException - if srcPts is too small
NoninvertibleTransformException - transform cannot be inverted

toString

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

isIdentity

public boolean isIdentity()
Returns the boolean true value if this PerspectiveTransform is an identity transform. Returns false otherwise.

clone

public Object clone()
Returns a copy of this PerspectiveTransform object.
Overrides:
clone in class Object

equals

public boolean equals(Object obj)
Tests if this PerspectiveTransform equals a supplied one.
Overrides:
equals in class Object
Parameters:
obj - The PerspectiveTransform to be compared to this one.