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 implements NativeResource
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 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 ofNVGPaint
structs.-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
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
RADIUSThe 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, POINTER_SHIFT, POINTER_SIZE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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)
Returns a newNVGPaint
instance for the specified memory address.static NVGPaint.Buffer
create(long address, int capacity)
Create aNVGPaint.Buffer
instance at the specified memory.static NVGPaint
createSafe(long address)
static NVGPaint.Buffer
createSafe(long address, int capacity)
java.nio.FloatBuffer
extent()
Returns aFloatBuffer
view of 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.NVGPaint
extent(java.nio.FloatBuffer value)
Copies the specifiedFloatBuffer
to 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(java.util.function.Consumer<NVGColor> consumer)
Passes theinnerColor
field to the specifiedConsumer
.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
.static java.nio.FloatBuffer
nextent(long struct)
Unsafe version ofextent()
.static float
nextent(long struct, int index)
Unsafe version ofextent
.static void
nextent(long struct, int index, float value)
Unsafe version ofextent
.static void
nextent(long struct, java.nio.FloatBuffer value)
Unsafe version ofextent
.static float
nfeather(long struct)
Unsafe version offeather()
.static void
nfeather(long struct, float value)
Unsafe version offeather
.static int
nimage(long struct)
Unsafe version ofimage()
.static void
nimage(long struct, int value)
Unsafe version ofimage
.static NVGColor
ninnerColor(long struct)
Unsafe version ofinnerColor()
.static void
ninnerColor(long struct, NVGColor value)
Unsafe version ofinnerColor
.static NVGColor
nouterColor(long struct)
Unsafe version ofouterColor()
.static void
nouterColor(long struct, NVGColor value)
Unsafe version ofouterColor
.static float
nradius(long struct)
Unsafe version ofradius()
.static void
nradius(long struct, float value)
Unsafe version ofradius
.static java.nio.FloatBuffer
nxform(long struct)
Unsafe version ofxform()
.static float
nxform(long struct, int index)
Unsafe version ofxform
.static void
nxform(long struct, int index, float value)
Unsafe version ofxform
.static void
nxform(long struct, java.nio.FloatBuffer value)
Unsafe version ofxform
.NVGColor
outerColor()
Returns aNVGColor
view of theouterColor
field.NVGPaint
outerColor(java.util.function.Consumer<NVGColor> consumer)
Passes theouterColor
field to the specifiedConsumer
.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()
Returnssizeof(struct)
.java.nio.FloatBuffer
xform()
Returns aFloatBuffer
view of 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.NVGPaint
xform(java.nio.FloatBuffer value)
Copies the specifiedFloatBuffer
to thexform
field.-
Methods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
-
-
-
-
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
Returnssizeof(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.
-
innerColor
public NVGPaint innerColor(java.util.function.Consumer<NVGColor> consumer)
Passes theinnerColor
field to the specifiedConsumer
.
-
outerColor
public NVGPaint outerColor(java.util.function.Consumer<NVGColor> consumer)
Passes theouterColor
field to the specifiedConsumer
.
-
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)
Returns a newNVGPaint
instance for the specified memory address.
-
createSafe
@Nullable public static NVGPaint createSafe(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
-
createSafe
@Nullable public static NVGPaint.Buffer createSafe(long address, int 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
-
nxform
public static java.nio.FloatBuffer nxform(long struct)
Unsafe version ofxform()
.
-
nxform
public static float nxform(long struct, int index)
Unsafe version ofxform
.
-
nextent
public static java.nio.FloatBuffer nextent(long struct)
Unsafe version ofextent()
.
-
nextent
public static float nextent(long struct, int index)
Unsafe version ofextent
.
-
nradius
public static float nradius(long struct)
Unsafe version ofradius()
.
-
nfeather
public static float nfeather(long struct)
Unsafe version offeather()
.
-
ninnerColor
public static NVGColor ninnerColor(long struct)
Unsafe version ofinnerColor()
.
-
nouterColor
public static NVGColor nouterColor(long struct)
Unsafe version ofouterColor()
.
-
nimage
public static int nimage(long struct)
Unsafe version ofimage()
.
-
nxform
public static void nxform(long struct, java.nio.FloatBuffer value)
Unsafe version ofxform
.
-
nxform
public static void nxform(long struct, int index, float value)
Unsafe version ofxform
.
-
nextent
public static void nextent(long struct, java.nio.FloatBuffer value)
Unsafe version ofextent
.
-
nextent
public static void nextent(long struct, int index, float value)
Unsafe version ofextent
.
-
nradius
public static void nradius(long struct, float value)
Unsafe version ofradius
.
-
nfeather
public static void nfeather(long struct, float value)
Unsafe version offeather
.
-
ninnerColor
public static void ninnerColor(long struct, NVGColor value)
Unsafe version ofinnerColor
.
-
nouterColor
public static void nouterColor(long struct, NVGColor value)
Unsafe version ofouterColor
.
-
nimage
public static void nimage(long struct, int value)
Unsafe version ofimage
.
-
-