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 { stbi_io_callbacks.read read; stbi_io_callbacks.skip skip; stbi_io_callbacks.eof eof; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classSTBIIOCallbacks.BufferAn array ofSTBIIOCallbacksstructs.
-
Field Summary
Fields Modifier and Type Field and Description static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor and 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 and 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 ornullif the address isNULL.static STBIIOCallbacks.Buffercreate(long address, int capacity)Create aSTBIIOCallbacks.Bufferinstance at the specified memory.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.STBIIOCallbacksnset(long struct)Unsafe version ofset.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()Returns thesizeof(struct).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)CallsSTBIIOCallbacks.validate(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()
Description copied from class:org.lwjgl.system.StructReturns thesizeof(struct).- 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.
-
nset
public STBIIOCallbacks nset(long struct)
Unsafe version ofset.
-
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 ornullif the address isNULL.
-
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
-
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
-
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)CallsSTBIIOCallbacks.validate(long)for each struct contained in the specified struct array.- Parameters:
array- the struct array to validatecount- the number of structs inarray
-
-