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, writepublic GIFWriter()
public GIFWriter(ImageParam param)
public void finishWrite(java.io.OutputStream os)
throws java.lang.Exception
os - OutputStream for the animated GIFjava.lang.Exceptionpublic ImageType getImageType()
getImageType in class ImageWriterpublic 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.Exceptionpublic void setLoopCount(int loopCount)
protected void write(int[] pixels,
int imageWidth,
int imageHeight,
java.io.OutputStream os)
throws java.lang.Exception
ImageWriterwrite in class ImageWriterpixels - input image array in ARGB formatimageWidth - image widthimageHeight - image heightos - OutputSteam to write the imagejava.lang.Exceptionpublic 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.Exceptionpublic void writeAnimatedGIF(GIFFrame[] frames, java.io.OutputStream os) throws java.lang.Exception
frames - an array of GIFFrameos - OutputStream for the animated GIFjava.lang.Exceptionpublic 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.Exceptionpublic void writeComment(java.io.OutputStream os,
java.lang.String comment)
throws java.lang.Exception
java.lang.Exceptionpublic void writeFrame(java.io.OutputStream os,
GIFFrame frame)
throws java.lang.Exception
java.lang.Exceptionpublic void writeFrame(java.io.OutputStream os,
java.awt.image.BufferedImage frame)
throws java.lang.Exception
java.lang.Exceptionpublic void writeFrame(java.io.OutputStream os,
java.awt.image.BufferedImage frame,
int delay)
throws java.lang.Exception
java.lang.Exception