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; nk_ushort w; nk_ushort h; nk_ushort region[4]; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNkImage.BufferAn array ofNkImagestructs.
-
Constructor Summary
Constructors Constructor Description NkImage(java.nio.ByteBuffer container)Creates aNkImageinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated 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 NkImage.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newNkImage.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static NkImagecalloc(org.lwjgl.system.MemoryStack stack)Returns a newNkImageinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static NkImagecallocStack()Deprecated.static NkImage.BuffercallocStack(int capacity)Deprecated.static NkImage.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static NkImagecallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.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()NkImageh(short value)Sets the specified value to thehfield.NkHandlehandle()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 NkImage.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newNkImage.Bufferinstance allocated on the specifiedMemoryStack.static NkImagemalloc(org.lwjgl.system.MemoryStack stack)Returns a newNkImageinstance allocated on the specifiedMemoryStack.static NkImagemallocStack()Deprecated.static NkImage.BuffermallocStack(int capacity)Deprecated.static NkImage.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static NkImagemallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.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()shortregion(int index)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()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
-
w
public short w()
- Returns:
- the value of the
wfield.
-
h
public short h()
- Returns:
- the value of the
hfield.
-
region
public java.nio.ShortBuffer region()
- Returns:
- a
ShortBufferview of theregionfield.
-
region
public short region(int index)
- Returns:
- the value at the specified index of the
regionfield.
-
handle
public NkImage handle(java.util.function.Consumer<NkHandle> consumer)
Passes thehandlefield to the specifiedConsumer.
-
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()
Returns a newNkImageinstance allocated withBufferUtils.
-
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
@Deprecated public static NkImage mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static NkImage callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static NkImage mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static NkImage callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static NkImage.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static NkImage.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
mallocStack
@Deprecated public static NkImage.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static NkImage.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
malloc
public static NkImage malloc(org.lwjgl.system.MemoryStack stack)
Returns a newNkImageinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static NkImage calloc(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
-
malloc
public static NkImage.Buffer malloc(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
-
calloc
public static NkImage.Buffer calloc(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.
-
-