All Packages Class Hierarchy This Package Index
Class jclass.image.GifConverter
java.lang.Object
|
+----jclass.image.GifConverter
- public class GifConverter
- extends Object
- implements ImageConsumer
The GifConverter class takes and image and writes it
to an OutputStream, in GIF format.
-
GifConverter(Image, OutputStream)
-
-
GifConverter(ImageProducer, OutputStream)
-
-
convert()
-
-
convertSynchronous()
- convertSynchronous() finds out which thread is doing
the image production then join()s it.
-
getThread()
- ImageProducers do their thing in their own thread.
-
imageComplete(int)
- The following methods are all ImageConsumer memebers and
are how GifConverter gets the image data
imageComplete() is called when the ImageProducer has sent
all its data to the ImageConsumer, thus this is our cue
to start doing the output in GIF format.
-
setColorModel(ColorModel)
-
-
setDestination(OutputStream)
-
-
setDimensions(int, int)
-
-
setHints(int)
-
-
setPixels(int, int, int, int, ColorModel, byte[], int, int)
- There are two flavours of setPixels() - one for 8 bit images, one for
24 bit images.
-
setPixels(int, int, int, int, ColorModel, int[], int, int)
-
-
setProperties(Hashtable)
- The properties are ignored, as they're undocumented anyways.
-
setSource(Image)
-
GifConverter
public GifConverter(ImageProducer ip,
OutputStream os)
GifConverter
public GifConverter(Image i,
OutputStream os)
setSource
public void setSource(Image i)
setDestination
public void setDestination(OutputStream os)
getThread
public Thread getThread()
- ImageProducers do their thing in their own thread.
Which thread is doing the work?
convert
public synchronized void convert() throws IOException
convertSynchronous
public synchronized void convertSynchronous() throws IOException
- convertSynchronous() finds out which thread is doing
the image production then join()s it.
imageComplete
public void imageComplete(int status)
- The following methods are all ImageConsumer memebers and
are how GifConverter gets the image data
imageComplete() is called when the ImageProducer has sent
all its data to the ImageConsumer, thus this is our cue
to start doing the output in GIF format.
setColorModel
public void setColorModel(ColorModel model)
setDimensions
public void setDimensions(int width,
int height)
setHints
public void setHints(int hints)
setPixels
public void setPixels(int x,
int y,
int w,
int h,
ColorModel model,
byte pixels[],
int off,
int scansize)
- There are two flavours of setPixels() - one for 8 bit images, one for
24 bit images. In theory you can't really predict which is going to get
called and due to sloppy specifications, you really can't predict it in
practice either. Therefore, GifConverter is set up to handle data coming
in through either version of setPixels().
setPixels
public void setPixels(int x,
int y,
int w,
int h,
ColorModel model,
int pixels[],
int off,
int scansize)
setProperties
public void setProperties(Hashtable props)
- The properties are ignored, as they're undocumented anyways.
All Packages Class Hierarchy This Package Index