Class spng_trns

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class spng_trns extends Struct<spng_trns> implements NativeResource

 struct spng_trns {
     uint16_t gray;
     uint16_t red;
     uint16_t green;
     uint16_t blue;
     uint32_t n_type3_entries;
     uint8_t type3_alpha[256];
 }
  • 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.
    • N_TYPE3_ENTRIES

      public static final int N_TYPE3_ENTRIES
      The struct member offsets.
    • TYPE3_ALPHA

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

    • spng_trns

      public spng_trns(ByteBuffer container)
      Creates a spng_trns 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_trns>
    • 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.
    • n_type3_entries

      public int n_type3_entries()
      Returns:
      the value of the n_type3_entries field.
    • type3_alpha

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

      public byte type3_alpha(int index)
      Returns:
      the value at the specified index of the type3_alpha field.
    • gray

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

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

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

      public spng_trns blue(short value)
      Sets the specified value to the blue field.
    • type3_alpha

      public spng_trns type3_alpha(ByteBuffer value)
      Copies the specified ByteBuffer to the type3_alpha field.
    • type3_alpha

      public spng_trns type3_alpha(int index, byte value)
      Sets the specified value at the specified index of the type3_alpha field.
    • set

      public spng_trns set(short gray, short red, short green, short blue, ByteBuffer type3_alpha)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static int nn_type3_entries(long struct)
      Unsafe version of n_type3_entries().
    • ntype3_alpha

      public static ByteBuffer ntype3_alpha(long struct)
      Unsafe version of type3_alpha().
    • ntype3_alpha

      public static byte ntype3_alpha(long struct, int index)
      Unsafe version of type3_alpha.
    • 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.
    • nn_type3_entries

      public static void nn_type3_entries(long struct, int value)
      Sets the specified value to the n_type3_entries field of the specified struct.
    • ntype3_alpha

      public static void ntype3_alpha(long struct, ByteBuffer value)
      Unsafe version of type3_alpha.
    • ntype3_alpha

      public static void ntype3_alpha(long struct, int index, byte value)
      Unsafe version of type3_alpha.