Class AbstractFrameTransfer<T>
- java.lang.Object
-
- io.tlf.jme.jfx.injfx.transfer.impl.AbstractFrameTransfer<T>
-
- Type Parameters:
T- the destination's type.
- All Implemented Interfaces:
FrameTransfer
- Direct Known Subclasses:
CanvasFrameTransfer,ImageFrameTransfer
public abstract class AbstractFrameTransfer<T> extends java.lang.Object implements FrameTransfer
The base implementation of a frame transfer.
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]byteBufferThe byte buffer.protected static intDISPOSED_STATEprotected static intDISPOSING_STATEprotected com.jme3.texture.FrameBufferframeBufferThe Frame buffer.protected java.nio.ByteBufferframeByteBufferThe Frame byte buffer.protected intframeCountHow many frames need to write else.protected java.util.concurrent.atomic.AtomicIntegerframeStateThe Frame state.protected byte[]imageByteBufferThe image byte buffer.protected java.util.concurrent.atomic.AtomicIntegerimageStateThe Image state.protected javafx.scene.image.PixelWriterpixelWriterThe Pixel writer.protected byte[]prevImageByteBufferThe prev image byte buffer.protected static intRUNNING_STATEprotected FrameTransferSceneProcessor.TransferModetransferModeThe transfer mode.protected static intWAITING_STATE
-
Constructor Summary
Constructors Constructor Description AbstractFrameTransfer(T destination, int width, int height, FrameTransferSceneProcessor.TransferMode transferMode)AbstractFrameTransfer(T destination, FrameTransferSceneProcessor.TransferMode transferMode, com.jme3.texture.FrameBuffer frameBuffer, int width, int height)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyFrameBufferToImage(com.jme3.renderer.RenderManager renderManager)Copy the content from render to the frameByteBuffer and write this content to javaFX.voiddispose()Dispose this transfer.protected voiddisposeImpl()Dispose.intgetHeight()Gets the height.protected byte[]getImageByteBuffer()Get the image byte buffer.protected javafx.scene.image.PixelWritergetPixelWriter(T destination, com.jme3.texture.FrameBuffer frameBuffer, int width, int height)Get the pixel writer.protected byte[]getPrevImageByteBuffer()Get the prev image byte buffer.intgetWidth()Gets the width.voidinitFor(com.jme3.renderer.Renderer renderer, boolean main)Init this transfer for the render.protected voidwriteFrame()Write content to image.
-
-
-
Field Detail
-
RUNNING_STATE
protected static final int RUNNING_STATE
- See Also:
- Constant Field Values
-
WAITING_STATE
protected static final int WAITING_STATE
- See Also:
- Constant Field Values
-
DISPOSING_STATE
protected static final int DISPOSING_STATE
- See Also:
- Constant Field Values
-
DISPOSED_STATE
protected static final int DISPOSED_STATE
- See Also:
- Constant Field Values
-
frameState
protected final java.util.concurrent.atomic.AtomicInteger frameState
The Frame state.
-
imageState
protected final java.util.concurrent.atomic.AtomicInteger imageState
The Image state.
-
frameBuffer
protected final com.jme3.texture.FrameBuffer frameBuffer
The Frame buffer.
-
pixelWriter
protected final javafx.scene.image.PixelWriter pixelWriter
The Pixel writer.
-
frameByteBuffer
protected final java.nio.ByteBuffer frameByteBuffer
The Frame byte buffer.
-
transferMode
protected final FrameTransferSceneProcessor.TransferMode transferMode
The transfer mode.
-
byteBuffer
protected final byte[] byteBuffer
The byte buffer.
-
imageByteBuffer
protected final byte[] imageByteBuffer
The image byte buffer.
-
prevImageByteBuffer
protected final byte[] prevImageByteBuffer
The prev image byte buffer.
-
frameCount
protected int frameCount
How many frames need to write else.
-
-
Constructor Detail
-
AbstractFrameTransfer
public AbstractFrameTransfer(T destination, int width, int height, FrameTransferSceneProcessor.TransferMode transferMode)
-
AbstractFrameTransfer
public AbstractFrameTransfer(T destination, FrameTransferSceneProcessor.TransferMode transferMode, com.jme3.texture.FrameBuffer frameBuffer, int width, int height)
-
-
Method Detail
-
initFor
public void initFor(com.jme3.renderer.Renderer renderer, boolean main)Description copied from interface:FrameTransferInit this transfer for the render.- Specified by:
initForin interfaceFrameTransfer- Parameters:
renderer- the render.main- true if this transfer is main.
-
getPixelWriter
protected javafx.scene.image.PixelWriter getPixelWriter(T destination, com.jme3.texture.FrameBuffer frameBuffer, int width, int height)
Get the pixel writer.- Parameters:
destination- the destination.frameBuffer- the frame buffer.width- the width.height- the height.- Returns:
- the pixel writer.
-
getWidth
public int getWidth()
Description copied from interface:FrameTransferGets the width.- Specified by:
getWidthin interfaceFrameTransfer- Returns:
- the width.
-
getHeight
public int getHeight()
Description copied from interface:FrameTransferGets the height.- Specified by:
getHeightin interfaceFrameTransfer- Returns:
- the height.
-
copyFrameBufferToImage
public void copyFrameBufferToImage(com.jme3.renderer.RenderManager renderManager)
Description copied from interface:FrameTransferCopy the content from render to the frameByteBuffer and write this content to javaFX.- Specified by:
copyFrameBufferToImagein interfaceFrameTransfer- Parameters:
renderManager- the render manager.
-
writeFrame
protected void writeFrame()
Write content to image.
-
getImageByteBuffer
protected byte[] getImageByteBuffer()
Get the image byte buffer.- Returns:
- the image byte buffer.
-
getPrevImageByteBuffer
protected byte[] getPrevImageByteBuffer()
Get the prev image byte buffer.- Returns:
- the prev image byte buffer.
-
dispose
public void dispose()
Description copied from interface:FrameTransferDispose this transfer.- Specified by:
disposein interfaceFrameTransfer
-
disposeImpl
protected void disposeImpl()
Dispose.
-
-