Class EXRAttribute

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class EXRAttribute extends Struct<EXRAttribute> implements NativeResource

 struct EXRAttribute {
     char name[256];
     char type[256];
     unsigned char * value;
     int size;
     char[4];
 }
  • Field Details

    • SIZEOF

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

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

      public static final int NAME
      The struct member offsets.
    • TYPE

      public static final int TYPE
      The struct member offsets.
    • VALUE

      public static final int VALUE
      The struct member offsets.
    • SIZE

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

    • EXRAttribute

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

      public ByteBuffer name()
      Returns:
      a ByteBuffer view of the name field.
    • nameString

      public String nameString()
      Returns:
      the null-terminated string stored in the name field.
    • type

      public ByteBuffer type()
      Returns:
      a ByteBuffer view of the type field.
    • typeString

      public String typeString()
      Returns:
      the null-terminated string stored in the type field.
    • value

      public @Nullable ByteBuffer value()
      Returns:
      a ByteBuffer view of the data pointed to by the value field.
    • size

      public int size()
      Returns:
      the value of the size field.
    • name

      public EXRAttribute name(ByteBuffer value)
      Copies the specified encoded string to the name field.
    • type

      public EXRAttribute type(ByteBuffer value)
      Copies the specified encoded string to the type field.
    • value

      public EXRAttribute value(@Nullable ByteBuffer value)
      Sets the address of the specified ByteBuffer to the value field.
    • set

      public EXRAttribute set(ByteBuffer name, ByteBuffer type, @Nullable ByteBuffer value)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static ByteBuffer nname(long struct)
      Unsafe version of name().
    • nnameString

      public static String nnameString(long struct)
      Unsafe version of nameString().
    • ntype

      public static ByteBuffer ntype(long struct)
      Unsafe version of type().
    • ntypeString

      public static String ntypeString(long struct)
      Unsafe version of typeString().
    • nvalue

      public static @Nullable ByteBuffer nvalue(long struct)
      Unsafe version of value.
    • nsize

      public static int nsize(long struct)
      Unsafe version of size().
    • nname

      public static void nname(long struct, ByteBuffer value)
      Unsafe version of name.
    • ntype

      public static void ntype(long struct, ByteBuffer value)
      Unsafe version of type.
    • nvalue

      public static void nvalue(long struct, @Nullable ByteBuffer value)
      Unsafe version of value.
    • nsize

      public static void nsize(long struct, int value)
      Sets the specified value to the size field of the specified struct.
    • validate

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