Package org.lwjgl.opencl
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.Member documentation
image_type– describes the image typeimage_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– 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– 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– 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– 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– 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– must be 0num_samples– must be 0buffer– refers to a valid buffer memory object ifimage_typeisMEM_OBJECT_IMAGE1D_BUFFER. Otherwise it must beNULL. For a 1D image buffer object, the image pixels are taken from the buffer object's data store. When the contents of a buffer object's data store are modified, those changes are reflected in the contents of the 1D image buffer object and vice-versa at corresponding sychronization points. Theimage_width * sizeof element in bytes must be ≤ size of buffer object data store.
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; cl_mem buffer; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classCLImageDesc.BufferAn array ofCLImageDescstructs.
-
Field Summary
Fields Modifier and Type Field and Description static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor and 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 Modifier and Type Method and Description longbuffer()Returns the value of thebufferfield.CLImageDescbuffer(long value)Sets the specified value to thebufferfield.static CLImageDesccalloc()Returns a newCLImageDescinstance allocated withmemCalloc.static CLImageDesc.Buffercalloc(int capacity)Returns a newCLImageDesc.Bufferinstance allocated withmemCalloc.static CLImageDesccallocStack()Returns a newCLImageDescinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static CLImageDesc.BuffercallocStack(int capacity)Returns a newCLImageDesc.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static CLImageDesc.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newCLImageDesc.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static CLImageDesccallocStack(org.lwjgl.system.MemoryStack stack)Returns a newCLImageDescinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.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()Returns the value of theimage_array_sizefield.CLImageDescimage_array_size(long value)Sets the specified value to theimage_array_sizefield.longimage_depth()Returns the value of theimage_depthfield.CLImageDescimage_depth(long value)Sets the specified value to theimage_depthfield.longimage_height()Returns the value of theimage_heightfield.CLImageDescimage_height(long value)Sets the specified value to theimage_heightfield.longimage_row_pitch()Returns the value of theimage_row_pitchfield.CLImageDescimage_row_pitch(long value)Sets the specified value to theimage_row_pitchfield.longimage_slice_pitch()Returns the value of theimage_slice_pitchfield.CLImageDescimage_slice_pitch(long value)Sets the specified value to theimage_slice_pitchfield.intimage_type()Returns the value of theimage_typefield.CLImageDescimage_type(int value)Sets the specified value to theimage_typefield.longimage_width()Returns the value of theimage_widthfield.CLImageDescimage_width(long value)Sets the specified value to theimage_widthfield.static CLImageDescmalloc()Returns a newCLImageDescinstance allocated withmemAlloc.static CLImageDesc.Buffermalloc(int capacity)Returns a newCLImageDesc.Bufferinstance allocated withmemAlloc.static CLImageDescmallocStack()Returns a newCLImageDescinstance allocated on the thread-localMemoryStack.static CLImageDesc.BuffermallocStack(int capacity)Returns a newCLImageDesc.Bufferinstance allocated on the thread-localMemoryStack.static CLImageDesc.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newCLImageDesc.Bufferinstance allocated on the specifiedMemoryStack.static CLImageDescmallocStack(org.lwjgl.system.MemoryStack stack)Returns a newCLImageDescinstance allocated on the specifiedMemoryStack.intnum_mip_levels()Returns the value of thenum_mip_levelsfield.CLImageDescnum_mip_levels(int value)Sets the specified value to thenum_mip_levelsfield.intnum_samples()Returns the value of thenum_samplesfield.CLImageDescnum_samples(int value)Sets the specified value to thenum_samplesfield.CLImageDescset(CLImageDesc src)Copies the specified struct data to this struct.CLImageDescset(int image_type, long image_width, long image_height, long image_depth, long image_array_size, long image_row_pitch, long image_slice_pitch, int num_mip_levels, int num_samples, long buffer)Initializes this struct with the specified values.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()
Returns the value of theimage_typefield.
-
image_width
public long image_width()
Returns the value of theimage_widthfield.
-
image_height
public long image_height()
Returns the value of theimage_heightfield.
-
image_depth
public long image_depth()
Returns the value of theimage_depthfield.
-
image_array_size
public long image_array_size()
Returns the value of theimage_array_sizefield.
-
image_row_pitch
public long image_row_pitch()
Returns the value of theimage_row_pitchfield.
-
image_slice_pitch
public long image_slice_pitch()
Returns the value of theimage_slice_pitchfield.
-
num_mip_levels
public int num_mip_levels()
Returns the value of thenum_mip_levelsfield.
-
num_samples
public int num_samples()
Returns the value of thenum_samplesfield.
-
buffer
public long buffer()
Returns the value of thebufferfield.
-
image_type
public CLImageDesc image_type(int value)
Sets the specified value to theimage_typefield.
-
image_width
public CLImageDesc image_width(long value)
Sets the specified value to theimage_widthfield.
-
image_height
public CLImageDesc image_height(long value)
Sets the specified value to theimage_heightfield.
-
image_depth
public CLImageDesc image_depth(long value)
Sets the specified value to theimage_depthfield.
-
image_array_size
public CLImageDesc image_array_size(long value)
Sets the specified value to theimage_array_sizefield.
-
image_row_pitch
public CLImageDesc image_row_pitch(long value)
Sets the specified value to theimage_row_pitchfield.
-
image_slice_pitch
public CLImageDesc image_slice_pitch(long value)
Sets the specified value to theimage_slice_pitchfield.
-
num_mip_levels
public CLImageDesc num_mip_levels(int value)
Sets the specified value to thenum_mip_levelsfield.
-
num_samples
public CLImageDesc num_samples(int value)
Sets the specified value to thenum_samplesfield.
-
buffer
public CLImageDesc buffer(long value)
Sets the specified value to thebufferfield.
-
set
public CLImageDesc set(int image_type, long image_width, long image_height, long image_depth, long image_array_size, long image_row_pitch, long image_slice_pitch, int num_mip_levels, int num_samples, long buffer)
Initializes this struct with the specified values.
-
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
public static CLImageDesc mallocStack()
Returns a newCLImageDescinstance allocated on the thread-localMemoryStack.
-
callocStack
public static CLImageDesc callocStack()
Returns a newCLImageDescinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static CLImageDesc mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newCLImageDescinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static CLImageDesc callocStack(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
-
mallocStack
public static CLImageDesc.Buffer mallocStack(int capacity)
Returns a newCLImageDesc.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static CLImageDesc.Buffer callocStack(int capacity)
Returns a newCLImageDesc.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static CLImageDesc.Buffer mallocStack(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
-
callocStack
public static CLImageDesc.Buffer callocStack(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
-
-