- java.lang.Object
-
- org.deepsymmetry.GifSequenceWriter
-
public class GifSequenceWriter extends Object
This class will generate an animated GIF from a sequence of individual images. Embedded in Wayang to facilitate capturing animations and interfaces rendered on the Push, for producing great online documentation. Originally created by Elliot Kroo on 2009-04-25. See http://elliot.kroo.net/software/java/GifSequenceWriter/ James Elliott split the constructor into a variety of different versions, to accommodate the needs of Wayang. This work is licensed under the Creative Commons Attribution 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.- Author:
- Elliot Kroo (elliot[at]kroo[dot]net)
-
-
Field Summary
Fields Modifier and Type Field Description protected ImageWritergifWriterprotected IIOMetadataimageMetaDataprotected ImageWriteParamimageWriteParam
-
Constructor Summary
Constructors Constructor Description GifSequenceWriter(ImageOutputStream outputStream, int imageType, int timeBetweenFramesMS, boolean loopContinuously)Creates a new GifSequenceWriterGifSequenceWriter(ImageOutputStream outputStream, RenderedImage image, int timeBetweenFramesMS, boolean loopContinuously)Creates a new GifSequenceWriter from an existing buffered image.GifSequenceWriter(ImageOutputStream outputStream, ImageTypeSpecifier imageTypeSpecifier, int timeBetweenFramesMS, boolean loopContinuously)Creates a new GifSequenceWriter
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close this GifSequenceWriter object.static voidmain(String[] args)Support invocation from the command line; provide a list of input file names, followed by a single output file name.voidwriteToSequence(RenderedImage img)
-
-
-
Field Detail
-
gifWriter
protected ImageWriter gifWriter
-
imageWriteParam
protected ImageWriteParam imageWriteParam
-
imageMetaData
protected IIOMetadata imageMetaData
-
-
Constructor Detail
-
GifSequenceWriter
public GifSequenceWriter(ImageOutputStream outputStream, RenderedImage image, int timeBetweenFramesMS, boolean loopContinuously) throws IIOException, IOException
Creates a new GifSequenceWriter from an existing buffered image.- Parameters:
outputStream- the ImageOutputStream to be written toimage- the source image that will be written to the outputtimeBetweenFramesMS- the time between frames in milisecondsloopContinuously- wether the gif should loop repeatedly- Throws:
IIOException- if no gif ImageWriters are foundIOException
-
GifSequenceWriter
public GifSequenceWriter(ImageOutputStream outputStream, int imageType, int timeBetweenFramesMS, boolean loopContinuously) throws IIOException, IOException
Creates a new GifSequenceWriter- Parameters:
outputStream- the ImageOutputStream to be written toimageType- one of the imageTypes specified in BufferedImagetimeBetweenFramesMS- the time between frames in milisecondsloopContinuously- wether the gif should loop repeatedly- Throws:
IIOException- if no gif ImageWriters are foundIOException
-
GifSequenceWriter
public GifSequenceWriter(ImageOutputStream outputStream, ImageTypeSpecifier imageTypeSpecifier, int timeBetweenFramesMS, boolean loopContinuously) throws IIOException, IOException
Creates a new GifSequenceWriter- Parameters:
outputStream- the ImageOutputStream to be written toimageTypeSpecifier- the type of images to be writtentimeBetweenFramesMS- the time between frames in milisecondsloopContinuously- wether the gif should loop repeatedly- Throws:
IIOException- if no gif ImageWriters are foundIOException
-
-
Method Detail
-
writeToSequence
public void writeToSequence(RenderedImage img) throws IOException
- Throws:
IOException
-
close
public void close() throws IOExceptionClose this GifSequenceWriter object. This does not close the underlying stream, just finishes off the GIF.- Throws:
IOException- if there is a problem writing the last bytes.
-
main
public static void main(String[] args) throws Exception
Support invocation from the command line; provide a list of input file names, followed by a single output file name.- Parameters:
args- the names of the image files to be combined into a GIF sequence, folloewd by the output file name.- Throws:
Exception- if there is a problem reading the inputs or writing the output.
-
-