org.geotools.image.io
Class RawBinaryImageReader

java.lang.Object
  extended byjavax.imageio.ImageReader
      extended byorg.geotools.image.io.SimpleImageReader
          extended byorg.geotools.image.io.RawBinaryImageReader

Deprecated. Use Sun's RAW decoder provided with "Java Advanced Imaging Image I/O Tools" instead. Download at http://java.sun.com/products/java-media/jai/.

public class RawBinaryImageReader
extends SimpleImageReader

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:

Data type can be specified in two ways: Pad value can be specified in three ways:

Version:
$Id: RawBinaryImageReader.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux

Nested Class Summary
static class RawBinaryImageReader.Spi
          Deprecated. Service provider interface (SPI) for RawBinaryImageReaders.
 
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

imageSize

protected java.awt.Dimension imageSize
Deprecated. 
The expected image size, or 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

RawBinaryImageReader

public RawBinaryImageReader(javax.imageio.spi.ImageReaderSpi provider)
Deprecated. 
Construct a new image reader.

Parameters:
provider - the ImageReaderSpi that is invoking this constructor, or null.
Method Detail

reset

public void reset()
Deprecated. 
Restores the image reader to its initial state.


setInput

public void setInput(java.lang.Object input,
                     boolean seekForwardOnly,
                     boolean ignoreMetadata)
Deprecated. 
Sets the input source to use.

Overrides:
setInput in class SimpleImageReader
Parameters:
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.

getWidth

public int getWidth(int imageIndex)
             throws java.io.IOException
Deprecated. 
Returns the image's width.

Throws:
java.io.IOException - if an I/O error occured.
javax.imageio.IIOException - if the image size is unknow.

getHeight

public int getHeight(int imageIndex)
              throws java.io.IOException
Deprecated. 
Returns the image's height.

Throws:
java.io.IOException - if an I/O error occured.
javax.imageio.IIOException - if the image size is unknow.

getRawDataType

public int getRawDataType(int imageIndex)
                   throws java.io.IOException
Deprecated. 
Returns the data type which most closely represents the "raw" internal data of the image. It should be a constant from DataBuffer. Common types are DataBuffer.TYPE_INT, DataBuffer.TYPE_FLOAT and DataBuffer.TYPE_DOUBLE.

Overrides:
getRawDataType in class SimpleImageReader
Parameters:
imageIndex - The index of the image to be queried.
Returns:
The data type.
Throws:
java.io.IOException - If an error occurs reading the format information from the input source.

getExpectedRange

public javax.media.jai.util.Range getExpectedRange(int imageIndex,
                                                   int bandIndex)
                                            throws java.io.IOException
Deprecated. 
Returns the expected range of values for a band.

Specified by:
getExpectedRange in class SimpleImageReader
Parameters:
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.
Returns:
The expected range of values.
Throws:
java.io.IOException - If an error occurs reading the data information from the input source.

transform

protected double transform(double value)
Deprecated. 
Transform a value. This method is invoked automatically for every pixel value during reading, in order to give subclasses a chance to perform some data conversion on the fly. The default implementation compare 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.


getStreamSampleModel

protected java.awt.image.SampleModel getStreamSampleModel(int imageIndex,
                                                          javax.imageio.ImageReadParam param)
                                                   throws java.io.IOException
Deprecated. 
Returns the stream sample model (the sample model used to encode pixel into the stream). The default implementation query 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).

Parameters:
imageIndex - The index of the image to be retrieved.
param - Parameters used to control the reading process, or null.
Returns:
The stream sample model.
Throws:
java.io.IOException - if an input operation failed.
javax.imageio.IIOException - if param do not contains the expected information.

getDefaultReadParam

public javax.imageio.ImageReadParam getDefaultReadParam()
Deprecated. 
Returns a default ImageReadParam object appropriate for this format.


read

public java.awt.image.BufferedImage read(int imageIndex,
                                         javax.imageio.ImageReadParam param)
                                  throws java.io.IOException
Deprecated. 
Reads the image indexed by imageIndex.

Parameters:
imageIndex - The index of the image to be retrieved.
param - Parameters used to control the reading process, or null.
Returns:
The desired portion of the image.
Throws:
java.io.IOException - if an input operation failed.

getDestination

protected final java.awt.image.BufferedImage getDestination(int imageIndex,
                                                            javax.imageio.ImageReadParam param)
                                                     throws java.io.IOException
Deprecated. 
Returns the 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.

Parameters:
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.
Returns:
The BufferedImage to which decoded pixel data should be written.
Throws:
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.


Copyright © GeoTools. All Rights Reserved.