| java.lang.Object javax.media.jai.PlanarImage javax.media.jai.OpImage javax.media.jai.StatisticsOpImage
All known Subclasses: com.sun.media.jai.opimage.MeanOpImage, com.sun.media.jai.mlib.MlibHistogramOpImage, com.sun.media.jai.opimage.ExtremaOpImage, com.sun.media.jai.opimage.HistogramOpImage,
StatisticsOpImage | abstract public class StatisticsOpImage extends OpImage (Code) | | An abstract base class representing image operators that compute
statistics on a given region of an image, and with a given sampling
period. Such operators may only have one source image.
The layout of this image is exactly the same as that of the source
image. Any user supplied layout values via the
RenderingHints are ignored.
The StatisticsOpImage simply passes the pixels of the
source image through unchanged. 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. If this
argument is null , the entire source image is used.
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 should provide implementations
of the getStatisticsNames , createStatistics ,
and accumulateStatistics methods.
See Also: OpImage |
Field Summary | |
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. |
Constructor Summary | |
public | StatisticsOpImage(RenderedImage source, ROI roi, int xStart, int yStart, int xPeriod, int yPeriod) Constructor.
The layout of this image is exactly the same as that of the
source image. |
Method Summary | |
abstract protected void | accumulateStatistics(String name, Raster source, Object stats) Accumulates statistics on the specified region into
the previously created statistics object. | public Raster | computeTile(int tileX, int tileY) Computes the image data of a tile. | public boolean | computesUniqueTiles() Returns false as computeTile() invocations
are forwarded to the RenderedImage source and are
therefore not unique objects in the global sense. | abstract protected Object | createStatistics(String name) Returns an object that will be used to gather the
named statistic. | public Object | getProperty(String name) Returns one of the available statistics as a property. | public String[] | getPropertyNames() Returns a list of property names that are recognized by this image. | abstract protected String[] | getStatisticsNames() Returns a list of names of statistics understood
by this class. | public Raster | getTile(int tileX, int tileY) Returns a tile of this image as a Raster . | public Raster[] | getTiles(Point[] tileIndices) Returns a list of tiles. | public Rectangle | mapDestRect(Rectangle destRect, int sourceIndex) Maps the destination rectangle into source space unchanged.
Parameters: destRect - the Rectangle in destination coordinates. Parameters: sourceIndex - the index of the source image. | public Rectangle | mapSourceRect(Rectangle sourceRect, int sourceIndex) Maps the source rectangle into destination space unchanged.
Parameters: sourceRect - the Rectangle in source coordinates. Parameters: sourceIndex - the index of the source image. |
roi | protected ROI roi(Code) | | The region of interest over which to compute the statistics.
If it is null , the entire image is used to compute
the statistics.
|
xPeriod | protected int xPeriod(Code) | | The horizontal sampling rate.
|
xStart | protected int xStart(Code) | | The X coordinate of the initial sample.
|
yPeriod | protected int yPeriod(Code) | | The vertical sampling rate.
|
yStart | protected int yStart(Code) | | The Y coordinate of the initial sample.
|
StatisticsOpImage | public StatisticsOpImage(RenderedImage source, ROI roi, int xStart, int yStart, int xPeriod, int yPeriod)(Code) | | Constructor.
The layout of this image is exactly the same as that of the
source image. Any user supplied layout values via the
RenderingHints are ignored.
Parameters: source - The source image over which the statisticsis accumulated. Parameters: roi - The region of interest that specifies the region of thesource image over which to compute the statistics. If itis null , the entire source image is used. Parameters: xStart - The initial X sample coordinate. Parameters: yStart - The initial Y sample coordinate. Parameters: xPeriod - The horizontal sampling rate. Parameters: yPeriod - The vertical sampling rate. throws: IllegalArgumentException - If source isnull . since: JAI 1.1 |
accumulateStatistics | abstract protected void accumulateStatistics(String name, Raster source, Object stats)(Code) | | Accumulates statistics on the specified region into
the previously created statistics object. The
region of interest and X and Y sampling rate
should be respected.
Parameters: name - The name of the statistic to be gathered. Parameters: source - A Raster containing source pixels.The dimensions of the Raster will notexceed maxWidth x maxHeight. Parameters: stats - A statistics object generated by a previous callto createStatistics. |
computeTile | public Raster computeTile(int tileX, int tileY)(Code) | | Computes the image data of a tile.
The implementation of this method in this class simply forwards
the request to the source image.
Parameters: tileX - The X index of the tile. Parameters: tileY - The Y index of the tile. since: JAI 1.1 |
computesUniqueTiles | public boolean computesUniqueTiles()(Code) | | Returns false as computeTile() invocations
are forwarded to the RenderedImage source and are
therefore not unique objects in the global sense.
since: JAI 1.1 |
createStatistics | abstract protected Object createStatistics(String name)(Code) | | Returns an object that will be used to gather the
named statistic.
Parameters: name - The name of the statistic to be gathered. |
getProperty | public Object getProperty(String name)(Code) | | Returns one of the available statistics as a property. If the
property name is not recognized, this method returns
java.awt.Image.UndefinedProperty .
throws: IllegalArgumentException - If name isnull . |
getPropertyNames | public String[] getPropertyNames()(Code) | | Returns a list of property names that are recognized by this image.
An array of String s containing validproperty names. |
getStatisticsNames | abstract protected String[] getStatisticsNames()(Code) | | Returns a list of names of statistics understood
by this class.
|
getTile | public Raster getTile(int tileX, int tileY)(Code) | | Returns a tile of this image as a Raster . If the
requested tile is completely outside of this image's bounds,
this method returns null .
Statistics operators do not cache their tiles internally.
Rather, the implementation of this method in this class simply
forwards the request to the source image.
Parameters: tileX - The X index of the tile. Parameters: tileY - The Y index of the tile. The requested tile as a Raster ornull . |
getTiles | public Raster[] getTiles(Point[] tileIndices)(Code) | | Returns a list of tiles. The request is simply
forwarded to the source image.
Parameters: tileIndices - The indices of the tiles requested. throws: IllegalArgumentException - If tileIndices isnull . |
mapDestRect | public Rectangle mapDestRect(Rectangle destRect, int sourceIndex)(Code) | | Maps the destination rectangle into source space unchanged.
Parameters: destRect - the Rectangle in destination coordinates. Parameters: sourceIndex - the index of the source image. A Rectangle indicating the required source region. throws: IllegalArgumentException - If sourceIndex is not 0. throws: IllegalArgumentException - If destRect isnull . |
mapSourceRect | public Rectangle mapSourceRect(Rectangle sourceRect, int sourceIndex)(Code) | | Maps the source rectangle into destination space unchanged.
Parameters: sourceRect - the Rectangle in source coordinates. Parameters: sourceIndex - the index of the source image. A Rectangle indicating the valid destination region. throws: IllegalArgumentException - If sourceIndex is not 0. throws: IllegalArgumentException - If sourceRect isnull . |
Methods inherited from javax.media.jai.OpImage | protected void addTileToCache(int tileX, int tileY, Raster tile)(Code)(Java Doc) public void cancelTiles(TileRequest request, Point[] tileIndices)(Code)(Java Doc) static Vector checkSourceVector(Vector sources, boolean checkElements)(Code)(Java Doc) protected void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect)(Code)(Java Doc) protected void computeRect(PlanarImage[] sources, WritableRaster dest, Rectangle destRect)(Code)(Java Doc) public Raster computeTile(int tileX, int tileY)(Code)(Java Doc) public boolean computesUniqueTiles()(Code)(Java Doc) final protected WritableRaster createTile(int tileX, int tileY)(Code)(Java Doc) public synchronized void dispose()(Code)(Java Doc) public static int getExpandedNumBands(SampleModel sampleModel, ColorModel colorModel)(Code)(Java Doc) protected synchronized RasterFormatTag[] getFormatTags()(Code)(Java Doc) public int getOperationComputeType()(Code)(Java Doc) public Raster getTile(int tileX, int tileY)(Code)(Java Doc) public TileCache getTileCache()(Code)(Java Doc) public Object getTileCacheMetric()(Code)(Java Doc) public Point[] getTileDependencies(int tileX, int tileY, int sourceIndex)(Code)(Java Doc) protected Raster getTileFromCache(int tileX, int tileY)(Code)(Java Doc) public TileRecycler getTileRecycler()(Code)(Java Doc) public Raster[] getTiles(Point[] tileIndices)(Code)(Java Doc) public boolean hasExtender(int sourceIndex)(Code)(Java Doc) public Point2D mapDestPoint(Point2D destPt, int sourceIndex)(Code)(Java Doc) abstract public Rectangle mapDestRect(Rectangle destRect, int sourceIndex)(Code)(Java Doc) public Point2D mapSourcePoint(Point2D sourcePt, int sourceIndex)(Code)(Java Doc) abstract public Rectangle mapSourceRect(Rectangle sourceRect, int sourceIndex)(Code)(Java Doc) public void prefetchTiles(Point[] tileIndices)(Code)(Java Doc) public TileRequest queueTiles(Point[] tileIndices)(Code)(Java Doc) protected void recycleTile(Raster tile)(Code)(Java Doc) public void setTileCache(TileCache cache)(Code)(Java Doc) protected static Vector vectorize(RenderedImage image)(Code)(Java Doc) protected static Vector vectorize(RenderedImage image1, RenderedImage image2)(Code)(Java Doc) protected static Vector vectorize(RenderedImage image1, RenderedImage image2, RenderedImage image3)(Code)(Java Doc)
|
Methods inherited from javax.media.jai.PlanarImage | public static int XToTileX(int x, int tileGridXOffset, int tileWidth)(Code)(Java Doc) public int XToTileX(int x)(Code)(Java Doc) public static int YToTileY(int y, int tileGridYOffset, int tileHeight)(Code)(Java Doc) public int YToTileY(int y)(Code)(Java Doc) public void addPropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc) public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)(Java Doc) public synchronized boolean addSink(Object sink)(Code)(Java Doc) protected void addSink(PlanarImage sink)(Code)(Java Doc) protected void addSource(Object source)(Code)(Java Doc) public synchronized void addTileComputationListener(TileComputationListener listener)(Code)(Java Doc) public void cancelTiles(TileRequest request, Point[] tileIndices)(Code)(Java Doc) public WritableRaster copyData()(Code)(Java Doc) public WritableRaster copyData(WritableRaster raster)(Code)(Java Doc) public void copyExtendedData(WritableRaster dest, BorderExtender extender)(Code)(Java Doc) public static ColorModel createColorModel(SampleModel sm)(Code)(Java Doc) public PlanarImage createSnapshot()(Code)(Java Doc) final protected WritableRaster createWritableRaster(SampleModel sampleModel, Point location)(Code)(Java Doc) public synchronized void dispose()(Code)(Java Doc) protected void finalize() throws Throwable(Code)(Java Doc) public BufferedImage getAsBufferedImage(Rectangle rect, ColorModel cm)(Code)(Java Doc) public BufferedImage getAsBufferedImage()(Code)(Java Doc) public Rectangle getBounds()(Code)(Java Doc) public ColorModel getColorModel()(Code)(Java Doc) public Raster getData()(Code)(Java Doc) public Raster getData(Rectangle region)(Code)(Java Doc) public static ColorModel getDefaultColorModel(int dataType, int numBands)(Code)(Java Doc) public Raster getExtendedData(Rectangle region, BorderExtender extender)(Code)(Java Doc) public Graphics getGraphics()(Code)(Java Doc) public int getHeight()(Code)(Java Doc) public Object getImageID()(Code)(Java Doc) public int getMaxTileX()(Code)(Java Doc) public int getMaxTileY()(Code)(Java Doc) public int getMaxX()(Code)(Java Doc) public int getMaxY()(Code)(Java Doc) public int getMinTileX()(Code)(Java Doc) public int getMinTileY()(Code)(Java Doc) public int getMinX()(Code)(Java Doc) public int getMinY()(Code)(Java Doc) public int getNumBands()(Code)(Java Doc) public int getNumSources()(Code)(Java Doc) public int getNumXTiles()(Code)(Java Doc) public int getNumYTiles()(Code)(Java Doc) protected Hashtable getProperties()(Code)(Java Doc) public Object getProperty(String name)(Code)(Java Doc) public Class getPropertyClass(String name)(Code)(Java Doc) public String[] getPropertyNames()(Code)(Java Doc) public String[] getPropertyNames(String prefix)(Code)(Java Doc) public SampleModel getSampleModel()(Code)(Java Doc) public Vector getSinks()(Code)(Java Doc) public PlanarImage getSource(int index)(Code)(Java Doc) public PlanarImage getSourceImage(int index)(Code)(Java Doc) public Object getSourceObject(int index)(Code)(Java Doc) public Vector getSources()(Code)(Java Doc) public void getSplits(IntegerSequence xSplits, IntegerSequence ySplits, Rectangle rect)(Code)(Java Doc) abstract public Raster getTile(int tileX, int tileY)(Code)(Java Doc) public TileComputationListener[] getTileComputationListeners()(Code)(Java Doc) public TileFactory getTileFactory()(Code)(Java Doc) public int getTileGridXOffset()(Code)(Java Doc) public int getTileGridYOffset()(Code)(Java Doc) public int getTileHeight()(Code)(Java Doc) public Point[] getTileIndices(Rectangle region)(Code)(Java Doc) public Rectangle getTileRect(int tileX, int tileY)(Code)(Java Doc) public int getTileWidth()(Code)(Java Doc) public Raster[] getTiles(Point[] tileIndices)(Code)(Java Doc) public Raster[] getTiles()(Code)(Java Doc) public int getWidth()(Code)(Java Doc) public boolean overlapsMultipleTiles(Rectangle rect)(Code)(Java Doc) public void prefetchTiles(Point[] tileIndices)(Code)(Java Doc) public TileRequest queueTiles(Point[] tileIndices)(Code)(Java Doc) public void removeProperty(String name)(Code)(Java Doc) public void removePropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc) public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)(Java Doc) public synchronized boolean removeSink(Object sink)(Code)(Java Doc) protected boolean removeSink(PlanarImage sink)(Code)(Java Doc) public void removeSinks()(Code)(Java Doc) protected boolean removeSource(Object source)(Code)(Java Doc) protected void removeSources()(Code)(Java Doc) public synchronized void removeTileComputationListener(TileComputationListener listener)(Code)(Java Doc) protected void setImageLayout(ImageLayout layout)(Code)(Java Doc) protected void setProperties(Hashtable properties)(Code)(Java Doc) public void setProperty(String name, Object value)(Code)(Java Doc) protected void setSource(Object source, int index)(Code)(Java Doc) protected void setSources(List sourceList)(Code)(Java Doc) public static int tileXToX(int tx, int tileGridXOffset, int tileWidth)(Code)(Java Doc) public int tileXToX(int tx)(Code)(Java Doc) public static int tileYToY(int ty, int tileGridYOffset, int tileHeight)(Code)(Java Doc) public int tileYToY(int ty)(Code)(Java Doc) public String toString()(Code)(Java Doc) public static PlanarImage wrapRenderedImage(RenderedImage image)(Code)(Java Doc)
|
|
|