|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.image.io.mosaic.TileManager
public abstract class TileManager
A collection of Tile
objects to be given to MosaicImageReader
. This base
class does not assume that the tiles are arranged in any particular order (especially grids).
But subclasses can make such assumption for better performances.
Constructor Summary | |
---|---|
protected |
TileManager()
Creates a tile manager. |
Method Summary | |
---|---|
Tile |
createGlobalTile(javax.imageio.spi.ImageReaderSpi provider,
java.lang.Object input,
int imageIndex)
Creates a tile with a region big enough for containing every tiles. |
ImageGeometry |
getGridGeometry()
Returns the grid geometry, including the "grid to real world" transform. |
java.util.Set<javax.imageio.spi.ImageReaderSpi> |
getImageReaderSpis()
Returns all image reader providers used by the tiles. |
abstract java.util.Collection<Tile> |
getTiles()
Returns all tiles. |
abstract java.util.Collection<Tile> |
getTiles(java.awt.Rectangle region,
java.awt.Dimension subsampling,
boolean subsamplingChangeAllowed)
Returns every tiles that intersect the given region. |
boolean |
intersects(java.awt.Rectangle region,
java.awt.Dimension subsampling)
Returns true if at least one tile having the given subsampling or a finer
one intersects the given region. |
void |
printErrors(java.io.PrintWriter out)
Checks for file existence and image size of every tiles and reports any error found. |
void |
setGridToCRS(java.awt.geom.AffineTransform gridToCRS)
Sets the grid to CRS transform for every tiles. |
java.lang.String |
toString()
Returns a string representation of this tile manager. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected TileManager()
Method Detail |
---|
public void setGridToCRS(java.awt.geom.AffineTransform gridToCRS) throws java.lang.IllegalStateException, java.io.IOException
The grid to CRS transform is not necessary for proper working of mosaic image reader, but is provided as a convenience for users.
This method can be invoked only once.
gridToCRS
- The "grid to CRS" transform.
java.lang.IllegalStateException
- if a transform was already assigned to at least one tile.
java.io.IOException
- If an I/O operation was required and failed.public ImageGeometry getGridGeometry() throws java.io.IOException
null
if this information is not available.
java.io.IOException
- If an I/O operation was required and failed.Tile.getGridToCRS()
public java.util.Set<javax.imageio.spi.ImageReaderSpi> getImageReaderSpis() throws java.io.IOException
java.io.IOException
- If an I/O operation was required and failed.MosaicImageReader.getTileReaderSpis()
public Tile createGlobalTile(javax.imageio.spi.ImageReaderSpi provider, java.lang.Object input, int imageIndex) throws java.util.NoSuchElementException, java.io.IOException
provider
- The image reader provider to be given to the created tile, or null
for
inferring it automatically. In the later case the provider is inferred from the
input suffix if any (e.g. the ".png"
extension in a filename), or
failing that the most frequently used provider is selected.input
- The input to be given to the created tile. It doesn't need to be an existing
file or URI since this method will not attempt to
read it.imageIndex
- The image index to be given to the created tile (usually 0).
java.util.NoSuchElementException
- If this manager do not contains at least one tile.
java.io.IOException
- If an I/O operation was required and failed.public abstract java.util.Collection<Tile> getTiles() throws java.io.IOException
java.io.IOException
- If an I/O operation was required and failed.public abstract java.util.Collection<Tile> getTiles(java.awt.Rectangle region, java.awt.Dimension subsampling, boolean subsamplingChangeAllowed) throws java.io.IOException
region
- The region of interest (shall not be null
).subsampling
- On input, the number of source columns and rows to advance for each pixel. On
output, the effective values to use. Those values may be different only if
subsamplingChangeAllowed
is true
.subsamplingChangeAllowed
- If true
, this method is allowed to replace subsampling
by the
highest subsampling that overviews can handle, not greater than the given
subsampling.
null
.
java.io.IOException
- If it was necessary to fetch an image dimension from its
reader and this operation failed.public boolean intersects(java.awt.Rectangle region, java.awt.Dimension subsampling) throws java.io.IOException
true
if at least one tile having the given subsampling or a finer
one intersects the given region. The default implementation returns true
if
getTiles(region, subsampling, false)
returns a non-empty set. Subclasses are encouraged to provide a more efficient implementation.
region
- The region of interest (shall not be null
).subsampling
- The maximal subsampling to look for.
true
if at least one tile having the given subsampling or a finer one
intersects the given region.
java.io.IOException
- If it was necessary to fetch an image dimension from its
reader and this operation failed.public void printErrors(java.io.PrintWriter out)
out
- Where to report errors (null
for default, which is the
standard output stream).public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |