artofillusion.image
Class ImageSaver

java.lang.Object
  extended by artofillusion.image.ImageSaver

public class ImageSaver
extends java.lang.Object

This class is used to save rendered images to disk.


Field Summary
static int FORMAT_BMP
           
static int FORMAT_HDR
           
static int FORMAT_JPEG
           
static int FORMAT_PNG
           
static int FORMAT_QUICKTIME
           
static int FORMAT_TIFF
           
 
Constructor Summary
ImageSaver(BFrame parent)
          Create an ImageSaver object which will be used for saving a single images.
ImageSaver(BFrame parent, int width, int height, int fps, int startFrameNumber)
          Create an ImageSaver object which will be used for saving an animation.
 
Method Summary
 boolean clickedOk()
          Determine whether the user canceled saving the image.
 void lastMovieImage()
          This should be called after the last frame of an animation has been saved.
 boolean saveImage(ComplexImage img)
          Save the next image to disk.
static boolean saveImage(ComplexImage img, java.io.File f, int format, int quality)
          Save an image to disk in the specified format.
 boolean saveImage(java.awt.Image im)
          Save the next image to disk.
static boolean saveImage(java.awt.Image im, java.io.File f, int format, int quality)
          Save an image to disk in the specified format.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORMAT_JPEG

public static final int FORMAT_JPEG
See Also:
Constant Field Values

FORMAT_TIFF

public static final int FORMAT_TIFF
See Also:
Constant Field Values

FORMAT_PNG

public static final int FORMAT_PNG
See Also:
Constant Field Values

FORMAT_BMP

public static final int FORMAT_BMP
See Also:
Constant Field Values

FORMAT_HDR

public static final int FORMAT_HDR
See Also:
Constant Field Values

FORMAT_QUICKTIME

public static final int FORMAT_QUICKTIME
See Also:
Constant Field Values
Constructor Detail

ImageSaver

public ImageSaver(BFrame parent)
Create an ImageSaver object which will be used for saving a single images. The constructor displays a dialog in which the user can select the name, location, and format. The saveImage() method can then be used to save individual frames of the animation. Use clickedOk() to determine whether the user clicked the OK or Cancel button.


ImageSaver

public ImageSaver(BFrame parent,
                  int width,
                  int height,
                  int fps,
                  int startFrameNumber)
           throws java.io.IOException
Create an ImageSaver object which will be used for saving an animation. The constructor displays a dialog in which the user can select the name, location, and format. The saveImage() method can then be used to save individual frames of the animation, and lastMovieImage() should be called once all frames have been saved. Use clickedOk() to determine whether the user clicked the OK or Cancel button.

Parameters:
parent - the parent window
width - the image width, in pixels
height - the image height, in pixels
fps - the number of frames per second
startFrameNumber - the default number for the first frame of the animation
Throws:
java.io.IOException
Method Detail

clickedOk

public boolean clickedOk()
Determine whether the user canceled saving the image.


saveImage

public boolean saveImage(java.awt.Image im)
                  throws java.io.IOException
Save the next image to disk. Returns false if an error occurs.

Throws:
java.io.IOException

saveImage

public boolean saveImage(ComplexImage img)
                  throws java.io.IOException
Save the next image to disk. Returns false if an error occurs.

Throws:
java.io.IOException

saveImage

public static boolean saveImage(java.awt.Image im,
                                java.io.File f,
                                int format,
                                int quality)
                         throws java.io.IOException,
                                java.lang.InterruptedException
Save an image to disk in the specified format. Returns true if the image was successfully saved, false if an error occurred. For JPEG, quality should be between 0 and 100. For other formats, it is ignored.

Throws:
java.io.IOException
java.lang.InterruptedException

saveImage

public static boolean saveImage(ComplexImage img,
                                java.io.File f,
                                int format,
                                int quality)
                         throws java.io.IOException,
                                java.lang.InterruptedException
Save an image to disk in the specified format. Returns true if the image was successfully saved, false if an error occurred. For JPEG, quality should be between 0 and 100. For other formats, it is ignored.

Throws:
java.io.IOException
java.lang.InterruptedException

lastMovieImage

public void lastMovieImage()
                    throws java.io.IOException
This should be called after the last frame of an animation has been saved.

Throws:
java.io.IOException


Copyright © 1999-2011 by Peter Eastman.