|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.jai.Warp | +--javax.media.jai.WarpPolynomial | +--javax.media.jai.WarpAffine
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.
Fields inherited from class javax.media.jai.WarpPolynomial |
degree,
postScaleX,
postScaleY,
preScaleX,
preScaleY,
xCoeffs,
yCoeffs |
Constructor Summary | |
WarpAffine(AffineTransform transform)
Constructs a WarpAffine with pre- and post-scale
factors of 1. |
|
WarpAffine(AffineTransform transform,
float preScaleX,
float preScaleY,
float postScaleX,
float postScaleY)
Constructs a WarpAffine with a given transform mapping
destination pixels into source space. |
|
WarpAffine(float[] xCoeffs,
float[] yCoeffs)
Constructs a WarpAffine with pre- and post-scale
factors of 1. |
|
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. |
Method Summary | |
AffineTransform |
getTransform()
Returns a clone of the AffineTransform associated
with this WarpAffine object. |
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. |
Rectangle |
mapSourceRect(Rectangle srcRect)
Computes a Rectangle that is guaranteed to enclose the region of the destination to which the source rectangle maps. |
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 |
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 WarpAffine(float[] xCoeffs, float[] yCoeffs, float preScaleX, float preScaleY, float postScaleX, float postScaleY)
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.xCoeffs
- The 3 destination to source transform coefficients for
the X coordinate.yCoeffs
- The 3 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 evaluated x transformpostScaleY
- The scale factor to apply to the evaluated y transformxCoeffs
or
yCoeffs
does not have length of 3.public WarpAffine(float[] xCoeffs, float[] yCoeffs)
WarpAffine
with pre- and post-scale
factors of 1.xCoeffs
- The 3 destination to source transform coefficients for
the X coordinate.yCoeffs
- The 3 destination to source transform coefficients for
the Y coordinate.public WarpAffine(AffineTransform transform, float preScaleX, float preScaleY, float postScaleX, float postScaleY)
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.transform
- The destination to source transform.preScaleX
- The scale factor to apply to source X positions.preScaleY
- The scale factor to apply to source Y positions.postScaleX
- The scale factor to apply to destination X positions.postScaleY
- The scale factor to apply to destination Y positions.public WarpAffine(AffineTransform transform)
WarpAffine
with pre- and post-scale
factors of 1.transform
- An AffineTransform
mapping dest to source
coordinates.Method Detail |
public AffineTransform getTransform()
AffineTransform
associated
with this WarpAffine
object.AffineTransform
.public float[] warpSparseRect(int x, int y, int width, int height, int periodX, int periodY, float[] destRect)
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.public Rectangle mapDestRect(Rectangle destRect)
destRect
- The Rectangle in destination coordinates.Rectangle
in the source coordinate
system that is guaranteed to contain all pixels
referenced by the output of warpRect()
on
the destination region, or null
.destRect
is
null
.public Rectangle mapSourceRect(Rectangle srcRect)
srcRect
- The Rectangle in source coordinates.Rectangle
in the destination coordinate
system that is guaranteed to contain all pixels
within the forward mapping of the source rectangle.srctRect
is
null
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |