com.sun.jimi.core
Class JimiSingleImageRasterDecoder

java.lang.Object
  |
  +--com.sun.jimi.core.util.ProgressMonitorSupport
        |
        +--com.sun.jimi.core.JimiRasterDecoderSupport
              |
              +--com.sun.jimi.core.JimiSingleImageRasterDecoder
Direct Known Subclasses:
APFDecoder

public abstract class JimiSingleImageRasterDecoder
extends JimiRasterDecoderSupport

Base class providing support for JimiDecoders for single-image formats.


Fields inherited from class com.sun.jimi.core.JimiRasterDecoderSupport
cleanupCommands, factory, input, noMoreRequests
 
Fields inherited from class com.sun.jimi.core.util.ProgressMonitorSupport
currentProgressLevel, progressListener
 
Constructor Summary
JimiSingleImageRasterDecoder()
           
 
Method Summary
abstract  void doImageDecode()
          Populate the image created in doInitDecoding with pixel data.
abstract  MutableJimiRasterImage doInitDecoding(JimiImageFactory factory, java.io.InputStream input)
          Initialize decoding by reading headers and creating the image representation.
 void driveDecoding()
           
 java.io.InputStream getInput()
          Get the stream to read image data from.
 JimiImageFactory getJimiImageFactory()
          Get the factory for creating JimiImages from.
 ImageSeriesDecodingController initDecoding(JimiImageFactory factory, java.io.InputStream input)
           
 void setProgress(int progressLevel)
          Set the amount of progress the decoder has made.
 
Methods inherited from class com.sun.jimi.core.JimiRasterDecoderSupport
addCleanupCommand, cleanup, init, setFinished
 
Methods inherited from class com.sun.jimi.core.util.ProgressMonitorSupport
setProgressListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JimiSingleImageRasterDecoder

public JimiSingleImageRasterDecoder()
Method Detail

initDecoding

public ImageSeriesDecodingController initDecoding(JimiImageFactory factory,
                                                  java.io.InputStream input)

driveDecoding

public void driveDecoding()

doInitDecoding

public abstract MutableJimiRasterImage doInitDecoding(JimiImageFactory factory,
                                                      java.io.InputStream input)
                                               throws JimiException,
                                                      java.io.IOException
Initialize decoding by reading headers and creating the image representation. The image should not be populated with any pixels in this method.
Parameters:
factory - the factory from which to create the image
input - the stream to read image data from
Throws:
JimiException - if the data from the stream is invalid or cannot be handled
java.io.IOException - if an error is encountered trying to read from the stream

doImageDecode

public abstract void doImageDecode()
                            throws JimiException,
                                   java.io.IOException
Populate the image created in doInitDecoding with pixel data.

setProgress

public void setProgress(int progressLevel)
Set the amount of progress the decoder has made.
Parameters:
progressLevel - the percentage of the image that has been decoded
Overrides:
setProgress in class ProgressMonitorSupport

getJimiImageFactory

public JimiImageFactory getJimiImageFactory()
Get the factory for creating JimiImages from.
Overrides:
getJimiImageFactory in class JimiRasterDecoderSupport

getInput

public java.io.InputStream getInput()
Get the stream to read image data from.
Overrides:
getInput in class JimiRasterDecoderSupport