Package org.lwjgl.nuklear
Class NkImage
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.nuklear.NkImage
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class NkImage extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Layout
struct nk_image {
nk_handle
handle; unsigned short w; unsigned short h; unsigned short region[4]; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NkImage.Buffer
An array ofNkImage
structs.
-
Constructor Summary
Constructors Constructor Description NkImage(java.nio.ByteBuffer container)
Creates aNkImage
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NkImage
calloc()
Returns a newNkImage
instance allocated withmemCalloc
.static NkImage.Buffer
calloc(int capacity)
Returns a newNkImage.Buffer
instance allocated withmemCalloc
.static NkImage
callocStack()
Returns a newNkImage
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NkImage.Buffer
callocStack(int capacity)
Returns a newNkImage.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NkImage.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkImage.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NkImage
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkImage
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NkImage
create()
Returns a newNkImage
instance allocated withBufferUtils
.static NkImage.Buffer
create(int capacity)
Returns a newNkImage.Buffer
instance allocated withBufferUtils
.static NkImage
create(long address)
Returns a newNkImage
instance for the specified memory address.static NkImage.Buffer
create(long address, int capacity)
Create aNkImage.Buffer
instance at the specified memory.static NkImage
createSafe(long address)
static NkImage.Buffer
createSafe(long address, int capacity)
short
h()
Returns the value of theh
field.NkImage
h(short value)
Sets the specified value to theh
field.NkHandle
handle()
Returns aNkHandle
view of thehandle
field.NkImage
handle(java.util.function.Consumer<NkHandle> consumer)
Passes thehandle
field to the specifiedConsumer
.NkImage
handle(NkHandle value)
Copies the specifiedNkHandle
to thehandle
field.static NkImage
malloc()
Returns a newNkImage
instance allocated withmemAlloc
.static NkImage.Buffer
malloc(int capacity)
Returns a newNkImage.Buffer
instance allocated withmemAlloc
.static NkImage
mallocStack()
Returns a newNkImage
instance allocated on the thread-localMemoryStack
.static NkImage.Buffer
mallocStack(int capacity)
Returns a newNkImage.Buffer
instance allocated on the thread-localMemoryStack
.static NkImage.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkImage.Buffer
instance allocated on the specifiedMemoryStack
.static NkImage
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkImage
instance allocated on the specifiedMemoryStack
.static short
nh(long struct)
Unsafe version ofh()
.static void
nh(long struct, short value)
Unsafe version ofh
.static NkHandle
nhandle(long struct)
Unsafe version ofhandle()
.static void
nhandle(long struct, NkHandle value)
Unsafe version ofhandle
.static java.nio.ShortBuffer
nregion(long struct)
Unsafe version ofregion()
.static short
nregion(long struct, int index)
Unsafe version ofregion
.static void
nregion(long struct, int index, short value)
Unsafe version ofregion
.static void
nregion(long struct, java.nio.ShortBuffer value)
Unsafe version ofregion
.static short
nw(long struct)
Unsafe version ofw()
.static void
nw(long struct, short value)
Unsafe version ofw
.java.nio.ShortBuffer
region()
Returns aShortBuffer
view of theregion
field.short
region(int index)
Returns the value at the specified index of theregion
field.NkImage
region(int index, short value)
Sets the specified value at the specified index of theregion
field.NkImage
region(java.nio.ShortBuffer value)
Copies the specifiedShortBuffer
to theregion
field.NkImage
set(NkHandle handle, short w, short h, java.nio.ShortBuffer region)
Initializes this struct with the specified values.NkImage
set(NkImage src)
Copies the specified struct data to this struct.int
sizeof()
short
w()
Returns the value of thew
field.NkImage
w(short value)
Sets the specified value to thew
field.
-
-
-
Constructor Detail
-
NkImage
public NkImage(java.nio.ByteBuffer container)
Creates aNkImage
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
-
w
public short w()
Returns the value of thew
field.
-
h
public short h()
Returns the value of theh
field.
-
region
public java.nio.ShortBuffer region()
Returns aShortBuffer
view of theregion
field.
-
region
public short region(int index)
Returns the value at the specified index of theregion
field.
-
handle
public NkImage handle(java.util.function.Consumer<NkHandle> consumer)
Passes thehandle
field to the specifiedConsumer
.
-
w
public NkImage w(short value)
Sets the specified value to thew
field.
-
h
public NkImage h(short value)
Sets the specified value to theh
field.
-
region
public NkImage region(java.nio.ShortBuffer value)
Copies the specifiedShortBuffer
to theregion
field.
-
region
public NkImage region(int index, short value)
Sets the specified value at the specified index of theregion
field.
-
set
public NkImage set(NkHandle handle, short w, short h, java.nio.ShortBuffer region)
Initializes this struct with the specified values.
-
set
public NkImage set(NkImage src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static NkImage malloc()
Returns a newNkImage
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static NkImage calloc()
Returns a newNkImage
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static NkImage create()
Returns a newNkImage
instance allocated withBufferUtils
.
-
create
public static NkImage create(long address)
Returns a newNkImage
instance for the specified memory address.
-
createSafe
@Nullable public static NkImage createSafe(long address)
-
malloc
public static NkImage.Buffer malloc(int capacity)
Returns a newNkImage.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static NkImage.Buffer calloc(int capacity)
Returns a newNkImage.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static NkImage.Buffer create(int capacity)
Returns a newNkImage.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static NkImage.Buffer create(long address, int capacity)
Create aNkImage.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static NkImage.Buffer createSafe(long address, int capacity)
-
mallocStack
public static NkImage mallocStack()
Returns a newNkImage
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static NkImage callocStack()
Returns a newNkImage
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static NkImage mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkImage
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static NkImage callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkImage
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static NkImage.Buffer mallocStack(int capacity)
Returns a newNkImage.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static NkImage.Buffer callocStack(int capacity)
Returns a newNkImage.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static NkImage.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkImage.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static NkImage.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkImage.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nw
public static short nw(long struct)
Unsafe version ofw()
.
-
nh
public static short nh(long struct)
Unsafe version ofh()
.
-
nregion
public static java.nio.ShortBuffer nregion(long struct)
Unsafe version ofregion()
.
-
nregion
public static short nregion(long struct, int index)
Unsafe version ofregion
.
-
nw
public static void nw(long struct, short value)
Unsafe version ofw
.
-
nh
public static void nh(long struct, short value)
Unsafe version ofh
.
-
nregion
public static void nregion(long struct, java.nio.ShortBuffer value)
Unsafe version ofregion
.
-
nregion
public static void nregion(long struct, int index, short value)
Unsafe version ofregion
.
-
-