|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.jai.PlanarImage | +--javax.media.jai.OpImage | +--javax.media.jai.GeometricOpImage | +--javax.media.jai.WarpOpImage
A general implementation of image warping, and a superclass for specific image warping operations.
The image warp is specified by a Warp
object
and an Interpolation
object.
Subclasses of WarpOpImage
may choose whether they
wish to implement the cobbled or non-cobbled variant of
computeRect
by means of the cobbleSources
constructor parameter. The class comments for OpImage
provide more information about how to override
computeRect
.
It should be noted that the superclass GeometricOpImage
automatically adds a value of Boolean.TRUE
for the
JAI.KEY_REPLACE_INDEX_COLOR_MODEL
to the given
configuration
and passes it up to its superclass constructor
so that geometric operations are performed on the pixel values instead
of being performed on the indices into the color map for those
operations whose source(s) have an IndexColorModel
.
This addition will take place only if a value for the
JAI.KEY_REPLACE_INDEX_COLOR_MODEL
has not already been
provided by the user. Note that the configuration
Map
is cloned before the new hint is added to it. Regarding the value
for the JAI.KEY_REPLACE_INDEX_COLOR_MODEL
RenderingHints
, the operator itself can be smart
based on the parameters, i.e. while the default value for
the JAI.KEY_REPLACE_INDEX_COLOR_MODEL
is
Boolean.TRUE
for operations that extend this class,
in some cases the operator could set the default.
GeometricOpImage
,
OpImage
,
Warp
,
Interpolation
Field Summary | |
protected Warp |
warp
The Warp object describing the backwards pixel
map. |
Fields inherited from class javax.media.jai.GeometricOpImage |
backgroundValues, computableBounds, extender, intBackgroundValues, interp, setBackground |
Fields inherited from class javax.media.jai.OpImage |
cache, cobbleSources, OP_COMPUTE_BOUND, OP_IO_BOUND, OP_NETWORK_BOUND, tileCacheMetric, tileRecycler |
Fields inherited from class javax.media.jai.PlanarImage |
colorModel, eventManager, height, minX, minY, properties, sampleModel, tileFactory, tileGridXOffset, tileGridYOffset, tileHeight, tileWidth, width |
Constructor Summary | |
WarpOpImage(RenderedImage source,
ImageLayout layout,
Map configuration,
boolean cobbleSources,
BorderExtender extender,
Interpolation interp,
Warp warp)
Deprecated. as of JAI 1.1.2. Use the constructor with the argument backgroundValues and set this argument to
null . |
|
WarpOpImage(RenderedImage source,
ImageLayout layout,
Map configuration,
boolean cobbleSources,
BorderExtender extender,
Interpolation interp,
Warp warp,
double[] backgroundValues)
Constructor. |
Method Summary | |
protected Rectangle |
backwardMapRect(Rectangle destRect,
int sourceIndex)
Returns the minimum bounding box of the region of the specified source to which a particular Rectangle of the
destination will be mapped. |
Raster |
computeTile(int tileX,
int tileY)
Computes a tile. |
protected Rectangle |
forwardMapRect(Rectangle sourceRect,
int sourceIndex)
Returns the minimum bounding box of the region of the destination to which a particular Rectangle of the specified source
will be mapped. |
int |
getBottomPadding()
Deprecated. as of JAI 1.1. |
int |
getLeftPadding()
Deprecated. as of JAI 1.1. |
int |
getRightPadding()
Deprecated. as of JAI 1.1. |
int |
getTopPadding()
Deprecated. as of JAI 1.1. |
Point2D |
mapDestPoint(Point2D destPt,
int sourceIndex)
Computes the position in the specified source that best matches the supplied destination image position. |
Point2D |
mapSourcePoint(Point2D sourcePt,
int sourceIndex)
Computes the position in the destination that best matches the supplied source image position. |
Methods inherited from class javax.media.jai.GeometricOpImage |
getBorderExtender, getInterpolation, mapDestRect, mapSourceRect |
Methods inherited from class javax.media.jai.OpImage |
addTileToCache, cancelTiles, computeRect, computeRect, computesUniqueTiles, createTile, dispose, getExpandedNumBands, getFormatTags, getOperationComputeType, getTile, getTileCache, getTileCacheMetric, getTileDependencies, getTileFromCache, getTileRecycler, getTiles, hasExtender, prefetchTiles, queueTiles, recycleTile, setTileCache, vectorize, vectorize, vectorize |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Warp warp
Warp
object describing the backwards pixel
map. It can not be null
.Constructor Detail |
public WarpOpImage(RenderedImage source, ImageLayout layout, Map configuration, boolean cobbleSources, BorderExtender extender, Interpolation interp, Warp warp)
backgroundValues
and set this argument to
null
.
The image's layout is encapsulated in the layout
argument. The user-supplied layout values supersedes the default
settings. Any layout setting not specified by the user will take
the corresponding value of the source image's layout.
layout
- The layout of this image.source
- The source image; can not be null
.configuration
- Configurable attributes of the image including
configuration variables indexed by
RenderingHints.Key
s and image properties indexed
by String
s or CaselessStringKey
s.
This is simply forwarded to the superclass constructor.cobbleSources
- A boolean
indicating whether
computeRect()
expects contiguous sources.
To use the default implementation of warping contained in
this class, set cobbleSources
to false
.extender
- A BorderExtender, or null.interp
- The Interpolation
object describing the
interpolation method.warp
- The Warp
object describing the warp.IllegalArgumentException
- if source
is null
.IllegalArgumentException
- if combining the
source bounds with the layout parameter results in negative
output width or height.IllegalArgumentException
- If warp
is
null
.public WarpOpImage(RenderedImage source, ImageLayout layout, Map configuration, boolean cobbleSources, BorderExtender extender, Interpolation interp, Warp warp, double[] backgroundValues)
The image's layout is encapsulated in the layout
argument. The user-supplied layout values supersedes the default
settings. Any layout setting not specified by the user will take
the corresponding value of the source image's layout.
layout
- The layout of this image.source
- The source image; can not be null
.configuration
- Configurable attributes of the image including
configuration variables indexed by
RenderingHints.Key
s and image properties indexed
by String
s or CaselessStringKey
s.
This is simply forwarded to the superclass constructor.cobbleSources
- A boolean
indicating whether
computeRect()
expects contiguous sources.
To use the default implementation of warping contained in
this class, set cobbleSources
to false
.extender
- A BorderExtender, or null.interp
- The Interpolation
object describing the
interpolation method.warp
- The Warp
object describing the warp.backgroundValues
- The user-specified background values. If the
provided array length is smaller than the number of bands, all
the bands will be filled with the first element of the array.
If the provided array is null, it will be set to
new double[]{0.0}
in the superclass.IllegalArgumentException
- if source
is null
.IllegalArgumentException
- if combining the
source bounds with the layout parameter results in negative
output width or height.IllegalArgumentException
- If warp
is
null
.Method Detail |
public int getLeftPadding()
public int getRightPadding()
public int getTopPadding()
public int getBottomPadding()
public Point2D mapDestPoint(Point2D destPt, int sourceIndex)
The implementation in this class returns the value returned by
warp.mapDestPoint(destPt)
. Subclasses requiring
different behavior should override this method.
mapDestPoint
in class GeometricOpImage
destPt
- the position in destination image coordinates
to map to source image coordinates.sourceIndex
- the index of the source image.Point2D
of the same class as
destPt
or null
.IllegalArgumentException
- if destPt
is
null
.IndexOutOfBoundsException
- if sourceIndex
is
non-zero.public Point2D mapSourcePoint(Point2D sourcePt, int sourceIndex)
The implementation in this class returns the value returned by
warp.mapSourcePoint(sourcePt)
. Subclasses requiring
different behavior should override this method.
mapSourcePoint
in class GeometricOpImage
sourcePt
- the position in source image coordinates
to map to destination image coordinates.sourceIndex
- the index of the source image.Point2D
of the same class as
sourcePt
or null
.IllegalArgumentException
- if sourcePt
is
null
.IndexOutOfBoundsException
- if sourceIndex
is
non-zero.protected Rectangle forwardMapRect(Rectangle sourceRect, int sourceIndex)
Rectangle
of the specified source
will be mapped.forwardMapRect
in class GeometricOpImage
sourceRect
- the Rectangle
in source coordinates.sourceIndex
- the index of the source image.Rectangle
indicating the destination
bounding box, or null
if the bounding box
is unknown.IllegalArgumentException
- if sourceIndex
is
negative or greater than the index of the last source.IllegalArgumentException
- if sourceRect
is
null
.protected Rectangle backwardMapRect(Rectangle destRect, int sourceIndex)
Rectangle
of the
destination will be mapped.backwardMapRect
in class GeometricOpImage
destRect
- the Rectangle
in destination coordinates.sourceIndex
- the index of the source image.Rectangle
indicating the source bounding box,
or null
if the bounding box is unknown.IllegalArgumentException
- if sourceIndex
is
negative or greater than the index of the last source.IllegalArgumentException
- if destRect
is
null
.public Raster computeTile(int tileX, int tileY)
WritableRaster
is created to
represent the requested tile. Its width and height equals to this
image's tile width and tile height respectively. This method
assumes that the requested tile either intersects or is within
the bounds of this image.
Whether or not this method performs source cobbling is determined
by the cobbleSources
variable set at construction time.
If cobbleSources
is true
, cobbling is
performed on the source for areas that intersect multiple tiles,
and computeRect(Raster[], WritableRaster, Rectangle)
is called to perform the actual computation. Otherwise,
computeRect(PlanarImage[], WritableRaster, Rectangle)
is called to perform the actual computation.
computeTile
in class GeometricOpImage
tileX
- The X index of the tile.tileY
- The Y index of the tile.Raster
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |