Package name.moore.kevin.ze.swing
Class sceneToImage
java.lang.Object
name.moore.kevin.ze.swing.sceneToImage
- All Implemented Interfaces:
com.jme3.post.SceneProcessor
This added to a viewport where it copies rendered frames (in memory) onto a specified Swing panel.
The processor wont function until attached to a
viewport and the imagepanel has been set.
- Author:
- Kevin Moore
<dev@kevin.moore.name>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ByteBufferprivate booleanprivate zImagePanelprivate static org.slf4j.Loggerprivate com.jme3.renderer.RenderManagerprivate com.jme3.renderer.ViewPort -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()voidinitialize(com.jme3.renderer.RenderManager rm, com.jme3.renderer.ViewPort vp)Called when the viewport is rendered.booleanvoidpostFrame(com.jme3.texture.FrameBuffer out)Update the CPU image's contents after the scene has been rendered to the framebuffer.voidpostQueue(com.jme3.renderer.queue.RenderQueue rq)voidpreFrame(float tpf)voidreshape(com.jme3.renderer.ViewPort vp, int w, int h)voidsetPanel(zImagePanel zp)voidsetProfiler(com.jme3.profile.AppProfiler profiler)voidcalled when the frame is completed - takes a copy of the offscreen buffer and paints it onto the swing component.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
cpuBuf
-
jimagepanel
-
viewport
private com.jme3.renderer.ViewPort viewport -
rendermanger
private com.jme3.renderer.RenderManager rendermanger -
init
private boolean init
-
-
Constructor Details
-
sceneToImage
public sceneToImage(int w, int h)- Parameters:
w-h-
-
-
Method Details
-
setPanel
-
initialize
public void initialize(com.jme3.renderer.RenderManager rm, com.jme3.renderer.ViewPort vp)Called when the viewport is rendered.- Specified by:
initializein interfacecom.jme3.post.SceneProcessor- Parameters:
rm-vp-
-
reshape
public void reshape(com.jme3.renderer.ViewPort vp, int w, int h)- Specified by:
reshapein interfacecom.jme3.post.SceneProcessor
-
isInitialized
public boolean isInitialized()- Specified by:
isInitializedin interfacecom.jme3.post.SceneProcessor
-
preFrame
public void preFrame(float tpf)- Specified by:
preFramein interfacecom.jme3.post.SceneProcessor
-
postQueue
public void postQueue(com.jme3.renderer.queue.RenderQueue rq)- Specified by:
postQueuein interfacecom.jme3.post.SceneProcessor
-
postFrame
public void postFrame(com.jme3.texture.FrameBuffer out)Update the CPU image's contents after the scene has been rendered to the framebuffer. Called after a frame has been rendered and the queue flushed.- Specified by:
postFramein interfacecom.jme3.post.SceneProcessor
-
cleanup
public void cleanup()- Specified by:
cleanupin interfacecom.jme3.post.SceneProcessor
-
setProfiler
public void setProfiler(com.jme3.profile.AppProfiler profiler)- Specified by:
setProfilerin interfacecom.jme3.post.SceneProcessor
-
updateImageContents
public void updateImageContents()called when the frame is completed - takes a copy of the offscreen buffer and paints it onto the swing component.
-