artisynth.core.moviemaker
Class AnimatedGifWriter

java.lang.Object
  extended by artisynth.core.moviemaker.AnimatedGifWriter

public class AnimatedGifWriter
extends java.lang.Object

Creates an animated Gif. Code adapted from discussions on the Oracle Forums: https://forums.oracle.com/thread/1264385

Author:
Antonio

Constructor Summary
AnimatedGifWriter()
           
 
Method Summary
static void main(java.lang.String[] args)
          Main function Usage: java artisynth.core.moviemaker.AnimatedGifWriter [options]
static java.lang.String[] parseArgs(java.lang.String[] args, argparser.DoubleHolder delayHolder, argparser.IntHolder loopHolder)
          Parses options, fills in the delay and loop values
static void parseArgs(java.lang.String args, argparser.DoubleHolder delayHolder, argparser.IntHolder loopHolder)
          Parses a string containing options, fills in the delay and loop values
static void write(java.io.File file, java.awt.image.BufferedImage[] frames, double delayTime, int loopCount)
          Writes a sequence of images to an animated GIF
static void write(java.io.File file, java.util.List<? extends java.awt.image.BufferedImage> frames, double delayTime, int loopCount)
          Writes a sequence of images to an animated GIF
static void write(java.io.File out, java.lang.String[] fileNames, double delayTime, int loopCount)
          Writes a sequence of images to an animated GIF
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnimatedGifWriter

public AnimatedGifWriter()
Method Detail

write

public static void write(java.io.File file,
                         java.awt.image.BufferedImage[] frames,
                         double delayTime,
                         int loopCount)
                  throws java.io.IOException
Writes a sequence of images to an animated GIF

Parameters:
file - output file
frames - input image sequence
delayTime - time between frames (s)
loopCount - number of times to loop (-1 for infinite)
Throws:
java.io.IOException - if cannot write to the output file

write

public static void write(java.io.File file,
                         java.util.List<? extends java.awt.image.BufferedImage> frames,
                         double delayTime,
                         int loopCount)
                  throws java.io.IOException
Writes a sequence of images to an animated GIF

Parameters:
file - output file
frames - input image sequence
delayTime - time between frames (s)
loopCount - number of times to loop (-1 for infinite)
Throws:
java.io.IOException - if cannot write to the output file

write

public static void write(java.io.File out,
                         java.lang.String[] fileNames,
                         double delayTime,
                         int loopCount)
                  throws java.io.IOException
Writes a sequence of images to an animated GIF

Parameters:
out - output file
fileNames - list of input frame file names (any supported format)
delayTime - time between frames (s)
loopCount - number of times to loop (-1 for infinite)
Throws:
java.io.IOException - if cannot read or write files

parseArgs

public static void parseArgs(java.lang.String args,
                             argparser.DoubleHolder delayHolder,
                             argparser.IntHolder loopHolder)
Parses a string containing options, fills in the delay and loop values

Parameters:
args - list of arguments
delayHolder - output delay time (s)
loopHolder - output loop count

parseArgs

public static java.lang.String[] parseArgs(java.lang.String[] args,
                                           argparser.DoubleHolder delayHolder,
                                           argparser.IntHolder loopHolder)
Parses options, fills in the delay and loop values

Parameters:
args - list of arguments
delayHolder - output delay time (s)
loopHolder - output loop count

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Main function Usage: java artisynth.core.moviemaker.AnimatedGifWriter [options]

Throws:
java.lang.Exception