Package org.lwjgl.nuklear
Class NkColor
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.nuklear.NkColor
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class NkColor extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Layout
struct nk_color { nk_byte r; nk_byte g; nk_byte b; nk_byte a; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NkColor.Buffer
An array ofNkColor
structs.
-
Constructor Summary
Constructors Constructor Description NkColor(java.nio.ByteBuffer container)
Creates aNkColor
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte
a()
Returns the value of thea
field.NkColor
a(byte value)
Sets the specified value to thea
field.byte
b()
Returns the value of theb
field.NkColor
b(byte value)
Sets the specified value to theb
field.static NkColor
calloc()
Returns a newNkColor
instance allocated withmemCalloc
.static NkColor.Buffer
calloc(int capacity)
Returns a newNkColor.Buffer
instance allocated withmemCalloc
.static NkColor
callocStack()
Returns a newNkColor
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NkColor.Buffer
callocStack(int capacity)
Returns a newNkColor.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NkColor.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkColor.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NkColor
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkColor
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NkColor
create()
Returns a newNkColor
instance allocated withBufferUtils
.static NkColor.Buffer
create(int capacity)
Returns a newNkColor.Buffer
instance allocated withBufferUtils
.static NkColor
create(long address)
Returns a newNkColor
instance for the specified memory address.static NkColor.Buffer
create(long address, int capacity)
Create aNkColor.Buffer
instance at the specified memory.static NkColor
createSafe(long address)
static NkColor.Buffer
createSafe(long address, int capacity)
byte
g()
Returns the value of theg
field.NkColor
g(byte value)
Sets the specified value to theg
field.static NkColor
malloc()
Returns a newNkColor
instance allocated withmemAlloc
.static NkColor.Buffer
malloc(int capacity)
Returns a newNkColor.Buffer
instance allocated withmemAlloc
.static NkColor
mallocStack()
Returns a newNkColor
instance allocated on the thread-localMemoryStack
.static NkColor.Buffer
mallocStack(int capacity)
Returns a newNkColor.Buffer
instance allocated on the thread-localMemoryStack
.static NkColor.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkColor.Buffer
instance allocated on the specifiedMemoryStack
.static NkColor
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkColor
instance allocated on the specifiedMemoryStack
.static byte
na(long struct)
Unsafe version ofa()
.static void
na(long struct, byte value)
Unsafe version ofa
.static byte
nb(long struct)
Unsafe version ofb()
.static void
nb(long struct, byte value)
Unsafe version ofb
.static byte
ng(long struct)
Unsafe version ofg()
.static void
ng(long struct, byte value)
Unsafe version ofg
.static byte
nr(long struct)
Unsafe version ofr()
.static void
nr(long struct, byte value)
Unsafe version ofr
.byte
r()
Returns the value of ther
field.NkColor
r(byte value)
Sets the specified value to ther
field.NkColor
set(byte r, byte g, byte b, byte a)
Initializes this struct with the specified values.NkColor
set(NkColor src)
Copies the specified struct data to this struct.int
sizeof()
-
-
-
Constructor Detail
-
NkColor
public NkColor(java.nio.ByteBuffer container)
Creates aNkColor
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
-
r
public byte r()
Returns the value of ther
field.
-
g
public byte g()
Returns the value of theg
field.
-
b
public byte b()
Returns the value of theb
field.
-
a
public byte a()
Returns the value of thea
field.
-
r
public NkColor r(byte value)
Sets the specified value to ther
field.
-
g
public NkColor g(byte value)
Sets the specified value to theg
field.
-
b
public NkColor b(byte value)
Sets the specified value to theb
field.
-
a
public NkColor a(byte value)
Sets the specified value to thea
field.
-
set
public NkColor set(byte r, byte g, byte b, byte a)
Initializes this struct with the specified values.
-
set
public NkColor set(NkColor src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static NkColor malloc()
Returns a newNkColor
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static NkColor calloc()
Returns a newNkColor
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static NkColor create()
Returns a newNkColor
instance allocated withBufferUtils
.
-
create
public static NkColor create(long address)
Returns a newNkColor
instance for the specified memory address.
-
createSafe
@Nullable public static NkColor createSafe(long address)
-
malloc
public static NkColor.Buffer malloc(int capacity)
Returns a newNkColor.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static NkColor.Buffer calloc(int capacity)
Returns a newNkColor.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static NkColor.Buffer create(int capacity)
Returns a newNkColor.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static NkColor.Buffer create(long address, int capacity)
Create aNkColor.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static NkColor.Buffer createSafe(long address, int capacity)
-
mallocStack
public static NkColor mallocStack()
Returns a newNkColor
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static NkColor callocStack()
Returns a newNkColor
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static NkColor mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkColor
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static NkColor callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkColor
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static NkColor.Buffer mallocStack(int capacity)
Returns a newNkColor.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static NkColor.Buffer callocStack(int capacity)
Returns a newNkColor.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static NkColor.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkColor.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static NkColor.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkColor.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nr
public static byte nr(long struct)
Unsafe version ofr()
.
-
ng
public static byte ng(long struct)
Unsafe version ofg()
.
-
nb
public static byte nb(long struct)
Unsafe version ofb()
.
-
na
public static byte na(long struct)
Unsafe version ofa()
.
-
nr
public static void nr(long struct, byte value)
Unsafe version ofr
.
-
ng
public static void ng(long struct, byte value)
Unsafe version ofg
.
-
nb
public static void nb(long struct, byte value)
Unsafe version ofb
.
-
na
public static void na(long struct, byte value)
Unsafe version ofa
.
-
-