Package org.lwjgl.nanovg
Class NVGColor
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.nanovg.NVGColor
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class NVGColor extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
A NanoVG color.Member documentation
- <union>
rgba[4]
– an array of 4 color components- <struct>
r
– the color red componentg
– the color green componentb
– the color blue componenta
– the color alpha component
Layout
struct NVGcolor { union { float rgba[4]; struct { float r; float g; float b; float a; }; }; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NVGColor.Buffer
An array ofNVGColor
structs.
-
Constructor Summary
Constructors Constructor Description NVGColor(java.nio.ByteBuffer container)
Creates aNVGColor
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description float
a()
Returns the value of thea
field.NVGColor
a(float value)
Sets the specified value to thea
field.float
b()
Returns the value of theb
field.NVGColor
b(float value)
Sets the specified value to theb
field.static NVGColor
calloc()
Returns a newNVGColor
instance allocated withmemCalloc
.static NVGColor.Buffer
calloc(int capacity)
Returns a newNVGColor.Buffer
instance allocated withmemCalloc
.static NVGColor
callocStack()
Returns a newNVGColor
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NVGColor.Buffer
callocStack(int capacity)
Returns a newNVGColor.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NVGColor.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNVGColor.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NVGColor
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNVGColor
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NVGColor
create()
Returns a newNVGColor
instance allocated withBufferUtils
.static NVGColor.Buffer
create(int capacity)
Returns a newNVGColor.Buffer
instance allocated withBufferUtils
.static NVGColor
create(long address)
Returns a newNVGColor
instance for the specified memory address.static NVGColor.Buffer
create(long address, int capacity)
Create aNVGColor.Buffer
instance at the specified memory.static NVGColor
createSafe(long address)
static NVGColor.Buffer
createSafe(long address, int capacity)
float
g()
Returns the value of theg
field.NVGColor
g(float value)
Sets the specified value to theg
field.static NVGColor
malloc()
Returns a newNVGColor
instance allocated withmemAlloc
.static NVGColor.Buffer
malloc(int capacity)
Returns a newNVGColor.Buffer
instance allocated withmemAlloc
.static NVGColor
mallocStack()
Returns a newNVGColor
instance allocated on the thread-localMemoryStack
.static NVGColor.Buffer
mallocStack(int capacity)
Returns a newNVGColor.Buffer
instance allocated on the thread-localMemoryStack
.static NVGColor.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNVGColor.Buffer
instance allocated on the specifiedMemoryStack
.static NVGColor
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNVGColor
instance allocated on the specifiedMemoryStack
.static float
na(long struct)
Unsafe version ofa()
.static void
na(long struct, float value)
Unsafe version ofa
.static float
nb(long struct)
Unsafe version ofb()
.static void
nb(long struct, float value)
Unsafe version ofb
.static float
ng(long struct)
Unsafe version ofg()
.static void
ng(long struct, float value)
Unsafe version ofg
.static float
nr(long struct)
Unsafe version ofr()
.static void
nr(long struct, float value)
Unsafe version ofr
.static java.nio.FloatBuffer
nrgba(long struct)
Unsafe version ofrgba()
.static float
nrgba(long struct, int index)
Unsafe version ofrgba
.static void
nrgba(long struct, int index, float value)
Unsafe version ofrgba
.static void
nrgba(long struct, java.nio.FloatBuffer value)
Unsafe version ofrgba
.float
r()
Returns the value of ther
field.NVGColor
r(float value)
Sets the specified value to ther
field.java.nio.FloatBuffer
rgba()
Returns aFloatBuffer
view of thergba
field.float
rgba(int index)
Returns the value at the specified index of thergba
field.NVGColor
rgba(int index, float value)
Sets the specified value at the specified index of thergba
field.NVGColor
rgba(java.nio.FloatBuffer value)
Copies the specifiedFloatBuffer
to thergba
field.NVGColor
set(NVGColor src)
Copies the specified struct data to this struct.int
sizeof()
-
-
-
Constructor Detail
-
NVGColor
public NVGColor(java.nio.ByteBuffer container)
Creates aNVGColor
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()
- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
rgba
public java.nio.FloatBuffer rgba()
Returns aFloatBuffer
view of thergba
field.
-
rgba
public float rgba(int index)
Returns the value at the specified index of thergba
field.
-
r
public float r()
Returns the value of ther
field.
-
g
public float g()
Returns the value of theg
field.
-
b
public float b()
Returns the value of theb
field.
-
a
public float a()
Returns the value of thea
field.
-
rgba
public NVGColor rgba(java.nio.FloatBuffer value)
Copies the specifiedFloatBuffer
to thergba
field.
-
rgba
public NVGColor rgba(int index, float value)
Sets the specified value at the specified index of thergba
field.
-
r
public NVGColor r(float value)
Sets the specified value to ther
field.
-
g
public NVGColor g(float value)
Sets the specified value to theg
field.
-
b
public NVGColor b(float value)
Sets the specified value to theb
field.
-
a
public NVGColor a(float value)
Sets the specified value to thea
field.
-
set
public NVGColor set(NVGColor src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static NVGColor malloc()
Returns a newNVGColor
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static NVGColor calloc()
Returns a newNVGColor
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static NVGColor create()
Returns a newNVGColor
instance allocated withBufferUtils
.
-
create
public static NVGColor create(long address)
Returns a newNVGColor
instance for the specified memory address.
-
createSafe
@Nullable public static NVGColor createSafe(long address)
-
malloc
public static NVGColor.Buffer malloc(int capacity)
Returns a newNVGColor.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static NVGColor.Buffer calloc(int capacity)
Returns a newNVGColor.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static NVGColor.Buffer create(int capacity)
Returns a newNVGColor.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static NVGColor.Buffer create(long address, int capacity)
Create aNVGColor.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static NVGColor.Buffer createSafe(long address, int capacity)
-
mallocStack
public static NVGColor mallocStack()
Returns a newNVGColor
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static NVGColor callocStack()
Returns a newNVGColor
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static NVGColor mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNVGColor
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static NVGColor callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNVGColor
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static NVGColor.Buffer mallocStack(int capacity)
Returns a newNVGColor.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static NVGColor.Buffer callocStack(int capacity)
Returns a newNVGColor.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static NVGColor.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNVGColor.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static NVGColor.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNVGColor.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nrgba
public static java.nio.FloatBuffer nrgba(long struct)
Unsafe version ofrgba()
.
-
nrgba
public static float nrgba(long struct, int index)
Unsafe version ofrgba
.
-
nr
public static float nr(long struct)
Unsafe version ofr()
.
-
ng
public static float ng(long struct)
Unsafe version ofg()
.
-
nb
public static float nb(long struct)
Unsafe version ofb()
.
-
na
public static float na(long struct)
Unsafe version ofa()
.
-
nrgba
public static void nrgba(long struct, java.nio.FloatBuffer value)
Unsafe version ofrgba
.
-
nrgba
public static void nrgba(long struct, int index, float value)
Unsafe version ofrgba
.
-
nr
public static void nr(long struct, float value)
Unsafe version ofr
.
-
ng
public static void ng(long struct, float value)
Unsafe version ofg
.
-
nb
public static void nb(long struct, float value)
Unsafe version ofb
.
-
na
public static void na(long struct, float value)
Unsafe version ofa
.
-
-