Package org.lwjgl.opencl
Class CLMem
java.lang.Object
org.lwjgl.PointerWrapperAbstract
org.lwjgl.opencl.CLMem
- All Implemented Interfaces:
PointerWrapper
This class is a wrapper around a cl_mem pointer.
- Author:
- Spasi
-
Field Summary
Fields inherited from class org.lwjgl.PointerWrapperAbstract
pointer
-
Method Summary
Modifier and TypeMethodDescriptionstatic CLMem
createImage2D
(CLContext context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_row_pitch, Buffer host_ptr, IntBuffer errcode_ret) Creates a new 2D image object.static CLMem
createImage3D
(CLContext context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, Buffer host_ptr, IntBuffer errcode_ret) Creates a new 3D image object.createSubBuffer
(long flags, int buffer_create_type, CLBufferRegion buffer_create_info, IntBuffer errcode_ret) int
Returns the GL object name.int
Returns the GL object type.int
getGLTextureInfoInt
(int param_name) Returns the int value of the specified parameter.int
Returns the image channel order.int
Returns the image channel type.Returns the image format.long
getImageInfoSize
(int param_name) Returns the size_t value of the specified parameter.Returns a direct ByteBuffer instance that points to the host memory that backs this CLMem object.int
getInfoInt
(int param_name) Returns the integer value of the specified parameter.long
getInfoLong
(int param_name) Returns the long value of the specified parameter.long
getInfoSize
(int param_name) Returns the size_t value of the specified parameter.final int
final boolean
isValid()
Returns true if this object represents a valid pointer.Methods inherited from class org.lwjgl.PointerWrapperAbstract
checkValid, equals, getPointer, hashCode, toString
-
Method Details
-
createImage2D
public static CLMem createImage2D(CLContext context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_row_pitch, Buffer host_ptr, IntBuffer errcode_ret) Creates a new 2D image object.- Parameters:
context
- the context on which to create the image objectflags
- the memory object flagsimage_format
- the image formatimage_width
- the image widthimage_height
- the image heightimage_row_pitch
- the image row pitchhost_ptr
- the host buffer from which to read image data (optional)errcode_ret
- the error code result- Returns:
- the new CLMem object
-
createImage3D
public static CLMem createImage3D(CLContext context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, Buffer host_ptr, IntBuffer errcode_ret) Creates a new 3D image object.- Parameters:
context
- the context on which to create the image objectflags
- the memory object flagsimage_format
- the image formatimage_width
- the image widthimage_height
- the image heightimage_depth
- the image depthimage_row_pitch
- the image row pitchimage_slice_pitch
- the image slice pitchhost_ptr
- the host buffer from which to read image data (optional)errcode_ret
- the error code result- Returns:
- the new CLMem object
-
createSubBuffer
public CLMem createSubBuffer(long flags, int buffer_create_type, CLBufferRegion buffer_create_info, IntBuffer errcode_ret) -
getInfoInt
public int getInfoInt(int param_name) Returns the integer value of the specified parameter.- Parameters:
param_name
- the parameter- Returns:
- the parameter value
-
getInfoSize
public long getInfoSize(int param_name) Returns the size_t value of the specified parameter.- Parameters:
param_name
- the parameter- Returns:
- the parameter value
-
getInfoLong
public long getInfoLong(int param_name) Returns the long value of the specified parameter. Can be used for both cl_ulong and cl_bitfield parameters.- Parameters:
param_name
- the parameter- Returns:
- the parameter value
-
getInfoHostBuffer
Returns a direct ByteBuffer instance that points to the host memory that backs this CLMem object. Applicable only to CLMem objects that were created with the CL_MEM_USE_HOST_PTR flag.- Returns:
- the host memory ByteBuffer
-
getImageInfoSize
public long getImageInfoSize(int param_name) Returns the size_t value of the specified parameter. Applicable to image objects only.- Parameters:
param_name
- the parameter- Returns:
- the parameter value
-
getImageFormat
Returns the image format. Applicable to image objects only.- Returns:
- the parameter value
-
getImageChannelOrder
public int getImageChannelOrder()Returns the image channel order. Applicable to image objects only.- Returns:
- the parameter value
-
getImageChannelType
public int getImageChannelType()Returns the image channel type. Applicable to image objects only.- Returns:
- the parameter value
-
getGLObjectType
public int getGLObjectType()Returns the GL object type. Applicable to CLMem objects that have been created GL objects only.- Returns:
- the parameter value
-
getGLObjectName
public int getGLObjectName()Returns the GL object name. Applicable to CLMem objects that have been created GL objects only.- Returns:
- the parameter value
-
getGLTextureInfoInt
public int getGLTextureInfoInt(int param_name) Returns the int value of the specified parameter. Applicable to CLMem objects that have been created by GL textures only.- Parameters:
param_name
- the parameter- Returns:
- the parameter value
-
getParent
-
getReferenceCount
public final int getReferenceCount() -
isValid
public final boolean isValid()Description copied from class:PointerWrapperAbstract
Returns true if this object represents a valid pointer. The pointer might be invalid because it is NULL or because some other action has deleted the object that this pointer represents.- Overrides:
isValid
in classPointerWrapperAbstract
- Returns:
- true if the pointer is valid
-