public class GIFWriter extends ImageWriter
Constructor and Description |
---|
GIFWriter() |
GIFWriter(ImageParam param) |
Modifier and Type | Method and Description |
---|---|
void |
finishWrite(java.io.OutputStream os)
This is intended to be called after writing all the frames if we write
an animated GIF frame by frame.
|
ImageType |
getImageType() |
void |
prepareForWrite(java.io.OutputStream os,
int logicalScreenWidth,
int logicalScreenHeight)
This is intended to be called first when writing an animated GIF
frame by frame.
|
void |
setLoopCount(int loopCount) |
protected void |
write(int[] pixels,
int imageWidth,
int imageHeight,
java.io.OutputStream os)
The actual image writing method to be implemented by any specific ImageWriter subclass
|
void |
writeAnimatedGIF(java.awt.image.BufferedImage[] images,
int[] delays,
java.io.OutputStream os)
Writes an array of BufferedImage as an animated GIF
|
void |
writeAnimatedGIF(GIFFrame[] frames,
java.io.OutputStream os)
Writes an array of GIFFrame as an animated GIF
|
void |
writeAnimatedGIF(java.util.List<GIFFrame> frames,
java.io.OutputStream os)
Writes a list of GIFFrame as an animated GIF
|
void |
writeComment(java.io.OutputStream os,
java.lang.String comment) |
void |
writeFrame(java.io.OutputStream os,
java.awt.image.BufferedImage frame) |
void |
writeFrame(java.io.OutputStream os,
java.awt.image.BufferedImage frame,
int delay) |
void |
writeFrame(java.io.OutputStream os,
GIFFrame frame) |
getImageParam, setImageParam, write
public GIFWriter()
public GIFWriter(ImageParam param)
public void finishWrite(java.io.OutputStream os) throws java.lang.Exception
os
- OutputStream for the animated GIFjava.lang.Exception
public ImageType getImageType()
getImageType
in class ImageWriter
public void prepareForWrite(java.io.OutputStream os, int logicalScreenWidth, int logicalScreenHeight) throws java.lang.Exception
os
- OutputStream for the animated GIFlogicalScreenWidth
- width of the logical screen. If it is less than
or equal zero, it will be determined from the first framelogicalScreenHeight
- height of the logical screen. If it is less than
or equal zero, it will be determined from the first framejava.lang.Exception
public void setLoopCount(int loopCount)
protected void write(int[] pixels, int imageWidth, int imageHeight, java.io.OutputStream os) throws java.lang.Exception
ImageWriter
write
in class ImageWriter
pixels
- input image array in ARGB formatimageWidth
- image widthimageHeight
- image heightos
- OutputSteam to write the imagejava.lang.Exception
public void writeAnimatedGIF(java.awt.image.BufferedImage[] images, int[] delays, java.io.OutputStream os) throws java.lang.Exception
images
- an array of BufferedImagedelays
- delays in millisecond for each frameos
- OutputStream for the animated GIFjava.lang.Exception
public void writeAnimatedGIF(GIFFrame[] frames, java.io.OutputStream os) throws java.lang.Exception
frames
- an array of GIFFrameos
- OutputStream for the animated GIFjava.lang.Exception
public void writeAnimatedGIF(java.util.List<GIFFrame> frames, java.io.OutputStream os) throws java.lang.Exception
frames
- a list of GIFFrameos
- OutputStream for the animated GIFjava.lang.Exception
public void writeComment(java.io.OutputStream os, java.lang.String comment) throws java.lang.Exception
java.lang.Exception
public void writeFrame(java.io.OutputStream os, GIFFrame frame) throws java.lang.Exception
java.lang.Exception
public void writeFrame(java.io.OutputStream os, java.awt.image.BufferedImage frame) throws java.lang.Exception
java.lang.Exception
public void writeFrame(java.io.OutputStream os, java.awt.image.BufferedImage frame, int delay) throws java.lang.Exception
java.lang.Exception