Class CLImageDesc
- All Implemented Interfaces:
AutoCloseable
,NativeResource
,Pointer
Layout
struct cl_image_desc {
cl_mem_object_type image_type()
;
size_t image_width()
;
size_t image_height()
;
size_t image_depth()
;
size_t image_array_size()
;
size_t image_row_pitch()
;
size_t image_slice_pitch()
;
cl_uint num_mip_levels()
;
cl_uint num_samples()
;
union {
cl_mem buffer()
;
cl_mem mem_object()
;
};
}
-
Nested Class Summary
Nested classes/interfaces inherited from class org.lwjgl.system.Struct
Struct.StructValidation
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The struct alignment in bytes.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct size in bytes.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
-
Constructor Summary
ConstructorDescriptionCLImageDesc
(ByteBuffer container) Creates aCLImageDesc
instance at the current position of the specifiedByteBuffer
container. -
Method Summary
Modifier and TypeMethodDescriptionlong
buffer()
alias formem_object
buffer
(long value) Sets the specified value to thebuffer()
field.static CLImageDesc
calloc()
Returns a newCLImageDesc
instance allocated withmemCalloc
.static CLImageDesc.Buffer
calloc
(int capacity) Returns a newCLImageDesc.Buffer
instance allocated withmemCalloc
.static CLImageDesc.Buffer
calloc
(int capacity, MemoryStack stack) Returns a newCLImageDesc.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static CLImageDesc
calloc
(MemoryStack stack) Returns a newCLImageDesc
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static CLImageDesc
Deprecated.static CLImageDesc.Buffer
callocStack
(int capacity) Deprecated.static CLImageDesc.Buffer
callocStack
(int capacity, MemoryStack stack) Deprecated.static CLImageDesc
callocStack
(MemoryStack stack) Deprecated.static CLImageDesc
create()
Returns a newCLImageDesc
instance allocated withBufferUtils
.static CLImageDesc.Buffer
create
(int capacity) Returns a newCLImageDesc.Buffer
instance allocated withBufferUtils
.static CLImageDesc
create
(long address) Returns a newCLImageDesc
instance for the specified memory address.static CLImageDesc.Buffer
create
(long address, int capacity) Create aCLImageDesc.Buffer
instance at the specified memory.static CLImageDesc
createSafe
(long address) static CLImageDesc.Buffer
createSafe
(long address, int capacity) long
the number of images in the image array.image_array_size
(long value) Sets the specified value to theimage_array_size()
field.long
the depth of the image in pixels.image_depth
(long value) Sets the specified value to theimage_depth()
field.long
the height of the image in pixels.image_height
(long value) Sets the specified value to theimage_height()
field.long
the scan-line pitch in bytes.image_row_pitch
(long value) Sets the specified value to theimage_row_pitch()
field.long
the size in bytes of each 2D slice in the 3D image or the size in bytes of each image in a 1D or 2D image array.image_slice_pitch
(long value) Sets the specified value to theimage_slice_pitch()
field.int
describes the image typeimage_type
(int value) Sets the specified value to theimage_type()
field.long
the width of the image in pixels.image_width
(long value) Sets the specified value to theimage_width()
field.static CLImageDesc
malloc()
Returns a newCLImageDesc
instance allocated withmemAlloc
.static CLImageDesc.Buffer
malloc
(int capacity) Returns a newCLImageDesc.Buffer
instance allocated withmemAlloc
.static CLImageDesc.Buffer
malloc
(int capacity, MemoryStack stack) Returns a newCLImageDesc.Buffer
instance allocated on the specifiedMemoryStack
.static CLImageDesc
malloc
(MemoryStack stack) Returns a newCLImageDesc
instance allocated on the specifiedMemoryStack
.static CLImageDesc
Deprecated.static CLImageDesc.Buffer
mallocStack
(int capacity) Deprecated.static CLImageDesc.Buffer
mallocStack
(int capacity, MemoryStack stack) Deprecated.static CLImageDesc
mallocStack
(MemoryStack stack) Deprecated.long
refers to a valid buffer or image memory object.mem_object
(long value) Sets the specified value to themem_object()
field.static long
nbuffer
(long struct) Unsafe version ofbuffer()
.static void
nbuffer
(long struct, long value) Unsafe version ofbuffer
.static long
nimage_array_size
(long struct) Unsafe version ofimage_array_size()
.static void
nimage_array_size
(long struct, long value) Unsafe version ofimage_array_size
.static long
nimage_depth
(long struct) Unsafe version ofimage_depth()
.static void
nimage_depth
(long struct, long value) Unsafe version ofimage_depth
.static long
nimage_height
(long struct) Unsafe version ofimage_height()
.static void
nimage_height
(long struct, long value) Unsafe version ofimage_height
.static long
nimage_row_pitch
(long struct) Unsafe version ofimage_row_pitch()
.static void
nimage_row_pitch
(long struct, long value) Unsafe version ofimage_row_pitch
.static long
nimage_slice_pitch
(long struct) Unsafe version ofimage_slice_pitch()
.static void
nimage_slice_pitch
(long struct, long value) Unsafe version ofimage_slice_pitch
.static int
nimage_type
(long struct) Unsafe version ofimage_type()
.static void
nimage_type
(long struct, int value) Unsafe version ofimage_type
.static long
nimage_width
(long struct) Unsafe version ofimage_width()
.static void
nimage_width
(long struct, long value) Unsafe version ofimage_width
.static long
nmem_object
(long struct) Unsafe version ofmem_object()
.static void
nmem_object
(long struct, long value) Unsafe version ofmem_object
.static int
nnum_mip_levels
(long struct) Unsafe version ofnum_mip_levels()
.static void
nnum_mip_levels
(long struct, int value) Unsafe version ofnum_mip_levels
.static int
nnum_samples
(long struct) Unsafe version ofnum_samples()
.static void
nnum_samples
(long struct, int value) Unsafe version ofnum_samples
.int
must be 0num_mip_levels
(int value) Sets the specified value to thenum_mip_levels()
field.int
must be 0num_samples
(int value) Sets the specified value to thenum_samples()
field.set
(CLImageDesc src) Copies the specified struct data to this struct.int
sizeof()
Returnssizeof(struct)
.Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
Methods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
IMAGE_TYPE
public static final int IMAGE_TYPEThe struct member offsets. -
IMAGE_WIDTH
public static final int IMAGE_WIDTHThe struct member offsets. -
IMAGE_HEIGHT
public static final int IMAGE_HEIGHTThe struct member offsets. -
IMAGE_DEPTH
public static final int IMAGE_DEPTHThe struct member offsets. -
IMAGE_ARRAY_SIZE
public static final int IMAGE_ARRAY_SIZEThe struct member offsets. -
IMAGE_ROW_PITCH
public static final int IMAGE_ROW_PITCHThe struct member offsets. -
IMAGE_SLICE_PITCH
public static final int IMAGE_SLICE_PITCHThe struct member offsets. -
NUM_MIP_LEVELS
public static final int NUM_MIP_LEVELSThe struct member offsets. -
NUM_SAMPLES
public static final int NUM_SAMPLESThe struct member offsets. -
BUFFER
public static final int BUFFERThe struct member offsets. -
MEM_OBJECT
public static final int MEM_OBJECTThe struct member offsets.
-
-
Constructor Details
-
CLImageDesc
Creates aCLImageDesc
instance at the current position of the specifiedByteBuffer
container. Changes to the buffer's content will be visible to the struct instance and vice versa.The created instance holds a strong reference to the container object.
-
-
Method Details
-
sizeof
public int sizeof()Description copied from class:Struct
Returnssizeof(struct)
.- Specified by:
sizeof
in classStruct<CLImageDesc>
-
image_type
public int image_type()describes the image type -
image_width
public long image_width()the width of the image in pixels. For a 2D image and image array, the image width must be ≤DEVICE_IMAGE2D_MAX_WIDTH
. For a 3D image, the image width must be ≤DEVICE_IMAGE3D_MAX_WIDTH
. For a 1D image buffer, the image width must be ≤DEVICE_IMAGE_MAX_BUFFER_SIZE
. For a 1D image and 1D image array, the image width must be ≤DEVICE_IMAGE2D_MAX_WIDTH
. -
image_height
public long image_height()the height of the image in pixels. This is only used if the image is a 2D, 3D or 2D image array. For a 2D image or image array, the image height must be ≤DEVICE_IMAGE2D_MAX_HEIGHT
. For a 3D image, the image height must be ≤DEVICE_IMAGE3D_MAX_HEIGHT
. -
image_depth
public long image_depth()the depth of the image in pixels. This is only used if the image is a 3D image and must be a value ≥ 1 and ≤DEVICE_IMAGE3D_MAX_DEPTH
. -
image_array_size
public long image_array_size()the number of images in the image array. This is only used if the image is a 1D or 2D image array. The values forimage_array_size
, if specified, must be a value ≥ 1 and ≤DEVICE_IMAGE_MAX_ARRAY_SIZE
.Note that reading and writing 2D image arrays from a kernel with
image_array_size = 1
may be lower performance than 2D images. -
image_row_pitch
public long image_row_pitch()the scan-line pitch in bytes. This must be 0 ifhost_ptr
isNULL
and can be either 0 or ≥image_width * size
of element in bytes ifhost_ptr
is notNULL
. Ifhost_ptr
is notNULL
andimage_row_pitch = 0
,image_row_pitch
is calculated asimage_width * size
of element in bytes. Ifimage_row_pitch
is not 0, it must be a multiple of the image element size in bytes. -
image_slice_pitch
public long image_slice_pitch()the size in bytes of each 2D slice in the 3D image or the size in bytes of each image in a 1D or 2D image array. This must be 0 ifhost_ptr
isNULL
. Ifhost_ptr
is notNULL
,image_slice_pitch
can be either 0 or ≥image_row_pitch * image_height
for a 2D image array or 3D image and can be either 0 or ≥image_row_pitch
for a 1D image array. Ifhost_ptr
is notNULL
andimage_slice_pitch = 0
,image_slice_pitch
is calculated asimage_row_pitch * image_height
for a 2D image array or 3D image andimage_row_pitch
for a 1D image array. Ifimage_slice_pitch
is not 0, it must be a multiple of theimage_row_pitch
. -
num_mip_levels
public int num_mip_levels()must be 0 -
num_samples
public int num_samples()must be 0 -
buffer
public long buffer()alias formem_object
-
mem_object
public long mem_object()refers to a valid buffer or image memory object.mem_object
can be a buffer memory object ifimage_type
isMEM_OBJECT_IMAGE1D_BUFFER
orMEM_OBJECT_IMAGE2D
.mem_object
can be an image object ifimage_type
isMEM_OBJECT_IMAGE2D
. Otherwise it must beNULL
. The image pixels are taken from the memory object’s data store. When the contents of the specified memory object’s data store are modified, those changes are reflected in the contents of the image object and vice-versa at corresponding sychronization points. For a 1D image buffer object, theimage_width * size
of element in bytes must be ≤ size of buffer object data store. For a 2D image created from a buffer, theimage_row_pitch * image_height
must be ≤ size of buffer object data store. For an image object created from another image object, the values specified in the image descriptor except formem_object
must match the image descriptor information associated withmem_object
. -
image_type
Sets the specified value to theimage_type()
field. -
image_width
Sets the specified value to theimage_width()
field. -
image_height
Sets the specified value to theimage_height()
field. -
image_depth
Sets the specified value to theimage_depth()
field. -
image_array_size
Sets the specified value to theimage_array_size()
field. -
image_row_pitch
Sets the specified value to theimage_row_pitch()
field. -
image_slice_pitch
Sets the specified value to theimage_slice_pitch()
field. -
num_mip_levels
Sets the specified value to thenum_mip_levels()
field. -
num_samples
Sets the specified value to thenum_samples()
field. -
buffer
Sets the specified value to thebuffer()
field. -
mem_object
Sets the specified value to themem_object()
field. -
set
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
Returns a newCLImageDesc
instance allocated withmemAlloc
. The instance must be explicitly freed. -
calloc
Returns a newCLImageDesc
instance allocated withmemCalloc
. The instance must be explicitly freed. -
create
Returns a newCLImageDesc
instance allocated withBufferUtils
. -
create
Returns a newCLImageDesc
instance for the specified memory address. -
createSafe
-
malloc
Returns a newCLImageDesc.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
Returns a newCLImageDesc.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
Returns a newCLImageDesc.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
Create aCLImageDesc.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
-
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)
instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)
instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)
instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)
instead. -
malloc
Returns a newCLImageDesc
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
Returns a newCLImageDesc
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
malloc
Returns a newCLImageDesc.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
calloc
Returns a newCLImageDesc.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
nimage_type
public static int nimage_type(long struct) Unsafe version ofimage_type()
. -
nimage_width
public static long nimage_width(long struct) Unsafe version ofimage_width()
. -
nimage_height
public static long nimage_height(long struct) Unsafe version ofimage_height()
. -
nimage_depth
public static long nimage_depth(long struct) Unsafe version ofimage_depth()
. -
nimage_array_size
public static long nimage_array_size(long struct) Unsafe version ofimage_array_size()
. -
nimage_row_pitch
public static long nimage_row_pitch(long struct) Unsafe version ofimage_row_pitch()
. -
nimage_slice_pitch
public static long nimage_slice_pitch(long struct) Unsafe version ofimage_slice_pitch()
. -
nnum_mip_levels
public static int nnum_mip_levels(long struct) Unsafe version ofnum_mip_levels()
. -
nnum_samples
public static int nnum_samples(long struct) Unsafe version ofnum_samples()
. -
nbuffer
public static long nbuffer(long struct) Unsafe version ofbuffer()
. -
nmem_object
public static long nmem_object(long struct) Unsafe version ofmem_object()
. -
nimage_type
public static void nimage_type(long struct, int value) Unsafe version ofimage_type
. -
nimage_width
public static void nimage_width(long struct, long value) Unsafe version ofimage_width
. -
nimage_height
public static void nimage_height(long struct, long value) Unsafe version ofimage_height
. -
nimage_depth
public static void nimage_depth(long struct, long value) Unsafe version ofimage_depth
. -
nimage_array_size
public static void nimage_array_size(long struct, long value) Unsafe version ofimage_array_size
. -
nimage_row_pitch
public static void nimage_row_pitch(long struct, long value) Unsafe version ofimage_row_pitch
. -
nimage_slice_pitch
public static void nimage_slice_pitch(long struct, long value) Unsafe version ofimage_slice_pitch
. -
nnum_mip_levels
public static void nnum_mip_levels(long struct, int value) Unsafe version ofnum_mip_levels
. -
nnum_samples
public static void nnum_samples(long struct, int value) Unsafe version ofnum_samples
. -
nbuffer
public static void nbuffer(long struct, long value) Unsafe version ofbuffer
. -
nmem_object
public static void nmem_object(long struct, long value) Unsafe version ofmem_object
.
-