|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xj3d.ui.awt.browser.ogl.TimeSensorSceneRecorder
public class TimeSensorSceneRecorder
A function module that performs a sequenced image capture of an embedded X3D world animation. The requirements of the X3D world are:
| Field Summary | |
|---|---|
protected java.lang.Object |
canvas
The rendering surface |
protected VirtualTimeSensorManager |
clock
The clock controller |
protected OGLConstruct |
construct
The construct instance to record from |
protected OGLStandardBrowserCore |
core
The browser core |
protected ErrorReporter |
errorReporter
The error reporting mechanism |
protected long |
fileTime
The total file write time |
protected java.text.NumberFormat |
fmt
Formatter for creating the image sequence identifier |
protected int |
fraction_changed_index
The field index of the time sensor's fraction_changed field. |
protected int |
height
The height of the output images |
protected RecorderListener |
listener
Listener for recorder status events |
protected int |
number
The sequence capture number, used as the file name |
protected java.io.File |
outputDir
The output directory for the captured images |
protected boolean |
recordingComplete
Flag indicating that the timer sensor has completed a cycle |
protected long |
renderTime
The total frame rendering time |
protected long |
startFrameTime
The last start of frame rendering time |
protected org.web3d.vrml.renderer.common.nodes.time.BaseTimeSensor |
timeSensor
The x3d time sensor node that controls the viewpoint animation |
protected java.lang.String |
timeSensorName
The name of the x3d time sensor node that controls the viewpoint animation. |
protected java.lang.String |
type
The image encoding type |
protected int |
width
The width of the output images |
| Constructor Summary | |
|---|---|
TimeSensorSceneRecorder(OGLConstruct construct)
Constructor |
|
| Method Summary | |
|---|---|
void |
fieldChanged(int index)
Listener for the end of the animation sequence |
double |
getAverageFileTime()
Return the average file write time in milliseconds |
double |
getAverageRenderTime()
Return the average frame rendering time in milliseconds |
void |
saveScreen(java.nio.Buffer buffer,
java.lang.String name,
int width,
int height)
Process the screen capture buffer into a BufferedImage and save it to a file |
void |
screenCaptured(java.nio.Buffer buffer)
Notification of a new screen capture. |
void |
setEncoding(java.lang.String type)
Set the image encoding type |
void |
setFrameRate(int framesPerSecond)
Set the recording rate |
void |
setOutputDirectory(java.io.File dir)
Set the output directory for images |
void |
setSize(int width,
int height)
Set the image size |
void |
setTimeSensorName(java.lang.String name)
Set the DEF'ed name of the time sensor |
void |
start(RecorderListener listener)
Initiate the capture sequence |
void |
stop()
Terminate the capture sequence |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected OGLConstruct construct
protected OGLStandardBrowserCore core
protected VirtualTimeSensorManager clock
protected ErrorReporter errorReporter
protected java.lang.Object canvas
protected int number
protected java.text.NumberFormat fmt
protected org.web3d.vrml.renderer.common.nodes.time.BaseTimeSensor timeSensor
protected java.lang.String timeSensorName
protected int fraction_changed_index
protected java.io.File outputDir
protected RecorderListener listener
protected boolean recordingComplete
protected int width
protected int height
protected java.lang.String type
protected long fileTime
protected long renderTime
protected long startFrameTime
| Constructor Detail |
|---|
public TimeSensorSceneRecorder(OGLConstruct construct)
construct - The construct instance to record from| Method Detail |
|---|
public void screenCaptured(java.nio.Buffer buffer)
screenCaptured in interface ScreenCaptureListenerbuffer - The screen capturepublic void fieldChanged(int index)
fieldChanged in interface VRMLNodeListenerindex - The index of the field that has changedpublic double getAverageRenderTime()
public double getAverageFileTime()
public void setEncoding(java.lang.String type)
type - The image encoding type
public void setSize(int width,
int height)
width - The image widthheight - The image heightpublic void setFrameRate(int framesPerSecond)
framesPerSecond - The frames per virtual second to recordpublic void setOutputDirectory(java.io.File dir)
dir - The output directory for imagespublic void setTimeSensorName(java.lang.String name)
name - The DEF'ed name of the time sensorpublic void start(RecorderListener listener)
public void stop()
public void saveScreen(java.nio.Buffer buffer,
java.lang.String name,
int width,
int height)
buffer - The screen capture buffername - The file name prefixwidth - The width of the imageheight - The height of the image
|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||