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.NativeResource
Image IO callbacks, used byload_from_callbacks
.Member documentation
read
– filldata
withsize
bytes. Return number of bytes actually read.skip
– skip the nextn
bytes, orunget
the 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 class
STBIIOCallbacks.Buffer
An array ofSTBIIOCallbacks
structs.
-
Field Summary
Fields Modifier and Type Field and Description static int
SIZEOF
The struct size in bytes.
-
Constructor Summary
Constructors Constructor and Description STBIIOCallbacks(java.nio.ByteBuffer container)
Creates aSTBIIOCallbacks
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static STBIIOCallbacks
calloc()
Returns a newSTBIIOCallbacks
instance allocated withmemCalloc
.static STBIIOCallbacks.Buffer
calloc(int capacity)
Returns a newSTBIIOCallbacks.Buffer
instance allocated withmemCalloc
.static STBIIOCallbacks
callocStack()
Returns a newSTBIIOCallbacks
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static STBIIOCallbacks.Buffer
callocStack(int capacity)
Returns a newSTBIIOCallbacks.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static STBIIOCallbacks.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBIIOCallbacks.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static STBIIOCallbacks
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBIIOCallbacks
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static STBIIOCallbacks
create()
Returns a newSTBIIOCallbacks
instance allocated withBufferUtils
.static STBIIOCallbacks.Buffer
create(int capacity)
Returns a newSTBIIOCallbacks.Buffer
instance allocated withBufferUtils
.static STBIIOCallbacks
create(long address)
Returns a newSTBIIOCallbacks
instance for the specified memory address ornull
if the address isNULL
.static STBIIOCallbacks.Buffer
create(long address, int capacity)
Create aSTBIIOCallbacks.Buffer
instance at the specified memory.STBIEOFCallback
eof()
Returns the value of theeof
field.STBIIOCallbacks
eof(STBIEOFCallbackI value)
Sets the specified value to theeof
field.static STBIIOCallbacks
malloc()
Returns a newSTBIIOCallbacks
instance allocated withmemAlloc
.static STBIIOCallbacks.Buffer
malloc(int capacity)
Returns a newSTBIIOCallbacks.Buffer
instance allocated withmemAlloc
.static STBIIOCallbacks
mallocStack()
Returns a newSTBIIOCallbacks
instance allocated on the thread-localMemoryStack
.static STBIIOCallbacks.Buffer
mallocStack(int capacity)
Returns a newSTBIIOCallbacks.Buffer
instance allocated on the thread-localMemoryStack
.static STBIIOCallbacks.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBIIOCallbacks.Buffer
instance allocated on the specifiedMemoryStack
.static STBIIOCallbacks
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBIIOCallbacks
instance allocated on the specifiedMemoryStack
.STBIIOCallbacks
nset(long struct)
Unsafe version ofset
.STBIReadCallback
read()
Returns the value of theread
field.STBIIOCallbacks
read(STBIReadCallbackI value)
Sets the specified value to theread
field.STBIIOCallbacks
set(STBIIOCallbacks src)
Copies the specified struct data to this struct.STBIIOCallbacks
set(STBIReadCallbackI read, STBISkipCallbackI skip, STBIEOFCallbackI eof)
Initializes this struct with the specified values.int
sizeof()
Returns thesizeof(struct)
.STBISkipCallback
skip()
Returns the value of theskip
field.STBIIOCallbacks
skip(STBISkipCallbackI value)
Sets the specified value to theskip
field.static void
validate(long struct)
Validates pointer members that should not beNULL
.static void
validate(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 aSTBIIOCallbacks
instance at the current position of the specifiedByteBuffer
container. 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.Struct
Returns thesizeof(struct)
.- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
read
public STBIReadCallback read()
Returns the value of theread
field.
-
skip
public STBISkipCallback skip()
Returns the value of theskip
field.
-
eof
public STBIEOFCallback eof()
Returns the value of theeof
field.
-
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.
-
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 newSTBIIOCallbacks
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static STBIIOCallbacks calloc()
Returns a newSTBIIOCallbacks
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static STBIIOCallbacks create()
Returns a newSTBIIOCallbacks
instance allocated withBufferUtils
.
-
create
public static STBIIOCallbacks create(long address)
Returns a newSTBIIOCallbacks
instance for the specified memory address ornull
if the address isNULL
.
-
malloc
public static STBIIOCallbacks.Buffer malloc(int capacity)
Returns a newSTBIIOCallbacks.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static STBIIOCallbacks.Buffer calloc(int capacity)
Returns a newSTBIIOCallbacks.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static STBIIOCallbacks.Buffer create(int capacity)
Returns a newSTBIIOCallbacks.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static STBIIOCallbacks.Buffer create(long address, int capacity)
Create aSTBIIOCallbacks.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
mallocStack
public static STBIIOCallbacks mallocStack()
Returns a newSTBIIOCallbacks
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static STBIIOCallbacks callocStack()
Returns a newSTBIIOCallbacks
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static STBIIOCallbacks mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBIIOCallbacks
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static STBIIOCallbacks callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBIIOCallbacks
instance allocated on the specifiedMemoryStack
and 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.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static STBIIOCallbacks.Buffer callocStack(int capacity)
Returns a newSTBIIOCallbacks.Buffer
instance allocated on the thread-localMemoryStack
and 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.Buffer
instance 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.Buffer
instance allocated on the specifiedMemoryStack
and 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
-
-