org.opensourcephysics.media.core
Class ImageVideoRecorder

java.lang.Object
  extended by org.opensourcephysics.media.core.ScratchVideoRecorder
      extended by org.opensourcephysics.media.core.ImageVideoRecorder
All Implemented Interfaces:
VideoRecorder

public class ImageVideoRecorder
extends ScratchVideoRecorder

This is an image video recorder that uses scratch files.

Version:
1.0
Author:
Douglas Brown

Constructor Summary
ImageVideoRecorder()
          Constructs a default ImageVideoRecorder object.
ImageVideoRecorder(ImageVideoType type)
          Constructs a ImageVideoRecorder object for a specific image type.
 
Method Summary
 Video getVideo()
          Gets the video.
 void reset()
          Discards the current video and resets the recorder to a ready state.
 java.lang.String saveVideo(java.lang.String fileName)
          Saves all video images to a numbered sequence of files.
 void setExpectedFrameCount(int n)
          Sets the expected frame count.
 
Methods inherited from class org.opensourcephysics.media.core.ScratchVideoRecorder
addFrame, createVideo, createVideo, getFileName, saveVideo, saveVideoAs, setFileName, setFrameDuration, setSize, suggestFileName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageVideoRecorder

public ImageVideoRecorder()
Constructs a default ImageVideoRecorder object.


ImageVideoRecorder

public ImageVideoRecorder(ImageVideoType type)
Constructs a ImageVideoRecorder object for a specific image type.

Method Detail

getVideo

public Video getVideo()
               throws java.io.IOException
Gets the video.

Specified by:
getVideo in interface VideoRecorder
Overrides:
getVideo in class ScratchVideoRecorder
Returns:
the video
Throws:
java.io.IOException

saveVideo

public java.lang.String saveVideo(java.lang.String fileName)
                           throws java.io.IOException
Saves all video images to a numbered sequence of files.

Specified by:
saveVideo in interface VideoRecorder
Overrides:
saveVideo in class ScratchVideoRecorder
Parameters:
fileName - the file name basis for images
Returns:
the full path of the first image in the sequence
Throws:
java.io.IOException

setExpectedFrameCount

public void setExpectedFrameCount(int n)
Sets the expected frame count.

Parameters:
n - the expected frame count

reset

public void reset()
Discards the current video and resets the recorder to a ready state.

Specified by:
reset in interface VideoRecorder
Overrides:
reset in class ScratchVideoRecorder