Package org.lwjgl.nanovg
Class NVGPaint
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.nanovg.NVGPaint
-
- All Implemented Interfaces:
- java.lang.AutoCloseable, NativeResource, Pointer
public class NVGPaint extends Struct
A NanoVG paint.Member documentation
xform
– the transformation matrixextent
– the extentradius
– the radiusfeather
– the feather amountinnerColor
– the inner colorouterColor
– the outer colorimage
– the image handle
Layout
struct NVGpaint { float[6] xform; float[2] extent; float radius; float feather;
NVGcolor
innerColor;NVGcolor
outerColor; int image; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
NVGPaint.Buffer
An array ofNVGPaint
structs.-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
Fields Modifier and Type Field and Description static int
SIZEOF
The struct size in bytes.-
Fields inherited from interface org.lwjgl.system.Pointer
POINTER_SHIFT, POINTER_SIZE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static NVGPaint
calloc()
static NVGPaint.Buffer
calloc(int capacity)
Returns a newNVGPaint.Buffer
instance allocated withmemCalloc
.static NVGPaint
callocStack()
Returns a newNVGPaint
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NVGPaint.Buffer
callocStack(int capacity)
Returns a newNVGPaint.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NVGPaint.Buffer
callocStack(int capacity, MemoryStack stack)
Returns a newNVGPaint.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NVGPaint
callocStack(MemoryStack stack)
Returns a newNVGPaint
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NVGPaint
create()
Returns a newNVGPaint
instance allocated withBufferUtils
.static NVGPaint.Buffer
create(int capacity)
Returns a newNVGPaint.Buffer
instance allocated withBufferUtils
.static NVGPaint
create(long address)
static NVGPaint.Buffer
create(long address, int capacity)
Create aNVGPaint.Buffer
instance at the specified memory.java.nio.FloatBuffer
extent()
Returns aFloatBuffer
view of theextent
field.NVGPaint
extent(java.nio.FloatBuffer value)
Copies the specifiedFloatBuffer
to theextent
field.float
extent(int index)
Returns the value at the specified index of theextent
field.NVGPaint
extent(int index, float value)
Sets the specified value at the specified index of theextent
field.float
feather()
Returns the value of thefeather
field.NVGPaint
feather(float value)
Sets the specified value to thefeather
field.int
image()
Returns the value of theimage
field.NVGPaint
image(int value)
Sets the specified value to theimage
field.NVGColor
innerColor()
Returns aNVGColor
view of theinnerColor
field.NVGPaint
innerColor(NVGColor value)
Copies the specifiedNVGColor
to theinnerColor
field.static NVGPaint
malloc()
static NVGPaint.Buffer
malloc(int capacity)
Returns a newNVGPaint.Buffer
instance allocated withmemAlloc
.static NVGPaint
mallocStack()
Returns a newNVGPaint
instance allocated on the thread-localMemoryStack
.static NVGPaint.Buffer
mallocStack(int capacity)
Returns a newNVGPaint.Buffer
instance allocated on the thread-localMemoryStack
.static NVGPaint.Buffer
mallocStack(int capacity, MemoryStack stack)
Returns a newNVGPaint.Buffer
instance allocated on the specifiedMemoryStack
.static NVGPaint
mallocStack(MemoryStack stack)
Returns a newNVGPaint
instance allocated on the specifiedMemoryStack
.NVGPaint
nset(long struct)
Unsafe version ofset
.NVGColor
outerColor()
Returns aNVGColor
view of theouterColor
field.NVGPaint
outerColor(NVGColor value)
Copies the specifiedNVGColor
to theouterColor
field.float
radius()
Returns the value of theradius
field.NVGPaint
radius(float value)
Sets the specified value to theradius
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()
Returns thesizeof(struct)
.java.nio.FloatBuffer
xform()
Returns aFloatBuffer
view of thexform
field.NVGPaint
xform(java.nio.FloatBuffer value)
Copies the specifiedFloatBuffer
to thexform
field.float
xform(int index)
Returns the value at the specified index of thexform
field.NVGPaint
xform(int index, float value)
Sets the specified value at the specified index of thexform
field.-
Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
-
Methods inherited from interface org.lwjgl.system.NativeResource
close
-
-
-
-
Constructor Detail
-
NVGPaint
public NVGPaint(java.nio.ByteBuffer container)
Creates aNVGPaint
instance at the current position of the specifiedByteBuffer
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 thesizeof(struct)
.
-
xform
public java.nio.FloatBuffer xform()
Returns aFloatBuffer
view of thexform
field.
-
xform
public float xform(int index)
Returns the value at the specified index of thexform
field.
-
extent
public java.nio.FloatBuffer extent()
Returns aFloatBuffer
view of theextent
field.
-
extent
public float extent(int index)
Returns the value at the specified index of theextent
field.
-
radius
public float radius()
Returns the value of theradius
field.
-
feather
public float feather()
Returns the value of thefeather
field.
-
image
public int image()
Returns the value of theimage
field.
-
xform
public NVGPaint xform(java.nio.FloatBuffer value)
Copies the specifiedFloatBuffer
to thexform
field.
-
xform
public NVGPaint xform(int index, float value)
Sets the specified value at the specified index of thexform
field.
-
extent
public NVGPaint extent(java.nio.FloatBuffer value)
Copies the specifiedFloatBuffer
to theextent
field.
-
extent
public NVGPaint extent(int index, float value)
Sets the specified value at the specified index of theextent
field.
-
radius
public NVGPaint radius(float value)
Sets the specified value to theradius
field.
-
feather
public NVGPaint feather(float value)
Sets the specified value to thefeather
field.
-
innerColor
public NVGPaint innerColor(NVGColor value)
Copies the specifiedNVGColor
to theinnerColor
field.
-
outerColor
public NVGPaint outerColor(NVGColor value)
Copies the specifiedNVGColor
to theouterColor
field.
-
image
public NVGPaint image(int value)
Sets the specified value to theimage
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()
-
calloc
public static NVGPaint calloc()
-
create
public static NVGPaint create()
Returns a newNVGPaint
instance allocated withBufferUtils
.
-
create
public static NVGPaint create(long address)
-
malloc
public static NVGPaint.Buffer malloc(int capacity)
Returns a newNVGPaint.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static NVGPaint.Buffer calloc(int capacity)
Returns a newNVGPaint.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static NVGPaint.Buffer create(int capacity)
Returns a newNVGPaint.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static NVGPaint.Buffer create(long address, int capacity)
Create aNVGPaint.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
mallocStack
public static NVGPaint mallocStack()
Returns a newNVGPaint
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static NVGPaint callocStack()
Returns a newNVGPaint
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static NVGPaint mallocStack(MemoryStack stack)
Returns a newNVGPaint
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static NVGPaint callocStack(MemoryStack stack)
Returns a newNVGPaint
instance allocated on the specifiedMemoryStack
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 newNVGPaint.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static NVGPaint.Buffer callocStack(int capacity)
Returns a newNVGPaint.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static NVGPaint.Buffer mallocStack(int capacity, MemoryStack stack)
Returns a newNVGPaint.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static NVGPaint.Buffer callocStack(int capacity, MemoryStack stack)
Returns a newNVGPaint.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
-