|
|||||||||
| 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.AreaOpImage
An abstract base class for image operators that require only a fixed rectangular source region around a source pixel in order to compute each destination pixel.
The source and the destination images will occupy the same region of the plane. A given destination pixel (x, y) may be computed from the neighborhood of source pixels beginning at (x - leftPadding, y - topPadding) and extending to (x + rightPadding, y + bottomPadding) inclusive.
Since this operator needs a region around the source pixel in order to compute the destination pixel, the border destination pixels cannot be computed without any source extension. The source extension can be specified by supplying a BorderExtender that will define the pixel values of the source outside the actual source area.
If no extension is specified, the destination samples that cannot be computed will be written in the destination as zero. If the source image begins at pixel (minX, minY) and has width w and height h, the result of performing an area operation will be an image beginning at minX, minY, and having a width of w and a height of h, with the area being computed and written starting at (minX + leftPadding, minY + topPadding) and having width Math.max(w - leftPadding - rightPadding, 0) and height Math.max(h - topPadding - bottomPadding, 0).
BorderExtender| Field Summary | |
protected int |
bottomPadding
The number of source pixels needed below the central pixel. |
protected BorderExtender |
extender
The BorderExtender, may be null. |
protected int |
leftPadding
The number of source pixels needed to the left of the central pixel. |
protected int |
rightPadding
The number of source pixels needed to the right of the central pixel. |
protected int |
topPadding
The number of source pixels needed above the central pixel. |
| Fields inherited from class javax.media.jai.OpImage |
cache,
cobbleSources,
OP_COMPUTE_BOUND,
OP_IO_BOUND,
OP_NETWORK_BOUND,
tileCacheMetric |
| Fields inherited from class javax.media.jai.PlanarImage |
colorModel,
eventManager,
height,
minX,
minY,
properties,
sampleModel,
tileGridXOffset,
tileGridYOffset,
tileHeight,
tileWidth,
width |
| Constructor Summary | |
AreaOpImage(RenderedImage source,
ImageLayout layout,
Map configuration,
boolean cobbleSources,
BorderExtender extender,
int leftPadding,
int rightPadding,
int topPadding,
int bottomPadding)
Constructs an AreaOpImage. |
|
| Method Summary | |
Raster |
computeTile(int tileX,
int tileY)
Computes a tile. |
BorderExtender |
getBorderExtender()
Retrieve the BorderExtender object associated with
this class instance. |
int |
getBottomPadding()
Returns the number of pixels needed below the central pixel. |
int |
getLeftPadding()
Returns the number of pixels needed to the left of the central pixel. |
int |
getRightPadding()
Returns the number of pixels needed to the right of the central pixel. |
int |
getTopPadding()
Returns the number of pixels needed above the central pixel. |
Rectangle |
mapDestRect(Rectangle destRect,
int sourceIndex)
Returns a conservative estimate of the region of a specified source that is required in order to compute the pixels of a given destination rectangle. |
Rectangle |
mapSourceRect(Rectangle sourceRect,
int sourceIndex)
Returns a conservative estimate of the destination region that can potentially be affected by the pixels of a rectangle of a given source. |
| Methods inherited from class javax.media.jai.OpImage |
addTileToCache,
cancelTiles,
computeRect,
computeRect,
computesUniqueTiles,
finalize,
getExpandedNumBands,
getFormatTags,
getOperationComputeType,
getTile,
getTileCache,
getTileCacheMetric,
getTileDependencies,
getTileFromCache,
getTiles,
hasExtender,
prefetchTiles,
queueTiles,
setTileCache,
vectorize,
vectorize,
vectorize |
| Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
protected int leftPadding
protected int rightPadding
protected int topPadding
protected int bottomPadding
protected BorderExtender extender
| Constructor Detail |
public AreaOpImage(RenderedImage source,
ImageLayout layout,
Map configuration,
boolean cobbleSources,
BorderExtender extender,
int leftPadding,
int rightPadding,
int topPadding,
int bottomPadding)
AreaOpImage. The layout variables
are set in the standard way by the OpImage constructor.
Additional control over the image bounds, tile grid layout,
SampleModel, and ColorModel may be
obtained by specifying an ImageLayout parameter.
If the image bounds are specified but do not overlap the source
bounds then an IllegalArgumentException will be thrown.
This parameter will be passed to the superclass constructor
unchanged.
source - A RenderedImage.layout - An ImageLayout containing the source
dimensions before padding, and optionally containing the
tile grid layout, SampleModel, and
ColorModel.configuration - Configurable attributes of the image including
configuration variables indexed by
RenderingHints.Keys and image properties indexed
by Strings or CaselessStringKeys.
This is simply forwarded to the superclass constructor.cobbleSources - A boolean indicating whether
computeRect() expects contiguous sources.extender - A BorderExtender, or null.leftPadding - The desired left padding.rightPadding - The desired right padding.topPadding - The desired top padding.bottomPadding - The desired bottom padding.source
is null.| Method Detail |
public int getLeftPadding()
public int getRightPadding()
public int getTopPadding()
public int getBottomPadding()
public BorderExtender getBorderExtender()
BorderExtender object associated with
this class instance. The object is returned by reference.BorderExtender object
or null.
public Rectangle mapSourceRect(Rectangle sourceRect,
int sourceIndex)
sourceRect - the Rectangle in source coordinates.sourceIndex - the index of the source image.Rectangle indicating the potentially affected
destination region, or null if the region is
unknown.sourceIndex is
negative or greater than the index of the last source.sourceRect is
null.
public Rectangle mapDestRect(Rectangle destRect,
int sourceIndex)
destRect - the Rectangle in destination coordinates.sourceIndex - the index of the source image.Rectangle indicating the required source region.sourceIndex is
negative or greater than the index of the last source.destRect is
null.
public Raster computeTile(int tileX,
int tileY)
computeRect(Raster[], WritableRaster, Rectangle)
is called for each of the resulting regions. Otherwise,
computeRect(PlanarImage[], WritableRaster,
Rectangle) is called once to compute the entire active
area of the tile.
The image bounds may be larger than the bounds of the source image. In this case, samples for which there are no no corresponding sources are set to zero.
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 | ||||||||