Class CLImageDesc
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.opencl.CLImageDesc
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class CLImageDesc extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceDescribes the type and dimensions of the image or image array.Layout
struct cl_image_desc { cl_mem_object_typeimage_type(); size_timage_width(); size_timage_height(); size_timage_depth(); size_timage_array_size(); size_timage_row_pitch(); size_timage_slice_pitch(); cl_uintnum_mip_levels(); cl_uintnum_samples(); union { cl_membuffer(); cl_memmem_object(); }; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCLImageDesc.BufferAn array ofCLImageDescstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intBUFFER
IMAGE_ARRAY_SIZE
IMAGE_DEPTH
IMAGE_HEIGHT
IMAGE_ROW_PITCH
IMAGE_SLICE_PITCH
IMAGE_TYPE
IMAGE_WIDTH
MEM_OBJECT
NUM_MIP_LEVELS
NUM_SAMPLESThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description CLImageDesc(java.nio.ByteBuffer container)Creates aCLImageDescinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description longbuffer()alias formem_objectCLImageDescbuffer(long value)Sets the specified value to thebuffer()field.static CLImageDesccalloc()Returns a newCLImageDescinstance allocated withmemCalloc.static CLImageDesc.Buffercalloc(int capacity)Returns a newCLImageDesc.Bufferinstance allocated withmemCalloc.static CLImageDesc.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newCLImageDesc.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static CLImageDesccalloc(org.lwjgl.system.MemoryStack stack)Returns a newCLImageDescinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static CLImageDesccallocStack()Deprecated.static CLImageDesc.BuffercallocStack(int capacity)Deprecated.static CLImageDesc.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static CLImageDesccallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.static CLImageDesccreate()Returns a newCLImageDescinstance allocated withBufferUtils.static CLImageDesc.Buffercreate(int capacity)Returns a newCLImageDesc.Bufferinstance allocated withBufferUtils.static CLImageDesccreate(long address)Returns a newCLImageDescinstance for the specified memory address.static CLImageDesc.Buffercreate(long address, int capacity)Create aCLImageDesc.Bufferinstance at the specified memory.static CLImageDesccreateSafe(long address)static CLImageDesc.BuffercreateSafe(long address, int capacity)longimage_array_size()the number of images in the image array.CLImageDescimage_array_size(long value)Sets the specified value to theimage_array_size()field.longimage_depth()the depth of the image in pixels.CLImageDescimage_depth(long value)Sets the specified value to theimage_depth()field.longimage_height()the height of the image in pixels.CLImageDescimage_height(long value)Sets the specified value to theimage_height()field.longimage_row_pitch()the scan-line pitch in bytes.CLImageDescimage_row_pitch(long value)Sets the specified value to theimage_row_pitch()field.longimage_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.CLImageDescimage_slice_pitch(long value)Sets the specified value to theimage_slice_pitch()field.intimage_type()describes the image typeCLImageDescimage_type(int value)Sets the specified value to theimage_type()field.longimage_width()the width of the image in pixels.CLImageDescimage_width(long value)Sets the specified value to theimage_width()field.static CLImageDescmalloc()Returns a newCLImageDescinstance allocated withmemAlloc.static CLImageDesc.Buffermalloc(int capacity)Returns a newCLImageDesc.Bufferinstance allocated withmemAlloc.static CLImageDesc.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newCLImageDesc.Bufferinstance allocated on the specifiedMemoryStack.static CLImageDescmalloc(org.lwjgl.system.MemoryStack stack)Returns a newCLImageDescinstance allocated on the specifiedMemoryStack.static CLImageDescmallocStack()Deprecated.static CLImageDesc.BuffermallocStack(int capacity)Deprecated.static CLImageDesc.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static CLImageDescmallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.longmem_object()refers to a valid buffer or image memory object.CLImageDescmem_object(long value)Sets the specified value to themem_object()field.static longnbuffer(long struct)Unsafe version ofbuffer().static voidnbuffer(long struct, long value)Unsafe version ofbuffer.static longnimage_array_size(long struct)Unsafe version ofimage_array_size().static voidnimage_array_size(long struct, long value)Unsafe version ofimage_array_size.static longnimage_depth(long struct)Unsafe version ofimage_depth().static voidnimage_depth(long struct, long value)Unsafe version ofimage_depth.static longnimage_height(long struct)Unsafe version ofimage_height().static voidnimage_height(long struct, long value)Unsafe version ofimage_height.static longnimage_row_pitch(long struct)Unsafe version ofimage_row_pitch().static voidnimage_row_pitch(long struct, long value)Unsafe version ofimage_row_pitch.static longnimage_slice_pitch(long struct)Unsafe version ofimage_slice_pitch().static voidnimage_slice_pitch(long struct, long value)Unsafe version ofimage_slice_pitch.static intnimage_type(long struct)Unsafe version ofimage_type().static voidnimage_type(long struct, int value)Unsafe version ofimage_type.static longnimage_width(long struct)Unsafe version ofimage_width().static voidnimage_width(long struct, long value)Unsafe version ofimage_width.static longnmem_object(long struct)Unsafe version ofmem_object().static voidnmem_object(long struct, long value)Unsafe version ofmem_object.static intnnum_mip_levels(long struct)Unsafe version ofnum_mip_levels().static voidnnum_mip_levels(long struct, int value)Unsafe version ofnum_mip_levels.static intnnum_samples(long struct)Unsafe version ofnum_samples().static voidnnum_samples(long struct, int value)Unsafe version ofnum_samples.intnum_mip_levels()must be 0CLImageDescnum_mip_levels(int value)Sets the specified value to thenum_mip_levels()field.intnum_samples()must be 0CLImageDescnum_samples(int value)Sets the specified value to thenum_samples()field.CLImageDescset(CLImageDesc src)Copies the specified struct data to this struct.intsizeof()
-
-
-
Constructor Detail
-
CLImageDesc
public CLImageDesc(java.nio.ByteBuffer container)
Creates aCLImageDescinstance at the current position of the specifiedByteBuffercontainer. 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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
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 = 1may 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_ptrisNULLand can be either 0 or ≥image_width * sizeof element in bytes ifhost_ptris notNULL. Ifhost_ptris notNULLandimage_row_pitch = 0,image_row_pitchis calculated asimage_width * sizeof element in bytes. Ifimage_row_pitchis 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_ptrisNULL. Ifhost_ptris notNULL,image_slice_pitchcan be either 0 or ≥image_row_pitch * image_heightfor a 2D image array or 3D image and can be either 0 or ≥image_row_pitchfor a 1D image array. Ifhost_ptris notNULLandimage_slice_pitch = 0,image_slice_pitchis calculated asimage_row_pitch * image_heightfor a 2D image array or 3D image andimage_row_pitchfor a 1D image array. Ifimage_slice_pitchis not 0, it must be a multiple of theimage_row_pitch.
-
num_mip_levels, num_samples
public int num_mip_levels() 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_objectcan be a buffer memory object ifimage_typeisMEM_OBJECT_IMAGE1D_BUFFERorMEM_OBJECT_IMAGE2D.mem_objectcan be an image object ifimage_typeisMEM_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 * sizeof element in bytes must be ≤ size of buffer object data store. For a 2D image created from a buffer, theimage_row_pitch * image_heightmust 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_objectmust match the image descriptor information associated withmem_object.
-
image_type
public CLImageDesc image_type(int value)
Sets the specified value to theimage_type()field.
-
image_width
public CLImageDesc image_width(long value)
Sets the specified value to theimage_width()field.
-
image_height
public CLImageDesc image_height(long value)
Sets the specified value to theimage_height()field.
-
image_depth
public CLImageDesc image_depth(long value)
Sets the specified value to theimage_depth()field.
-
image_array_size
public CLImageDesc image_array_size(long value)
Sets the specified value to theimage_array_size()field.
-
image_row_pitch
public CLImageDesc image_row_pitch(long value)
Sets the specified value to theimage_row_pitch()field.
-
image_slice_pitch
public CLImageDesc image_slice_pitch(long value)
Sets the specified value to theimage_slice_pitch()field.
-
num_mip_levels
public CLImageDesc num_mip_levels(int value)
Sets the specified value to thenum_mip_levels()field.
-
num_samples
public CLImageDesc num_samples(int value)
Sets the specified value to thenum_samples()field.
-
buffer
public CLImageDesc buffer(long value)
Sets the specified value to thebuffer()field.
-
mem_object
public CLImageDesc mem_object(long value)
Sets the specified value to themem_object()field.
-
set
public CLImageDesc set(CLImageDesc src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static CLImageDesc malloc()
Returns a newCLImageDescinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static CLImageDesc calloc()
Returns a newCLImageDescinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static CLImageDesc create()
Returns a newCLImageDescinstance allocated withBufferUtils.
-
create
public static CLImageDesc create(long address)
Returns a newCLImageDescinstance for the specified memory address.
-
createSafe
@Nullable public static CLImageDesc createSafe(long address)
-
malloc
public static CLImageDesc.Buffer malloc(int capacity)
Returns a newCLImageDesc.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static CLImageDesc.Buffer calloc(int capacity)
Returns a newCLImageDesc.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static CLImageDesc.Buffer create(int capacity)
Returns a newCLImageDesc.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static CLImageDesc.Buffer create(long address, int capacity)
Create aCLImageDesc.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static CLImageDesc.Buffer createSafe(long address, int capacity)
-
mallocStack
@Deprecated public static CLImageDesc mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static CLImageDesc callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static CLImageDesc mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static CLImageDesc callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static CLImageDesc.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static CLImageDesc.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
mallocStack
@Deprecated public static CLImageDesc.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static CLImageDesc.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
malloc
public static CLImageDesc malloc(org.lwjgl.system.MemoryStack stack)
Returns a newCLImageDescinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static CLImageDesc calloc(org.lwjgl.system.MemoryStack stack)
Returns a newCLImageDescinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static CLImageDesc.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newCLImageDesc.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static CLImageDesc.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newCLImageDesc.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
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.
-
-