Class CLImageDesc

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class CLImageDesc extends Struct<CLImageDesc> implements NativeResource

 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;
     };
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • IMAGE_TYPE

      public static final int IMAGE_TYPE
      The struct member offsets.
    • IMAGE_WIDTH

      public static final int IMAGE_WIDTH
      The struct member offsets.
    • IMAGE_HEIGHT

      public static final int IMAGE_HEIGHT
      The struct member offsets.
    • IMAGE_DEPTH

      public static final int IMAGE_DEPTH
      The struct member offsets.
    • IMAGE_ARRAY_SIZE

      public static final int IMAGE_ARRAY_SIZE
      The struct member offsets.
    • IMAGE_ROW_PITCH

      public static final int IMAGE_ROW_PITCH
      The struct member offsets.
    • IMAGE_SLICE_PITCH

      public static final int IMAGE_SLICE_PITCH
      The struct member offsets.
    • NUM_MIP_LEVELS

      public static final int NUM_MIP_LEVELS
      The struct member offsets.
    • NUM_SAMPLES

      public static final int NUM_SAMPLES
      The struct member offsets.
    • BUFFER

      public static final int BUFFER
      The struct member offsets.
    • MEM_OBJECT

      public static final int MEM_OBJECT
      The struct member offsets.
  • Constructor Details

    • CLImageDesc

      public CLImageDesc(ByteBuffer container)
      Creates a CLImageDesc instance at the current position of the specified ByteBuffer 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
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<CLImageDesc>
    • image_type

      public int image_type()
      Returns:
      the value of the image_type field.
    • image_width

      public long image_width()
      Returns:
      the value of the image_width field.
    • image_height

      public long image_height()
      Returns:
      the value of the image_height field.
    • image_depth

      public long image_depth()
      Returns:
      the value of the image_depth field.
    • image_array_size

      public long image_array_size()
      Returns:
      the value of the image_array_size field.
    • image_row_pitch

      public long image_row_pitch()
      Returns:
      the value of the image_row_pitch field.
    • image_slice_pitch

      public long image_slice_pitch()
      Returns:
      the value of the image_slice_pitch field.
    • num_mip_levels

      public int num_mip_levels()
      Returns:
      the value of the num_mip_levels field.
    • num_samples

      public int num_samples()
      Returns:
      the value of the num_samples field.
    • buffer

      public long buffer()
      Returns:
      the value of the buffer field.
    • mem_object

      public long mem_object()
      Returns:
      the value of the mem_object field.
    • image_type

      public CLImageDesc image_type(int value)
      Sets the specified value to the image_type field.
    • image_width

      public CLImageDesc image_width(long value)
      Sets the specified value to the image_width field.
    • image_height

      public CLImageDesc image_height(long value)
      Sets the specified value to the image_height field.
    • image_depth

      public CLImageDesc image_depth(long value)
      Sets the specified value to the image_depth field.
    • image_array_size

      public CLImageDesc image_array_size(long value)
      Sets the specified value to the image_array_size field.
    • image_row_pitch

      public CLImageDesc image_row_pitch(long value)
      Sets the specified value to the image_row_pitch field.
    • image_slice_pitch

      public CLImageDesc image_slice_pitch(long value)
      Sets the specified value to the image_slice_pitch field.
    • num_mip_levels

      public CLImageDesc num_mip_levels(int value)
      Sets the specified value to the num_mip_levels field.
    • num_samples

      public CLImageDesc num_samples(int value)
      Sets the specified value to the num_samples field.
    • buffer

      public CLImageDesc buffer(long value)
      Sets the specified value to the buffer field.
    • mem_object

      public CLImageDesc mem_object(long value)
      Sets the specified value to the mem_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 new CLImageDesc instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static CLImageDesc calloc()
      Returns a new CLImageDesc instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static CLImageDesc create()
      Returns a new CLImageDesc instance allocated with BufferUtils.
    • create

      public static CLImageDesc create(long address)
      Returns a new CLImageDesc instance for the specified memory address.
    • createSafe

      public static @Nullable CLImageDesc createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static CLImageDesc.Buffer malloc(int capacity)
      Returns a new CLImageDesc.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static CLImageDesc.Buffer calloc(int capacity)
      Returns a new CLImageDesc.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static CLImageDesc.Buffer create(int capacity)
      Returns a new CLImageDesc.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static CLImageDesc.Buffer create(long address, int capacity)
      Create a CLImageDesc.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable CLImageDesc.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • mallocStack

      @Deprecated public static CLImageDesc mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static CLImageDesc callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static CLImageDesc mallocStack(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static CLImageDesc callocStack(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static CLImageDesc.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static CLImageDesc.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static CLImageDesc.Buffer mallocStack(int capacity, MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static CLImageDesc.Buffer callocStack(int capacity, MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

      public static CLImageDesc malloc(MemoryStack stack)
      Returns a new CLImageDesc instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static CLImageDesc calloc(MemoryStack stack)
      Returns a new CLImageDesc instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static CLImageDesc.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new CLImageDesc.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static CLImageDesc.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new CLImageDesc.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nimage_type

      public static int nimage_type(long struct)
      Unsafe version of image_type().
    • nimage_width

      public static long nimage_width(long struct)
      Unsafe version of image_width().
    • nimage_height

      public static long nimage_height(long struct)
      Unsafe version of image_height().
    • nimage_depth

      public static long nimage_depth(long struct)
      Unsafe version of image_depth().
    • nimage_array_size

      public static long nimage_array_size(long struct)
      Unsafe version of image_array_size().
    • nimage_row_pitch

      public static long nimage_row_pitch(long struct)
      Unsafe version of image_row_pitch().
    • nimage_slice_pitch

      public static long nimage_slice_pitch(long struct)
      Unsafe version of image_slice_pitch().
    • nnum_mip_levels

      public static int nnum_mip_levels(long struct)
      Unsafe version of num_mip_levels().
    • nnum_samples

      public static int nnum_samples(long struct)
      Unsafe version of num_samples().
    • nbuffer

      public static long nbuffer(long struct)
      Unsafe version of buffer().
    • nmem_object

      public static long nmem_object(long struct)
      Unsafe version of mem_object().
    • nimage_type

      public static void nimage_type(long struct, int value)
      Unsafe version of image_type.
    • nimage_width

      public static void nimage_width(long struct, long value)
      Unsafe version of image_width.
    • nimage_height

      public static void nimage_height(long struct, long value)
      Unsafe version of image_height.
    • nimage_depth

      public static void nimage_depth(long struct, long value)
      Unsafe version of image_depth.
    • nimage_array_size

      public static void nimage_array_size(long struct, long value)
      Unsafe version of image_array_size.
    • nimage_row_pitch

      public static void nimage_row_pitch(long struct, long value)
      Unsafe version of image_row_pitch.
    • nimage_slice_pitch

      public static void nimage_slice_pitch(long struct, long value)
      Unsafe version of image_slice_pitch.
    • nnum_mip_levels

      public static void nnum_mip_levels(long struct, int value)
      Unsafe version of num_mip_levels.
    • nnum_samples

      public static void nnum_samples(long struct, int value)
      Unsafe version of num_samples.
    • nbuffer

      public static void nbuffer(long struct, long value)
      Unsafe version of buffer.
    • nmem_object

      public static void nmem_object(long struct, long value)
      Unsafe version of mem_object.