Class spng_bkgd

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class spng_bkgd extends Struct<spng_bkgd> implements NativeResource

 struct spng_bkgd {
     uint16_t gray;
     uint16_t red;
     uint16_t green;
     uint16_t blue;
     uint16_t plte_index;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int GRAY
      The struct member offsets.
    • 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.
    • PLTE_INDEX

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

    • spng_bkgd

      public spng_bkgd(ByteBuffer container)
      Creates a spng_bkgd 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_bkgd>
    • gray

      public short gray()
      Returns:
      the value of the gray field.
    • 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.
    • plte_index

      public short plte_index()
      Returns:
      the value of the plte_index field.
    • gray

      public spng_bkgd gray(short value)
      Sets the specified value to the gray field.
    • red

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

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

      public spng_bkgd blue(short value)
      Sets the specified value to the blue field.
    • plte_index

      public spng_bkgd plte_index(short value)
      Sets the specified value to the plte_index field.
    • set

      public spng_bkgd set(short gray, short red, short green, short blue, short plte_index)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static short ngray(long struct)
      Unsafe version of gray().
    • 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().
    • nplte_index

      public static short nplte_index(long struct)
      Unsafe version of plte_index().
    • ngray

      public static void ngray(long struct, short value)
      Unsafe version of gray.
    • 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.
    • nplte_index

      public static void nplte_index(long struct, short value)
      Unsafe version of plte_index.