| java.lang.Object javax.media.jai.Warp javax.media.jai.WarpPolynomial javax.media.jai.WarpQuadratic
WarpQuadratic | final public class WarpQuadratic extends WarpPolynomial (Code) | | A quadratic-based description of an image warp.
The source position (x', y') of a point (x, y) is given by the
quadratic bivariate polynomials:
x' = p(x, y) = c1 + c2*x + c3*y + c4*x^2 + c5*x*y + c6*y^2
y' = q(x, y) = c7 + c8*x + c9*y + c10*x^2 + c11*x*y + c12*y^2
WarpQuadratic is marked final so that it may be
more easily inlined.
See Also: WarpPolynomial |
Constructor Summary | |
public | WarpQuadratic(float[] xCoeffs, float[] yCoeffs, float preScaleX, float preScaleY, float postScaleX, float postScaleY) Constructs a WarpQuadratic with a given transform mapping
destination pixels into source space. | public | WarpQuadratic(float[] xCoeffs, float[] yCoeffs) Constructs a WarpQuadratic with pre- and
post-scale factors of 1.
Parameters: xCoeffs - The 6 destination to source transform coefficients forthe X coordinate. Parameters: yCoeffs - The 6 destination to source transform coefficients forthe Y coordinate. throws: IllegalArgumentException - if the xCoeff and yCoeff arraysdo not each have size entries. |
Method Summary | |
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 x1 = (destPt.getX() + 0.5F)*preScaleX;
double x2 = x1*x1;
double y1 = (destPt.getY() + 0.5F)*preScaleY;
double y2 = y1*y1;
double x = c1 + c2*x1 + c3*y1 + c4*x2 + c5*x1*y1 + c6*y2;
double y = c7 + c8*x1 + c9*y1 + c10*x2 + c11*x1*y1 + c12*y2;
Point2D pt = (Point2D)destPt.clone();
pt.setLocation(x*postScaleX - 0.5, y*postScaleY - 0.5);
Parameters: destPt - the position in destination image coordinatesto map to source image 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. |
WarpQuadratic | public WarpQuadratic(float[] xCoeffs, float[] yCoeffs, float preScaleX, float preScaleY, float postScaleX, float postScaleY)(Code) | | Constructs a WarpQuadratic 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. The coeffs arrays must each contain 6 floats
corresponding to the coefficients c1, c2, etc. as shown in the
class comment.
Parameters: xCoeffs - The six destination to source transform coefficients forthe X coordinate. Parameters: yCoeffs - The six 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 result of theX polynomial evaluation Parameters: postScaleY - The scale factor to apply to the result of theY polynomial evaluation throws: IllegalArgumentException - if the xCoeff and yCoeff arraysdo not each have size entries. |
WarpQuadratic | public WarpQuadratic(float[] xCoeffs, float[] yCoeffs)(Code) | | Constructs a WarpQuadratic with pre- and
post-scale factors of 1.
Parameters: xCoeffs - The 6 destination to source transform coefficients forthe X coordinate. Parameters: yCoeffs - The 6 destination to source transform coefficients forthe Y coordinate. throws: IllegalArgumentException - if the xCoeff and yCoeff arraysdo not each have size entries. |
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 x1 = (destPt.getX() + 0.5F)*preScaleX;
double x2 = x1*x1;
double y1 = (destPt.getY() + 0.5F)*preScaleY;
double y2 = y1*y1;
double x = c1 + c2*x1 + c3*y1 + c4*x2 + c5*x1*y1 + c6*y2;
double y = c7 + c8*x1 + c9*y1 + c10*x2 + c11*x1*y1 + c12*y2;
Point2D pt = (Point2D)destPt.clone();
pt.setLocation(x*postScaleX - 0.5, y*postScaleY - 0.5);
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 |
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. throws: ArrayBoundsException - if destRect is too small |
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)
|
|
|