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.NativeResourceLayout
struct nk_image {nk_handlehandle; unsigned short w; unsigned short h; unsigned short region[4]; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNkImage.BufferAn array ofNkImagestructs.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NkImagecalloc()Returns a newNkImageinstance allocated withmemCalloc.static NkImage.Buffercalloc(int capacity)Returns a newNkImage.Bufferinstance allocated withmemCalloc.static NkImagecallocStack()Returns a newNkImageinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static NkImage.BuffercallocStack(int capacity)Returns a newNkImage.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static NkImage.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newNkImage.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static NkImagecallocStack(org.lwjgl.system.MemoryStack stack)Returns a newNkImageinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static NkImagecreate()Returns a newNkImageinstance allocated withBufferUtils.static NkImage.Buffercreate(int capacity)Returns a newNkImage.Bufferinstance allocated withBufferUtils.static NkImagecreate(long address)Returns a newNkImageinstance for the specified memory address.static NkImage.Buffercreate(long address, int capacity)Create aNkImage.Bufferinstance at the specified memory.static NkImagecreateSafe(long address)static NkImage.BuffercreateSafe(long address, int capacity)shorth()Returns the value of thehfield.NkImageh(short value)Sets the specified value to thehfield.NkHandlehandle()Returns aNkHandleview of thehandlefield.NkImagehandle(java.util.function.Consumer<NkHandle> consumer)Passes thehandlefield to the specifiedConsumer.NkImagehandle(NkHandle value)Copies the specifiedNkHandleto thehandlefield.static NkImagemalloc()Returns a newNkImageinstance allocated withmemAlloc.static NkImage.Buffermalloc(int capacity)Returns a newNkImage.Bufferinstance allocated withmemAlloc.static NkImagemallocStack()Returns a newNkImageinstance allocated on the thread-localMemoryStack.static NkImage.BuffermallocStack(int capacity)Returns a newNkImage.Bufferinstance allocated on the thread-localMemoryStack.static NkImage.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newNkImage.Bufferinstance allocated on the specifiedMemoryStack.static NkImagemallocStack(org.lwjgl.system.MemoryStack stack)Returns a newNkImageinstance allocated on the specifiedMemoryStack.static shortnh(long struct)Unsafe version ofh().static voidnh(long struct, short value)Unsafe version ofh.static NkHandlenhandle(long struct)Unsafe version ofhandle().static voidnhandle(long struct, NkHandle value)Unsafe version ofhandle.static java.nio.ShortBuffernregion(long struct)Unsafe version ofregion().static shortnregion(long struct, int index)Unsafe version ofregion.static voidnregion(long struct, int index, short value)Unsafe version ofregion.static voidnregion(long struct, java.nio.ShortBuffer value)Unsafe version ofregion.static shortnw(long struct)Unsafe version ofw().static voidnw(long struct, short value)Unsafe version ofw.java.nio.ShortBufferregion()Returns aShortBufferview of theregionfield.shortregion(int index)Returns the value at the specified index of theregionfield.NkImageregion(int index, short value)Sets the specified value at the specified index of theregionfield.NkImageregion(java.nio.ShortBuffer value)Copies the specifiedShortBufferto theregionfield.NkImageset(NkHandle handle, short w, short h, java.nio.ShortBuffer region)Initializes this struct with the specified values.NkImageset(NkImage src)Copies the specified struct data to this struct.intsizeof()shortw()Returns the value of thewfield.NkImagew(short value)Sets the specified value to thewfield.
-
-
-
Constructor Detail
-
NkImage
public NkImage(java.nio.ByteBuffer container)
Creates aNkImageinstance 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
-
handle
public NkImage handle(java.util.function.Consumer<NkHandle> consumer)
Passes thehandlefield to the specifiedConsumer.
-
w
public short w()
Returns the value of thewfield.
-
h
public short h()
Returns the value of thehfield.
-
region
public java.nio.ShortBuffer region()
Returns aShortBufferview of theregionfield.
-
region
public short region(int index)
Returns the value at the specified index of theregionfield.
-
w
public NkImage w(short value)
Sets the specified value to thewfield.
-
h
public NkImage h(short value)
Sets the specified value to thehfield.
-
region
public NkImage region(java.nio.ShortBuffer value)
Copies the specifiedShortBufferto theregionfield.
-
region
public NkImage region(int index, short value)
Sets the specified value at the specified index of theregionfield.
-
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 newNkImageinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static NkImage calloc()
Returns a newNkImageinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static NkImage create(long address)
Returns a newNkImageinstance for the specified memory address.
-
createSafe
@Nullable public static NkImage createSafe(long address)
-
malloc
public static NkImage.Buffer malloc(int capacity)
Returns a newNkImage.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static NkImage.Buffer calloc(int capacity)
Returns a newNkImage.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static NkImage.Buffer create(int capacity)
Returns a newNkImage.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static NkImage.Buffer create(long address, int capacity)
Create aNkImage.Bufferinstance 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 newNkImageinstance allocated on the thread-localMemoryStack.
-
callocStack
public static NkImage callocStack()
Returns a newNkImageinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static NkImage mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkImageinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static NkImage callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkImageinstance allocated on the specifiedMemoryStackand 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.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static NkImage.Buffer callocStack(int capacity)
Returns a newNkImage.Bufferinstance allocated on the thread-localMemoryStackand 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.Bufferinstance 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.Bufferinstance allocated on the specifiedMemoryStackand 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.
-
-