Class NVGPaint

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class NVGPaint extends Struct<NVGPaint> implements NativeResource

 struct NVGpaint {
     float xform[6];
     float extent[2];
     float radius;
     float feather;
     {@link NVGColor NVGcolor} innerColor;
     {@link NVGColor NVGcolor} outerColor;
     int image;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int XFORM
      The struct member offsets.
    • EXTENT

      public static final int EXTENT
      The struct member offsets.
    • RADIUS

      public static final int RADIUS
      The struct member offsets.
    • FEATHER

      public static final int FEATHER
      The struct member offsets.
    • INNERCOLOR

      public static final int INNERCOLOR
      The struct member offsets.
    • OUTERCOLOR

      public static final int OUTERCOLOR
      The struct member offsets.
    • IMAGE

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

    • NVGPaint

      public NVGPaint(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 Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<NVGPaint>
    • xform

      public 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 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(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(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(NVGColor value)
      Copies the specified NVGColor to the innerColor field.
    • innerColor

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

      public NVGPaint outerColor(NVGColor value)
      Copies the specified NVGColor to the outerColor field.
    • outerColor

      public NVGPaint outerColor(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(FloatBuffer xform, 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

      public static @Nullable 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

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

      @Deprecated public static NVGPaint mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static NVGPaint callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static NVGPaint mallocStack(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static NVGPaint callocStack(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static NVGPaint.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static NVGPaint.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static NVGPaint.Buffer mallocStack(int capacity, MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static NVGPaint.Buffer callocStack(int capacity, MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

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

      public static NVGPaint calloc(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
    • malloc

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

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

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

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

      public static 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().
    • ninnerColor

      public static NVGColor ninnerColor(long struct)
      Unsafe version of innerColor().
    • nouterColor

      public static NVGColor nouterColor(long struct)
      Unsafe version of outerColor().
    • nimage

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

      public static void nxform(long struct, 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, 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.