http://www.eteks.com

com.eteks.awt.image
Class GIFDecoder

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

public class GIFDecoder
extends java.lang.Object
implements java.awt.image.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
Version:
2.4
Author:
Emmanuel Puybaret

Constructor Summary
GIFDecoder(java.io.InputStream input)
          Creates an instance of a GIF decoder for further reading from input.
GIFDecoder(java.io.InputStream input, boolean closeWhenFinished)
          Creates an instance of a GIF decoder for further reading from input.
 
Method Summary
 void addConsumer(java.awt.image.ImageConsumer ic)
          ImageProducer implementation.
 boolean isConsumer(java.awt.image.ImageConsumer ic)
          ImageProducer implementation.
 void removeConsumer(java.awt.image.ImageConsumer ic)
          ImageProducer implementation.
 void requestTopDownLeftRightResend(java.awt.image.ImageConsumer ic)
          ImageProducer implementation.
 void startProduction(java.awt.image.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(java.io.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. By default, input isn't closed once image reading is done.

GIFDecoder

public GIFDecoder(java.io.InputStream input,
                  boolean closeWhenFinished)
Creates an instance of a GIF decoder for further reading from input. Image reading from the stream starts only at startProduction () or addConsumer () call.
Parameters:
input - an input stream
closeWhenFinished - if true then input will be closed once image reading will be done.
Since:
PJA2.4
Method Detail

startProduction

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

addConsumer

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

isConsumer

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

removeConsumer

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

requestTopDownLeftRightResend

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

© 1997-2001 eTeks - All rights reserved