Class spng_splt_entry

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class spng_splt_entry extends Struct<spng_splt_entry> implements NativeResource

 struct spng_splt_entry {
     uint16_t red;
     uint16_t green;
     uint16_t blue;
     uint16_t alpha;
     uint16_t frequency;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int RED
      The struct member offsets.
    • GREEN

      public static final int GREEN
      The struct member offsets.
    • BLUE

      public static final int BLUE
      The struct member offsets.
    • ALPHA

      public static final int ALPHA
      The struct member offsets.
    • FREQUENCY

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

    • spng_splt_entry

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

      public short red()
      Returns:
      the value of the red field.
    • green

      public short green()
      Returns:
      the value of the green field.
    • blue

      public short blue()
      Returns:
      the value of the blue field.
    • alpha

      public short alpha()
      Returns:
      the value of the alpha field.
    • frequency

      public short frequency()
      Returns:
      the value of the frequency field.
    • red

      public spng_splt_entry red(short value)
      Sets the specified value to the red field.
    • green

      public spng_splt_entry green(short value)
      Sets the specified value to the green field.
    • blue

      public spng_splt_entry blue(short value)
      Sets the specified value to the blue field.
    • alpha

      public spng_splt_entry alpha(short value)
      Sets the specified value to the alpha field.
    • frequency

      public spng_splt_entry frequency(short value)
      Sets the specified value to the frequency field.
    • set

      public spng_splt_entry set(short red, short green, short blue, short alpha, short frequency)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static short nred(long struct)
      Unsafe version of red().
    • ngreen

      public static short ngreen(long struct)
      Unsafe version of green().
    • nblue

      public static short nblue(long struct)
      Unsafe version of blue().
    • nalpha

      public static short nalpha(long struct)
      Unsafe version of alpha().
    • nfrequency

      public static short nfrequency(long struct)
      Unsafe version of frequency().
    • nred

      public static void nred(long struct, short value)
      Unsafe version of red.
    • ngreen

      public static void ngreen(long struct, short value)
      Unsafe version of green.
    • nblue

      public static void nblue(long struct, short value)
      Unsafe version of blue.
    • nalpha

      public static void nalpha(long struct, short value)
      Unsafe version of alpha.
    • nfrequency

      public static void nfrequency(long struct, short value)
      Unsafe version of frequency.