Package org.lwjgl.stb
Class STBIIOCallbacks
java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<STBIIOCallbacks>
org.lwjgl.stb.STBIIOCallbacks
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class STBIIOCallbacks
extends org.lwjgl.system.Struct<STBIIOCallbacks>
implements org.lwjgl.system.NativeResource
Image IO callbacks, used by
load_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 ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
org.lwjgl.system.Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.static final intThe struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionSTBIIOCallbacks(ByteBuffer container) Creates aSTBIIOCallbacksinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 STBIIOCallbacksDeprecated.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 @Nullable STBIIOCallbackscreateSafe(long address) static @Nullable STBIIOCallbacks.BuffercreateSafe(long address, int capacity) eof()returns nonzero if we are at end of file/dataeof(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 STBIIOCallbacksDeprecated.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.read()filldatawithsizebytes.read(STBIReadCallbackI value) Sets the specified value to theread()field.set(STBIIOCallbacks src) Copies the specified struct data to this struct.set(STBIReadCallbackI read, STBISkipCallbackI skip, STBIEOFCallbackI eof) Initializes this struct with the specified values.intsizeof()skip()skip the nextnbytes, orungetthe last -n bytes if negativeskip(STBISkipCallbackI value) Sets the specified value to theskip()field.static voidvalidate(long struct) Validates pointer members that should not beNULL.Methods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validate, validateMethods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
READ
public static final int READThe struct member offsets. -
SKIP
public static final int SKIPThe struct member offsets. -
EOF
public static final int EOFThe struct member offsets.
-
-
Constructor Details
-
STBIIOCallbacks
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 Details
-
sizeof
public int sizeof()- Specified by:
sizeofin classorg.lwjgl.system.Struct<STBIIOCallbacks>
-
read
filldatawithsizebytes. Return number of bytes actually read. -
skip
skip the nextnbytes, orungetthe last -n bytes if negative -
eof
returns nonzero if we are at end of file/data -
read
Sets the specified value to theread()field. -
skip
Sets the specified value to theskip()field. -
eof
Sets the specified value to theeof()field. -
set
Initializes this struct with the specified values. -
set
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
Returns a newSTBIIOCallbacksinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newSTBIIOCallbacksinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newSTBIIOCallbacksinstance allocated withBufferUtils. -
create
Returns a newSTBIIOCallbacksinstance for the specified memory address. -
createSafe
-
malloc
Returns a newSTBIIOCallbacks.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newSTBIIOCallbacks.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newSTBIIOCallbacks.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aSTBIIOCallbacks.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead. -
callocStack
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
Returns a newSTBIIOCallbacksinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newSTBIIOCallbacksinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newSTBIIOCallbacks.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newSTBIIOCallbacks.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
nread
Unsafe version ofread(). -
nskip
Unsafe version ofskip(). -
neof
Unsafe version ofeof(). -
nread
Unsafe version ofread. -
nskip
Unsafe version ofskip. -
neof
Unsafe version ofeof. -
validate
public static void validate(long struct) Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-