use of argparser.IntHolder in project artisynth_core by artisynth.
the class AnimatedGifWriter method main.
/**
* Main function
* Usage: java artisynth.core.moviemaker.AnimatedGifWriter [options] <list of input files> <output file>
*/
public static void main(String[] args) throws Exception {
DoubleHolder delayHolder = new DoubleHolder(0);
IntHolder loopHolder = new IntHolder(1);
String[] left = parseArgs(args, delayHolder, loopHolder);
if (left == null || left.length < 2) {
return;
}
ArrayList<BufferedImage> imageList = new ArrayList<BufferedImage>(left.length);
for (int i = 0; i < left.length - 1; i++) {
try {
BufferedImage image = ImageIO.read(new File(left[i]));
imageList.add(image);
} catch (Exception e) {
System.err.println("Cannot read " + left[i] + ", ignoring");
}
}
String outputFile = left[left.length - 1];
if (imageList.size() > 0) {
write(new File(outputFile), imageList, delayHolder.value, loopHolder.value);
}
}
Aggregations