Class GeoToolsReadParams
- Object
-
- IIOParam
-
- ImageReadParam
-
- GeoToolsReadParams
-
public abstract class GeoToolsReadParams extends ImageReadParam
This class is the base class for building adapters/extensions to the ImageIOImageReadParamclass for controlling the processing of reading a coverage from anImageReader.- Since:
- 2.3.x
- Author:
- Simone Giannecchini
-
-
Field Summary
Fields Modifier and Type Field Description protected ImageReadParamadapteeTheImageReadParamwe are adapting/exteding.protected Dimension[]preferredTileSizesAn array of preferred tile size range pairs.protected inttileHeightThe height of each tile if tiling has been set, or 0 otherwise.protected inttileWidthThe width of each tile if tiling has been set, or 0 otherwise.protected booleantilingSetAbooleanthat istrueif tiling parameters have been specified.-
Fields inherited from class ImageReadParam
canSetSourceRenderSize, destination, destinationBands, minProgressivePass, numProgressivePasses, sourceRenderSize
-
Fields inherited from class IIOParam
controller, defaultController, destinationOffset, destinationType, sourceBands, sourceRegion, sourceXSubsampling, sourceYSubsampling, subsamplingXOffset, subsamplingYOffset
-
-
Constructor Summary
Constructors Constructor Description GeoToolsReadParams(ImageReadParam params)Default contructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Dimension[]getPreferredTileSizes()Returns an array ofDimensions indicating the legal size ranges for tiles.intgetTileHeight()Returns the width of each tile in an raster as it will be reader If tiling parameters have not been set, anIllegalStateExceptionis thrown.intgetTileWidth()Returns the width of each tile in an raster as it will be reader If tiling parameters have not been set, anIllegalStateExceptionis thrown.voidsetTiling(int tileWidth, int tileHeight)Specifies that the image should be tiled.-
Methods inherited from class ImageReadParam
canSetSourceRenderSize, getDestination, getDestinationBands, getSourceMaxProgressivePass, getSourceMinProgressivePass, getSourceNumProgressivePasses, getSourceRenderSize, setDestination, setDestinationBands, setDestinationType, setSourceProgressivePasses, setSourceRenderSize
-
Methods inherited from class IIOParam
activateController, getController, getDefaultController, getDestinationOffset, getDestinationType, getSourceBands, getSourceRegion, getSourceXSubsampling, getSourceYSubsampling, getSubsamplingXOffset, getSubsamplingYOffset, hasController, setController, setDestinationOffset, setSourceBands, setSourceRegion, setSourceSubsampling
-
-
-
-
Field Detail
-
adaptee
protected ImageReadParam adaptee
TheImageReadParamwe are adapting/exteding.
-
preferredTileSizes
protected Dimension[] preferredTileSizes
An array of preferred tile size range pairs. The default value isnull, which indicates that there are no preferred sizes. If the value is non-null, it must have an even length of at least two.Subclasses that do not support reading tiles may ignore this value.
- See Also:
getPreferredTileSizes()
-
tileWidth
protected int tileWidth
The width of each tile if tiling has been set, or 0 otherwise.Subclasses that do not support tiling may ignore this value.
-
tileHeight
protected int tileHeight
The height of each tile if tiling has been set, or 0 otherwise. The initial value is0.Subclasses that do not support tiling may ignore this value.
-
tilingSet
protected boolean tilingSet
Abooleanthat istrueif tiling parameters have been specified.Subclasses that do not support reading tiles may ignore this value.
-
-
Constructor Detail
-
GeoToolsReadParams
public GeoToolsReadParams(ImageReadParam params)
Default contructor.
-
-
Method Detail
-
getTileWidth
public int getTileWidth()
Returns the width of each tile in an raster as it will be reader If tiling parameters have not been set, anIllegalStateExceptionis thrown.- Returns:
- the tile width to be used for decoding.
- Throws:
IllegalStateException- if the tiling parameters have not been set.- See Also:
#setTiling(int, int, int, int),getTileHeight()
-
getTileHeight
public int getTileHeight()
Returns the width of each tile in an raster as it will be reader If tiling parameters have not been set, anIllegalStateExceptionis thrown.- Returns:
- the tile height to be used for decoding.
- Throws:
IllegalStateException- if the tiling parameters have not been set.- See Also:
#setTiling(int, int, int, int),getTileWidth()
-
setTiling
public void setTiling(int tileWidth, int tileHeight)Specifies that the image should be tiled. ThetileWidthandtileHeightparameters specify the width and height of the tiles in memory. If the tile width or height is greater than the width or height of the image, the image is not tiled in that dimension.- Parameters:
tileWidth- the width of each tile.tileHeight- the height of each tile.- Throws:
IllegalArgumentException- if the tile size is not within one of the allowable ranges returned bygetPreferredTileSizes.IllegalArgumentException- iftileWidthortileHeightis less than or equal to 0.- See Also:
#canWriteTiles,#canOffsetTiles,getTileWidth(),getTileHeight(),#getTileGridXOffset(),#getTileGridYOffset()
-
getPreferredTileSizes
public Dimension[] getPreferredTileSizes()
Returns an array ofDimensions indicating the legal size ranges for tiles. The returned array is a copy.The information is returned as a set of pairs; the first element of a pair contains an (inclusive) minimum width and height, and the second element contains an (inclusive) maximum width and height. Together, each pair defines a valid range of sizes. To specify a fixed size, use the same width and height for both elements. To specify an arbitrary range, a value of
nullis used in place of an actual array ofDimensions.If no array is specified on the constructor, but tiling is allowed, then this method returns
null.- Returns:
- an array of
Dimensions with an even length of at least two, ornull. - Throws:
UnsupportedOperationException- if the plug-in does not support tiling.
-
-