| org.geotools.referencing.operation.transform.AbstractMathTransform org.geotools.referencing.operation.transform.ProjectiveTransform
All known Subclasses: org.geotools.referencing.operation.transform.GeocentricTranslation,
ProjectiveTransform | public class ProjectiveTransform extends AbstractMathTransform implements LinearTransform,Serializable(Code) | | A usually affine, or otherwise a projective transform. A projective transform is capable of
mapping an arbitrary quadrilateral into another arbitrary quadrilateral, while preserving the
straightness of lines. In the special case where the transform is affine, the parallelism of
lines in the source is preserved in the output.
Such a coordinate transformation can be represented by a square
of an arbitrary size. Point coordinates must have a dimension equals to
-1 . For example, for square matrix of size 4×4,
coordinate points are three-dimensional. The transformed points (x',y',z') are
computed as below (note that this computation is similar to
javax.media.jai.PerspectiveTransform in Java Advanced Imaging):
[ u ] [ m00 m01 m02 m03 ] [ x ]
[ v ] = [ m10 m11 m12 m13 ] [ y ]
[ w ] [ m20 m21 m22 m23 ] [ z ]
[ t ] [ m30 m31 m32 m33 ] [ 1 ]
x' = u/t
y' = v/t
y' = w/t
In the special case of an affine transform, the last row contains only zero
values except in the last column, which contains 1.
since: 2.0 version: $Id: ProjectiveTransform.java 24925 2007-03-27 20:12:08Z jgarnett $ author: Martin Desruisseaux See Also: javax.media.jai.PerspectiveTransform See Also: java.awt.geom.AffineTransform See Also: Affine transformation on MathWorld |
Constructor Summary | |
protected | ProjectiveTransform(Matrix matrix) Constructs a transform from the specified matrix. |
Method Summary | |
public static LinearTransform | create(Matrix matrix) Creates a transform for the specified matrix. | public static LinearTransform | create(AffineTransform matrix) Creates a transform for the specified matrix as a Java2D object. | MathTransform | createInverse(Matrix matrix) Creates an inverse transform using the specified matrix. | public static LinearTransform | createScale(int dimension, double scale) Creates a transform that apply a uniform scale along all axis. | public static Matrix | createSelectMatrix(int sourceDim, int[] toKeep) Creates a matrix that keep only a subset of the ordinate values.
The dimension of source coordinates is
sourceDim and
the dimension of target coordinates is
toKeep.length .
Parameters: sourceDim - the dimension of source coordinates. Parameters: toKeep - the indices of ordinate values to keep. | public static LinearTransform | createTranslation(int dimension, double offset) Creates a transform that apply the same translation along all axis. | public Matrix | derivative(Point2D point) Gets the derivative of this transform at a point. | public Matrix | derivative(DirectPosition point) Gets the derivative of this transform at a point. | public boolean | equals(Object object) Compares the specified object with
this math transform for equality. | public Matrix | getMatrix() Returns a copy of the matrix. | public ParameterDescriptorGroup | getParameterDescriptors() Returns the parameter descriptors for this math transform. | static ParameterValueGroup | getParameterValues(Matrix matrix) Returns the matrix elements as a group of parameters values. | public ParameterValueGroup | getParameterValues() Returns the matrix elements as a group of parameters values. | public int | getSourceDimensions() Gets the dimension of input points. | public int | getTargetDimensions() Gets the dimension of output points. | public int | hashCode() Returns a hash value for this transform. | public MathTransform | inverse() Creates the inverse transform of this object. | public boolean | isIdentity() Tests whether this transform does not move any points. | public boolean | isIdentity(double tolerance) Tests whether this transform does not move any points by using the provided tolerance. | public void | transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) Transforms an array of floating point coordinates by this matrix. | public void | transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Transforms an array of floating point coordinates by this matrix. |
ProjectiveTransform | protected ProjectiveTransform(Matrix matrix)(Code) | | Constructs a transform from the specified matrix.
The matrix should be affine, but it will not be verified.
Parameters: matrix - The matrix. |
create | public static LinearTransform create(Matrix matrix)(Code) | | Creates a transform for the specified matrix.
The matrix should be affine, but it is not be verified.
|
createInverse | MathTransform createInverse(Matrix matrix)(Code) | | Creates an inverse transform using the specified matrix.
To be overridden by
GeocentricAffineTransform .
|
createScale | public static LinearTransform createScale(int dimension, double scale)(Code) | | Creates a transform that apply a uniform scale along all axis.
Parameters: dimension - The input and output dimensions. Parameters: scale - The scale factor. since: 2.3 |
createSelectMatrix | public static Matrix createSelectMatrix(int sourceDim, int[] toKeep) throws IndexOutOfBoundsException(Code) | | Creates a matrix that keep only a subset of the ordinate values.
The dimension of source coordinates is
sourceDim and
the dimension of target coordinates is
toKeep.length .
Parameters: sourceDim - the dimension of source coordinates. Parameters: toKeep - the indices of ordinate values to keep. The matrix to give to the ProjectiveTransform.create(Matrix)method in order to create the transform. throws: IndexOutOfBoundsException - if a value of toKeep is lower than 0 or not smaller than sourceDim . |
createTranslation | public static LinearTransform createTranslation(int dimension, double offset)(Code) | | Creates a transform that apply the same translation along all axis.
Parameters: dimension - The input and output dimensions. Parameters: offset - The translation. since: 2.3 |
derivative | public Matrix derivative(Point2D point)(Code) | | Gets the derivative of this transform at a point.
For a matrix transform, the derivative is the
same everywhere.
|
derivative | public Matrix derivative(DirectPosition point)(Code) | | Gets the derivative of this transform at a point.
For a matrix transform, the derivative is the
same everywhere.
|
equals | public boolean equals(Object object)(Code) | | Compares the specified object with
this math transform for equality.
|
getMatrix | public Matrix getMatrix()(Code) | | Returns a copy of the matrix.
|
getParameterDescriptors | public ParameterDescriptorGroup getParameterDescriptors()(Code) | | Returns the parameter descriptors for this math transform.
|
getParameterValues | static ParameterValueGroup getParameterValues(Matrix matrix)(Code) | | Returns the matrix elements as a group of parameters values. The number of parameters
depends on the matrix size. Only matrix elements different from their default value
will be included in this group.
Parameters: matrix - The matrix to returns as a group of parameters. A copy of the parameter values for this math transform. |
getParameterValues | public ParameterValueGroup getParameterValues()(Code) | | Returns the matrix elements as a group of parameters values. The number of parameters
depends on the matrix size. Only matrix elements different from their default value
will be included in this group.
A copy of the parameter values for this math transform. |
getSourceDimensions | public int getSourceDimensions()(Code) | | Gets the dimension of input points.
|
getTargetDimensions | public int getTargetDimensions()(Code) | | Gets the dimension of output points.
|
hashCode | public int hashCode()(Code) | | Returns a hash value for this transform.
This value need not remain consistent between
different implementations of the same class.
|
inverse | public MathTransform inverse() throws NoninvertibleTransformException(Code) | | Creates the inverse transform of this object.
|
isIdentity | public boolean isIdentity()(Code) | | Tests whether this transform does not move any points.
|
transform | public void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)(Code) | | Transforms an array of floating point coordinates by this matrix. Point coordinates
must have a dimension equals to
Matrix.getNumCol -1 . For example,
for square matrix of size 4×4, coordinate points are three-dimensional and
stored in the arrays starting at the specified offset (
srcOff ) in the order
[x0, y0, z0,
x1, y1, z1...,
xn, yn, zn] .
Parameters: srcPts - The array containing the source point coordinates. Parameters: srcOff - The offset to the first point to be transformed in the source array. Parameters: dstPts - The array into which the transformed point coordinates are returned. Parameters: dstOff - The offset to the location of the first transformed point that is storedin the destination array. The source and destination array sections canbe overlaps. Parameters: numPts - The number of points to be transformed |
transform | public void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)(Code) | | Transforms an array of floating point coordinates by this matrix. Point coordinates
must have a dimension equals to
Matrix.getNumCol -1 . For example,
for square matrix of size 4×4, coordinate points are three-dimensional and
stored in the arrays starting at the specified offset (
srcOff ) in the order
[x0, y0, z0,
x1, y1, z1...,
xn, yn, zn] .
Parameters: srcPts - The array containing the source point coordinates. Parameters: srcOff - The offset to the first point to be transformed in the source array. Parameters: dstPts - The array into which the transformed point coordinates are returned. Parameters: dstOff - The offset to the location of the first transformed point that is storedin the destination array. The source and destination array sections canbe overlaps. Parameters: numPts - The number of points to be transformed |
Methods inherited from org.geotools.referencing.operation.transform.AbstractMathTransform | MathTransform concatenate(MathTransform other, boolean applyOtherFirst)(Code)(Java Doc) public Shape createTransformedShape(Shape shape) throws TransformException(Code)(Java Doc) final Shape createTransformedShape(Shape shape, AffineTransform preTransform, AffineTransform postTransform, int orientation) throws TransformException(Code)(Java Doc) public Matrix derivative(Point2D point) throws TransformException(Code)(Java Doc) public Matrix derivative(DirectPosition point) throws TransformException(Code)(Java Doc) protected static void ensureNonNull(String name, Object object) throws IllegalArgumentException(Code)(Java Doc) public boolean equals(Object object)(Code)(Java Doc) protected String formatWKT(Formatter formatter)(Code)(Java Doc) public ParameterDescriptorGroup getParameterDescriptors()(Code)(Java Doc) public ParameterValueGroup getParameterValues()(Code)(Java Doc) abstract public int getSourceDimensions()(Code)(Java Doc) abstract public int getTargetDimensions()(Code)(Java Doc) public int hashCode()(Code)(Java Doc) public MathTransform inverse() throws NoninvertibleTransformException(Code)(Java Doc) static Matrix invert(Matrix matrix) throws NoninvertibleTransformException(Code)(Java Doc) public boolean isIdentity()(Code)(Java Doc) protected static boolean needCopy(int srcOff, int dimSource, int dstOff, int dimTarget, int numPts)(Code)(Java Doc) protected static double rollLongitude(double x)(Code)(Java Doc) static GeneralMatrix toGMatrix(Matrix matrix)(Code)(Java Doc) static XMatrix toXMatrix(Matrix matrix)(Code)(Java Doc) public Point2D transform(Point2D ptSrc, Point2D ptDst) throws TransformException(Code)(Java Doc) public DirectPosition transform(DirectPosition ptSrc, DirectPosition ptDst) throws TransformException(Code)(Java Doc) public void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) throws TransformException(Code)(Java Doc)
|
|
|