|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.media.core.ScratchVideoRecorder
org.opensourcephysics.media.core.ImageVideoRecorder
public class ImageVideoRecorder
This is an image video recorder that uses scratch files.
| Field Summary | |
|---|---|
protected int |
frameCount
|
| Fields inherited from class org.opensourcephysics.media.core.ScratchVideoRecorder |
|---|
canRecord, chooser, chooserField, chosenExtension, dim, ext, frameDuration, frameImage, hasContent, ignoreChooser, isSaved, saveChanges, saveFile, scratchFile, scratchName, scratchNumber, suggestedFileName, tempDirectory, tempFilePrefix, tempFiles, videoType |
| Constructor Summary | |
|---|---|
ImageVideoRecorder()
Constructs a default ImageVideoRecorder object. |
|
ImageVideoRecorder(ImageVideoType type)
Constructs a ImageVideoRecorder object for a specific image type. |
|
| Method Summary | |
|---|---|
protected boolean |
append(java.awt.Image image)
Appends a frame to the current video by saving the image in a tempFile. |
protected void |
finalize()
Called by the garbage collector when this recorder is no longer in use. |
protected static int |
getAppendedNumber(java.lang.String path)
|
protected static java.lang.String |
getBase(java.lang.String path)
|
protected static java.lang.String[] |
getFileNames(java.lang.String fileName,
int length)
|
protected java.io.File |
getFileToBeSaved(java.io.File file)
Return the file that will be saved if the specified file is selected. |
Video |
getVideo()
Gets the video. |
void |
reset()
Discards the current video and resets the recorder to a ready state. |
protected static java.lang.String[] |
saveImages(java.lang.String fileName,
java.awt.image.BufferedImage[] images)
Saves images to a numbered sequence of jpg files. |
protected void |
saveScratch()
Required by ScratchVideoRecorder, but unused. |
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. |
protected boolean |
startRecording()
Starts the video recording process. |
| Methods inherited from class org.opensourcephysics.media.core.ScratchVideoRecorder |
|---|
addFrame, createScratch, createVideo, createVideo, deleteTempFiles, getFileName, getScratchExtension, saveVideo, saveVideoAs, selectFile, setFileName, setFrameDuration, setSize, suggestFileName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int frameCount
| Constructor Detail |
|---|
public ImageVideoRecorder()
public ImageVideoRecorder(ImageVideoType type)
type - the image type| Method Detail |
|---|
public Video getVideo()
throws java.io.IOException
getVideo in interface VideoRecordergetVideo in class ScratchVideoRecorderjava.io.IOException
public java.lang.String saveVideo(java.lang.String fileName)
throws java.io.IOException
saveVideo in interface VideoRecordersaveVideo in class ScratchVideoRecorderfileName - the file name basis for images
java.io.IOExceptionpublic void setExpectedFrameCount(int n)
n - the expected frame countpublic void reset()
reset in interface VideoRecorderreset in class ScratchVideoRecorderprotected void finalize()
finalize in class ScratchVideoRecorder
protected void saveScratch()
throws java.io.IOException
saveScratch in class ScratchVideoRecorderjava.io.IOExceptionprotected boolean startRecording()
startRecording in class ScratchVideoRecorderprotected boolean append(java.awt.Image image)
append in class ScratchVideoRecorderimage - the image to append
protected java.io.File getFileToBeSaved(java.io.File file)
getFileToBeSaved in class ScratchVideoRecorderfile - the file selected with the chooser
protected static java.lang.String[] saveImages(java.lang.String fileName,
java.awt.image.BufferedImage[] images)
throws java.io.IOException
fileName - the file name basis for imagesimages - the images to save
java.io.IOException
protected static java.lang.String[] getFileNames(java.lang.String fileName,
int length)
protected static java.lang.String getBase(java.lang.String path)
protected static int getAppendedNumber(java.lang.String path)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||