|
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.ThumbnailRecorder
public class ThumbnailRecorder
A function module that performs an image capture of an X3D scene for the purpose of creating a thumbnail image. The requirements of the X3D world are:
| Field Summary | |
|---|---|
protected java.lang.String[] |
alphaTypes
Image encoding types that may have an alpha |
protected java.lang.Object |
canvas
The rendering surface |
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 boolean |
hasAlpha
Flag indicating that the selected encoding type may have an alpha |
protected int |
height
The height of the output images |
protected int |
imageARGB
|
protected int |
isBound_index
The index of the viewpoint's isBound field. |
protected RecorderListener |
listener
Listener for recorder status events |
protected int |
number
The sequence capture number, somewhat unnecessary as in this application, it only ever reaches one (1) |
protected java.io.File |
outputFile
The output file for the captured images |
protected boolean |
postProcess
Flag indicating that the image capture should be post processed |
protected long |
renderTime
The total frame rendering time |
protected int |
snapRGB
RGB value for snap pixels that should be replaced |
protected long |
startFrameTime
The last start of frame rendering time |
protected java.lang.String |
type
The image encoding type |
protected org.web3d.vrml.renderer.common.nodes.navigation.BaseViewpoint |
viewpoint
The viewpoint node, used when we have to wait for the named viewpoint to be bound |
protected java.lang.String |
viewpointName
The name of the x3d viewpoint to capture. |
protected int |
width
The width of the output images |
| Constructor Summary | |
|---|---|
ThumbnailRecorder(OGLConstruct construct)
Constructor |
|
| Method Summary | |
|---|---|
void |
fieldChanged(int index)
Listener for the viewpoint binding, if necessary |
double |
getFileTime()
Return the file write time in milliseconds |
double |
getRenderTime()
Return the frame rendering time in milliseconds |
void |
saveScreen(java.nio.Buffer buffer,
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 |
setBackgroundColor(java.awt.Color x3dBackgroundColor,
java.awt.Color imageBackgroundColor)
Set the background color for the image. |
boolean |
setEncoding(java.lang.String type)
Set the image encoding type |
boolean |
setOutputFile(java.io.File file)
Set the output file for the image |
void |
setSize(int width,
int height)
Set the image size |
void |
setViewpointName(java.lang.String name)
Set the DEF'ed name of the Viewpoint |
void |
start(RecorderListener listener)
Initiate the capture |
| 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 ErrorReporter errorReporter
protected java.lang.Object canvas
protected int number
protected java.lang.String viewpointName
protected org.web3d.vrml.renderer.common.nodes.navigation.BaseViewpoint viewpoint
protected int isBound_index
protected java.io.File outputFile
protected RecorderListener listener
protected int width
protected int height
protected java.lang.String type
protected boolean hasAlpha
protected java.lang.String[] alphaTypes
protected long fileTime
protected long renderTime
protected long startFrameTime
protected boolean postProcess
protected int snapRGB
protected int imageARGB
| Constructor Detail |
|---|
public ThumbnailRecorder(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 getRenderTime()
public double getFileTime()
public boolean setEncoding(java.lang.String type)
type - The image encoding type
public void setSize(int width,
int height)
width - The image widthheight - The image height
public void setBackgroundColor(java.awt.Color x3dBackgroundColor,
java.awt.Color imageBackgroundColor)
x3dBackgroundColor - The background color of the X3D model to
replace with the image background color. If null, the image background
will not be changed from the capture.imageBackgroundColor - The color to set for the image background.
If null, the image background will not be changed from the capture.public boolean setOutputFile(java.io.File file)
file - The output file for the image
public void setViewpointName(java.lang.String name)
name - The DEF'ed name of the Viewpointpublic void start(RecorderListener listener)
public void saveScreen(java.nio.Buffer buffer,
int width,
int height)
buffer - The screen capture bufferwidth - 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 | |||||||||