Class NVGGlyphPosition

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class NVGGlyphPosition
    extends Struct
    implements NativeResource
    A glyph position.

    Member documentation

    • str – position of the glyph in the input string
    • x – the x-coordinate of the logical glyph position
    • minx – the left bound of the glyph shape
    • maxx – the right bound of the glyph shape

    Layout

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

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • STR, X, MINX, MAXX

        The struct member offsets.
    • Constructor Detail

      • NVGGlyphPosition

        public NVGGlyphPosition​(java.nio.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 Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • 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​(long address)
        Returns a new NVGGlyphPosition instance for the specified memory address.
      • createSafe

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

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

        public static NVGGlyphPosition mallocStack()
        Returns a new NVGGlyphPosition instance allocated on the thread-local MemoryStack.
      • callocStack

        public static NVGGlyphPosition callocStack()
        Returns a new NVGGlyphPosition instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

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

        public static NVGGlyphPosition callocStack​(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
      • 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().