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.Member documentation
read– filldatawithsizebytes. Return number of bytes actually read.skip– skip the nextnbytes, orungetthe last -n bytes if negativeeof– returns nonzero if we are at end of file/data
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 Modifier and Type Method Description static STBIIOCallbackscalloc()Returns a newSTBIIOCallbacksinstance allocated withmemCalloc.static STBIIOCallbacks.Buffercalloc(int capacity)Returns a newSTBIIOCallbacks.Bufferinstance allocated withmemCalloc.static STBIIOCallbackscallocStack()Returns a newSTBIIOCallbacksinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static STBIIOCallbacks.BuffercallocStack(int capacity)Returns a newSTBIIOCallbacks.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static STBIIOCallbacks.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newSTBIIOCallbacks.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static STBIIOCallbackscallocStack(org.lwjgl.system.MemoryStack stack)Returns a newSTBIIOCallbacksinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.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 the value of theeoffield.STBIIOCallbackseof(STBIEOFCallbackI value)Sets the specified value to theeoffield.static STBIIOCallbacksmalloc()Returns a newSTBIIOCallbacksinstance allocated withmemAlloc.static STBIIOCallbacks.Buffermalloc(int capacity)Returns a newSTBIIOCallbacks.Bufferinstance allocated withmemAlloc.static STBIIOCallbacksmallocStack()Returns a newSTBIIOCallbacksinstance allocated on the thread-localMemoryStack.static STBIIOCallbacks.BuffermallocStack(int capacity)Returns a newSTBIIOCallbacks.Bufferinstance allocated on the thread-localMemoryStack.static STBIIOCallbacks.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newSTBIIOCallbacks.Bufferinstance allocated on the specifiedMemoryStack.static STBIIOCallbacksmallocStack(org.lwjgl.system.MemoryStack stack)Returns a newSTBIIOCallbacksinstance allocated on the specifiedMemoryStack.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()Returns the value of thereadfield.STBIIOCallbacksread(STBIReadCallbackI value)Sets the specified value to thereadfield.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()Returns the value of theskipfield.STBIIOCallbacksskip(STBISkipCallbackI value)Sets the specified value to theskipfield.static voidvalidate(long struct)Validates pointer members that should not beNULL.static voidvalidate(long array, int count)Callsvalidate(long)for each struct contained in the specified struct array.
-
-
-
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()
Returns the value of thereadfield.
-
skip
public STBISkipCallback skip()
Returns the value of theskipfield.
-
eof
public STBIEOFCallback eof()
Returns the value of theeoffield.
-
read
public STBIIOCallbacks read(STBIReadCallbackI value)
Sets the specified value to thereadfield.
-
skip
public STBIIOCallbacks skip(STBISkipCallbackI value)
Sets the specified value to theskipfield.
-
eof
public STBIIOCallbacks eof(STBIEOFCallbackI value)
Sets the specified value to theeoffield.
-
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
public static STBIIOCallbacks mallocStack()
Returns a newSTBIIOCallbacksinstance allocated on the thread-localMemoryStack.
-
callocStack
public static STBIIOCallbacks callocStack()
Returns a newSTBIIOCallbacksinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static STBIIOCallbacks mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBIIOCallbacksinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static STBIIOCallbacks callocStack(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
-
mallocStack
public static STBIIOCallbacks.Buffer mallocStack(int capacity)
Returns a newSTBIIOCallbacks.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static STBIIOCallbacks.Buffer callocStack(int capacity)
Returns a newSTBIIOCallbacks.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static STBIIOCallbacks.Buffer mallocStack(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
-
callocStack
public static STBIIOCallbacks.Buffer callocStack(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
-
validate
public static void validate(long array, int count)Callsvalidate(long)for each struct contained in the specified struct array.- Parameters:
array- the struct array to validatecount- the number of structs inarray
-
-