|
|||||||||
| 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.StatisticsOpImage
An abstract base class for image operators that compute statistics on a given region of an image, and with a given sampling rate.
StatisticsOpImage simply passes pixels through
unchanged from its parent image. However, the desired statistics
are computed on demand and made available as a property or set of
properties on the image.
All instances of StatisticsOpImage make use of a
region of interest, specified as a ROI object.
Additionally, they may perform spatial subsampling of the region of
interest according to xPeriod and yPeriod
parameters that may vary from 1 (sample every pixel of the region
of interest) upwards. This allows the speed and quality of
statistics gathering to be traded off against one another.
Subclasses provide implementations
of the getStatisticsNames, createStatistics,
and accumulateStatistics methods.
OpImage| Field Summary | |
protected int |
maxHeight
The largest allowable height of the source argument to accumulateStatistics. |
protected int |
maxWidth
The largest allowable width of the source argument to accumulateStatistics. |
protected java.util.Hashtable |
properties
A Hashtable containing all the properties generated,
hashed by property names. |
protected ROI |
roi
The region of interest over which to compute the statistics. |
protected int |
xPeriod
The horizontal sampling rate. |
protected int |
xStart
The X coordinate of the initial sample. |
protected int |
yPeriod
The vertical sampling rate. |
protected int |
yStart
The Y coordinate of the initial sample. |
| Fields inherited from class javax.media.jai.OpImage |
cache,
cobbleSources,
extenders,
OP_COMPUTE_BOUND,
OP_IO_BOUND,
OP_NETWORK_BOUND |
| Fields inherited from class javax.media.jai.PlanarImage |
colorModel,
height,
minX,
minY,
sampleModel,
snapshot,
source0,
source1,
sources,
tileGridXOffset,
tileGridYOffset,
tileHeight,
tileWidth,
width |
| Constructor Summary | |
StatisticsOpImage(java.awt.image.RenderedImage source,
ROI roi,
int xStart,
int yStart,
int xPeriod,
int yPeriod,
int maxWidth,
int maxHeight)
Constructs a StatisticsOpImage. |
|
| Method Summary | |
protected abstract void |
accumulateStatistics(java.lang.String name,
java.awt.image.Raster source,
java.lang.Object stats)
Accumulates statistics on the specified region into the previously created statistics object. |
protected abstract java.lang.Object |
createStatistics(java.lang.String name)
Returns an object that will be used to gather the named statistic. |
java.lang.Object |
getProperty(java.lang.String name)
Returns one of the available statistics as a property. |
java.lang.String[] |
getPropertyNames()
Returns a list of property names that are recognized by this image. |
protected abstract java.lang.String[] |
getStatisticsNames()
Returns a list of names of statistics understood by this class. |
java.awt.image.Raster |
getTile(int tileX,
int tileY)
Returns a tile for reading. |
java.awt.Rectangle |
mapDestRect(java.awt.Rectangle destRect,
int sourceIndex)
Maps the destination rectangle into source space unchanged. |
java.awt.Rectangle |
mapSourceRect(java.awt.Rectangle sourceRect,
int sourceIndex)
Maps the source rectangle into destination space unchanged. |
| Methods inherited from class javax.media.jai.OpImage |
addTileToCache,
computeRect,
computeRect,
computesUniqueTiles,
computeTile,
finalize,
getExpandedNumBands,
getFormatTags,
getOperationComputeType,
getTileDependencies,
getTileFromCache,
getTiles,
hasExtender,
prefetchTiles,
setTileCache |
| Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected ROI roi
protected int xStart
protected int yStart
protected int xPeriod
protected int yPeriod
protected int maxWidth
protected int maxHeight
protected java.util.Hashtable properties
Hashtable containing all the properties generated,
hashed by property names.| Constructor Detail |
public StatisticsOpImage(java.awt.image.RenderedImage source,
ROI roi,
int xStart,
int yStart,
int xPeriod,
int yPeriod,
int maxWidth,
int maxHeight)
source - A RenderedImage.roi - The region of interest, as a ROI.xStart - The initial X sample coordinate.yStart - The initial Y sample coordinate.xPeriod - The X sampling rate.yPeriod - The Y sampling rate.maxWidth - The largest allowed width for processing.maxHeight - The largest allowed height for processing.| Method Detail |
public java.awt.Rectangle mapSourceRect(java.awt.Rectangle sourceRect,
int sourceIndex)
sourceRect - the Rectangle in source 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.sourceRect is
null.
public java.awt.Rectangle mapDestRect(java.awt.Rectangle destRect,
int sourceIndex)
destRect - the Rectangle in destination coordinates.sourceIndex - the index of the source image.Rectangle indicating the valid destination region.sourceIndex is
negative or greater than the index of the last source.destRect is
null.
public java.awt.image.Raster getTile(int tileX,
int tileY)
tileX - the X index of the tile.tileY - the Y index of the tile.public java.lang.Object getProperty(java.lang.String name)
public java.lang.String[] getPropertyNames()
protected abstract java.lang.String[] getStatisticsNames()
protected abstract java.lang.Object createStatistics(java.lang.String name)
name - the name of the statistic to be gathered.
protected abstract void accumulateStatistics(java.lang.String name,
java.awt.image.Raster source,
java.lang.Object stats)
name - the name of the statistic to be gathered.source - a Raster containing source pixels.
The dimensions of the Raster will not
exceed maxWidth x maxHeight.stats - a statistics object generated by a previous call
to createStatistics.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||