Package org.lwjgl.util.ktx
Class ktxStream
- All Implemented Interfaces:
AutoCloseable
,NativeResource
,Pointer
struct ktxStream {
{@link ktxStream_readI ktxStream_read} read;
{@link ktxStream_skipI ktxStream_skip} skip;
{@link ktxStream_writeI ktxStream_write} write;
{@link ktxStream_getposI ktxStream_getpos} getpos;
{@link ktxStream_setposI ktxStream_setpos} setpos;
{@link ktxStream_getsizeI ktxStream_getsize} getsize;
{@link ktxStream_destructI ktxStream_destruct} destruct;
enum streamType type;
union {
FILE * file;
ktxMem * mem;
struct {
void * address;
void * allocatorAddress;
ktx_size_t size;
} custom_ptr;
} data;
ktx_off_t readpos;
ktx_bool_t closeOnDestruct;
}
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
Struct.StructValidation
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The struct alignment in bytes.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct size in bytes.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
-
Constructor Summary
ConstructorsConstructorDescriptionktxStream
(ByteBuffer container) Creates aktxStream
instance at the current position of the specifiedByteBuffer
container. -
Method Summary
Modifier and TypeMethodDescriptionstatic ktxStream
calloc()
Returns a newktxStream
instance allocated withmemCalloc
.static ktxStream.Buffer
calloc
(int capacity) Returns a newktxStream.Buffer
instance allocated withmemCalloc
.static ktxStream.Buffer
calloc
(int capacity, MemoryStack stack) Returns a newktxStream.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static ktxStream
calloc
(MemoryStack stack) Returns a newktxStream
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.boolean
closeOnDestruct
(boolean value) Sets the specified value to thecloseOnDestruct
field.static ktxStream
create()
Returns a newktxStream
instance allocated withBufferUtils
.static ktxStream.Buffer
create
(int capacity) Returns a newktxStream.Buffer
instance allocated withBufferUtils
.static ktxStream
create
(long address) Returns a newktxStream
instance for the specified memory address.static ktxStream.Buffer
create
(long address, int capacity) Create aktxStream.Buffer
instance at the specified memory.static @Nullable ktxStream
createSafe
(long address) static @Nullable ktxStream.Buffer
createSafe
(long address, int capacity) data_custom_ptr_address
(int capacity) Sets the address of the specifiedByteBuffer
to theaddress
field.long
data_custom_ptr_allocatorAddress
(long value) Sets the specified value to theallocatorAddress
field.long
data_custom_ptr_size
(long value) Sets the specified value to thesize
field.long
data_file
(long value) Sets the specified value to thefile
field.long
data_mem()
data_mem
(long value) Sets the specified value to themem
field.destruct()
destruct
(ktxStream_destructI value) Sets the specified value to thedestruct
field.getpos()
getpos
(ktxStream_getposI value) Sets the specified value to thegetpos
field.getsize()
getsize
(ktxStream_getsizeI value) Sets the specified value to thegetsize
field.static ktxStream
malloc()
Returns a newktxStream
instance allocated withmemAlloc
.static ktxStream.Buffer
malloc
(int capacity) Returns a newktxStream.Buffer
instance allocated withmemAlloc
.static ktxStream.Buffer
malloc
(int capacity, MemoryStack stack) Returns a newktxStream.Buffer
instance allocated on the specifiedMemoryStack
.static ktxStream
malloc
(MemoryStack stack) Returns a newktxStream
instance allocated on the specifiedMemoryStack
.static boolean
ncloseOnDestruct
(long struct) Unsafe version ofcloseOnDestruct()
.static void
ncloseOnDestruct
(long struct, boolean value) Unsafe version ofcloseOnDestruct
.static ByteBuffer
ndata_custom_ptr_address
(long struct, int capacity) Unsafe version ofdata_custom_ptr_address
.static void
ndata_custom_ptr_address
(long struct, ByteBuffer value) Unsafe version ofdata_custom_ptr_address
.static long
ndata_custom_ptr_allocatorAddress
(long struct) Unsafe version ofdata_custom_ptr_allocatorAddress()
.static void
ndata_custom_ptr_allocatorAddress
(long struct, long value) Unsafe version ofdata_custom_ptr_allocatorAddress
.static long
ndata_custom_ptr_size
(long struct) Unsafe version ofdata_custom_ptr_size()
.static void
ndata_custom_ptr_size
(long struct, long value) Sets the specified value to thesize
field of the specifiedstruct
.static long
ndata_file
(long struct) Unsafe version ofdata_file()
.static void
ndata_file
(long struct, long value) Unsafe version ofdata_file
.static long
ndata_mem
(long struct) Unsafe version ofdata_mem()
.static void
ndata_mem
(long struct, long value) Unsafe version ofdata_mem
.static ktxStream_destruct
ndestruct
(long struct) Unsafe version ofdestruct()
.static void
ndestruct
(long struct, ktxStream_destructI value) Unsafe version ofdestruct
.static ktxStream_getpos
ngetpos
(long struct) Unsafe version ofgetpos()
.static void
ngetpos
(long struct, ktxStream_getposI value) Unsafe version ofgetpos
.static ktxStream_getsize
ngetsize
(long struct) Unsafe version ofgetsize()
.static void
ngetsize
(long struct, ktxStream_getsizeI value) Unsafe version ofgetsize
.static ktxStream_read
nread
(long struct) Unsafe version ofread()
.static void
nread
(long struct, ktxStream_readI value) Unsafe version ofread
.static long
nreadpos
(long struct) Unsafe version ofreadpos()
.static void
nreadpos
(long struct, long value) Unsafe version ofreadpos
.static ktxStream_setpos
nsetpos
(long struct) Unsafe version ofsetpos()
.static void
nsetpos
(long struct, ktxStream_setposI value) Unsafe version ofsetpos
.static ktxStream_skip
nskip
(long struct) Unsafe version ofskip()
.static void
nskip
(long struct, ktxStream_skipI value) Unsafe version ofskip
.static int
ntype
(long struct) Unsafe version oftype()
.static void
ntype
(long struct, int value) Unsafe version oftype
.static ktxStream_write
nwrite
(long struct) Unsafe version ofwrite()
.static void
nwrite
(long struct, ktxStream_writeI value) Unsafe version ofwrite
.read()
read
(ktxStream_readI value) Sets the specified value to theread
field.long
readpos()
readpos
(long value) Sets the specified value to thereadpos
field.Copies the specified struct data to this struct.setpos()
setpos
(ktxStream_setposI value) Sets the specified value to thesetpos
field.int
sizeof()
Returnssizeof(struct)
.skip()
skip
(ktxStream_skipI value) Sets the specified value to theskip
field.int
type()
type
(int value) Sets the specified value to thetype
field.static void
validate
(long struct) Validates pointer members that should not beNULL
.write()
write
(ktxStream_writeI value) Sets the specified value to thewrite
field.Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
Methods 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. -
WRITE
public static final int WRITEThe struct member offsets. -
GETPOS
public static final int GETPOSThe struct member offsets. -
SETPOS
public static final int SETPOSThe struct member offsets. -
GETSIZE
public static final int GETSIZEThe struct member offsets. -
DESTRUCT
public static final int DESTRUCTThe struct member offsets. -
TYPE
public static final int TYPEThe struct member offsets. -
DATA
public static final int DATAThe struct member offsets. -
DATA_FILE
public static final int DATA_FILEThe struct member offsets. -
DATA_MEM
public static final int DATA_MEMThe struct member offsets. -
DATA_CUSTOM_PTR
public static final int DATA_CUSTOM_PTRThe struct member offsets. -
DATA_CUSTOM_PTR_ADDRESS
public static final int DATA_CUSTOM_PTR_ADDRESSThe struct member offsets. -
DATA_CUSTOM_PTR_ALLOCATORADDRESS
public static final int DATA_CUSTOM_PTR_ALLOCATORADDRESSThe struct member offsets. -
DATA_CUSTOM_PTR_SIZE
public static final int DATA_CUSTOM_PTR_SIZEThe struct member offsets. -
READPOS
public static final int READPOSThe struct member offsets. -
CLOSEONDESTRUCT
public static final int CLOSEONDESTRUCTThe struct member offsets.
-
-
Constructor Details
-
ktxStream
Creates aktxStream
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 Details
-
sizeof
public int sizeof()Description copied from class:Struct
Returnssizeof(struct)
. -
read
- Returns:
- the value of the
read
field.
-
skip
- Returns:
- the value of the
skip
field.
-
write
- Returns:
- the value of the
write
field.
-
getpos
- Returns:
- the value of the
getpos
field.
-
setpos
- Returns:
- the value of the
setpos
field.
-
getsize
- Returns:
- the value of the
getsize
field.
-
destruct
- Returns:
- the value of the
destruct
field.
-
type
public int type()- Returns:
- the value of the
type
field.
-
data_file
public long data_file()- Returns:
- the value of the
data.file
field.
-
data_mem
public long data_mem()- Returns:
- the value of the
data.mem
field.
-
data_custom_ptr_address
- Returns:
- a
ByteBuffer
view of the data pointed to by thedata.custom_ptr.address
field.
-
data_custom_ptr_allocatorAddress
public long data_custom_ptr_allocatorAddress()- Returns:
- the value of the
data.custom_ptr.allocatorAddress
field.
-
data_custom_ptr_size
public long data_custom_ptr_size()- Returns:
- the value of the
data.custom_ptr.size
field.
-
readpos
public long readpos()- Returns:
- the value of the
readpos
field.
-
closeOnDestruct
public boolean closeOnDestruct()- Returns:
- the value of the
closeOnDestruct
field.
-
read
Sets the specified value to theread
field. -
skip
Sets the specified value to theskip
field. -
write
Sets the specified value to thewrite
field. -
getpos
Sets the specified value to thegetpos
field. -
setpos
Sets the specified value to thesetpos
field. -
getsize
Sets the specified value to thegetsize
field. -
destruct
Sets the specified value to thedestruct
field. -
type
Sets the specified value to thetype
field. -
data_file
Sets the specified value to thefile
field. -
data_mem
Sets the specified value to themem
field. -
data_custom_ptr_address
Sets the address of the specifiedByteBuffer
to theaddress
field. -
data_custom_ptr_allocatorAddress
Sets the specified value to theallocatorAddress
field. -
data_custom_ptr_size
Sets the specified value to thesize
field. -
readpos
Sets the specified value to thereadpos
field. -
closeOnDestruct
Sets the specified value to thecloseOnDestruct
field. -
set
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
Returns a newktxStream
instance allocated withmemAlloc
. The instance must be explicitly freed. -
calloc
Returns a newktxStream
instance allocated withmemCalloc
. The instance must be explicitly freed. -
create
Returns a newktxStream
instance allocated withBufferUtils
. -
create
Returns a newktxStream
instance for the specified memory address. -
createSafe
-
malloc
Returns a newktxStream.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
Returns a newktxStream.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
Returns a newktxStream.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
Create aktxStream.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
-
malloc
Returns a newktxStream
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
Returns a newktxStream
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
malloc
Returns a newktxStream.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
calloc
Returns a newktxStream.Buffer
instance allocated on the specifiedMemoryStack
and 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()
. -
nwrite
Unsafe version ofwrite()
. -
ngetpos
Unsafe version ofgetpos()
. -
nsetpos
Unsafe version ofsetpos()
. -
ngetsize
Unsafe version ofgetsize()
. -
ndestruct
Unsafe version ofdestruct()
. -
ntype
public static int ntype(long struct) Unsafe version oftype()
. -
ndata_file
public static long ndata_file(long struct) Unsafe version ofdata_file()
. -
ndata_mem
public static long ndata_mem(long struct) Unsafe version ofdata_mem()
. -
ndata_custom_ptr_address
Unsafe version ofdata_custom_ptr_address
. -
ndata_custom_ptr_allocatorAddress
public static long ndata_custom_ptr_allocatorAddress(long struct) Unsafe version ofdata_custom_ptr_allocatorAddress()
. -
ndata_custom_ptr_size
public static long ndata_custom_ptr_size(long struct) Unsafe version ofdata_custom_ptr_size()
. -
nreadpos
public static long nreadpos(long struct) Unsafe version ofreadpos()
. -
ncloseOnDestruct
public static boolean ncloseOnDestruct(long struct) Unsafe version ofcloseOnDestruct()
. -
nread
Unsafe version ofread
. -
nskip
Unsafe version ofskip
. -
nwrite
Unsafe version ofwrite
. -
ngetpos
Unsafe version ofgetpos
. -
nsetpos
Unsafe version ofsetpos
. -
ngetsize
Unsafe version ofgetsize
. -
ndestruct
Unsafe version ofdestruct
. -
ntype
public static void ntype(long struct, int value) Unsafe version oftype
. -
ndata_file
public static void ndata_file(long struct, long value) Unsafe version ofdata_file
. -
ndata_mem
public static void ndata_mem(long struct, long value) Unsafe version ofdata_mem
. -
ndata_custom_ptr_address
Unsafe version ofdata_custom_ptr_address
. -
ndata_custom_ptr_allocatorAddress
public static void ndata_custom_ptr_allocatorAddress(long struct, long value) Unsafe version ofdata_custom_ptr_allocatorAddress
. -
ndata_custom_ptr_size
public static void ndata_custom_ptr_size(long struct, long value) Sets the specified value to thesize
field of the specifiedstruct
. -
nreadpos
public static void nreadpos(long struct, long value) Unsafe version ofreadpos
. -
ncloseOnDestruct
public static void ncloseOnDestruct(long struct, boolean value) Unsafe version ofcloseOnDestruct
. -
validate
public static void validate(long struct) Validates pointer members that should not beNULL
.- Parameters:
struct
- the struct to validate
-