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, NativeResource, Pointer
public class NVGColor extends Struct
A NanoVG color.Member documentation
rgba
– an array of 4 color componentsr
– the color red componentg
– the color green componentb
– the color blue componenta
– the color alpha component
Layout
struct NVGcolor { union { float[4] rgba; struct { float r; float g; float b; float a; }; }; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
NVGColor.Buffer
An array ofNVGColor
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 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()
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, MemoryStack stack)
Returns a newNVGColor.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NVGColor
callocStack(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)
static NVGColor.Buffer
create(long address, int capacity)
Create aNVGColor.Buffer
instance at the specified memory.float
g()
Returns the value of theg
field.NVGColor
g(float value)
Sets the specified value to theg
field.static NVGColor
malloc()
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, MemoryStack stack)
Returns a newNVGColor.Buffer
instance allocated on the specifiedMemoryStack
.static NVGColor
mallocStack(MemoryStack stack)
Returns a newNVGColor
instance allocated on the specifiedMemoryStack
.NVGColor
nset(long struct)
Unsafe version ofset
.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.NVGColor
rgba(java.nio.FloatBuffer value)
Copies the specifiedFloatBuffer
to 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
set(NVGColor src)
Copies the specified struct data to this struct.int
sizeof()
Returns thesizeof(struct)
.-
Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
-
Methods inherited from interface org.lwjgl.system.NativeResource
close
-
-
-
-
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()
Description copied from class:Struct
Returns thesizeof(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()
-
calloc
public static NVGColor calloc()
-
create
public static NVGColor create()
Returns a newNVGColor
instance allocated withBufferUtils
.
-
create
public static NVGColor create(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
-
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(MemoryStack stack)
Returns a newNVGColor
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static NVGColor callocStack(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, 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, 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
-
-