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 classNVGColor.BufferAn array ofNVGColorstructs.-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
Fields Modifier and Type Field and Description static intSIZEOFThe 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 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()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, MemoryStack stack)Returns a newNVGColor.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static NVGColorcallocStack(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)static NVGColor.Buffercreate(long address, int capacity)Create aNVGColor.Bufferinstance at the specified memory.floatg()Returns the value of thegfield.NVGColorg(float value)Sets the specified value to thegfield.static NVGColormalloc()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, MemoryStack stack)Returns a newNVGColor.Bufferinstance allocated on the specifiedMemoryStack.static NVGColormallocStack(MemoryStack stack)Returns a newNVGColorinstance allocated on the specifiedMemoryStack.NVGColornset(long struct)Unsafe version ofset.floatr()Returns the value of therfield.NVGColorr(float value)Sets the specified value to therfield.java.nio.FloatBufferrgba()Returns aFloatBufferview of thergbafield.NVGColorrgba(java.nio.FloatBuffer value)Copies the specifiedFloatBufferto 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.NVGColorset(NVGColor src)Copies the specified struct data to this struct.intsizeof()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 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()
Description copied from class:StructReturns thesizeof(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()
-
calloc
public static NVGColor calloc()
-
create
public static NVGColor create()
Returns a newNVGColorinstance allocated withBufferUtils.
-
create
public static NVGColor create(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
-
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(MemoryStack stack)
Returns a newNVGColorinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static NVGColor callocStack(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, 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, 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
-
-