| java.lang.Object javax.media.jai.Warp javax.media.jai.WarpPolynomial javax.media.jai.WarpAffine
WarpAffine | final public class WarpAffine extends WarpPolynomial (Code) | | A description of an Affine warp.
The transform is specified as a mapping from destination
space to source space, a backward mapping, as opposed to the
forward mapping used in AffineOpImage.
The source position (x', y') of a point (x, y) is given by the
first order (affine) bivariate polynomials:
x' = p(x, y) = c1 + c2*x + c3*y
y' = q(x, y) = c4 + c5*x + c6*y
WarpAffine is marked final so that it may be more
easily inlined.
|
Constructor Summary | |
public | WarpAffine(float[] xCoeffs, float[] yCoeffs, float preScaleX, float preScaleY, float postScaleX, float postScaleY) Constructs a WarpAffine with a given transform mapping
destination pixels into source space. | public | WarpAffine(float[] xCoeffs, float[] yCoeffs) Constructs a WarpAffine with pre- and post-scale
factors of 1. | public | WarpAffine(AffineTransform transform, float preScaleX, float preScaleY, float postScaleX, float postScaleY) Constructs a WarpAffine with a given transform mapping
destination pixels into source space. | public | WarpAffine(AffineTransform transform) Constructs a WarpAffine with pre- and post-scale
factors of 1. |
Method Summary | |
public AffineTransform | getTransform() Returns a clone of the AffineTransform associated
with this WarpAffine object. | public Point2D | mapDestPoint(Point2D destPt) Computes the source point corresponding to the supplied point.
This method returns the value of pt in the following
code snippet:
double dx = (destPt.getX() + 0.5)*preScaleX;
double dy = (destPt.getY() + 0.5)*preScaleY;
Point2D pt = (Point2D)destPt.clone();
pt.setLocation((c1 + c2*dx + c3*dy)*postScaleX - 0.5F,
(c4 + c5*dx + c6*dy)*postScaleY - 0.5F);
Parameters: destPt - the position in destination image coordinatesto map to source image coordinates. | public Rectangle | mapDestRect(Rectangle destRect) Computes a Rectangle that is guaranteed to enclose the region
of the source that is required in order to produce a given
rectangular output region.
Parameters: destRect - The Rectangle in destination coordinates. | public Point2D | mapSourcePoint(Point2D sourcePt) Computes the destination point corresponding to the supplied point.
If the transform is invertible, this method returns the value of
pt in the following code snippet:
double sx = (sourcePt.getX() + 0.5F)/postScaleX;
double sy = (sourcePt.getY() + 0.5F)/postScaleY;
Point2D pt = (Point2D)sourcePt.clone();
pt.setLocation((invc1 + invc2*sx + invc3*sy)/preScaleX - 0.5F,
(invc4 + invc5*sx + invc6*sy)/preScaleY - 0.5F);
where invc* are the inverse transform coefficients. | public Rectangle | mapSourceRect(Rectangle srcRect) Computes a Rectangle that is guaranteed to enclose the region
of the destination to which the source rectangle maps.
Parameters: srcRect - The Rectangle in source coordinates. | public float[] | warpSparseRect(int x, int y, int width, int height, int periodX, int periodY, float[] destRect) Computes the source subpixel positions for a given rectangular
destination region, subsampled with an integral period. |
WarpAffine | public WarpAffine(float[] xCoeffs, float[] yCoeffs, float preScaleX, float preScaleY, float postScaleX, float postScaleY)(Code) | | Constructs a WarpAffine with a given transform mapping
destination pixels into source space. The transform is
given by:
x' = xCoeffs[0] + xCoeffs[1]*x + xCoeffs[2]*y;
y' = yCoeffs[0] + yCoeffs[1]*x + yCoeffs[2]*y;
where x', y' are the source image coordinates
and x, y are the destination image coordinates.
Parameters: xCoeffs - The 3 destination to source transform coefficients forthe X coordinate. Parameters: yCoeffs - The 3 destination to source transform coefficients forthe Y coordinate. Parameters: preScaleX - The scale factor to apply to input (dest) X positions. Parameters: preScaleY - The scale factor to apply to input (dest) Y positions. Parameters: postScaleX - The scale factor to apply to the evaluated x transform Parameters: postScaleY - The scale factor to apply to the evaluated y transform throws: IllegalArgumentException - if array xCoeffs oryCoeffs does not have length of 3. |
WarpAffine | public WarpAffine(float[] xCoeffs, float[] yCoeffs)(Code) | | Constructs a WarpAffine with pre- and post-scale
factors of 1.
Parameters: xCoeffs - The 3 destination to source transform coefficients forthe X coordinate. Parameters: yCoeffs - The 3 destination to source transform coefficients forthe Y coordinate. |
WarpAffine | public WarpAffine(AffineTransform transform, float preScaleX, float preScaleY, float postScaleX, float postScaleY)(Code) | | Constructs a WarpAffine with a given transform mapping
destination pixels into source space. Note that this is
a backward mapping as opposed to the forward mapping used in
AffineOpImage.
Parameters: transform - The destination to source transform. Parameters: preScaleX - The scale factor to apply to source X positions. Parameters: preScaleY - The scale factor to apply to source Y positions. Parameters: postScaleX - The scale factor to apply to destination X positions. Parameters: postScaleY - The scale factor to apply to destination Y positions. |
WarpAffine | public WarpAffine(AffineTransform transform)(Code) | | Constructs a WarpAffine with pre- and post-scale
factors of 1.
Parameters: transform - An AffineTransform mapping dest to sourcecoordinates. |
getTransform | public AffineTransform getTransform()(Code) | | Returns a clone of the AffineTransform associated
with this WarpAffine object.
An AffineTransform . |
mapDestPoint | public Point2D mapDestPoint(Point2D destPt)(Code) | | Computes the source point corresponding to the supplied point.
This method returns the value of pt in the following
code snippet:
double dx = (destPt.getX() + 0.5)*preScaleX;
double dy = (destPt.getY() + 0.5)*preScaleY;
Point2D pt = (Point2D)destPt.clone();
pt.setLocation((c1 + c2*dx + c3*dy)*postScaleX - 0.5F,
(c4 + c5*dx + c6*dy)*postScaleY - 0.5F);
Parameters: destPt - the position in destination image coordinatesto map to source image coordinates. a Point2D of the same class asdestPt . throws: IllegalArgumentException - if destPt isnull . since: JAI 1.1.2 |
mapDestRect | public Rectangle mapDestRect(Rectangle destRect)(Code) | | Computes a Rectangle that is guaranteed to enclose the region
of the source that is required in order to produce a given
rectangular output region.
Parameters: destRect - The Rectangle in destination coordinates. A Rectangle in the source coordinatesystem that is guaranteed to contain all pixelsreferenced by the output of warpRect() onthe destination region, or null . throws: IllegalArgumentException - if destRect isnull . |
mapSourcePoint | public Point2D mapSourcePoint(Point2D sourcePt)(Code) | | Computes the destination point corresponding to the supplied point.
If the transform is invertible, this method returns the value of
pt in the following code snippet:
double sx = (sourcePt.getX() + 0.5F)/postScaleX;
double sy = (sourcePt.getY() + 0.5F)/postScaleY;
Point2D pt = (Point2D)sourcePt.clone();
pt.setLocation((invc1 + invc2*sx + invc3*sy)/preScaleX - 0.5F,
(invc4 + invc5*sx + invc6*sy)/preScaleY - 0.5F);
where invc* are the inverse transform coefficients. If
the transform is not invertible, null is returned.
Parameters: sourcePt - the position in source image coordinatesto map to destination image coordinates. a Point2D of the same class assourcePt or null> if the transform isnot invertible. throws: IllegalArgumentException - if destPt isnull . since: JAI 1.1.2 |
mapSourceRect | public Rectangle mapSourceRect(Rectangle srcRect)(Code) | | Computes a Rectangle that is guaranteed to enclose the region
of the destination to which the source rectangle maps.
Parameters: srcRect - The Rectangle in source coordinates. A Rectangle in the destination coordinatesystem that is guaranteed to contain all pixelswithin the forward mapping of the source rectangle. throws: IllegalArgumentException - if srctRect isnull . since: JAI 1.1 |
warpSparseRect | public float[] warpSparseRect(int x, int y, int width, int height, int periodX, int periodY, float[] destRect)(Code) | | Computes the source subpixel positions for a given rectangular
destination region, subsampled with an integral period. The
destination region is specified using normal integral (full
pixel) coordinates. The source positions returned by the
method are specified in floating point.
Parameters: x - The minimum X coordinate of the destination region. Parameters: y - The minimum Y coordinate of the destination region. Parameters: width - The width of the destination region. Parameters: height - The height of the destination region. Parameters: periodX - The horizontal sampling period. Parameters: periodY - The vertical sampling period. Parameters: destRect - A float array containing at least2*((width+periodX-1)/periodX)*((height+periodY-1)/periodY) elements, or null . If null , anew array will be constructed. A reference to the destRect parameter ifit is non-null , or a newfloat array otherwise. |
Methods inherited from javax.media.jai.Warp | public Point2D mapDestPoint(Point2D destPt)(Code)(Java Doc) public Rectangle mapDestRect(Rectangle destRect)(Code)(Java Doc) public Point2D mapSourcePoint(Point2D sourcePt)(Code)(Java Doc) public Rectangle mapSourceRect(Rectangle sourceRect)(Code)(Java Doc) public int[] warpPoint(int x, int y, int subsampleBitsH, int subsampleBitsV, int[] destRect)(Code)(Java Doc) public float[] warpPoint(int x, int y, float[] destRect)(Code)(Java Doc) public int[] warpRect(int x, int y, int width, int height, int subsampleBitsH, int subsampleBitsV, int[] destRect)(Code)(Java Doc) public float[] warpRect(int x, int y, int width, int height, float[] destRect)(Code)(Java Doc) public int[] warpSparseRect(int x, int y, int width, int height, int periodX, int periodY, int subsampleBitsH, int subsampleBitsV, int[] destRect)(Code)(Java Doc) abstract public float[] warpSparseRect(int x, int y, int width, int height, int periodX, int periodY, float[] destRect)(Code)(Java Doc)
|
|
|