Package org.lwjgl.util.ktx
Class ktxAstcParams
java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<ktxAstcParams>
org.lwjgl.util.ktx.ktxAstcParams
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class ktxAstcParams
extends org.lwjgl.system.Struct<ktxAstcParams>
implements org.lwjgl.system.NativeResource
Structure for passing extended parameters to
ktxTexture_CompressAstc.
Passing a struct initialized to 0 will use blockDimension 4x4, mode LDR and qualityLevel FASTEST. Setting
qualityLevel to PACK_ASTC_QUALITY_LEVEL_MEDIUM is recommended.
Layout
struct ktxAstcParams {
ktx_uint32_t structSize();
ktx_bool_t verbose();
ktx_uint32_t threadCount();
ktx_uint32_t blockDimension();
ktx_uint32_t mode();
ktx_uint32_t qualityLevel();
ktx_bool_t normalMap();
ktx_bool_t perceptual();
char inputSwizzle()[4];
}-
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 member offsets.static final intThe struct member offsets.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.static final intThe struct member offsets.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
ConstructorsConstructorDescriptionktxAstcParams(ByteBuffer container) Creates aktxAstcParamsinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionintCombinations of block dimensions that astcenc supportsblockDimension(int value) Sets the specified value to theblockDimension()field.static ktxAstcParamscalloc()Returns a newktxAstcParamsinstance allocated withmemCalloc.static ktxAstcParams.Buffercalloc(int capacity) Returns a newktxAstcParams.Bufferinstance allocated withmemCalloc.static ktxAstcParams.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newktxAstcParams.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static ktxAstcParamscalloc(org.lwjgl.system.MemoryStack stack) Returns a newktxAstcParamsinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static ktxAstcParamscreate()Returns a newktxAstcParamsinstance allocated withBufferUtils.static ktxAstcParams.Buffercreate(int capacity) Returns a newktxAstcParams.Bufferinstance allocated withBufferUtils.static ktxAstcParamscreate(long address) Returns a newktxAstcParamsinstance for the specified memory address.static ktxAstcParams.Buffercreate(long address, int capacity) Create aktxAstcParams.Bufferinstance at the specified memory.static @Nullable ktxAstcParamscreateSafe(long address) static @Nullable ktxAstcParams.BuffercreateSafe(long address, int capacity) A swizzle to provide as input to astcenc.byteinputSwizzle(int index) A swizzle to provide as input to astcenc.inputSwizzle(int index, byte value) Sets the specified value at the specified index of theinputSwizzle()field.inputSwizzle(ByteBuffer value) Copies the specifiedByteBufferto theinputSwizzle()field.static ktxAstcParamsmalloc()Returns a newktxAstcParamsinstance allocated withmemAlloc.static ktxAstcParams.Buffermalloc(int capacity) Returns a newktxAstcParams.Bufferinstance allocated withmemAlloc.static ktxAstcParams.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newktxAstcParams.Bufferinstance allocated on the specifiedMemoryStack.static ktxAstcParamsmalloc(org.lwjgl.system.MemoryStack stack) Returns a newktxAstcParamsinstance allocated on the specifiedMemoryStack.intmode()Can be {ldr/hdr} from astcencmode(int value) Sets the specified value to themode()field.static intnblockDimension(long struct) Unsafe version ofblockDimension().static voidnblockDimension(long struct, int value) Unsafe version ofblockDimension.static ByteBufferninputSwizzle(long struct) Unsafe version ofinputSwizzle().static byteninputSwizzle(long struct, int index) Unsafe version ofinputSwizzle.static voidninputSwizzle(long struct, int index, byte value) Unsafe version ofinputSwizzle.static voidninputSwizzle(long struct, ByteBuffer value) Unsafe version ofinputSwizzle.static intnmode(long struct) Unsafe version ofmode().static voidnmode(long struct, int value) Unsafe version ofmode.static booleannnormalMap(long struct) Unsafe version ofnormalMap().static voidnnormalMap(long struct, boolean value) Unsafe version ofnormalMap.booleanTunes codec parameters for better quality on normal maps.normalMap(boolean value) Sets the specified value to thenormalMap()field.static booleannperceptual(long struct) Unsafe version ofperceptual().static voidnperceptual(long struct, boolean value) Unsafe version ofperceptual.static intnqualityLevel(long struct) Unsafe version ofqualityLevel().static voidnqualityLevel(long struct, int value) Unsafe version ofqualityLevel.static intnstructSize(long struct) Unsafe version ofstructSize().static voidnstructSize(long struct, int value) Unsafe version ofstructSize.static intnthreadCount(long struct) Unsafe version ofthreadCount().static voidnthreadCount(long struct, int value) Unsafe version ofthreadCount.static booleannverbose(long struct) Unsafe version ofverbose().static voidnverbose(long struct, boolean value) Unsafe version ofverbose.booleanThe codec should optimize for perceptual error, instead of direct RMS error.perceptual(boolean value) Sets the specified value to theperceptual()field.intastcenc supports -fastest, -fast, -medium, -thorough, -exhaustivequalityLevel(int value) Sets the specified value to thequalityLevel()field.set(int structSize, boolean verbose, int threadCount, int blockDimension, int mode, int qualityLevel, boolean normalMap, boolean perceptual, ByteBuffer inputSwizzle) Initializes this struct with the specified values.set(ktxAstcParams src) Copies the specified struct data to this struct.intsizeof()intSize of this struct.structSize(int value) Sets the specified value to thestructSize()field.intNumber of threads used for compression.threadCount(int value) Sets the specified value to thethreadCount()field.booleanverbose()If true, prints Astc encoder operation details tostdout.verbose(boolean value) Sets the specified value to theverbose()field.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. -
STRUCTSIZE
public static final int STRUCTSIZEThe struct member offsets. -
VERBOSE
public static final int VERBOSEThe struct member offsets. -
THREADCOUNT
public static final int THREADCOUNTThe struct member offsets. -
BLOCKDIMENSION
public static final int BLOCKDIMENSIONThe struct member offsets. -
MODE
public static final int MODEThe struct member offsets. -
QUALITYLEVEL
public static final int QUALITYLEVELThe struct member offsets. -
NORMALMAP
public static final int NORMALMAPThe struct member offsets. -
PERCEPTUAL
public static final int PERCEPTUALThe struct member offsets. -
INPUTSWIZZLE
public static final int INPUTSWIZZLEThe struct member offsets.
-
-
Constructor Details
-
ktxAstcParams
Creates aktxAstcParamsinstance 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<ktxAstcParams>
-
structSize
public int structSize()Size of this struct.Used so library can tell which version of struct is being passed.
-
verbose
public boolean verbose()If true, prints Astc encoder operation details tostdout.Not recommended for GUI apps.
-
threadCount
public int threadCount()Number of threads used for compression. Default is 1. -
blockDimension
public int blockDimension()Combinations of block dimensions that astcenc supports -
mode
public int mode()Can be {ldr/hdr} from astcenc -
qualityLevel
public int qualityLevel()astcenc supports -fastest, -fast, -medium, -thorough, -exhaustive -
normalMap
public boolean normalMap()Tunes codec parameters for better quality on normal maps.In this mode normals are compressed to X,Y components, Discarding Z component, reader will need to generate Z component in shaders.
-
perceptual
public boolean perceptual()The codec should optimize for perceptual error, instead of direct RMS error.This aims to improves perceived image quality, but typically lowers the measured PSNR score. Perceptual methods are currently only available for normal maps and RGB color data.
-
inputSwizzle
A swizzle to provide as input to astcenc. It must match the regular expression/^[rgba01]{4}$/. -
inputSwizzle
public byte inputSwizzle(int index) A swizzle to provide as input to astcenc. It must match the regular expression/^[rgba01]{4}$/. -
structSize
Sets the specified value to thestructSize()field. -
verbose
Sets the specified value to theverbose()field. -
threadCount
Sets the specified value to thethreadCount()field. -
blockDimension
Sets the specified value to theblockDimension()field. -
mode
Sets the specified value to themode()field. -
qualityLevel
Sets the specified value to thequalityLevel()field. -
normalMap
Sets the specified value to thenormalMap()field. -
perceptual
Sets the specified value to theperceptual()field. -
inputSwizzle
Copies the specifiedByteBufferto theinputSwizzle()field. -
inputSwizzle
Sets the specified value at the specified index of theinputSwizzle()field. -
set
public ktxAstcParams set(int structSize, boolean verbose, int threadCount, int blockDimension, int mode, int qualityLevel, boolean normalMap, boolean perceptual, ByteBuffer inputSwizzle) 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 newktxAstcParamsinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newktxAstcParamsinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newktxAstcParamsinstance allocated withBufferUtils. -
create
Returns a newktxAstcParamsinstance for the specified memory address. -
createSafe
-
malloc
Returns a newktxAstcParams.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newktxAstcParams.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newktxAstcParams.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aktxAstcParams.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
malloc
Returns a newktxAstcParamsinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newktxAstcParamsinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newktxAstcParams.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newktxAstcParams.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
nstructSize
public static int nstructSize(long struct) Unsafe version ofstructSize(). -
nverbose
public static boolean nverbose(long struct) Unsafe version ofverbose(). -
nthreadCount
public static int nthreadCount(long struct) Unsafe version ofthreadCount(). -
nblockDimension
public static int nblockDimension(long struct) Unsafe version ofblockDimension(). -
nmode
public static int nmode(long struct) Unsafe version ofmode(). -
nqualityLevel
public static int nqualityLevel(long struct) Unsafe version ofqualityLevel(). -
nnormalMap
public static boolean nnormalMap(long struct) Unsafe version ofnormalMap(). -
nperceptual
public static boolean nperceptual(long struct) Unsafe version ofperceptual(). -
ninputSwizzle
Unsafe version ofinputSwizzle(). -
ninputSwizzle
public static byte ninputSwizzle(long struct, int index) Unsafe version ofinputSwizzle. -
nstructSize
public static void nstructSize(long struct, int value) Unsafe version ofstructSize. -
nverbose
public static void nverbose(long struct, boolean value) Unsafe version ofverbose. -
nthreadCount
public static void nthreadCount(long struct, int value) Unsafe version ofthreadCount. -
nblockDimension
public static void nblockDimension(long struct, int value) Unsafe version ofblockDimension. -
nmode
public static void nmode(long struct, int value) Unsafe version ofmode. -
nqualityLevel
public static void nqualityLevel(long struct, int value) Unsafe version ofqualityLevel. -
nnormalMap
public static void nnormalMap(long struct, boolean value) Unsafe version ofnormalMap. -
nperceptual
public static void nperceptual(long struct, boolean value) Unsafe version ofperceptual. -
ninputSwizzle
Unsafe version ofinputSwizzle. -
ninputSwizzle
public static void ninputSwizzle(long struct, int index, byte value) Unsafe version ofinputSwizzle.
-