All Packages Class Hierarchy This Package Previous Next Index
Class att.grappa.GIFEncoder
java.lang.Object
|
+----att.grappa.GIFEncoder
- public class GIFEncoder
- extends Object
GIFEncoder is a class which takes an image and saves it to a stream
using the GIF file format (Graphics Interchange
Format). A GIFEncoder
is constructed using an AWT Image (which must be fully
loaded). The image can be written out with a
call to Write
.
Three caveats:
GIFEncoder is based upon gifsave.c, which was written and released
by:
Sverre H. Huseby
Bjoelsengt. 17
N-0468 Oslo
Norway
Phone: +47 2 230539
sverrehu@ifi.uio.no
Many hands at many different times contributed to the writing of this
class as it appears here.
- Version:
- 1.1, 30 Sep 1999
- Author:
- John Mocenigo, Research @ AT&T Labs
-
GIFEncoder(Image)
- Creates a
GIFEncoder
instance and encodes the supplied
image.
-
GIFEncoder(Image, int)
- Creates a
GIFEncoder
instance and encodes the supplied
image.
-
Write(OutputStream)
- Writes the image out to a stream in the GIF file format.
GIFEncoder
public GIFEncoder(Image image,
int colors) throws AWTException, OutOfMemoryError, IOException
- Creates a
GIFEncoder
instance and encodes the supplied
image.
- Parameters:
- image - the AWT Image to be GIF encoded.
- colors - the maximum number of colors the GIF will use. To minimize
memory usage, the GIFEncoder assumes in advance that 256
colors will be used (thus the output GIF may contains more
bytes than truly needed), if a maximum is known in advance
this can reduce the size of the resulting GIF image a bit.
- Throws: AWTException
- whenever
java.awt.image.PixelGrabber
fails or there more than the specified number of colors
- Throws: OutOfMemoryError
- whenever there is not enough memory to allocate the arrays needed for encoding
GIFEncoder
public GIFEncoder(Image image) throws AWTException, OutOfMemoryError, IOException
- Creates a
GIFEncoder
instance and encodes the supplied
image.
- Parameters:
- image - the AWT Image to be GIF encoded.
- Throws: AWTException
- whenever
java.awt.image.PixelGrabber
fails or there more than 256 colors
- Throws: OutOfMemoryError
- whenever there is not enough memory to allocate the arrays needed for encoding
Write
public void Write(OutputStream output) throws IOException
- Writes the image out to a stream in the GIF file format. The output will
be a single GIF87a image, non-interlaced, with no background color.
- Parameters:
- output - the OutputStream for writing the GIF image
- Throws: IOException
- whenever there is a problem writing to the stream
All Packages Class Hierarchy This Package Previous Next Index