Class ExrDataSource

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class ExrDataSource extends Struct<ExrDataSource> implements NativeResource
struct ExrDataSource {
    void * userdata;
    ExrFetchCallback fetch;
    ExrFetchCancel cancel;
    uint64_t total_size;
    uint32_t flags;
}
  • Field Details

    • SIZEOF

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

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

      public static final int USERDATA
      The struct member offsets.
    • FETCH

      public static final int FETCH
      The struct member offsets.
    • CANCEL

      public static final int CANCEL
      The struct member offsets.
    • TOTAL_SIZE

      public static final int TOTAL_SIZE
      The struct member offsets.
    • FLAGS

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

    • ExrDataSource

      public ExrDataSource(ByteBuffer container)
      Creates a ExrDataSource 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<ExrDataSource>
    • userdata

      @NativeType("void *") public long userdata()
      Returns:
      the value of the userdata field.
    • fetch

      public ExrFetchCallback fetch()
      Returns:
      the value of the fetch field.
    • cancel

      public @Nullable ExrFetchCancel cancel()
      Returns:
      the value of the cancel field.
    • total_size

      @NativeType("uint64_t") public long total_size()
      Returns:
      the value of the total_size field.
    • flags

      @NativeType("uint32_t") public int flags()
      Returns:
      the value of the flags field.
    • userdata

      public ExrDataSource userdata(@NativeType("void *") long value)
      Sets the specified value to the userdata field.
    • fetch

      public ExrDataSource fetch(@NativeType("ExrFetchCallback") ExrFetchCallbackI value)
      Sets the specified value to the fetch field.
    • cancel

      public ExrDataSource cancel(@NativeType("ExrFetchCancel") @Nullable ExrFetchCancelI value)
      Sets the specified value to the cancel field.
    • total_size

      public ExrDataSource total_size(@NativeType("uint64_t") long value)
      Sets the specified value to the total_size field.
    • flags

      public ExrDataSource flags(@NativeType("uint32_t") int value)
      Sets the specified value to the flags field.
    • set

      public ExrDataSource set(long userdata, ExrFetchCallbackI fetch, ExrFetchCancelI cancel, long total_size, int flags)
      Initializes this struct with the specified values.
    • set

      public ExrDataSource set(ExrDataSource src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static ExrDataSource malloc()
      Returns a new ExrDataSource instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

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

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

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

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

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

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

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

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

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

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

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

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

      public static ExrDataSource.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new ExrDataSource.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
    • nuserdata

      public static long nuserdata(long struct)
      Unsafe version of userdata().
    • nfetch

      public static ExrFetchCallback nfetch(long struct)
      Unsafe version of fetch().
    • ncancel

      public static @Nullable ExrFetchCancel ncancel(long struct)
      Unsafe version of cancel().
    • ntotal_size

      public static long ntotal_size(long struct)
      Unsafe version of total_size().
    • nflags

      public static int nflags(long struct)
      Unsafe version of flags().
    • nuserdata

      public static void nuserdata(long struct, long value)
      Unsafe version of userdata.
    • nfetch

      public static void nfetch(long struct, ExrFetchCallbackI value)
      Unsafe version of fetch.
    • ncancel

      public static void ncancel(long struct, @Nullable ExrFetchCancelI value)
      Unsafe version of cancel.
    • ntotal_size

      public static void ntotal_size(long struct, long value)
      Unsafe version of total_size.
    • nflags

      public static void nflags(long struct, int value)
      Unsafe version of flags.
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate