Class NVGPaint

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

    public class NVGPaint
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    A NanoVG paint.

    Member documentation

    • xform[6] – the transformation matrix
    • extent[2] – the extent
    • radius – the radius
    • feather – the feather amount
    • innerColor – the inner color
    • outerColor – the outer color
    • image – the image handle

    Layout

    
     struct NVGpaint {
         float xform[6];
         float extent[2];
         float radius;
         float feather;
         NVGcolor innerColor;
         NVGcolor outerColor;
         int image;
     }
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  NVGPaint.Buffer
      An array of NVGPaint structs.
      • Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

        org.lwjgl.system.Pointer.Default
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ALIGNOF
      The struct alignment in bytes.
      static int EXTENT
      FEATHER
      IMAGE
      INNERCOLOR
      OUTERCOLOR
      RADIUS
      The struct member offsets.
      static int SIZEOF
      The struct size in bytes.
      static int XFORM
      The struct member offsets.
      • Fields inherited from interface org.lwjgl.system.Pointer

        BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
    • Constructor Summary

      Constructors 
      Constructor Description
      NVGPaint​(java.nio.ByteBuffer container)
      Creates a NVGPaint instance at the current position of the specified ByteBuffer container.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static NVGPaint calloc()
      Returns a new NVGPaint instance allocated with memCalloc.
      static NVGPaint.Buffer calloc​(int capacity)
      Returns a new NVGPaint.Buffer instance allocated with memCalloc.
      static NVGPaint callocStack()
      Returns a new NVGPaint instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      static NVGPaint.Buffer callocStack​(int capacity)
      Returns a new NVGPaint.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      static NVGPaint.Buffer callocStack​(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new NVGPaint.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      static NVGPaint callocStack​(org.lwjgl.system.MemoryStack stack)
      Returns a new NVGPaint instance allocated on the specified MemoryStack and initializes all its bits to zero.
      static NVGPaint create()
      Returns a new NVGPaint instance allocated with BufferUtils.
      static NVGPaint.Buffer create​(int capacity)
      Returns a new NVGPaint.Buffer instance allocated with BufferUtils.
      static NVGPaint create​(long address)
      Returns a new NVGPaint instance for the specified memory address.
      static NVGPaint.Buffer create​(long address, int capacity)
      Create a NVGPaint.Buffer instance at the specified memory.
      static NVGPaint createSafe​(long address)
      Like create, but returns null if address is NULL.
      static NVGPaint.Buffer createSafe​(long address, int capacity)
      Like create, but returns null if address is NULL.
      java.nio.FloatBuffer extent()
      Returns a FloatBuffer view of the extent field.
      float extent​(int index)
      Returns the value at the specified index of the extent field.
      NVGPaint extent​(int index, float value)
      Sets the specified value at the specified index of the extent field.
      NVGPaint extent​(java.nio.FloatBuffer value)
      Copies the specified FloatBuffer to the extent field.
      float feather()
      Returns the value of the feather field.
      NVGPaint feather​(float value)
      Sets the specified value to the feather field.
      int image()
      Returns the value of the image field.
      NVGPaint image​(int value)
      Sets the specified value to the image field.
      NVGColor innerColor()
      Returns a NVGColor view of the innerColor field.
      NVGPaint innerColor​(java.util.function.Consumer<NVGColor> consumer)
      Passes the innerColor field to the specified Consumer.
      NVGPaint innerColor​(NVGColor value)
      Copies the specified NVGColor to the innerColor field.
      static NVGPaint malloc()
      Returns a new NVGPaint instance allocated with memAlloc.
      static NVGPaint.Buffer malloc​(int capacity)
      Returns a new NVGPaint.Buffer instance allocated with memAlloc.
      static NVGPaint mallocStack()
      Returns a new NVGPaint instance allocated on the thread-local MemoryStack.
      static NVGPaint.Buffer mallocStack​(int capacity)
      Returns a new NVGPaint.Buffer instance allocated on the thread-local MemoryStack.
      static NVGPaint.Buffer mallocStack​(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new NVGPaint.Buffer instance allocated on the specified MemoryStack.
      static NVGPaint mallocStack​(org.lwjgl.system.MemoryStack stack)
      Returns a new NVGPaint instance allocated on the specified MemoryStack.
      static java.nio.FloatBuffer nextent​(long struct)
      Unsafe version of extent().
      static float nextent​(long struct, int index)
      Unsafe version of extent.
      static void nextent​(long struct, int index, float value)
      Unsafe version of extent.
      static void nextent​(long struct, java.nio.FloatBuffer value)
      Unsafe version of extent.
      static float nfeather​(long struct)
      Unsafe version of feather().
      static void nfeather​(long struct, float value)
      Unsafe version of feather.
      static int nimage​(long struct)
      Unsafe version of image().
      static void nimage​(long struct, int value)
      Unsafe version of image.
      static NVGColor ninnerColor​(long struct)
      Unsafe version of innerColor().
      static void ninnerColor​(long struct, NVGColor value)
      Unsafe version of innerColor.
      static NVGColor nouterColor​(long struct)
      Unsafe version of outerColor().
      static void nouterColor​(long struct, NVGColor value)
      Unsafe version of outerColor.
      static float nradius​(long struct)
      Unsafe version of radius().
      static void nradius​(long struct, float value)
      Unsafe version of radius.
      static java.nio.FloatBuffer nxform​(long struct)
      Unsafe version of xform().
      static float nxform​(long struct, int index)
      Unsafe version of xform.
      static void nxform​(long struct, int index, float value)
      Unsafe version of xform.
      static void nxform​(long struct, java.nio.FloatBuffer value)
      Unsafe version of xform.
      NVGColor outerColor()
      Returns a NVGColor view of the outerColor field.
      NVGPaint outerColor​(java.util.function.Consumer<NVGColor> consumer)
      Passes the outerColor field to the specified Consumer.
      NVGPaint outerColor​(NVGColor value)
      Copies the specified NVGColor to the outerColor field.
      float radius()
      Returns the value of the radius field.
      NVGPaint radius​(float value)
      Sets the specified value to the radius field.
      NVGPaint set​(java.nio.FloatBuffer xform, java.nio.FloatBuffer extent, float radius, float feather, NVGColor innerColor, NVGColor outerColor, int image)
      Initializes this struct with the specified values.
      NVGPaint set​(NVGPaint src)
      Copies the specified struct data to this struct.
      int sizeof()  
      java.nio.FloatBuffer xform()
      Returns a FloatBuffer view of the xform field.
      float xform​(int index)
      Returns the value at the specified index of the xform field.
      NVGPaint xform​(int index, float value)
      Sets the specified value at the specified index of the xform field.
      NVGPaint xform​(java.nio.FloatBuffer value)
      Copies the specified FloatBuffer to the xform field.
      • Methods inherited from interface org.lwjgl.system.NativeResource

        close, free
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from class org.lwjgl.system.Pointer.Default

        address, equals, hashCode, toString
      • Methods inherited from class org.lwjgl.system.Struct

        clear, free, isNull
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • XFORM, EXTENT, RADIUS, FEATHER, INNERCOLOR, OUTERCOLOR, IMAGE

        The struct member offsets.
    • Constructor Detail

      • NVGPaint

        public NVGPaint​(java.nio.ByteBuffer container)
        Creates a NVGPaint 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()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • xform

        public java.nio.FloatBuffer xform()
        Returns a FloatBuffer view of the xform field.
      • xform

        public float xform​(int index)
        Returns the value at the specified index of the xform field.
      • extent

        public java.nio.FloatBuffer extent()
        Returns a FloatBuffer view of the extent field.
      • extent

        public float extent​(int index)
        Returns the value at the specified index of the extent field.
      • radius

        public float radius()
        Returns the value of the radius field.
      • feather

        public float feather()
        Returns the value of the feather field.
      • innerColor

        public NVGColor innerColor()
        Returns a NVGColor view of the innerColor field.
      • outerColor

        public NVGColor outerColor()
        Returns a NVGColor view of the outerColor field.
      • image

        public int image()
        Returns the value of the image field.
      • xform

        public NVGPaint xform​(java.nio.FloatBuffer value)
        Copies the specified FloatBuffer to the xform field.
      • xform

        public NVGPaint xform​(int index,
                              float value)
        Sets the specified value at the specified index of the xform field.
      • extent

        public NVGPaint extent​(java.nio.FloatBuffer value)
        Copies the specified FloatBuffer to the extent field.
      • extent

        public NVGPaint extent​(int index,
                               float value)
        Sets the specified value at the specified index of the extent field.
      • radius

        public NVGPaint radius​(float value)
        Sets the specified value to the radius field.
      • feather

        public NVGPaint feather​(float value)
        Sets the specified value to the feather field.
      • innerColor

        public NVGPaint innerColor​(java.util.function.Consumer<NVGColor> consumer)
        Passes the innerColor field to the specified Consumer.
      • outerColor

        public NVGPaint outerColor​(java.util.function.Consumer<NVGColor> consumer)
        Passes the outerColor field to the specified Consumer.
      • image

        public NVGPaint image​(int value)
        Sets the specified value to the image field.
      • set

        public NVGPaint set​(java.nio.FloatBuffer xform,
                            java.nio.FloatBuffer extent,
                            float radius,
                            float feather,
                            NVGColor innerColor,
                            NVGColor outerColor,
                            int image)
        Initializes this struct with the specified values.
      • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        public static NVGPaint callocStack​(org.lwjgl.system.MemoryStack stack)
        Returns a new NVGPaint instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • mallocStack

        public static NVGPaint.Buffer mallocStack​(int capacity)
        Returns a new NVGPaint.Buffer instance allocated on the thread-local MemoryStack.
        Parameters:
        capacity - the buffer capacity
      • callocStack

        public static NVGPaint.Buffer callocStack​(int capacity)
        Returns a new NVGPaint.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • mallocStack

        public static NVGPaint.Buffer mallocStack​(int capacity,
                                                  org.lwjgl.system.MemoryStack stack)
        Returns a new NVGPaint.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • callocStack

        public static NVGPaint.Buffer callocStack​(int capacity,
                                                  org.lwjgl.system.MemoryStack stack)
        Returns a new NVGPaint.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • nxform

        public static java.nio.FloatBuffer nxform​(long struct)
        Unsafe version of xform().
      • nxform

        public static float nxform​(long struct,
                                   int index)
        Unsafe version of xform.
      • nextent

        public static java.nio.FloatBuffer nextent​(long struct)
        Unsafe version of extent().
      • nextent

        public static float nextent​(long struct,
                                    int index)
        Unsafe version of extent.
      • nradius

        public static float nradius​(long struct)
        Unsafe version of radius().
      • nfeather

        public static float nfeather​(long struct)
        Unsafe version of feather().
      • nimage

        public static int nimage​(long struct)
        Unsafe version of image().
      • nxform

        public static void nxform​(long struct,
                                  java.nio.FloatBuffer value)
        Unsafe version of xform.
      • nxform

        public static void nxform​(long struct,
                                  int index,
                                  float value)
        Unsafe version of xform.
      • nextent

        public static void nextent​(long struct,
                                   java.nio.FloatBuffer value)
        Unsafe version of extent.
      • nextent

        public static void nextent​(long struct,
                                   int index,
                                   float value)
        Unsafe version of extent.
      • nradius

        public static void nradius​(long struct,
                                   float value)
        Unsafe version of radius.
      • nfeather

        public static void nfeather​(long struct,
                                    float value)
        Unsafe version of feather.
      • ninnerColor

        public static void ninnerColor​(long struct,
                                       NVGColor value)
        Unsafe version of innerColor.
      • nouterColor

        public static void nouterColor​(long struct,
                                       NVGColor value)
        Unsafe version of outerColor.
      • nimage

        public static void nimage​(long struct,
                                  int value)
        Unsafe version of image.