|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.media.jai.Warp
javax.media.jai.WarpPolynomial
javax.media.jai.WarpQuadratic
public final class WarpQuadratic
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.
WarpPolynomial
,
Serialized FormField Summary |
---|
Fields inherited from class javax.media.jai.WarpPolynomial |
---|
degree, postScaleX, postScaleY, preScaleX, preScaleY, xCoeffs, yCoeffs |
Constructor Summary | |
---|---|
WarpQuadratic(float[] xCoeffs,
float[] yCoeffs)
Constructs a WarpQuadratic with pre- and
post-scale factors of 1. |
|
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. |
Method Summary | |
---|---|
Point2D |
mapDestPoint(Point2D destPt)
Computes the source point corresponding to the supplied point. |
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. |
Methods inherited from class javax.media.jai.WarpPolynomial |
---|
createWarp, getCoeffs, getDegree, getPostScaleX, getPostScaleY, getPreScaleX, getPreScaleY, getXCoeffs, getYCoeffs |
Methods inherited from class javax.media.jai.Warp |
---|
mapDestRect, mapSourcePoint, mapSourceRect, warpPoint, warpPoint, warpRect, warpRect, warpSparseRect |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WarpQuadratic(float[] xCoeffs, float[] yCoeffs, float preScaleX, float preScaleY, float postScaleX, float postScaleY)
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.
xCoeffs
- The six destination to source transform coefficients for
the X coordinate.yCoeffs
- The six destination to source transform coefficients for
the Y coordinate.preScaleX
- The scale factor to apply to input (dest) X positions.preScaleY
- The scale factor to apply to input (dest) Y positions.postScaleX
- The scale factor to apply to the result of the
X polynomial evaluationpostScaleY
- The scale factor to apply to the result of the
Y polynomial evaluation
IllegalArgumentException
- if the xCoeff and yCoeff arrays
do not each have size entries.public WarpQuadratic(float[] xCoeffs, float[] yCoeffs)
WarpQuadratic
with pre- and
post-scale factors of 1.
xCoeffs
- The 6 destination to source transform coefficients for
the X coordinate.yCoeffs
- The 6 destination to source transform coefficients for
the Y coordinate.
IllegalArgumentException
- if the xCoeff and yCoeff arrays
do not each have size entries.Method Detail |
---|
public float[] warpSparseRect(int x, int y, int width, int height, int periodX, int periodY, float[] destRect)
warpSparseRect
in class Warp
x
- The minimum X coordinate of the destination region.y
- The minimum Y coordinate of the destination region.width
- The width of the destination region.height
- The height of the destination region.periodX
- The horizontal sampling period.periodY
- The vertical sampling period.destRect
- A float
array containing at least
2*((width+periodX-1)/periodX)*
((height+periodY-1)/periodY)
elements, or null
. If null
, a
new array will be constructed.
destRect
parameter if
it is non-null
, or a new
float
array otherwise.
ArrayBoundsException
- if destRect is too smallpublic Point2D mapDestPoint(Point2D destPt)
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);
mapDestPoint
in class WarpPolynomial
destPt
- the position in destination image coordinates
to map to source image coordinates.
Point2D
of the same class as
destPt
.
IllegalArgumentException
- if destPt
is
null
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |