uk.ac.starlink.jaiutil
Class HDXDecoder

java.lang.Object
  extended by com.sun.media.jai.codec.ImageDecoderImpl
      extended by uk.ac.starlink.jaiutil.HDXDecoder
All Implemented Interfaces:
com.sun.media.jai.codec.ImageDecoder

public class HDXDecoder
extends com.sun.media.jai.codec.ImageDecoderImpl

An ImageDecoder for the HDX file format.

Version:
$Id$
Author:
Allan Brighton, Peter W. Draper

Field Summary
 
Fields inherited from class com.sun.media.jai.codec.ImageDecoderImpl
input, param
 
Constructor Summary
HDXDecoder(com.sun.media.jai.codec.SeekableStream input, com.sun.media.jai.codec.ImageDecodeParam param)
          Constructor
 
Method Summary
 RenderedImage decodeAsRenderedImage()
          Return the current RenderedImage that has been extracted from the SeekableStream,
 RenderedImage decodeAsRenderedImage(int page)
          Returns a RenderedImage that contains the decoded contents of the SeekableStream associated with this ImageDecoder.
 int getNumPages()
          Returns the number of pages (NDXs) present in the current stream.
 
Methods inherited from class com.sun.media.jai.codec.ImageDecoderImpl
decodeAsRaster, decodeAsRaster, getInputStream, getParam, setParam
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HDXDecoder

public HDXDecoder(com.sun.media.jai.codec.SeekableStream input,
                  com.sun.media.jai.codec.ImageDecodeParam param)
           throws IOException
Constructor

Throws:
IOException
Method Detail

decodeAsRenderedImage

public RenderedImage decodeAsRenderedImage()
                                    throws IOException
Return the current RenderedImage that has been extracted from the SeekableStream,

Specified by:
decodeAsRenderedImage in interface com.sun.media.jai.codec.ImageDecoder
Overrides:
decodeAsRenderedImage in class com.sun.media.jai.codec.ImageDecoderImpl
Throws:
IOException

decodeAsRenderedImage

public RenderedImage decodeAsRenderedImage(int page)
                                    throws IOException
Returns a RenderedImage that contains the decoded contents of the SeekableStream associated with this ImageDecoder. The given page of a multi-page image is decoded. If the page does not exist, an IOException will be thrown. Page numbering begins at zero. For HDX "pages" are just the NDXs.

Specified by:
decodeAsRenderedImage in interface com.sun.media.jai.codec.ImageDecoder
Specified by:
decodeAsRenderedImage in class com.sun.media.jai.codec.ImageDecoderImpl
Throws:
IOException

getNumPages

public int getNumPages()
                throws IOException
Returns the number of pages (NDXs) present in the current stream.

Note: The HDX codec defines properties, such as "#num_pages", "#hdx_image", and "#preview_image" that give direct access to the NDXs, so that you can tell ahead of time if an HDX structure contains an image.

Specified by:
getNumPages in interface com.sun.media.jai.codec.ImageDecoder
Overrides:
getNumPages in class com.sun.media.jai.codec.ImageDecoderImpl
Throws:
IOException


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.