public abstract class StatisticsOpImage
extends javax.media.jai.OpImage
SimpleStatsOpImage
and ComplexStatsOpImage
. The first one is used for calculating simple statistics which does not requests the use
of an array for saving all the values, instead of the second class which stores the statistics on an array and then performs the final computations
when the result is requested. The 2 subclasses must only update their constructor for adding a control on which kind of statistics are calculated
and defining the computeTile() method which is used for calculating the statistics for each tile.Modifier and Type | Field and Description |
---|---|
protected int[] |
bands
Array containing the indexes of the selected bands
|
protected int |
bandsNumber
Image bands number
|
protected boolean[] |
booleanLookupTable
Boolean lookuptable used if no data are present
|
protected boolean |
caseA
Boolean indicating that there No Data and ROI are not used
|
protected boolean |
caseB
Boolean indicating that only ROI is used
|
protected boolean |
caseC
Boolean indicating that only No Data are used
|
protected AtomicBoolean |
firstTime
Boolean indicating if the statistics have been already calculated(if false) or not
|
protected boolean |
hasNoData
Boolean indicating if a No Data Range is used
|
protected boolean |
hasROI
Boolean indicating if a ROI object is used
|
protected Range |
noData
No Data Range
|
protected static javax.media.jai.BorderExtender |
ROI_EXTENDER
ROI extender
|
protected Rectangle |
roiBounds
Rectangle containing ROI bounds
|
protected int |
selectedBands
Selected bands number
|
protected javax.media.jai.PlanarImage |
srcROIImage
ROI image
|
protected javax.media.jai.RenderedOp |
srcROIImgExt
Extended ROI image
|
protected int |
statNum
Length of the statsTypes array
|
protected Statistics[][] |
stats
Object containing the current statistics for the selected bands and for the selected statistic types
|
protected Statistics.StatsType[] |
statsTypes
Array containing the type of statistics to calculate
|
protected boolean |
useROIAccessor
Boolean indicating if a ROI RasterAccessor should be used
|
protected int |
xPeriod
Horizontal subsampling
|
protected int |
yPeriod
Vertical subsampling
|
Constructor and Description |
---|
StatisticsOpImage(RenderedImage source,
int xPeriod,
int yPeriod,
javax.media.jai.ROI roi,
Range noData,
boolean useROIAccessor,
int[] bands,
Statistics.StatsType[] statsTypes,
double[] minBound,
double[] maxBound,
int[] numBins) |
Modifier and Type | Method and Description |
---|---|
protected void |
byteLoop(javax.media.jai.RasterAccessor src,
Rectangle srcRect,
javax.media.jai.RasterAccessor roi,
Statistics[][] statArray,
javax.media.jai.iterator.RandomIter roiIter) |
void |
clearStatistic()
This method is used if the user needs to perform again the statistical calculations.
|
void |
dispose()
When the dispose method is called, then old dispose method is performed and also the statistic container is cleared.
|
protected void |
doubleLoop(javax.media.jai.RasterAccessor src,
Rectangle srcRect,
javax.media.jai.RasterAccessor roi,
Statistics[][] statArray,
javax.media.jai.iterator.RandomIter roiIter) |
protected void |
floatLoop(javax.media.jai.RasterAccessor src,
Rectangle srcRect,
javax.media.jai.RasterAccessor roi,
Statistics[][] statArray,
javax.media.jai.iterator.RandomIter roiIter) |
Object |
getProperty(String name)
Get the specified property.
|
String[] |
getPropertyNames()
Returns a list of property names that are recognized by this image.
|
Raster[] |
getTiles()
Computes and returns all tiles in the image.
|
protected void |
intLoop(javax.media.jai.RasterAccessor src,
Rectangle srcRect,
javax.media.jai.RasterAccessor roi,
Statistics[][] statArray,
javax.media.jai.iterator.RandomIter roiIter) |
Rectangle |
mapDestRect(Rectangle destRect,
int sourceIndex) |
Rectangle |
mapSourceRect(Rectangle sourceRect,
int sourceIndex) |
protected void |
shortLoop(javax.media.jai.RasterAccessor src,
Rectangle srcRect,
javax.media.jai.RasterAccessor roi,
Statistics[][] statArray,
javax.media.jai.iterator.RandomIter roiIter) |
protected void |
ushortLoop(javax.media.jai.RasterAccessor src,
Rectangle srcRect,
javax.media.jai.RasterAccessor roi,
Statistics[][] statArray,
javax.media.jai.iterator.RandomIter roiIter) |
addTileToCache, cancelTiles, computeRect, computeRect, computesUniqueTiles, computeTile, createTile, getExpandedNumBands, getFormatTags, getOperationComputeType, getTile, getTileCache, getTileCacheMetric, getTileDependencies, getTileFromCache, getTileRecycler, getTiles, hasExtender, mapDestPoint, mapSourcePoint, prefetchTiles, queueTiles, recycleTile, setTileCache, vectorize, vectorize, vectorize
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, getProperties, getPropertyClass, getPropertyNames, getSampleModel, getSinks, getSource, getSourceImage, getSourceObject, getSources, getSplits, getTileComputationListeners, getTileFactory, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileIndices, getTileRect, 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
protected static final javax.media.jai.BorderExtender ROI_EXTENDER
protected Statistics[][] stats
protected final boolean hasNoData
protected final boolean hasROI
protected final boolean useROIAccessor
protected final javax.media.jai.PlanarImage srcROIImage
protected final Rectangle roiBounds
protected final boolean caseA
protected final boolean caseB
protected final boolean caseC
protected int bandsNumber
protected int selectedBands
protected int[] bands
protected Statistics.StatsType[] statsTypes
protected int statNum
protected AtomicBoolean firstTime
protected final int xPeriod
protected final int yPeriod
protected final boolean[] booleanLookupTable
protected Range noData
protected javax.media.jai.RenderedOp srcROIImgExt
public StatisticsOpImage(RenderedImage source, int xPeriod, int yPeriod, javax.media.jai.ROI roi, Range noData, boolean useROIAccessor, int[] bands, Statistics.StatsType[] statsTypes, double[] minBound, double[] maxBound, int[] numBins)
public String[] getPropertyNames()
getPropertyNames
in interface RenderedImage
getPropertyNames
in interface javax.media.jai.PropertySource
getPropertyNames
in class javax.media.jai.PlanarImage
String
s containing valid property names.public void clearStatistic()
public void dispose()
dispose
in class javax.media.jai.OpImage
public Raster[] getTiles()
getTiles
in class javax.media.jai.PlanarImage
public Object getProperty(String name)
Use this method to retrieve the calculated statistics as an array per band and per statistic types.
getProperty
in interface RenderedImage
getProperty
in interface javax.media.jai.PropertySource
getProperty
in class javax.media.jai.PlanarImage
name
- property nameprotected void byteLoop(javax.media.jai.RasterAccessor src, Rectangle srcRect, javax.media.jai.RasterAccessor roi, Statistics[][] statArray, javax.media.jai.iterator.RandomIter roiIter)
protected void ushortLoop(javax.media.jai.RasterAccessor src, Rectangle srcRect, javax.media.jai.RasterAccessor roi, Statistics[][] statArray, javax.media.jai.iterator.RandomIter roiIter)
protected void shortLoop(javax.media.jai.RasterAccessor src, Rectangle srcRect, javax.media.jai.RasterAccessor roi, Statistics[][] statArray, javax.media.jai.iterator.RandomIter roiIter)
protected void intLoop(javax.media.jai.RasterAccessor src, Rectangle srcRect, javax.media.jai.RasterAccessor roi, Statistics[][] statArray, javax.media.jai.iterator.RandomIter roiIter)
protected void floatLoop(javax.media.jai.RasterAccessor src, Rectangle srcRect, javax.media.jai.RasterAccessor roi, Statistics[][] statArray, javax.media.jai.iterator.RandomIter roiIter)
protected void doubleLoop(javax.media.jai.RasterAccessor src, Rectangle srcRect, javax.media.jai.RasterAccessor roi, Statistics[][] statArray, javax.media.jai.iterator.RandomIter roiIter)
public Rectangle mapDestRect(Rectangle destRect, int sourceIndex)
mapDestRect
in class javax.media.jai.OpImage
Copyright © 2006–2018 GeoSolutions. All rights reserved.