Class NVGGlyphPosition

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class NVGGlyphPosition extends Struct<NVGGlyphPosition> implements NativeResource

 struct NVGglyphPosition {
     char * str;
     float x;
     float minx;
     float maxx;
 }
  • Field Details

    • SIZEOF

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

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

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

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

      public static final int MINX
      The struct member offsets.
    • MAXX

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

    • NVGGlyphPosition

      public NVGGlyphPosition(ByteBuffer container)
      Creates a NVGGlyphPosition 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<NVGGlyphPosition>
    • str

      public long str()
      Returns:
      the value of the str field.
    • x

      public float x()
      Returns:
      the value of the x field.
    • minx

      public float minx()
      Returns:
      the value of the minx field.
    • maxx

      public float maxx()
      Returns:
      the value of the maxx field.
    • malloc

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

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

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

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

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

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

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

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

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

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

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

      public static NVGGlyphPosition calloc(MemoryStack stack)
      Returns a new NVGGlyphPosition instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static NVGGlyphPosition.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new NVGGlyphPosition.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

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

      public static long nstr(long struct)
      Unsafe version of str().
    • nx

      public static float nx(long struct)
      Unsafe version of x().
    • nminx

      public static float nminx(long struct)
      Unsafe version of minx().
    • nmaxx

      public static float nmaxx(long struct)
      Unsafe version of maxx().