org.geotools.image.io
Class TextMatrixImageReader

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

public class TextMatrixImageReader
extends TextImageReader

An image decoder for matrix of floating-point numbers.

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

Nested Class Summary
static class TextMatrixImageReader.Spi
          Service provider interface (SPI) for TextMatrixImageReaders.
 
Field Summary
 
Fields inherited from class javax.imageio.ImageReader
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales
 
Constructor Summary
protected TextMatrixImageReader(javax.imageio.spi.ImageReaderSpi provider)
          Construct a new image reader storing pixels as DataBuffer.TYPE_FLOAT.
 
Method Summary
 javax.media.jai.util.Range getExpectedRange(int imageIndex, int bandIndex)
          Returns the expected range of values for a band.
 int getHeight(int imageIndex)
          Returns the height in pixels of the given image within the input source.
 int getWidth(int imageIndex)
          Returns the width in pixels of the given image within the input source.
 java.awt.image.BufferedImage read(int imageIndex, javax.imageio.ImageReadParam param)
          Reads the image indexed by .
 void reset()
          Restores the image reader to its initial state.
 void setInput(java.lang.Object input, boolean seekForwardOnly, boolean ignoreMetadata)
          Sets the input source to use.
 
Methods inherited from class org.geotools.image.io.TextImageReader
getCharset, getLineFormat, getPadValue, getPositionString, getRawDataType, getReader
 
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, getDefaultReadParam, 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
 

Constructor Detail

TextMatrixImageReader

protected TextMatrixImageReader(javax.imageio.spi.ImageReaderSpi provider)
Construct a new image reader storing pixels as DataBuffer.TYPE_FLOAT.

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

reset

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

Overrides:
reset in class TextImageReader

setInput

public void setInput(java.lang.Object input,
                     boolean seekForwardOnly,
                     boolean ignoreMetadata)
Sets the input source to use. Input may be one of the following object (in preference order): File, URL, BufferedReader, Reader, InputStream or ImageInputStream.

Overrides:
setInput in class TextImageReader

getWidth

public int getWidth(int imageIndex)
             throws java.io.IOException
Returns the width in pixels of the given image within the input source.

Parameters:
imageIndex - the index of the image to be queried.
Returns:
Image width.
Throws:
java.io.IOException - If an error occurs reading the width information from the input source.

getHeight

public int getHeight(int imageIndex)
              throws java.io.IOException
Returns the height in pixels of the given image within the input source. Calling this method may force loading of full image.

Parameters:
imageIndex - the index of the image to be queried.
Returns:
Image height.
Throws:
java.io.IOException - If an error occurs reading the height information from the input source.

read

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

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.

getExpectedRange

public javax.media.jai.util.Range getExpectedRange(int imageIndex,
                                                   int bandIndex)
                                            throws java.io.IOException
Returns the expected range of values for a band. Calling this method may force loading of full image.

Specified by:
getExpectedRange in class SimpleImageReader
Parameters:
imageIndex - The image index.
bandIndex - The band index.
Returns:
The expected range of values, or if unknow.
Throws:
java.io.IOException - If an error occurs reading the data information from the input source.


Copyright © GeoTools. All Rights Reserved.