com.eteks.awt.image
Class GIFDecoder

java.lang.Object
  |
  +--com.eteks.awt.image.GIFDecoder
All Implemented Interfaces:
ImageProducer

public class GIFDecoder
extends Object
implements ImageProducer

An ImageProducer implementation that builds an image from a GIF input stream.
Image data is sent to consumers only when image build is complete. This class can be used without any link to java.awt package and an AWT toolkit.
The color model for this image is either an instance of java.awt.image.IndexColorModel or the default ARGB model. Default RGB model is used if java.awt.image.ColorModel class can't be instantiated for security or other reason (java.awt.image.ColorModel requires AWT library to be loaded). In that case, the method setPixels () of the interface java.awt.image.ImageConsumer will be called with the color model parameter set to null. No support for animated GIFs.

Since:
PJA1.2
Author:
Emmanuel Puybaret

Constructor Summary
GIFDecoder(InputStream input)
          Creates an instance of a GIF decoder for further reading from input.
 
Method Summary
 void addConsumer(ImageConsumer ic)
          ImageProducer implementation.
 boolean isConsumer(ImageConsumer ic)
          ImageProducer implementation.
 void removeConsumer(ImageConsumer ic)
          ImageProducer implementation.
 void requestTopDownLeftRightResend(ImageConsumer ic)
          ImageProducer implementation.
 void startProduction(ImageConsumer ic)
          ImageProducer implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GIFDecoder

public GIFDecoder(InputStream input)
Creates an instance of a GIF decoder for further reading from input. Image reading from the stream starts only at startProduction () or addConsumer () call.
Method Detail

startProduction

public void startProduction(ImageConsumer ic)
ImageProducer implementation.
Specified by:
startProduction in interface ImageProducer

addConsumer

public void addConsumer(ImageConsumer ic)
ImageProducer implementation.
Specified by:
addConsumer in interface ImageProducer

isConsumer

public boolean isConsumer(ImageConsumer ic)
ImageProducer implementation.
Specified by:
isConsumer in interface ImageProducer

removeConsumer

public void removeConsumer(ImageConsumer ic)
ImageProducer implementation.
Specified by:
removeConsumer in interface ImageProducer

requestTopDownLeftRightResend

public void requestTopDownLeftRightResend(ImageConsumer ic)
ImageProducer implementation.
Specified by:
requestTopDownLeftRightResend in interface ImageProducer