Class spng_phys

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class spng_phys extends Struct<spng_phys> implements NativeResource

 struct spng_phys {
     uint32_t ppu_x;
     uint32_t ppu_y;
     uint8_t unit_specifier;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int PPU_X
      The struct member offsets.
    • PPU_Y

      public static final int PPU_Y
      The struct member offsets.
    • UNIT_SPECIFIER

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

    • spng_phys

      public spng_phys(ByteBuffer container)
      Creates a spng_phys 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_phys>
    • ppu_x

      public int ppu_x()
      Returns:
      the value of the ppu_x field.
    • ppu_y

      public int ppu_y()
      Returns:
      the value of the ppu_y field.
    • unit_specifier

      public byte unit_specifier()
      Returns:
      the value of the unit_specifier field.
    • ppu_x

      public spng_phys ppu_x(int value)
      Sets the specified value to the ppu_x field.
    • ppu_y

      public spng_phys ppu_y(int value)
      Sets the specified value to the ppu_y field.
    • unit_specifier

      public spng_phys unit_specifier(byte value)
      Sets the specified value to the unit_specifier field.
    • set

      public spng_phys set(int ppu_x, int ppu_y, byte unit_specifier)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static int nppu_x(long struct)
      Unsafe version of ppu_x().
    • nppu_y

      public static int nppu_y(long struct)
      Unsafe version of ppu_y().
    • nunit_specifier

      public static byte nunit_specifier(long struct)
      Unsafe version of unit_specifier().
    • nppu_x

      public static void nppu_x(long struct, int value)
      Unsafe version of ppu_x.
    • nppu_y

      public static void nppu_y(long struct, int value)
      Unsafe version of ppu_y.
    • nunit_specifier

      public static void nunit_specifier(long struct, byte value)
      Unsafe version of unit_specifier.