kinetic.util.MovieEncoder
Class SequenceExporter

java.lang.Object
  |
  +--kinetic.util.MovieEncoder.SequenceExporter
All Implemented Interfaces:
BufferedImageSource

public class SequenceExporter
extends java.lang.Object
implements BufferedImageSource

this is a utility class that lets you easily take a completed animation sequence and push it out to a Quicktime file. Each frame can take as long as it need to render its image.


Field Summary
protected  java.awt.image.BufferedImage bufferedImg1
           
protected  java.awt.image.BufferedImage bufferedImg2
           
protected  java.awt.Dimension d
           
protected  double duration
           
protected  SequenceExportEventListener el
           
protected  float frameRate
           
protected  java.awt.Graphics2D graphicsHandle1
           
protected  java.awt.Graphics2D graphicsHandle2
           
protected  java.awt.geom.AffineTransform identity
           
protected  boolean isComplete
           
protected  double lastTime
           
protected  int motionBlur
           
protected  java.awt.Component panel
           
protected  java.awt.Rectangle screenRect
           
protected  kinetic.Sequence seq
           
protected  boolean updateScreen
           
 
Constructor Summary
SequenceExporter(java.awt.Component p, kinetic.Sequence s, double dur, float frameRate)
          creates a new instance of a sequence exporter.
 
Method Summary
 boolean endOfMedia()
           
 void export(java.lang.String filename, float quality)
           
 float getFrameRate()
           
 int getHeight()
           
 int getWidth()
           
 java.awt.image.BufferedImage read(long frameNumber)
           
 void setEventListener(SequenceExportEventListener e)
          set if you want to be able to respond to the exporter events such as a progress bar
 void setMotionBlur(int blur)
          allows you to set the motion blur output of the exporter.
 void setMotionBlur(int blur, double shutterAngle, double shutterPhase)
          allows you to set the motion blur output of the exporter.
 void updateCanvas(boolean update)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

panel

protected java.awt.Component panel

d

protected java.awt.Dimension d

screenRect

protected java.awt.Rectangle screenRect

frameRate

protected float frameRate

seq

protected kinetic.Sequence seq

duration

protected double duration

isComplete

protected boolean isComplete

bufferedImg1

protected java.awt.image.BufferedImage bufferedImg1

graphicsHandle1

protected java.awt.Graphics2D graphicsHandle1

bufferedImg2

protected java.awt.image.BufferedImage bufferedImg2

graphicsHandle2

protected java.awt.Graphics2D graphicsHandle2

identity

protected java.awt.geom.AffineTransform identity

updateScreen

protected boolean updateScreen

motionBlur

protected int motionBlur

lastTime

protected double lastTime

el

protected SequenceExportEventListener el
Constructor Detail

SequenceExporter

public SequenceExporter(java.awt.Component p,
                        kinetic.Sequence s,
                        double dur,
                        float frameRate)
creates a new instance of a sequence exporter. by default, the exporter updates the canvas during export.

Parameters:
p - the drawing canvas
s - the animation sequence
dur - the desired duration of movie (seconds)
frameRate - the desired frameRate of the movie (fps)
Method Detail

setEventListener

public void setEventListener(SequenceExportEventListener e)
set if you want to be able to respond to the exporter events such as a progress bar

Parameters:
e - an export event listener

endOfMedia

public boolean endOfMedia()
Specified by:
endOfMedia in interface BufferedImageSource

getWidth

public int getWidth()
Specified by:
getWidth in interface BufferedImageSource

getHeight

public int getHeight()
Specified by:
getHeight in interface BufferedImageSource

getFrameRate

public float getFrameRate()
Specified by:
getFrameRate in interface BufferedImageSource

updateCanvas

public void updateCanvas(boolean update)

setMotionBlur

public void setMotionBlur(int blur)
allows you to set the motion blur output of the exporter. This is initially set to 0 (no temporal super sampling). 16 would be considered high quality motion bluring.

Parameters:
blur - number of temporally super sampled to render

setMotionBlur

public void setMotionBlur(int blur,
                          double shutterAngle,
                          double shutterPhase)
allows you to set the motion blur output of the exporter. This is initially set to 0 (no temporal super sampling). 16 would be considered high quality motion bluring. Shutter angle and shutter phase allow greater control of the motion blurring. Shutter angle (0-360 degrees) controls how much of the interframe interval is closed and shutterPhase (0-360 degrees) determines the location of the "open time" is in the inter frame interval.

Parameters:
blur - number of images to render per frame
shutterAngle - shutter angle 0-360 degrees. 180 by default
shutterPhase - shutter phase 0-360 degrees. 0 by default.

read

public java.awt.image.BufferedImage read(long frameNumber)
Specified by:
read in interface BufferedImageSource

export

public void export(java.lang.String filename,
                   float quality)