|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectImageReader
SpatialImageReader
RawTiffImageReader
public class RawTiffImageReader
An image reader for uncompressed TIFF files or RGB images. This image reader duplicates the works
performed by the reader provided in Image I/O extension for Java Advanced Imaging,
but is specialized to the specific case of uncompressed files. For such case, this
RawTiffImageReader is faster.
RawTiffImageReader has the following restrictions:
File or String input objects
(the standard ImageInputStream is not supported).Because of the above-cited restrictions, this reader registers itself only after the JAI readers (unless otherwise specified). Users wanting this reader should request for it explicitly, for example as below:
This image reader can also process Big TIFF images.ImageReaderSpi spi = IIORegistry.getDefaultInstance().getServiceProviderByClass(RawTiffImageReader.class); ImageReader reader = spi.createReaderInstance();
| coverage/geotk-coverageio (download) | View source code for this class |
| Nested Class Summary | |
|---|---|
static class |
RawTiffImageReader.Spi
Service provider interface (SPI) for RawTiffImageReaders. |
| Field Summary |
|---|
| Fields inherited from class ImageReader |
|---|
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales |
| Fields inherited from interface WarningProducer |
|---|
LOGGER |
| Constructor Summary | |
|---|---|
RawTiffImageReader(RawTiffImageReader.Spi provider)
Creates a new reader. |
|
| Method Summary | |
|---|---|
protected void |
close()
Closes the file channel. |
int |
getHeight(int imageIndex)
Returns the height of the image at the given index. |
Iterator<ImageTypeSpecifier> |
getImageTypes(int imageIndex)
Returns a collection of ImageTypeSpecifier containing possible image types to which
the given image may be decoded. |
int |
getNumBands(int imageIndex)
Returns the number of bands available for the specified image. |
int |
getNumImages(boolean allowSearch)
Returns the number of images available from the current input file. |
protected int |
getRawDataType(int imageIndex)
Returns the data type which most closely represents the "raw" internal data of the image. |
ImageTypeSpecifier |
getRawImageType(int imageIndex)
Returns the SampleModel and ColorModel which most closely represents the
internal format of the image. |
int |
getTileHeight(int imageIndex)
Returns the height of the tiles in the given image. |
int |
getTileWidth(int imageIndex)
Returns the width of the tiles in the given image. |
int |
getWidth(int imageIndex)
Returns the width of the image at the given index. |
boolean |
hasColors(int imageIndex)
Returns true since TIFF images have color palette. |
boolean |
isImageTiled(int imageIndex)
Returns true if the image is organized into tiles. |
boolean |
isRandomAccessEasy(int imageIndex)
Returns true since this image format places no inherent impediment on random access
to pixels. |
BufferedImage |
read(int imageIndex,
ImageReadParam param)
Reads the image at the given index. |
| Methods inherited from class SpatialImageReader |
|---|
checkBandIndex, checkImageIndex, collapseNoDataValues, createMetadata, dispose, flipVertically, getDefaultReadParam, getDestination, getDimension, getGridEnvelope, getImageMetadata, getImageType, getStreamMetadata, setInput, warningOccurred |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface Localized |
|---|
getLocale |
| Constructor Detail |
|---|
public RawTiffImageReader(RawTiffImageReader.Spi provider)
provider - The provider, or null if none.| Method Detail |
|---|
public boolean isRandomAccessEasy(int imageIndex)
throws IOException
true since this image format places no inherent impediment on random access
to pixels. Actually, having easy random access is the whole point of uncompressed TIFF files
in many GIS infrastructures.
isRandomAccessEasy in class ImageReaderimageIndex - The image index (ignored by this implementation).
true in this implementation.
IOException - If an I/O access was necessary and failed.
public int getNumImages(boolean allowSearch)
throws IOException
true argument value.
getNumImages in class SpatialImageReaderallowSearch - If true, the number of images will be returned
even if a search is required.
allowSearch
is false and a search would be required.
IOException - if an error occurs reading the information from the input source.
public int getNumBands(int imageIndex)
throws IOException
getNumBands in class SpatialImageReaderimageIndex - The image index.
IOException - if an error occurs reading the information from the input source.
public int getWidth(int imageIndex)
throws IOException
getWidth in class ImageReaderimageIndex - the index of the image to be queried.
IOException - If an error occurred while reading the file.
public int getHeight(int imageIndex)
throws IOException
getHeight in class ImageReaderimageIndex - the index of the image to be queried.
IOException - If an error occurred while reading the file.
public int getTileWidth(int imageIndex)
throws IOException
getTileWidth in class ImageReaderimageIndex - the index of the image to be queried.
IOException - If an error occurred while reading the file.
public int getTileHeight(int imageIndex)
throws IOException
getTileHeight in class ImageReaderimageIndex - the index of the image to be queried.
IOException - If an error occurred while reading the file.
public boolean isImageTiled(int imageIndex)
throws IOException
true if the image is organized into tiles.
isImageTiled in class ImageReaderimageIndex - the index of the image to be queried.
true if the image is organized into tiles.
IOException - If an error occurred while reading the file.
public boolean hasColors(int imageIndex)
throws IOException
true since TIFF images have color palette.
hasColors in class SpatialImageReaderimageIndex - The index of the image to be queried.
true if the image at the given index has a color palette.
IOException - If an error occurs reading the information from the input source.SpatialImageReadParam.setPaletteName(String)
protected int getRawDataType(int imageIndex)
throws IOException
return getRawImageType(imageIndex).getSampleModel().getDataType();
getRawDataType in class SpatialImageReaderimageIndex - The index of the image to be queried.
DataBuffer.TYPE_BYTE).
IOException - If an error occurs reading the format information from the input source.SpatialImageReader.getImageType(int, ImageReadParam, SampleConverter[]),
SampleConversionType.SHIFT_SIGNED_INTEGERS
public ImageTypeSpecifier getRawImageType(int imageIndex)
throws IOException
SampleModel and ColorModel which most closely represents the
internal format of the image.
getRawImageType in class SpatialImageReaderimageIndex - The index of the image to be queried.
IOException - If an error occurs reading the format information from the input source.SpatialImageReader.getImageType(int, ImageReadParam, SampleConverter[]),
SpatialImageReader.getDefaultReadParam()
public Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex)
throws IOException
ImageTypeSpecifier containing possible image types to which
the given image may be decoded. The default implementation returns a singleton containing
only the raw image type.
getImageTypes in class SpatialImageReaderimageIndex - The index of the image to be queried.
IOException - If an error occurs reading the format information from the input source.
public BufferedImage read(int imageIndex,
ImageReadParam param)
throws IOException
read in class ImageReaderimageIndex - The index of the image to read.param - Parameters used to control the reading process, or null.
IOException - If an error occurred while reading the image.
protected void close()
throws IOException
close in class SpatialImageReaderIOException - If an error occurred while closing the channel.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||