org.geotools.image.io.text
Class TextMatrixImageReader

java.lang.Object
  extended by javax.imageio.ImageReader
      extended by org.geotools.image.io.GeographicImageReader
          extended by org.geotools.image.io.StreamImageReader
              extended by org.geotools.image.io.text.TextImageReader
                  extended by org.geotools.image.io.text.TextMatrixImageReader

public class TextMatrixImageReader
extends TextImageReader

An image decoder for matrix of floating-point numbers. The default implementation creates rasters of DataBuffer.TYPE_FLOAT. An easy way to change this type is to overwrite the GeographicImageReader.getRawDataType(int) method.

Since:
2.4
Version:
$Id: TextMatrixImageReader.java 30679 2008-06-13 10:19:41Z acuster $
Author:
Martin Desruisseaux (IRD)

Nested Class Summary
static class TextMatrixImageReader.Spi
          Service provider interface (SPI) for TextMatrixImageReaders.
 
Field Summary
 
Fields inherited from class org.geotools.image.io.StreamImageReader
closeOnReset
 
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)
          Constructs a new image reader.
 
Method Summary
 void close()
          Closes the input stream and disposes the resources that was specific to that stream.
 int getHeight(int imageIndex)
          Returns the height in pixels of the given image within the input source.
 javax.imageio.metadata.IIOMetadata getImageMetadata(int imageIndex)
          Returns metadata associated with the given image.
 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 imageIndex.
 
Methods inherited from class org.geotools.image.io.text.TextImageReader
getCharset, getLineFormat, getPadValue, getPositionString, getReader, isComment
 
Methods inherited from class org.geotools.image.io.StreamImageReader
dispose, finalize, getInputStream, getStreamLength, reset, setInput
 
Methods inherited from class org.geotools.image.io.GeographicImageReader
checkBandIndex, checkImageIndex, collapseNoDataValues, flipVertically, getDefaultReadParam, getDestination, getDimension, getGeographicMetadata, getImageTypes, getNumBands, getNumImages, getRawDataType, getRawImageType, getRawImageType, getStreamMetadata, read, warningOccurred
 
Methods inherited from class javax.imageio.ImageReader
abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, canReadRaster, checkReadParamBandSettings, clearAbortRequest, computeRegions, 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, 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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextMatrixImageReader

protected TextMatrixImageReader(javax.imageio.spi.ImageReaderSpi provider)
Constructs a new image reader.

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

getWidth

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

Specified by:
getWidth in class javax.imageio.ImageReader
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.

Specified by:
getHeight in class javax.imageio.ImageReader
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.

getImageMetadata

public javax.imageio.metadata.IIOMetadata getImageMetadata(int imageIndex)
                                                    throws java.io.IOException
Returns metadata associated with the given image. Calling this method may force loading of full image.

Overrides:
getImageMetadata in class GeographicImageReader
Parameters:
imageIndex - The image index.
Returns:
The metadata, or null if none.
Throws:
java.io.IOException - If an error occurs reading the data 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 imageIndex.

Specified by:
read in class javax.imageio.ImageReader
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.

close

public void close()
           throws java.io.IOException
Closes the input stream and disposes the resources that was specific to that stream.

Overrides:
close in class TextImageReader
Throws:
java.io.IOException - if an error occured while closing the stream.
See Also:
StreamImageReader.closeOnReset


Copyright © 1996-2010 Geotools. All Rights Reserved.