to.etc.sjit
Class GifHandlerBase

java.lang.Object
  extended by to.etc.sjit.GifHandlerBase
Direct Known Subclasses:
GifIndexedHandler

public abstract class GifHandlerBase
extends java.lang.Object

Part of the GIF encoder, this class is the base class for each specialized BufferedImage writer. It contains the base code to determine where to write in the BufferedImage.


Field Summary
protected  java.awt.image.BufferedImage m_bi
           
protected  AnimGifDecoder m_gd
           
protected  int m_h
           
protected  GifImaMeta m_im
           
protected  int m_interlace_phase
           
protected  int m_out_e
           
protected  int m_out_o
           
protected  int m_type
           
protected  int m_w
           
protected  int m_x
           
protected  int m_y
           
 
Constructor Summary
GifHandlerBase(AnimGifDecoder gd, GifImaMeta im, int type)
           
 
Method Summary
protected  int getOffset()
           
protected  int getRunMax()
          Returns the #of pixels that can be written in one go, before end-of-line processing has to take place.
protected  int getX()
           
protected  int getY()
           
protected  void incrementPos(int nwritten)
          Increments the pixel position for when n pixels are written.
protected abstract  void pixels(byte[] pix, int len)
          Called when a new set of pixels is available.
protected abstract  java.awt.image.BufferedImage prepare()
          Called when the image-to-decode's metadata is known and decoding will commence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_gd

protected AnimGifDecoder m_gd

m_im

protected GifImaMeta m_im

m_type

protected int m_type

m_bi

protected java.awt.image.BufferedImage m_bi

m_interlace_phase

protected int m_interlace_phase

m_out_o

protected int m_out_o

m_x

protected int m_x

m_y

protected int m_y

m_out_e

protected int m_out_e

m_w

protected int m_w

m_h

protected int m_h
Constructor Detail

GifHandlerBase

public GifHandlerBase(AnimGifDecoder gd,
                      GifImaMeta im,
                      int type)
Method Detail

getRunMax

protected int getRunMax()
Returns the #of pixels that can be written in one go, before end-of-line processing has to take place.


incrementPos

protected void incrementPos(int nwritten)
Increments the pixel position for when n pixels are written. If the current position exceeds a line AND if we're interlaced a new position will be calculated.


getOffset

protected int getOffset()

getX

protected int getX()

getY

protected int getY()

prepare

protected abstract java.awt.image.BufferedImage prepare()
                                                 throws java.io.IOException
Called when the image-to-decode's metadata is known and decoding will commence. This will create the actual BufferedImage and will set up the code to write pixels to the image as fast as possible.

Throws:
java.io.IOException

pixels

protected abstract void pixels(byte[] pix,
                               int len)
                        throws java.io.IOException
Called when a new set of pixels is available. This writes the pixels to the appropriate position within the image.

Throws:
java.io.IOException