it.geosolutions.imageio.plugins.swan
Class SwanImageReader

Object
  extended by ImageReader
      extended by SwanImageReader

public final class SwanImageReader
extends ImageReader

Author:
Daniele Romagnoli, GeoSolutions., Simone Giannecchini, GeoSolutions.

Field Summary
 
Fields inherited from class ImageReader
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales
 
Constructor Summary
SwanImageReader(SwanImageReaderSpi originatingProvider)
          Constructor.
 
Method Summary
 boolean canReadRaster()
           
 void dispose()
           
 int getHeight(int imageIndex)
           
 int getImageIndexFromTauAndDatasets(int requiredForecast, int requiredQuantity)
          This auxiliary method provide to retrieve a proper imageIndex to access the required raster contained within the input file which may have data for several forecast and several SWAN output quantities.
 IIOMetadata getImageMetadata(int imageIndex)
           
 Iterator getImageTypes(int imageIndex)
           
 int getIndexFromQuantityName(String quantityName)
          Return the index related to a specified SWAN quantity
 int getNumImages(boolean allowSearch)
           
 IIOMetadata getStreamMetadata()
           
 int getTileHeight(int imageIndex)
           
 int getTileWidth(int imageIndex)
           
 int getWidth(int imageIndex)
           
 BufferedImage read(int imageIndex)
           
 BufferedImage read(int imageIndex, ImageReadParam param)
           
 RenderedImage readAsRenderedImage(int imageIndex, ImageReadParam param)
           
 BufferedImage readTile(int imageIndex, int tileX, int tileY)
           
 Raster readTileRaster(int imageIndex, int tileX, int tileY)
           
 void reset()
          Resets this SwanImageReader.
static ColorModel retrieveColorModel(SampleModel sm)
           
 void setInput(Object input)
           
 void setInput(Object input, boolean seekForwardOnly)
           
 void setInput(Object input, boolean seekForwardOnly, boolean ignoreMetadata)
           
 
Methods inherited from class ImageReader
abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, checkReadParamBandSettings, clearAbortRequest, computeRegions, getAspectRatio, getAvailableLocales, getDefaultReadParam, getDestination, getFormatName, getImageMetadata, getInput, getLocale, getMinIndex, getNumThumbnails, getOriginatingProvider, getRawImageType, getSourceRegion, getStreamMetadata, getThumbnailHeight, getThumbnailWidth, getTileGridXOffset, getTileGridYOffset, hasThumbnails, isIgnoringMetadata, isImageTiled, isRandomAccessEasy, isSeekForwardOnly, processImageComplete, processImageProgress, processImageStarted, processImageUpdate, processPassComplete, processPassStarted, processReadAborted, processSequenceComplete, processSequenceStarted, processThumbnailComplete, processThumbnailPassComplete, processThumbnailPassStarted, processThumbnailProgress, processThumbnailStarted, processThumbnailUpdate, processWarningOccurred, processWarningOccurred, readAll, readAll, readerSupportsThumbnails, readRaster, readThumbnail, removeAllIIOReadProgressListeners, removeAllIIOReadUpdateListeners, removeAllIIOReadWarningListeners, removeIIOReadProgressListener, removeIIOReadUpdateListener, removeIIOReadWarningListener, setLocale
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwanImageReader

public SwanImageReader(SwanImageReaderSpi originatingProvider)
Constructor. It builts up an SwanImageReader by providing an SwanImageReaderSpi

Parameters:
originatingProvider -
Method Detail

getHeight

public int getHeight(int imageIndex)
              throws IOException
Specified by:
getHeight in class ImageReader
Throws:
IOException

getImageTypes

public Iterator getImageTypes(int imageIndex)
                       throws IOException
Specified by:
getImageTypes in class ImageReader
Throws:
IOException

retrieveColorModel

public static ColorModel retrieveColorModel(SampleModel sm)

getNumImages

public int getNumImages(boolean allowSearch)
                 throws IOException
Specified by:
getNumImages in class ImageReader
Throws:
IOException

getStreamMetadata

public IIOMetadata getStreamMetadata()
                              throws IOException
Specified by:
getStreamMetadata in class ImageReader
Throws:
IOException

getImageMetadata

public IIOMetadata getImageMetadata(int imageIndex)
                             throws IOException
Specified by:
getImageMetadata in class ImageReader
Throws:
IOException

getWidth

public int getWidth(int imageIndex)
             throws IOException
Specified by:
getWidth in class ImageReader
Throws:
IOException

read

public BufferedImage read(int imageIndex,
                          ImageReadParam param)
                   throws IOException
Specified by:
read in class ImageReader
Throws:
IOException

getImageIndexFromTauAndDatasets

public int getImageIndexFromTauAndDatasets(int requiredForecast,
                                           int requiredQuantity)
This auxiliary method provide to retrieve a proper imageIndex to access the required raster contained within the input file which may have data for several forecast and several SWAN output quantities.

Parameters:
requiredForecast - the forecast for which we need data. (starts from zero)
requiredQuantity - the quantity for which we need data. (starts from zero)
Returns:
an imageIndex needed to access the required raster.

getIndexFromQuantityName

public int getIndexFromQuantityName(String quantityName)
Return the index related to a specified SWAN quantity

Parameters:
quantityName - the name of the required SWAN quantity
Returns:

setInput

public void setInput(Object input)
Overrides:
setInput in class ImageReader

setInput

public void setInput(Object input,
                     boolean seekForwardOnly,
                     boolean ignoreMetadata)
Overrides:
setInput in class ImageReader

setInput

public void setInput(Object input,
                     boolean seekForwardOnly)
Overrides:
setInput in class ImageReader

read

public BufferedImage read(int imageIndex)
                   throws IOException
Overrides:
read in class ImageReader
Throws:
IOException

readAsRenderedImage

public RenderedImage readAsRenderedImage(int imageIndex,
                                         ImageReadParam param)
                                  throws IOException
Overrides:
readAsRenderedImage in class ImageReader
Throws:
IOException

readTile

public BufferedImage readTile(int imageIndex,
                              int tileX,
                              int tileY)
                       throws IOException
Overrides:
readTile in class ImageReader
Throws:
IOException

readTileRaster

public Raster readTileRaster(int imageIndex,
                             int tileX,
                             int tileY)
                      throws IOException
Overrides:
readTileRaster in class ImageReader
Throws:
IOException

canReadRaster

public boolean canReadRaster()
Overrides:
canReadRaster in class ImageReader

reset

public void reset()
Resets this SwanImageReader.

Overrides:
reset in class ImageReader
See Also:
ImageReader.reset()

dispose

public void dispose()
Overrides:
dispose in class ImageReader

getTileHeight

public int getTileHeight(int imageIndex)
                  throws IOException
Overrides:
getTileHeight in class ImageReader
Throws:
IOException

getTileWidth

public int getTileWidth(int imageIndex)
                 throws IOException
Overrides:
getTileWidth in class ImageReader
Throws:
IOException


Copyright © 2006-2010 GeoSolutions. All Rights Reserved.