Class spng_offs

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class spng_offs extends Struct<spng_offs> implements NativeResource

 struct spng_offs {
     int32_t x;
     int32_t 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.
    • X

      public static final int X
      The struct member offsets.
    • Y

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

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

    • spng_offs

      public spng_offs(ByteBuffer container)
      Creates a spng_offs 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_offs>
    • x

      public int x()
      Returns:
      the value of the x field.
    • y

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

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

      public spng_offs x(int value)
      Sets the specified value to the x field.
    • y

      public spng_offs y(int value)
      Sets the specified value to the y field.
    • unit_specifier

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

      public spng_offs set(int x, int y, byte unit_specifier)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static int nx(long struct)
      Unsafe version of x().
    • ny

      public static int ny(long struct)
      Unsafe version of y().
    • nunit_specifier

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

      public static void nx(long struct, int value)
      Unsafe version of x.
    • ny

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

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