|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.media.jai.Warp javax.media.jai.WarpPolynomial javax.media.jai.WarpGeneralPolynomial
A general polynomial-based description of an image warp.
The mapping is defined by two bivariate polynomial functions X(x, y) and Y(x, y) that define the source X and Y positions that map to a given destination (x, y) pixel coordinate.
The functions X(x, y) and Y(x, y) have the form:
SUM{i = 0 to n} {SUM{j = 0 to i}{a_ij*x^(i - j)*y^j}}
WarpPolynomial
,
Serialized FormField Summary |
Fields inherited from class javax.media.jai.WarpPolynomial |
degree, postScaleX, postScaleY, preScaleX, preScaleY, xCoeffs, yCoeffs |
Constructor Summary | |
WarpGeneralPolynomial(float[] xCoeffs,
float[] yCoeffs)
Constructs a WarpGeneralPolynomial with pre- and post-scale factors of 1. |
|
WarpGeneralPolynomial(float[] xCoeffs,
float[] yCoeffs,
float preScaleX,
float preScaleY,
float postScaleX,
float postScaleY)
Constructs a WarpGeneralPolynomial with a given transform mapping destination pixels into source space. |
Method Summary | |
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, mapDestPoint |
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 WarpGeneralPolynomial(float[] xCoeffs, float[] yCoeffs, float preScaleX, float preScaleY, float postScaleX, float postScaleY)
The xCoeffs
and yCoeffs
parameters
must contain the same number of coefficients,
(n + 1)(n + 2)/2
, for some n
, where
n
is the non-negative degree power of the polynomial.
The coefficients, in order, are associated with the terms:
1, x, y, x^2, x*y, y^2, ..., x^n, x^(n - 1)*y, ..., x*y^(n - 1), y^nand coefficients of value 0 cannot be omitted.
The destination pixel coordinates (the arguments to the X() and Y() functions) are given in normal integral pixel coordinates, while the output of the functions is given in fixed-point, subpixel coordinates with a number of fractional bits specified by the subsampleBitsH and subsampleBitsV parameters.
xCoeffs
- The destination to source transform coefficients for
the X coordinate.yCoeffs
- The destination to source transform coefficients for
the Y coordinate.preScaleX
- The scale factor to apply to input (dst) X positions.preScaleY
- The scale factor to apply to input (dst) Y positions.postScaleX
- The scale factor to apply to output (src) X positions.postScaleY
- The scale factor to apply to output (src) Y positions.
IllegalArgumentException
- if arrays xCoeffs and yCoeffs do not
have the correct number of entries.public WarpGeneralPolynomial(float[] xCoeffs, float[] yCoeffs)
xCoeffs
- The destination to source transform coefficients for
the X coordinate.yCoeffs
- The destination to source transform coefficients for
the Y coordinate.
IllegalArgumentException
- if arrays xCoeffs and yCoeffs do not
have the correct number of 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
- An int array containing at least
2*((width+periodX-1)/periodX)*((height+periodY-1)/periodY)
elements, or null
. If null
, a
new array will be constructed.
null
, or a new int array of length
2*width*height otherwise.
ArrayBoundsException
- if destRect array is too small
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |