wyvern.util
Class Giffer

java.lang.Object
  extended bywyvern.util.Giffer

public class Giffer
extends java.lang.Object

Object that writes out an image to the specified GIF file.

Version:
1.0, Sep 07, 1997
Author:
Steve Yegge

Constructor Summary
Giffer(java.awt.image.ImageProducer producer, java.lang.String filename)
           
Giffer(java.awt.Image img, java.lang.String filename)
          Write out the image as a GIF file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Giffer

public Giffer(java.awt.Image img,
              java.lang.String filename)
Write out the image as a GIF file. The GIF Encoder we use doesn't allow an ImageObserver to see the progress. I looked at the code, and there doesn't appear to be an obvious way to put that functionality in. You might be able to put a call to imageUpdate() in GIFNextPixel(), but that would probably slow things down horribly. I was hoping there was a way to be updated after each scanline, but by that time the data is being treated as a linear byte array. One hack we could do is spawn a thread to check the output file size a few times per second. We could probably make a good guess as to the final file size based on the image dimensions - even though GIF uses compression, it's probably not very good on our artwork, because there aren't big runs of a single color.

Parameters:
img - the Image to write to the file
filename - the name of the file to write

Giffer

public Giffer(java.awt.image.ImageProducer producer,
              java.lang.String filename)