Class spng_plte_entry

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class spng_plte_entry extends Struct<spng_plte_entry> implements NativeResource

 struct spng_plte_entry {
     uint8_t red;
     uint8_t green;
     uint8_t blue;
     uint8_t alpha;
 }
  • 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.
  • Constructor Details

    • spng_plte_entry

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

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

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

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

      public byte alpha()
      Returns:
      the value of the alpha field.
    • red

      public spng_plte_entry red(byte value)
      Sets the specified value to the red field.
    • green

      public spng_plte_entry green(byte value)
      Sets the specified value to the green field.
    • blue

      public spng_plte_entry blue(byte value)
      Sets the specified value to the blue field.
    • alpha

      public spng_plte_entry alpha(byte value)
      Sets the specified value to the alpha field.
    • set

      public spng_plte_entry set(byte red, byte green, byte blue, byte alpha)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

      public static spng_plte_entry calloc(MemoryStack stack)
      Returns a new spng_plte_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_plte_entry.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new spng_plte_entry.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static spng_plte_entry.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new spng_plte_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 byte nred(long struct)
      Unsafe version of red().
    • ngreen

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

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

      public static byte nalpha(long struct)
      Unsafe version of alpha().
    • nred

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

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

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

      public static void nalpha(long struct, byte value)
      Unsafe version of alpha.