| org.geotools.referencing.operation.transform.AbstractMathTransform org.geotools.referencing.operation.transform.WarpTransform2D
WarpTransform2D | public class WarpTransform2D extends AbstractMathTransform implements MathTransform2D,Serializable(Code) | | Wraps an arbitrary
Warp object as a
.
Calls to
methods are forwarded to
the
Warp.warpPoint(intintfloat[]) warpPoint method, or something equivalent. This
implies that source coordinates may be rounded to nearest integers before the transformation
is applied.
This transform is typically used with
for reprojecting an image. Source and destination coordinates
are usually pixel coordinates in source and target image, which is why this transform may use
integer arithmetic.
This math transform can be created alone (by invoking its public constructors directly), or it
can be created by a factory like
LocalizationGrid .
For more information on image warp, see
Geometric
Image Manipulation in the Programming in Java Advanced Imaging guide.
since: 2.1 version: $Id: WarpTransform2D.java 29101 2008-02-06 12:11:19Z desruisseaux $ author: Martin Desruisseaux author: Alessio Fabiani See Also: LocalizationGrid.getPolynomialTransform(int) See Also: Warp See Also: javax.media.jai.WarpOpImage See Also: javax.media.jai.operator.WarpDescriptor |
Field Summary | |
final public static int | MAX_DEGREE The maximal polynomial degree allowed. |
Constructor Summary | |
public | WarpTransform2D(Point2D[] srcCoords, Point2D[] dstCoords, int degree) Constructs a warp transform that approximatively maps the given source coordinates to the
given destination coordinates. | public | WarpTransform2D(Rectangle2D srcBounds, Point2D[] srcCoords, int srcOffset, Rectangle2D dstBounds, Point2D[] dstCoords, int dstOffset, int numCoords, int degree) Constructs a warp transform that approximatively maps the given source coordinates to the
given destination coordinates. | public | WarpTransform2D(Rectangle2D srcBounds, float[] srcCoords, int srcOffset, Rectangle2D dstBounds, float[] dstCoords, int dstOffset, int numCoords, int degree) Constructs a warp transform that approximatively maps the given source coordinates to the
given destination coordinates. | protected | WarpTransform2D(Warp warp, Warp inverse) Constructs a transform using the specified warp object. |
Method Summary | |
public static MathTransform2D | create(Warp warp) Returns a transform using the specified warp object. | public boolean | equals(Object object) Compares this transform with the specified object for equality. | public ParameterDescriptorGroup | getParameterDescriptors() Returns the parameter descriptors for this math transform. | public ParameterValueGroup | getParameterValues() Returns the parameter values for this math transform. | public int | getSourceDimensions() Returns the dimension of input points. | public int | getTargetDimensions() Returns the dimension of output points. | public static Warp | getWarp(CharSequence name, MathTransform2D transform) Returns a
for the specified transform. | public Warp | getWarp() Returns
wrapped by this transform. | public int | hashCode() Returns a hash value for this transform. | public MathTransform | inverse() Returns the inverse transform. | public boolean | isIdentity() Tests if this transform is the identity transform. | public Point2D | transform(Point2D ptSrc, Point2D ptDst) Transforms source coordinates (usually pixel indices) into destination coordinates
(usually "real world" coordinates).
Parameters: ptSrc - the specified coordinate point to be transformed. Parameters: ptDst - the specified coordinate point that stores the result of transforming ptSrc , or null . | public void | transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) Transforms source coordinates (usually pixel indices) into destination coordinates
(usually "real world" coordinates). | public void | transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Transforms source coordinates (usually pixel indices) into destination coordinates
(usually "real world" coordinates). |
MAX_DEGREE | final public static int MAX_DEGREE(Code) | | The maximal polynomial degree allowed.
since: 2.4 |
WarpTransform2D | public WarpTransform2D(Point2D[] srcCoords, Point2D[] dstCoords, int degree)(Code) | | Constructs a warp transform that approximatively maps the given source coordinates to the
given destination coordinates. The transformation is performed using some polynomial warp
with the degree supplied in argument. The number of points required for each degree of warp
are as follows:
Degree of Warp | Number of Points |
1 | 3 |
2 | 6 |
3 | 10 |
4 | 15 |
5 | 21 |
6 | 28 |
7 | 36 |
Parameters: srcCoords - Source coordinates. Parameters: dstCoords - Destination coordinates. Parameters: degree - The desired degree of the warp polynomials. |
WarpTransform2D | public WarpTransform2D(Rectangle2D srcBounds, Point2D[] srcCoords, int srcOffset, Rectangle2D dstBounds, Point2D[] dstCoords, int dstOffset, int numCoords, int degree)(Code) | | Constructs a warp transform that approximatively maps the given source coordinates to the
given destination coordinates. The transformation is performed using some polynomial warp
with the degree supplied in argument.
Parameters: srcBounds - Bounding box of source coordinates, or null if unknow. Parameters: srcCoords - Source coordinates. Parameters: srcOffset - The inital entry of srcCoords to be used. Parameters: dstBounds - Bounding box of destination coordinates, or null if unknow. Parameters: dstCoords - Destination coordinates. Parameters: dstOffset - The inital entry of destCoords to be used. Parameters: numCoords - The number of coordinates from srcCoords and destCoords to be used. Parameters: degree - The desired degree of the warp polynomials. |
WarpTransform2D | public WarpTransform2D(Rectangle2D srcBounds, float[] srcCoords, int srcOffset, Rectangle2D dstBounds, float[] dstCoords, int dstOffset, int numCoords, int degree)(Code) | | Constructs a warp transform that approximatively maps the given source coordinates to the
given destination coordinates. The transformation is performed using some polynomial warp
with the degree supplied in argument.
Parameters: srcBounds - Bounding box of source coordinates, or null if unknow. Parameters: srcCoords - Source coordinates with x and y alternating. Parameters: srcOffset - The inital entry of srcCoords to be used. Parameters: dstBounds - Bounding box of destination coordinates, or null if unknow. Parameters: dstCoords - Destination coordinates with x and y alternating. Parameters: dstOffset - The inital entry of destCoords to be used. Parameters: numCoords - The number of coordinates from srcCoords and destCoords to be used. Parameters: degree - The desired degree of the warp polynomials. |
WarpTransform2D | protected WarpTransform2D(Warp warp, Warp inverse)(Code) | | Constructs a transform using the specified warp object. Transformations will be applied
using the
Warp.warpPoint(intintfloat[]) warpPoint method or something equivalent.
Parameters: warp - The image warp to wrap into a math transform. Parameters: inverse - An image warp to uses for the ,or null in none. |
create | public static MathTransform2D create(Warp warp)(Code) | | Returns a transform using the specified warp object. Transformations will be applied
using the
Warp.warpPoint(intintfloat[]) warpPoint method or something equivalent.
Parameters: warp - The image warp to wrap into a math transform. |
equals | public boolean equals(Object object)(Code) | | Compares this transform with the specified object for equality.
|
getParameterDescriptors | public ParameterDescriptorGroup getParameterDescriptors()(Code) | | Returns the parameter descriptors for this math transform.
|
getParameterValues | public ParameterValueGroup getParameterValues()(Code) | | Returns the parameter values for this math transform.
|
getSourceDimensions | public int getSourceDimensions()(Code) | | Returns the dimension of input points.
|
getTargetDimensions | public int getTargetDimensions()(Code) | | Returns the dimension of output points.
|
getWarp | public static Warp getWarp(CharSequence name, MathTransform2D transform)(Code) | | Returns a
for the specified transform. The
Warp.warpPoint(intintfloat[]) Warp.warpPoint method transforms coordinates from
source to target CRS. Note that JAI's
needs a warp object with the opposite semantic (i.e. the image warp must
transforms coordinates from target to source CRS). Consequently, consider invoking
getWarp(transform.inverse()) if the warp object is going to be used in an
image reprojection.
Parameters: name - The image or name, or null in unknow. Used only for formatting error message if someorg.opengis.referencing.operation.TransformException are thrown by thesupplied transform. Parameters: transform - The transform to returns as an image warp.ConcatenatedTransform WarpTransform2D AffineTransform AffineTransform AffineTransform WarpPolynomial |
getWarp | public Warp getWarp()(Code) | | Returns
wrapped by this transform. The
Warp.warpPoint(intintfloat[]) Warp.warpPoint method transforms coordinates from
source to target CRS. Note that JAI's
needs a warp object with the opposite semantic (i.e. the image warp must
transforms coordinates from target to source CRS). Consequently, consider invoking
.getWarp() if the warp object is going to be used in an
image reprojection.
|
hashCode | public int hashCode()(Code) | | Returns a hash value for this transform.
|
inverse | public MathTransform inverse() throws NoninvertibleTransformException(Code) | | Returns the inverse transform.
throws: NoninvertibleTransformException - if no inverse warp were specified at construction time. |
isIdentity | public boolean isIdentity()(Code) | | Tests if this transform is the identity transform.
|
transform | public Point2D transform(Point2D ptSrc, Point2D ptDst)(Code) | | Transforms source coordinates (usually pixel indices) into destination coordinates
(usually "real world" coordinates).
Parameters: ptSrc - the specified coordinate point to be transformed. Parameters: ptDst - the specified coordinate point that stores the result of transforming ptSrc , or null . the coordinate point after transforming ptSrc and storing the result in ptDst . |
transform | public void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)(Code) | | Transforms source coordinates (usually pixel indices) into destination coordinates
(usually "real world" coordinates).
|
transform | public void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)(Code) | | Transforms source coordinates (usually pixel indices) into destination coordinates
(usually "real world" coordinates).
|
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)
|
|
|