|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.media.jai.PlanarImage
javax.media.jai.OpImage
javax.media.jai.PointOpImage
jaitools.media.jai.regionalize.RegionalizeOpImage
public class RegionalizeOpImage
An operator to identify regions of uniform value, within a user-specified tolerance, in the source image. Produces a destination image of these regions where pixel values are equal to region ID.
To avoid region numbering artefacts on image tile boundaries this
operator imposes an order on tile computation (by column within row).
If an arbitrary tile is requested by the caller, the operator first
checks that all of the preceding tiles have been computed and cached,
processing any that have not. The operator creates its own
ExecutorService for sequential tile computations.
Each computed tile is cached using an instance of DiskMemTileCache.
The caller can provide this to the operator via RenderingHints, or set
it as the default TileCache using JAI.getDefaultInstance().setTileCache().
Otherwise the operator will create a DiskMemTileCache object for itself.
RegionalizeDescriptor,
RegionData| Field Summary | |
|---|---|
static int |
NO_REGION
Destingation value indicating that the pixel does not belong to a region |
| 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 | |
|---|---|
RegionalizeOpImage(java.awt.image.RenderedImage source,
java.util.Map config,
javax.media.jai.ImageLayout layout,
int band,
double tolerance,
boolean diagonal)
Constructor |
|
| Method Summary | |
|---|---|
protected void |
addTileToCache(int tileX,
int tileY,
java.awt.image.Raster tile)
This method is overridden to prevent it being used because the RegionalizeOpImage object should be soley responsible for
creating tiles and caching them. |
java.awt.image.Raster |
computeTile(int tileX,
int tileY)
|
java.util.Hashtable |
getProperties()
Get the properties for this operator. |
java.lang.Object |
getProperty(java.lang.String name)
Get a property associated with this operator. |
java.lang.Class<?> |
getPropertyClass(java.lang.String name)
For internal use |
java.lang.String[] |
getPropertyNames()
For internal use |
java.awt.image.Raster |
getTile(int tileX,
int tileY)
Returns a tile of this image as a Raster. |
protected java.awt.image.Raster |
getTileFromCache(int tileX,
int tileY)
This method is overridden to ensure that the cache is always addressed through the DiskMemImage being used by this operator, otherwise
tile IDs calculated by the cache will vary with the perceived owner
(the image or the operator) of the tile. |
void |
setTileCache(javax.media.jai.TileCache cache)
Set the tile cache. |
| Methods inherited from class javax.media.jai.PointOpImage |
|---|
dispose, isColormapOperation, mapDestRect, mapSourceRect, permitInPlaceOperation |
| Methods inherited from class javax.media.jai.OpImage |
|---|
cancelTiles, computeRect, computeRect, computesUniqueTiles, createTile, getExpandedNumBands, getFormatTags, getOperationComputeType, getTileCache, getTileCacheMetric, getTileDependencies, getTileRecycler, getTiles, hasExtender, mapDestPoint, mapSourcePoint, prefetchTiles, queueTiles, recycleTile, vectorize, vectorize, vectorize |
| Methods inherited from class javax.media.jai.PlanarImage |
|---|
addPropertyChangeListener, addPropertyChangeListener, addSink, addSink, addSource, addTileComputationListener, copyData, copyData, copyExtendedData, createColorModel, createSnapshot, createWritableRaster, finalize, getAsBufferedImage, getAsBufferedImage, getBounds, getColorModel, getData, getData, getDefaultColorModel, getExtendedData, getGraphics, getHeight, getImageID, getMaxTileX, getMaxTileY, getMaxX, getMaxY, getMinTileX, getMinTileY, getMinX, getMinY, getNumBands, getNumSources, getNumXTiles, getNumYTiles, getPropertyNames, getSampleModel, getSinks, getSource, getSourceImage, getSourceObject, getSources, getSplits, getTileComputationListeners, getTileFactory, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileIndices, getTileRect, getTiles, getTileWidth, getWidth, overlapsMultipleTiles, removeProperty, removePropertyChangeListener, removePropertyChangeListener, removeSink, removeSink, removeSinks, removeSource, removeSources, removeTileComputationListener, setImageLayout, setProperties, setProperty, setSource, setSources, tileXToX, tileXToX, tileYToY, tileYToY, toString, wrapRenderedImage, XToTileX, XToTileX, YToTileY, YToTileY |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int NO_REGION
| Constructor Detail |
|---|
public RegionalizeOpImage(java.awt.image.RenderedImage source,
java.util.Map config,
javax.media.jai.ImageLayout layout,
int band,
double tolerance,
boolean diagonal)
source - a RenderedImage.config - configurable attributes of the image (see AreaOpImage)layout - an ImageLayout optionally containing the tile grid layout,
SampleModel, and ColorModel, or null.band - the band to processtolerance - max absolute difference in value between the starting pixel for
a region and any pixel added to that regiondiagonal - true to include sub-regions with only diagonal connectedness;
false to require orthogonal connectednessRegionalizeDescriptor| Method Detail |
|---|
public java.lang.Object getProperty(java.lang.String name)
getProperty in interface java.awt.image.RenderedImagegetProperty in interface javax.media.jai.PropertySourcegetProperty in class javax.media.jai.PlanarImagename - property name
public java.util.Hashtable getProperties()
getProperties in class javax.media.jai.PlanarImagepublic java.lang.Class<?> getPropertyClass(java.lang.String name)
getPropertyClass in interface javax.media.jai.PropertySourcegetPropertyClass in class javax.media.jai.PlanarImagepublic java.lang.String[] getPropertyNames()
getPropertyNames in interface java.awt.image.RenderedImagegetPropertyNames in interface javax.media.jai.PropertySourcegetPropertyNames in class javax.media.jai.PlanarImage
public java.awt.image.Raster getTile(int tileX,
int tileY)
Raster. If the
requested tile is completely outside of this image's bounds,
this method returns null.
The nature of the regionalizing algorithm means that to compute any tile other than the first (top left) we must compute all tiles to avoid region numbering artefacts across tile boundaries.
getTile in interface java.awt.image.RenderedImagegetTile in class javax.media.jai.OpImagetileX - The X index of the tile.tileY - The Y index of the tile.
public java.awt.image.Raster computeTile(int tileX,
int tileY)
computeTile in class javax.media.jai.PointOpImage
protected void addTileToCache(int tileX,
int tileY,
java.awt.image.Raster tile)
RegionalizeOpImage object should be soley responsible for
creating tiles and caching them. If invoked an
UnsupportedOperationException will be thrown.
addTileToCache in class javax.media.jai.OpImage
protected java.awt.image.Raster getTileFromCache(int tileX,
int tileY)
DiskMemImage being used by this operator, otherwise
tile IDs calculated by the cache will vary with the perceived owner
(the image or the operator) of the tile.
getTileFromCache in class javax.media.jai.OpImagetileX - tile X coordinatetileY - tile Y coordinate
public void setTileCache(javax.media.jai.TileCache cache)
DiskMemTileCache.
setTileCache in class javax.media.jai.OpImagecache - an instance of DiskMemTileCache
java.lang.IllegalArgumentException - if cache is null or not an instance
of DiskMemTileCache
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||