|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.imageio.ImageReader org.geotools.image.io.SimpleImageReader
Base class for simple image decoders. "Simple" images are usually flat binary
or ASCII files with no meta-data and no color information. There pixel values
may be floating point values instead of integers. Such formats are of common
use in remote sensing.
This base class makes it easier to construct images from floating point values.
It provides default implementations for most ImageReader
methods. Since
does not expect to know anything about image's
color, it uses a grayscale color space scaled to fit the range of values.
Displaying such an image may be very slow. Consequently, users who want
to display image are encouraged to change data type and color space with
Java Advanced Imaging
operators after reading.
RawBinaryImageReader
,
TextRecordImageReader
,
TextMatrixImageReader
Field Summary |
Fields inherited from class javax.imageio.ImageReader |
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales |
Constructor Summary | |
protected |
SimpleImageReader(javax.imageio.spi.ImageReaderSpi provider)
Construct a new image reader. |
Method Summary | |
abstract javax.media.jai.util.Range |
getExpectedRange(int imageIndex,
int bandIndex)
Returns the expected range of values for a band. |
javax.imageio.metadata.IIOMetadata |
getImageMetadata(int imageIndex)
Returns metadata associated with the given image. |
java.util.Iterator |
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 source. |
int |
getRawDataType(int imageIndex)
Returns the data type which most closely represents the "raw" internal data of the image. |
javax.imageio.ImageTypeSpecifier |
getRawImageType(int imageIndex)
Returns an image type specifier indicating the SampleModel and ColorModel
which most closely represents the "raw" internal format of the image. |
javax.imageio.metadata.IIOMetadata |
getStreamMetadata()
Returns metadata associated with the input source as a whole. |
void |
setInput(java.lang.Object input,
boolean seekForwardOnly,
boolean ignoreMetadata)
Sets the input source to use. |
Methods inherited from class javax.imageio.ImageReader |
abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, canReadRaster, checkReadParamBandSettings, clearAbortRequest, computeRegions, dispose, getAspectRatio, getAvailableLocales, getDefaultReadParam, getDestination, getFormatName, getHeight, getImageMetadata, getInput, getLocale, getMinIndex, getNumThumbnails, getOriginatingProvider, getSourceRegion, getStreamMetadata, getThumbnailHeight, getThumbnailWidth, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getWidth, hasThumbnails, isIgnoringMetadata, isImageTiled, isRandomAccessEasy, isSeekForwardOnly, processImageComplete, processImageProgress, processImageStarted, processImageUpdate, processPassComplete, processPassStarted, processReadAborted, processSequenceComplete, processSequenceStarted, processThumbnailComplete, processThumbnailPassComplete, processThumbnailPassStarted, processThumbnailProgress, processThumbnailStarted, processThumbnailUpdate, processWarningOccurred, processWarningOccurred, read, read, readAll, readAll, readAsRenderedImage, readerSupportsThumbnails, readRaster, readThumbnail, readTile, readTileRaster, removeAllIIOReadProgressListeners, removeAllIIOReadUpdateListeners, removeAllIIOReadWarningListeners, removeIIOReadProgressListener, removeIIOReadUpdateListener, removeIIOReadWarningListener, reset, setInput, setInput, setLocale |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected SimpleImageReader(javax.imageio.spi.ImageReaderSpi provider)
provider
- the ImageReaderSpi
that is
invoking this constructor, or null.Method Detail |
public void setInput(java.lang.Object input, boolean seekForwardOnly, boolean ignoreMetadata)
input
- The input object to use for future decoding.seekForwardOnly
- If true, images and metadata may only be read
in ascending order from this input source.ignoreMetadata
- If true, metadata may be ignored during reads.public int getNumImages(boolean allowSearch) throws java.lang.IllegalStateException, java.io.IOException
allowSearch
- If true, the number of images will be returned
even if a search is required.
java.lang.IllegalStateException
- if the input source has not been set.
java.io.IOException
- if an error occurs reading the information from the input source.public int getNumBands(int imageIndex) throws java.io.IOException
imageIndex
- The image index.
java.io.IOException
- if an error occurs reading the information from the input source.public javax.imageio.metadata.IIOMetadata getImageMetadata(int imageIndex) throws java.io.IOException
java.io.IOException
- if an error occurs during reading.public javax.imageio.metadata.IIOMetadata getStreamMetadata() throws java.io.IOException
java.io.IOException
- if an error occurs during reading.public java.util.Iterator getImageTypes(int imageIndex) throws java.io.IOException
ImageTypeSpecifier
containing possible image
types to which the given image may be decoded. The default implementation
returns a singleton containing getRawImageType(int)
.
imageIndex
- The index of the image to be retrieved.
java.io.IOException
- If an error occurs reading the format information from the input source.public javax.imageio.ImageTypeSpecifier getRawImageType(int imageIndex) throws java.io.IOException
SampleModel
and ColorModel
which most closely represents the "raw" internal format of the image. The default
implementation returns an image type specifier for a BandedSampleModel
of
data type getRawDataType(int)
.
imageIndex
- The index of the image to be queried.
java.io.IOException
- If an error occurs reading the format information from the input source.public int getRawDataType(int imageIndex) throws java.io.IOException
DataBuffer
. Common types are DataBuffer.TYPE_INT
,
DataBuffer.TYPE_FLOAT
and DataBuffer.TYPE_DOUBLE
.
The default implementation returns .
imageIndex
- The index of the image to be queried.
java.io.IOException
- If an error occurs reading the format information
from the input source.public abstract javax.media.jai.util.Range getExpectedRange(int imageIndex, int bandIndex) throws java.io.IOException
imageIndex
- The image index.bandIndex
- The band index. Valid index goes from inclusive
to exclusive. Index are independent
of any IIOParam.setSourceBands(int[])
setting.
java.io.IOException
- If an error occurs reading the data information from
the input source.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |