All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class picture.GifEncoder

java.lang.Object
   |
   +----picture.ImageEncoder
           |
           +----picture.GifEncoder

public class GifEncoder
extends ImageEncoder
Write out an image as a GIF.

Fetch the software.
Fetch the entire Acme package.

See Also:
ToGif

Variable Index

 o a_count
 o accum
 o BITS
 o clear_flg
 o ClearCode
 o codetab
 o colorHash
 o CountDown
 o cur_accum
 o cur_bits
 o curx
 o cury
 o EOF
 o EOFCode
 o free_ent
 o g_init_bits
 o Height
 o height
 o hsize
 o HSIZE
 o htab
 o Interlace
 o interlace
 o masks
 o maxbits
 o maxcode
 o maxmaxcode
 o n_bits
 o Pass
 o rgbPixels
 o width
 o Width

Constructor Index

 o GifEncoder(Image, OutputStream)
Constructor from Image.
 o GifEncoder(Image, OutputStream, boolean)
Constructor from Image with interlace setting.
 o GifEncoder(ImageProducer, OutputStream)
Constructor from ImageProducer.
 o GifEncoder(ImageProducer, OutputStream, boolean)
Constructor from ImageProducer with interlace setting.

Method Index

 o BumpPixel()
 o char_init()
 o char_out(byte, OutputStream)
 o cl_block(OutputStream)
 o cl_hash(int)
 o compress(int, OutputStream)
 o encodeDone()
Subclasses implement this to finish an encoding.
 o encodePixels(int, int, int, int, int[], int, int)
Subclasses implement this to actually write out some bits.
 o encodeStart(int, int)
Subclasses implement this to initialize an encoding.
 o flush_char(OutputStream)
 o GetPixel(int, int)
 o GIFEncode(OutputStream, int, int, boolean, byte, int, int, byte[], byte[], byte[])
 o GIFNextPixel()
 o MAXCODE(int)
 o output(int, OutputStream)
 o Putbyte(byte, OutputStream)
 o Putword(int, OutputStream)
 o writeString(OutputStream, String)

Variables

 o interlace
 private boolean interlace
 o width
 int width
 o height
 int height
 o rgbPixels
 int rgbPixels[][]
 o colorHash
 IntHashtable colorHash
 o Width
 int Width
 o Height
 int Height
 o Interlace
 boolean Interlace
 o curx
 int curx
 o cury
 int cury
 o CountDown
 int CountDown
 o Pass
 int Pass
 o EOF
 static final int EOF
 o BITS
 static final int BITS
 o HSIZE
 static final int HSIZE
 o n_bits
 int n_bits
 o maxbits
 int maxbits
 o maxcode
 int maxcode
 o maxmaxcode
 int maxmaxcode
 o htab
 int htab[]
 o codetab
 int codetab[]
 o hsize
 int hsize
 o free_ent
 int free_ent
 o clear_flg
 boolean clear_flg
 o g_init_bits
 int g_init_bits
 o ClearCode
 int ClearCode
 o EOFCode
 int EOFCode
 o cur_accum
 int cur_accum
 o cur_bits
 int cur_bits
 o masks
 int masks[]
 o a_count
 int a_count
 o accum
 byte accum[]

Constructors

 o GifEncoder
 public GifEncoder(Image img,
                   OutputStream out) throws IOException
Constructor from Image.

Parameters:
img - The image to encode.
out - The stream to write the GIF to.
 o GifEncoder
 public GifEncoder(Image img,
                   OutputStream out,
                   boolean interlace) throws IOException
Constructor from Image with interlace setting.

Parameters:
img - The image to encode.
out - The stream to write the GIF to.
interlace - Whether to interlace.
 o GifEncoder
 public GifEncoder(ImageProducer prod,
                   OutputStream out) throws IOException
Constructor from ImageProducer.

Parameters:
prod - The ImageProducer to encode.
out - The stream to write the GIF to.
 o GifEncoder
 public GifEncoder(ImageProducer prod,
                   OutputStream out,
                   boolean interlace) throws IOException
Constructor from ImageProducer with interlace setting.

Parameters:
prod - The ImageProducer to encode.
out - The stream to write the GIF to.

Methods

 o encodeStart
 void encodeStart(int width,
                  int height) throws IOException
Subclasses implement this to initialize an encoding.

Overrides:
encodeStart in class ImageEncoder
 o encodePixels
 void encodePixels(int x,
                   int y,
                   int w,
                   int h,
                   int rgbPixels[],
                   int off,
                   int scansize) throws IOException
Subclasses implement this to actually write out some bits.

Overrides:
encodePixels in class ImageEncoder
 o encodeDone
 void encodeDone() throws IOException
Subclasses implement this to finish an encoding.

Overrides:
encodeDone in class ImageEncoder
 o GetPixel
 byte GetPixel(int x,
               int y) throws IOException
 o writeString
 static void writeString(OutputStream out,
                         String str) throws IOException
 o GIFEncode
 void GIFEncode(OutputStream outs,
                int Width,
                int Height,
                boolean Interlace,
                byte Background,
                int Transparent,
                int BitsPerPixel,
                byte Red[],
                byte Green[],
                byte Blue[]) throws IOException
 o BumpPixel
 void BumpPixel()
 o GIFNextPixel
 int GIFNextPixel() throws IOException
 o Putword
 void Putword(int w,
              OutputStream outs) throws IOException
 o Putbyte
 void Putbyte(byte b,
              OutputStream outs) throws IOException
 o MAXCODE
 final int MAXCODE(int n_bits)
 o compress
 void compress(int init_bits,
               OutputStream outs) throws IOException
 o output
 void output(int code,
             OutputStream outs) throws IOException
 o cl_block
 void cl_block(OutputStream outs) throws IOException
 o cl_hash
 void cl_hash(int hsize)
 o char_init
 void char_init()
 o char_out
 void char_out(byte c,
               OutputStream outs) throws IOException
 o flush_char
 void flush_char(OutputStream outs) throws IOException

All Packages  Class Hierarchy  This Package  Previous  Next  Index