Copyright 2011-01-06 Werner Randelshofer

ch.randelshofer.media.ilbm
Class ILBMImageReader

java.lang.Object
  extended by javax.imageio.ImageReader
      extended by ch.randelshofer.media.ilbm.ILBMImageReader

public class ILBMImageReader
extends javax.imageio.ImageReader

Reads an image in the Amiga IFF Interleaved Bitmap image format (ILBM).

Version:
1.0 2009-12-17 Created.
Author:
Werner Randelshofer

Field Summary
 
Fields inherited from class javax.imageio.ImageReader
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales
 
Constructor Summary
ILBMImageReader(ILBMImageReaderSpi originatingProvider)
           
 
Method Summary
 float getAspectRatio(int imageIndex)
          Returns the aspect ratio of the given image (that is, its width divided by its height) as a float.
 int getHeight(int imageIndex)
           
 javax.imageio.metadata.IIOMetadata getImageMetadata(int imageIndex)
           
 java.util.Iterator<javax.imageio.ImageTypeSpecifier> getImageTypes(int imageIndex)
           
 int getNumImages(boolean allowSearch)
           
 javax.imageio.metadata.IIOMetadata getStreamMetadata()
           
 int getWidth(int imageIndex)
           
 java.awt.image.BufferedImage read(int imageIndex, javax.imageio.ImageReadParam param)
           
 
Methods inherited from class javax.imageio.ImageReader
abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, canReadRaster, checkReadParamBandSettings, clearAbortRequest, computeRegions, dispose, getAvailableLocales, getDefaultReadParam, getDestination, getFormatName, getImageMetadata, getInput, getLocale, getMinIndex, getNumThumbnails, getOriginatingProvider, getRawImageType, 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, reset, setInput, setInput, setInput, setLocale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ILBMImageReader

public ILBMImageReader(ILBMImageReaderSpi originatingProvider)
Method Detail

getNumImages

public int getNumImages(boolean allowSearch)
                 throws java.io.IOException
Specified by:
getNumImages in class javax.imageio.ImageReader
Throws:
java.io.IOException

getWidth

public int getWidth(int imageIndex)
             throws java.io.IOException
Specified by:
getWidth in class javax.imageio.ImageReader
Throws:
java.io.IOException

getHeight

public int getHeight(int imageIndex)
              throws java.io.IOException
Specified by:
getHeight in class javax.imageio.ImageReader
Throws:
java.io.IOException

getImageTypes

public java.util.Iterator<javax.imageio.ImageTypeSpecifier> getImageTypes(int imageIndex)
                                                                   throws java.io.IOException
Specified by:
getImageTypes in class javax.imageio.ImageReader
Throws:
java.io.IOException

getAspectRatio

public float getAspectRatio(int imageIndex)
                     throws java.io.IOException
Returns the aspect ratio of the given image (that is, its width divided by its height) as a float. For images that are inherently resizable, this method provides a way to determine the appropriate width given a deired height, or vice versa. For non-resizable images, the true width and height are used.

The default implementation simply returns (float)getWidth(imageIndex)/getHeight(imageIndex).

Overrides:
getAspectRatio in class javax.imageio.ImageReader
Parameters:
imageIndex - the index of the image to be queried.
Returns:
a float indicating the aspect ratio of the given image.
Throws:
java.lang.IllegalStateException - if the input source has not been set.
java.lang.IndexOutOfBoundsException - if the supplied index is out of bounds.
java.io.IOException - if an error occurs during reading.

getStreamMetadata

public javax.imageio.metadata.IIOMetadata getStreamMetadata()
                                                     throws java.io.IOException
Specified by:
getStreamMetadata in class javax.imageio.ImageReader
Throws:
java.io.IOException

getImageMetadata

public javax.imageio.metadata.IIOMetadata getImageMetadata(int imageIndex)
                                                    throws java.io.IOException
Specified by:
getImageMetadata in class javax.imageio.ImageReader
Throws:
java.io.IOException

read

public java.awt.image.BufferedImage read(int imageIndex,
                                         javax.imageio.ImageReadParam param)
                                  throws java.io.IOException
Specified by:
read in class javax.imageio.ImageReader
Throws:
java.io.IOException

Copyright 2011-01-06 Werner Randelshofer