|
|||||||||||
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 org.geotools.image.io.RawBinaryImageReader
Image reader for raw binary files. This reader can't decode a stream without some extra informations (image size, data type...). Image size can be specified in three ways:
RawBinaryImageReadParam.setStreamImageSize(java.awt.Dimension)
with a non-null argument.RawBinaryImageReader.Spi.createReaderInstance(Object)
with an argument of
type Dimension
.RawBinaryImageReader
or RawBinaryImageReader.Spi
subclass setting the imageSize
field.RawBinaryImageReadParam.setStreamDataType(int)
.RawBinaryImageReader
subclass
overriding getRawDataType(int)
.RawBinaryImageReadParam.setPadValue(double)
.RawBinaryImageReader
subclass
overriding transform(double)
.RawBinaryImageReader.Spi
subclass setting the padValue
field.
Nested Class Summary | |
static class |
RawBinaryImageReader.Spi
Deprecated. Service provider interface (SPI) for RawBinaryImageReader s.
|
Field Summary | |
protected java.awt.Dimension |
imageSize
Deprecated. The expected image size, or null if unknow. |
Fields inherited from class javax.imageio.ImageReader |
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales |
Constructor Summary | |
RawBinaryImageReader(javax.imageio.spi.ImageReaderSpi provider)
Deprecated. Construct a new image reader. |
Method Summary | |
javax.imageio.ImageReadParam |
getDefaultReadParam()
Deprecated. Returns a default ImageReadParam
object appropriate for this format. |
protected java.awt.image.BufferedImage |
getDestination(int imageIndex,
javax.imageio.ImageReadParam param)
Deprecated. Returns the BufferedImage to which decoded pixel data should
be written. |
javax.media.jai.util.Range |
getExpectedRange(int imageIndex,
int bandIndex)
Deprecated. Returns the expected range of values for a band. |
int |
getHeight(int imageIndex)
Deprecated. Returns the image's height. |
int |
getRawDataType(int imageIndex)
Deprecated. Returns the data type which most closely represents the "raw" internal data of the image. |
protected java.awt.image.SampleModel |
getStreamSampleModel(int imageIndex,
javax.imageio.ImageReadParam param)
Deprecated. Returns the stream sample model (the sample model used to encode pixel into the stream). |
int |
getWidth(int imageIndex)
Deprecated. Returns the image's width. |
java.awt.image.BufferedImage |
read(int imageIndex,
javax.imageio.ImageReadParam param)
Deprecated. Reads the image indexed by imageIndex . |
void |
reset()
Deprecated. Restores the image reader to its initial state. |
void |
setInput(java.lang.Object input,
boolean seekForwardOnly,
boolean ignoreMetadata)
Deprecated. Sets the input source to use. |
protected double |
transform(double value)
Deprecated. Transform a value. |
Methods inherited from class org.geotools.image.io.SimpleImageReader |
getImageMetadata, getImageTypes, getNumBands, getNumImages, getRawImageType, getStreamMetadata |
Methods inherited from class javax.imageio.ImageReader |
abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, canReadRaster, checkReadParamBandSettings, clearAbortRequest, computeRegions, dispose, getAspectRatio, getAvailableLocales, getDestination, getFormatName, getImageMetadata, getInput, getLocale, getMinIndex, getNumThumbnails, getOriginatingProvider, getSourceRegion, getStreamMetadata, getThumbnailHeight, getThumbnailWidth, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, hasThumbnails, isIgnoringMetadata, isImageTiled, isRandomAccessEasy, isSeekForwardOnly, processImageComplete, processImageProgress, processImageStarted, processImageUpdate, processPassComplete, processPassStarted, processReadAborted, processSequenceComplete, processSequenceStarted, processThumbnailComplete, processThumbnailPassComplete, processThumbnailPassStarted, processThumbnailProgress, processThumbnailStarted, processThumbnailUpdate, processWarningOccurred, processWarningOccurred, read, readAll, readAll, readAsRenderedImage, readerSupportsThumbnails, readRaster, readThumbnail, readTile, readTileRaster, removeAllIIOReadProgressListeners, removeAllIIOReadUpdateListeners, removeAllIIOReadWarningListeners, removeIIOReadProgressListener, removeIIOReadUpdateListener, removeIIOReadWarningListener, setInput, setInput, setLocale |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.awt.Dimension imageSize
null
if unknow. Setting this field to a
non-null value allow getWidth(int)
and getHeight(int)
to returns this size.
This size will be compared with RawBinaryImageReadParam.getStreamImageSize()
at reading time, if such a parameter is specified. An IIOException
exception will be thrown if sizes don't match, in order to ensure consistency
with getWidth(int)
and getHeight(int)
methods.
Constructor Detail |
public RawBinaryImageReader(javax.imageio.spi.ImageReaderSpi provider)
provider
- the ImageReaderSpi
that is
invoking this constructor, or null.Method Detail |
public void reset()
public void setInput(java.lang.Object input, boolean seekForwardOnly, boolean ignoreMetadata)
setInput
in class SimpleImageReader
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 getWidth(int imageIndex) throws java.io.IOException
java.io.IOException
- if an I/O error occured.
javax.imageio.IIOException
- if the image size is unknow.public int getHeight(int imageIndex) throws java.io.IOException
java.io.IOException
- if an I/O error occured.
javax.imageio.IIOException
- if the image size is unknow.public int getRawDataType(int imageIndex) throws java.io.IOException
DataBuffer
. Common types are DataBuffer.TYPE_INT
,
DataBuffer.TYPE_FLOAT
and DataBuffer.TYPE_DOUBLE
.
getRawDataType
in class SimpleImageReader
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 javax.media.jai.util.Range getExpectedRange(int imageIndex, int bandIndex) throws java.io.IOException
getExpectedRange
in class SimpleImageReader
imageIndex
- The image index.bandIndex
- The band index. Valid index goes from 0
inclusive
to getNumBands(imageIndex)
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.protected double transform(double value)
value
to the pad value (as specified in RawBinaryImageReader.Spi.padValue
)
and returns Double.NaN
if both values are equals. Otherwise,
value
is returned unchanged.
protected java.awt.image.SampleModel getStreamSampleModel(int imageIndex, javax.imageio.ImageReadParam param) throws java.io.IOException
RawBinaryImageReadParam.getStreamSampleModel()
if the supplied parameters is an instance of RawBinaryImageReadParam
. Default
values are provided through the following methods: SimpleImageReader.getNumBands(int)
, getRawDataType(int)
,
SimpleImageReader.getRawImageType(int)
and getExpectedRange(int, int)
.
imageIndex
- The index of the image to be retrieved.param
- Parameters used to control the reading process, or null.
java.io.IOException
- if an input operation failed.
javax.imageio.IIOException
- if param
do not contains the expected information.public javax.imageio.ImageReadParam getDefaultReadParam()
ImageReadParam
object appropriate for this format.
public java.awt.image.BufferedImage read(int imageIndex, javax.imageio.ImageReadParam param) throws java.io.IOException
imageIndex
.
imageIndex
- The index of the image to be retrieved.param
- Parameters used to control the reading process, or null.
java.io.IOException
- if an input operation failed.protected final java.awt.image.BufferedImage getDestination(int imageIndex, javax.imageio.ImageReadParam param) throws java.io.IOException
BufferedImage
to which decoded pixel data should
be written. The image is determined by inspecting the supplied ImageReadParam
if it is non-null, as in the ImageReader.getDestination(...)
method. If the parameter is an instance
of RawBinaryImageReadParam
, then this method will use its size
and data type information for constructing the image.
imageIndex
- The index of the image to be read.param
- an ImageReadParam
to be used to get
the destination image or image type, or null
.
BufferedImage
to which decoded pixel
data should be written.
java.lang.IndexOutOfBoundsException
- if imageIndex
is out of bounds.
java.lang.IllegalStateException
- if no source has been set with
setInput(java.lang.Object, boolean, boolean)
.
java.io.IOException
- if an error occur while fetching informations
from the stream.
javax.imageio.IIOException
- if the ImageTypeSpecifier
specified by
param
does not match any of the legal ones.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |