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.NativeResourceA 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 rgba[4]; struct { float r; float g; float b; float a; }; }; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNVGColor.BufferAn array ofNVGColorstructs.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description floata()Returns the value of theafield.NVGColora(float value)Sets the specified value to theafield.floatb()Returns the value of thebfield.NVGColorb(float value)Sets the specified value to thebfield.static NVGColorcalloc()Returns a newNVGColorinstance allocated withmemCalloc.static NVGColor.Buffercalloc(int capacity)Returns a newNVGColor.Bufferinstance allocated withmemCalloc.static NVGColorcallocStack()Returns a newNVGColorinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static NVGColor.BuffercallocStack(int capacity)Returns a newNVGColor.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static NVGColor.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newNVGColor.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static NVGColorcallocStack(org.lwjgl.system.MemoryStack stack)Returns a newNVGColorinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static NVGColorcreate()Returns a newNVGColorinstance allocated withBufferUtils.static NVGColor.Buffercreate(int capacity)Returns a newNVGColor.Bufferinstance allocated withBufferUtils.static NVGColorcreate(long address)Returns a newNVGColorinstance for the specified memory address.static NVGColor.Buffercreate(long address, int capacity)Create aNVGColor.Bufferinstance at the specified memory.static NVGColorcreateSafe(long address)static NVGColor.BuffercreateSafe(long address, int capacity)floatg()Returns the value of thegfield.NVGColorg(float value)Sets the specified value to thegfield.static NVGColormalloc()Returns a newNVGColorinstance allocated withmemAlloc.static NVGColor.Buffermalloc(int capacity)Returns a newNVGColor.Bufferinstance allocated withmemAlloc.static NVGColormallocStack()Returns a newNVGColorinstance allocated on the thread-localMemoryStack.static NVGColor.BuffermallocStack(int capacity)Returns a newNVGColor.Bufferinstance allocated on the thread-localMemoryStack.static NVGColor.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newNVGColor.Bufferinstance allocated on the specifiedMemoryStack.static NVGColormallocStack(org.lwjgl.system.MemoryStack stack)Returns a newNVGColorinstance allocated on the specifiedMemoryStack.static floatna(long struct)Unsafe version ofa().static voidna(long struct, float value)Unsafe version ofa.static floatnb(long struct)Unsafe version ofb().static voidnb(long struct, float value)Unsafe version ofb.static floatng(long struct)Unsafe version ofg().static voidng(long struct, float value)Unsafe version ofg.static floatnr(long struct)Unsafe version ofr().static voidnr(long struct, float value)Unsafe version ofr.static java.nio.FloatBuffernrgba(long struct)Unsafe version ofrgba().static floatnrgba(long struct, int index)Unsafe version ofrgba.static voidnrgba(long struct, int index, float value)Unsafe version ofrgba.static voidnrgba(long struct, java.nio.FloatBuffer value)Unsafe version ofrgba.floatr()Returns the value of therfield.NVGColorr(float value)Sets the specified value to therfield.java.nio.FloatBufferrgba()Returns aFloatBufferview of thergbafield.floatrgba(int index)Returns the value at the specified index of thergbafield.NVGColorrgba(int index, float value)Sets the specified value at the specified index of thergbafield.NVGColorrgba(java.nio.FloatBuffer value)Copies the specifiedFloatBufferto thergbafield.NVGColorset(NVGColor src)Copies the specified struct data to this struct.intsizeof()
-
-
-
Constructor Detail
-
NVGColor
public NVGColor(java.nio.ByteBuffer container)
Creates aNVGColorinstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.lwjgl.system.Struct
-
rgba
public java.nio.FloatBuffer rgba()
Returns aFloatBufferview of thergbafield.
-
rgba
public float rgba(int index)
Returns the value at the specified index of thergbafield.
-
r
public float r()
Returns the value of therfield.
-
g
public float g()
Returns the value of thegfield.
-
b
public float b()
Returns the value of thebfield.
-
a
public float a()
Returns the value of theafield.
-
rgba
public NVGColor rgba(java.nio.FloatBuffer value)
Copies the specifiedFloatBufferto thergbafield.
-
rgba
public NVGColor rgba(int index, float value)
Sets the specified value at the specified index of thergbafield.
-
r
public NVGColor r(float value)
Sets the specified value to therfield.
-
g
public NVGColor g(float value)
Sets the specified value to thegfield.
-
b
public NVGColor b(float value)
Sets the specified value to thebfield.
-
a
public NVGColor a(float value)
Sets the specified value to theafield.
-
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 newNVGColorinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static NVGColor calloc()
Returns a newNVGColorinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static NVGColor create(long address)
Returns a newNVGColorinstance for the specified memory address.
-
createSafe
@Nullable public static NVGColor createSafe(long address)
-
malloc
public static NVGColor.Buffer malloc(int capacity)
Returns a newNVGColor.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static NVGColor.Buffer calloc(int capacity)
Returns a newNVGColor.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static NVGColor.Buffer create(int capacity)
Returns a newNVGColor.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static NVGColor.Buffer create(long address, int capacity)
Create aNVGColor.Bufferinstance 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 newNVGColorinstance allocated on the thread-localMemoryStack.
-
callocStack
public static NVGColor callocStack()
Returns a newNVGColorinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static NVGColor mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNVGColorinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static NVGColor callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNVGColorinstance allocated on the specifiedMemoryStackand 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.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static NVGColor.Buffer callocStack(int capacity)
Returns a newNVGColor.Bufferinstance allocated on the thread-localMemoryStackand 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.Bufferinstance 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.Bufferinstance allocated on the specifiedMemoryStackand 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.
-
-