public class LwjglImage extends Image
Image.ImageChannelOrder, Image.ImageChannelType, Image.ImageDescriptor, Image.ImageFormat, Image.ImageMapping, Image.ImageTypeOpenCLObject.ObjectReleaserreleaser| Constructor and Description |
|---|
LwjglImage(org.lwjgl.opencl.CLMem image) |
| Modifier and Type | Method and Description |
|---|---|
Event |
acquireImageForSharingAsync(CommandQueue queue)
Aquires this image object for using.
|
void |
acquireImageForSharingNoEvent(CommandQueue queue)
Aquires this image object for using.
|
void |
copyTo(CommandQueue queue,
Image dest,
long[] srcOrigin,
long[] destOrigin,
long[] region)
Performs a blocking copy operation from one image to another.
|
Event |
copyToAsync(CommandQueue queue,
Image dest,
long[] srcOrigin,
long[] destOrigin,
long[] region)
Performs an async/non-blocking copy operation from one image to another.
|
Event |
copyToBufferAsync(CommandQueue queue,
Buffer dest,
long[] srcOrigin,
long[] srcRegion,
long destOffset)
Copies this image into the specified buffer, no format conversion is done.
|
static int |
decodeImageChannelOrder(Image.ImageChannelOrder order) |
static int |
decodeImageChannelType(Image.ImageChannelType type) |
static int |
decodeImageType(Image.ImageType type) |
static Image.ImageChannelOrder |
encodeImageChannelOrder(int order) |
static Image.ImageChannelType |
encodeImageChannelType(int type) |
static Image.ImageType |
encodeImageType(int type) |
Event |
fillAsync(CommandQueue queue,
long[] origin,
long[] region,
ColorRGBA color)
Fills the image with the specified color.
|
Event |
fillAsync(CommandQueue queue,
long[] origin,
long[] region,
int[] color)
Fills the image with the specified color given as four integer variables.
|
long |
getArraySize() |
long |
getDepth() |
int |
getElementSize() |
long |
getHeight() |
org.lwjgl.opencl.CLMem |
getImage() |
Image.ImageFormat |
getImageFormat() |
Image.ImageType |
getImageType() |
long |
getRowPitch() |
long |
getSlicePitch() |
long |
getWidth() |
Image.ImageMapping |
map(CommandQueue queue,
long[] origin,
long[] region,
MappingAccess access)
Maps the image into host memory.
|
Image.ImageMapping |
mapAsync(CommandQueue queue,
long[] origin,
long[] region,
MappingAccess access)
Non-blocking version of
Image.map(com.jme3.opencl.CommandQueue, long[], long[], com.jme3.opencl.MappingAccess). |
void |
readImage(CommandQueue queue,
java.nio.ByteBuffer dest,
long[] origin,
long[] region,
long rowPitch,
long slicePitch)
Performs a blocking read of the image into the specified byte buffer.
|
Event |
readImageAsync(CommandQueue queue,
java.nio.ByteBuffer dest,
long[] origin,
long[] region,
long rowPitch,
long slicePitch)
Performs an async/non-blocking read of the image into the specified byte buffer.
|
Event |
releaseImageForSharingAsync(CommandQueue queue)
Releases a shared image object.
|
void |
releaseImageForSharingNoEvent(CommandQueue queue)
Releases a shared image object.
|
void |
unmap(CommandQueue queue,
Image.ImageMapping mapping)
Unmaps the mapped memory
|
void |
writeImage(CommandQueue queue,
java.nio.ByteBuffer dest,
long[] origin,
long[] region,
long rowPitch,
long slicePitch)
Performs a blocking write from the specified byte buffer into the image.
|
Event |
writeImageAsync(CommandQueue queue,
java.nio.ByteBuffer dest,
long[] origin,
long[] region,
long rowPitch,
long slicePitch)
Performs an async/non-blocking write from the specified byte buffer into the image.
|
finalize, getReleaser, releasepublic org.lwjgl.opencl.CLMem getImage()
public static int decodeImageChannelOrder(Image.ImageChannelOrder order)
public static Image.ImageChannelOrder encodeImageChannelOrder(int order)
public static int decodeImageChannelType(Image.ImageChannelType type)
public static Image.ImageChannelType encodeImageChannelType(int type)
public static int decodeImageType(Image.ImageType type)
public static Image.ImageType encodeImageType(int type)
public long getWidth()
public long getHeight()
public long getDepth()
public long getRowPitch()
getRowPitch in class Imagepublic long getSlicePitch()
getSlicePitch in class Imagepublic long getArraySize()
getArraySize in class ImageImage.ImageType.IMAGE_1D_ARRAY,
Image.ImageType.IMAGE_2D_ARRAYpublic Image.ImageFormat getImageFormat()
getImageFormat in class Imagepublic Image.ImageType getImageType()
getImageType in class Imagepublic int getElementSize()
getElementSize in class Imagepublic void readImage(CommandQueue queue, java.nio.ByteBuffer dest, long[] origin, long[] region, long rowPitch, long slicePitch)
ImagereadImage in class Imagequeue - the command queuedest - the target byte bufferorigin - the image origin location, see class description for the formatregion - the copied region, see class description for the formatrowPitch - the row pitch of the target buffer, must be set to 0 if the image is 1D.
If set to 0 for 2D and 3D image, the row pitch is calculated as bytesPerElement * widthslicePitch - the slice pitch of the target buffer, must be set to 0 for 1D and 2D images.
If set to 0 for 3D images, the slice pitch is calculated as rowPitch * heightpublic Event readImageAsync(CommandQueue queue, java.nio.ByteBuffer dest, long[] origin, long[] region, long rowPitch, long slicePitch)
ImagereadImageAsync in class Imagequeue - the command queuedest - the target byte bufferorigin - the image origin location, see class description for the formatregion - the copied region, see class description for the formatrowPitch - the row pitch of the target buffer, must be set to 0 if the image is 1D.
If set to 0 for 2D and 3D image, the row pitch is calculated as bytesPerElement * widthslicePitch - the slice pitch of the target buffer, must be set to 0 for 1D and 2D images.
If set to 0 for 3D images, the slice pitch is calculated as rowPitch * heightpublic void writeImage(CommandQueue queue, java.nio.ByteBuffer dest, long[] origin, long[] region, long rowPitch, long slicePitch)
ImagewriteImage in class Imagequeue - the command queuedest - the source bufferorigin - the image origin location, see class description for the formatregion - the copied region, see class description for the formatrowPitch - the row pitch of the target buffer, must be set to 0 if the image is 1D.
If set to 0 for 2D and 3D image, the row pitch is calculated as bytesPerElement * widthslicePitch - the slice pitch of the target buffer, must be set to 0 for 1D and 2D images.
If set to 0 for 3D images, the slice pitch is calculated as rowPitch * heightpublic Event writeImageAsync(CommandQueue queue, java.nio.ByteBuffer dest, long[] origin, long[] region, long rowPitch, long slicePitch)
ImagewriteImageAsync in class Imagequeue - the command queuedest - the source bufferorigin - the image origin location, see class description for the formatregion - the copied region, see class description for the formatrowPitch - the row pitch of the target buffer, must be set to 0 if the image is 1D.
If set to 0 for 2D and 3D image, the row pitch is calculated as bytesPerElement * widthslicePitch - the slice pitch of the target buffer, must be set to 0 for 1D and 2D images.
If set to 0 for 3D images, the slice pitch is calculated as rowPitch * heightpublic void copyTo(CommandQueue queue, Image dest, long[] srcOrigin, long[] destOrigin, long[] region)
ImagecopyTo in class Imagequeue - the command queuedest - the target imagesrcOrigin - the source image origin, see class description for the formatdestOrigin - the target image origin, see class description for the formatregion - the copied region, see class description for the formatpublic Event copyToAsync(CommandQueue queue, Image dest, long[] srcOrigin, long[] destOrigin, long[] region)
ImagecopyToAsync in class Imagequeue - the command queuedest - the target imagesrcOrigin - the source image origin, see class description for the formatdestOrigin - the target image origin, see class description for the formatregion - the copied region, see class description for the formatpublic Image.ImageMapping map(CommandQueue queue, long[] origin, long[] region, MappingAccess access)
Imagenull, it is needed for the asnyc
version Image.mapAsync(com.jme3.opencl.CommandQueue, long[], long[], com.jme3.opencl.MappingAccess).map in class Imagequeue - the command queueorigin - the image origin, see class description for the formatregion - the mapped region, see class description for the formataccess - the allowed memory access to the mapped memoryImage.unmap(com.jme3.opencl.CommandQueue, com.jme3.opencl.Image.ImageMapping)public Image.ImageMapping mapAsync(CommandQueue queue, long[] origin, long[] region, MappingAccess access)
ImageImage.map(com.jme3.opencl.CommandQueue, long[], long[], com.jme3.opencl.MappingAccess).
The returned structure contains the mapped byte buffer and row and slice pitch.
The event object is used to detect when the mapped memory is available.mapAsync in class Imagequeue - the command queueorigin - the image origin, see class description for the formatregion - the mapped region, see class description for the formataccess - the allowed memory access to the mapped memoryImage.unmap(com.jme3.opencl.CommandQueue, com.jme3.opencl.Image.ImageMapping)public void unmap(CommandQueue queue, Image.ImageMapping mapping)
Imagepublic Event fillAsync(CommandQueue queue, long[] origin, long[] region, ColorRGBA color)
ImageImage.ImageChannelType.FLOAT
or Image.ImageChannelType.HALF_FLOAT.public Event fillAsync(CommandQueue queue, long[] origin, long[] region, int[] color)
ImageImage.ImageChannelType.FLOAT
or Image.ImageChannelType.HALF_FLOAT.fillAsync in class Imagequeue - the command queueorigin - the image origin, see class description for the formatregion - the size of the region, see class description for the formatcolor - the color to fill, must be an array of length 4public Event copyToBufferAsync(CommandQueue queue, Buffer dest, long[] srcOrigin, long[] srcRegion, long destOffset)
ImageBuffer.copyToImageAsync(com.jme3.opencl.CommandQueue, com.jme3.opencl.Image, long, long[], long[]).copyToBufferAsync in class Imagequeue - the command queuedest - the target buffersrcOrigin - the image origin, see class description for the formatsrcRegion - the copied region, see class description for the formatdestOffset - an offset into the target bufferpublic Event acquireImageForSharingAsync(CommandQueue queue)
ImageContext.bindImage(com.jme3.texture.Image, com.jme3.texture.Texture.Type, int, com.jme3.opencl.MemoryAccess)
or variations.
This method must be called before the image is used. After the work is
done, the image must be released by calling
Image.releaseImageForSharingAsync(com.jme3.opencl.CommandQueue)
so that OpenGL can use the image/texture/renderbuffer again.acquireImageForSharingAsync in class Imagequeue - the command queuepublic void acquireImageForSharingNoEvent(CommandQueue queue)
ImageContext.bindImage(com.jme3.texture.Image, com.jme3.texture.Texture.Type, int, com.jme3.opencl.MemoryAccess)
or variations.
This method must be called before the image is used. After the work is
done, the image must be released by calling
Image.releaseImageForSharingAsync(com.jme3.opencl.CommandQueue)
so that OpenGL can use the image/texture/renderbuffer again.
The generated event object is directly released.
This brings a performance improvement when the resource is e.g. directly
used by a kernel afterwards on the same queue (this implicitly waits for
this action). If you need the event, use
Image.acquireImageForSharingAsync(com.jme3.opencl.CommandQueue).acquireImageForSharingNoEvent in class Imagequeue - the command queuepublic Event releaseImageForSharingAsync(CommandQueue queue)
ImageImage.acquireImageForSharingAsync(com.jme3.opencl.CommandQueue)
to hand the control back to OpenGL.releaseImageForSharingAsync in class Imagequeue - the command queuepublic void releaseImageForSharingNoEvent(CommandQueue queue)
ImageImage.acquireImageForSharingAsync(com.jme3.opencl.CommandQueue)
to hand the control back to OpenGL.
The generated event object is directly released, resulting in
performance improvements.releaseImageForSharingNoEvent in class Imagequeue - the command queue