Class NVGPaint

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


    public class NVGPaint
    extends Struct
    A NanoVG paint.

    Member documentation

    • xform – the transformation matrix
    • extent – 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[6] xform;
        float[2] extent;
        float radius;
        float feather;
        NVGcolor innerColor;
        NVGcolor outerColor;
        int image;
    }
    • Field Detail

      • SIZEOF

        public static final int SIZEOF
        The struct size in bytes.
    • 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()
        Description copied from class: Struct
        Returns the sizeof(struct).
        Specified by:
        sizeof in class 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.
      • 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.
      • nset

        public NVGPaint nset(long struct)
        Unsafe version of set.
      • 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(long address)
        Returns a new NVGPaint instance for the specified memory address or null if the 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(long address,
                                             int capacity)
        Create a NVGPaint.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • 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(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(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
      • 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
      • callocStack

        public static NVGPaint.Buffer callocStack(int capacity,
                                                  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