Package org.lwjgl.stb
Class STBIIOCallbacks
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.stb.STBIIOCallbacks
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class STBIIOCallbacks extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceImage IO callbacks, used byload_from_callbacks.Layout
struct stbi_io_callbacks { int (*read) (void *user, char *data, int size); void (*skip) (void *user, int n); int (*eof) (void *user); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSTBIIOCallbacks.BufferAn array ofSTBIIOCallbacksstructs.
-
Constructor Summary
Constructors Constructor Description STBIIOCallbacks(java.nio.ByteBuffer container)Creates aSTBIIOCallbacksinstance 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 STBIIOCallbackscalloc()Returns a newSTBIIOCallbacksinstance allocated withmemCalloc.static STBIIOCallbacks.Buffercalloc(int capacity)Returns a newSTBIIOCallbacks.Bufferinstance allocated withmemCalloc.static STBIIOCallbacks.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newSTBIIOCallbacks.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static STBIIOCallbackscalloc(org.lwjgl.system.MemoryStack stack)Returns a newSTBIIOCallbacksinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static STBIIOCallbackscallocStack()Deprecated.static STBIIOCallbacks.BuffercallocStack(int capacity)Deprecated.static STBIIOCallbacks.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static STBIIOCallbackscallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.static STBIIOCallbackscreate()Returns a newSTBIIOCallbacksinstance allocated withBufferUtils.static STBIIOCallbacks.Buffercreate(int capacity)Returns a newSTBIIOCallbacks.Bufferinstance allocated withBufferUtils.static STBIIOCallbackscreate(long address)Returns a newSTBIIOCallbacksinstance for the specified memory address.static STBIIOCallbacks.Buffercreate(long address, int capacity)Create aSTBIIOCallbacks.Bufferinstance at the specified memory.static STBIIOCallbackscreateSafe(long address)static STBIIOCallbacks.BuffercreateSafe(long address, int capacity)STBIEOFCallbackeof()returns nonzero if we are at end of file/dataSTBIIOCallbackseof(STBIEOFCallbackI value)Sets the specified value to theeof()field.static STBIIOCallbacksmalloc()Returns a newSTBIIOCallbacksinstance allocated withmemAlloc.static STBIIOCallbacks.Buffermalloc(int capacity)Returns a newSTBIIOCallbacks.Bufferinstance allocated withmemAlloc.static STBIIOCallbacks.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newSTBIIOCallbacks.Bufferinstance allocated on the specifiedMemoryStack.static STBIIOCallbacksmalloc(org.lwjgl.system.MemoryStack stack)Returns a newSTBIIOCallbacksinstance allocated on the specifiedMemoryStack.static STBIIOCallbacksmallocStack()Deprecated.static STBIIOCallbacks.BuffermallocStack(int capacity)Deprecated.static STBIIOCallbacks.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static STBIIOCallbacksmallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.static STBIEOFCallbackneof(long struct)Unsafe version ofeof().static voidneof(long struct, STBIEOFCallbackI value)Unsafe version ofeof.static STBIReadCallbacknread(long struct)Unsafe version ofread().static voidnread(long struct, STBIReadCallbackI value)Unsafe version ofread.static STBISkipCallbacknskip(long struct)Unsafe version ofskip().static voidnskip(long struct, STBISkipCallbackI value)Unsafe version ofskip.STBIReadCallbackread()filldatawithsizebytes.STBIIOCallbacksread(STBIReadCallbackI value)Sets the specified value to theread()field.STBIIOCallbacksset(STBIIOCallbacks src)Copies the specified struct data to this struct.STBIIOCallbacksset(STBIReadCallbackI read, STBISkipCallbackI skip, STBIEOFCallbackI eof)Initializes this struct with the specified values.intsizeof()STBISkipCallbackskip()skip the nextnbytes, orungetthe last -n bytes if negativeSTBIIOCallbacksskip(STBISkipCallbackI value)Sets the specified value to theskip()field.static voidvalidate(long struct)Validates pointer members that should not beNULL.
-
-
-
Constructor Detail
-
STBIIOCallbacks
public STBIIOCallbacks(java.nio.ByteBuffer container)
Creates aSTBIIOCallbacksinstance 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
-
read
public STBIReadCallback read()
filldatawithsizebytes. Return number of bytes actually read.
-
skip
public STBISkipCallback skip()
skip the nextnbytes, orungetthe last -n bytes if negative
-
eof
public STBIEOFCallback eof()
returns nonzero if we are at end of file/data
-
read
public STBIIOCallbacks read(STBIReadCallbackI value)
Sets the specified value to theread()field.
-
skip
public STBIIOCallbacks skip(STBISkipCallbackI value)
Sets the specified value to theskip()field.
-
eof
public STBIIOCallbacks eof(STBIEOFCallbackI value)
Sets the specified value to theeof()field.
-
set
public STBIIOCallbacks set(STBIReadCallbackI read, STBISkipCallbackI skip, STBIEOFCallbackI eof)
Initializes this struct with the specified values.
-
set
public STBIIOCallbacks set(STBIIOCallbacks src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static STBIIOCallbacks malloc()
Returns a newSTBIIOCallbacksinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static STBIIOCallbacks calloc()
Returns a newSTBIIOCallbacksinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static STBIIOCallbacks create()
Returns a newSTBIIOCallbacksinstance allocated withBufferUtils.
-
create
public static STBIIOCallbacks create(long address)
Returns a newSTBIIOCallbacksinstance for the specified memory address.
-
createSafe
@Nullable public static STBIIOCallbacks createSafe(long address)
-
malloc
public static STBIIOCallbacks.Buffer malloc(int capacity)
Returns a newSTBIIOCallbacks.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static STBIIOCallbacks.Buffer calloc(int capacity)
Returns a newSTBIIOCallbacks.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static STBIIOCallbacks.Buffer create(int capacity)
Returns a newSTBIIOCallbacks.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static STBIIOCallbacks.Buffer create(long address, int capacity)
Create aSTBIIOCallbacks.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static STBIIOCallbacks.Buffer createSafe(long address, int capacity)
-
mallocStack
@Deprecated public static STBIIOCallbacks mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static STBIIOCallbacks callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static STBIIOCallbacks mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static STBIIOCallbacks callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static STBIIOCallbacks.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static STBIIOCallbacks.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
mallocStack
@Deprecated public static STBIIOCallbacks.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 STBIIOCallbacks.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
malloc
public static STBIIOCallbacks malloc(org.lwjgl.system.MemoryStack stack)
Returns a newSTBIIOCallbacksinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static STBIIOCallbacks calloc(org.lwjgl.system.MemoryStack stack)
Returns a newSTBIIOCallbacksinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static STBIIOCallbacks.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBIIOCallbacks.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static STBIIOCallbacks.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBIIOCallbacks.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nread
public static STBIReadCallback nread(long struct)
Unsafe version ofread().
-
nskip
public static STBISkipCallback nskip(long struct)
Unsafe version ofskip().
-
neof
public static STBIEOFCallback neof(long struct)
Unsafe version ofeof().
-
nread
public static void nread(long struct, STBIReadCallbackI value)Unsafe version ofread.
-
nskip
public static void nskip(long struct, STBISkipCallbackI value)Unsafe version ofskip.
-
neof
public static void neof(long struct, STBIEOFCallbackI value)Unsafe version ofeof.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-
-