Top Description Inners Fields Constructors Methods
org.lwjgl.util.ktx

public Class ktxBasisParams

extends Struct<ktxBasisParams>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

Structure for passing extended parameters to Texture2_CompressBasisEx.

If you only want default values, use Texture2_CompressBasis. Here, at a minimum you must initialize the structure as follows:


  ktxBasisParams params = {0};
  params.structSize = sizeof(params);
  params.compressionLevel = KTX_ETC1S_DEFAULT_COMPRESSION_LEVEL;

compressionLevel has to be explicitly set because 0 is a valid compressionLevel but is not the default used by the BasisU encoder when no value is set. Only the other settings that are to be non-default must be non-zero.

Layout


struct ktxBasisParams {
    ktx_uint32_t structSize;
    ktx_bool_t uastc;
    ktx_bool_t verbose;
    ktx_bool_t noSSE;
    ktx_uint32_t threadCount;
    ktx_uint32_t compressionLevel;
    ktx_uint32_t qualityLevel;
    ktx_uint32_t maxEndpoints;
    float endpointRDOThreshold;
    ktx_uint32_t maxSelectors;
    float selectorRDOThreshold;
    char inputSwizzle[4];
    ktx_bool_t normalMap;
    ktx_bool_t separateRGToRGB_A;
    ktx_bool_t preSwizzle;
    ktx_bool_t noEndpointRDO;
    ktx_bool_t noSelectorRDO;
    ktx_pack_uastc_flags uastcFlags;
    ktx_bool_t uastcRDO;
    float uastcRDOQualityScalar;
    ktx_uint32_t uastcRDODictSize;
    float uastcRDOMaxSmoothBlockErrorScale;
    float uastcRDOMaxSmoothBlockStdDev;
    ktx_bool_t uastcRDODontFavorSimplerModes;
    ktx_bool_t uastcRDONoMultithreading;
}

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final int
ALIGNOF

The struct alignment in bytes.

public static final int
COMPRESSIONLEVEL

The struct member offsets.

public static final int
ENDPOINTRDOTHRESHOLD

The struct member offsets.

public static final int
INPUTSWIZZLE

The struct member offsets.

public static final int
MAXENDPOINTS

The struct member offsets.

public static final int
MAXSELECTORS

The struct member offsets.

public static final int
NOENDPOINTRDO

The struct member offsets.

public static final int
NORMALMAP

The struct member offsets.

public static final int
NOSELECTORRDO

The struct member offsets.

public static final int
NOSSE

The struct member offsets.

public static final int
PRESWIZZLE

The struct member offsets.

public static final int
QUALITYLEVEL

The struct member offsets.

public static final int
SELECTORRDOTHRESHOLD

The struct member offsets.

public static final int
SEPARATERGTORGB_A

The struct member offsets.

public static final int
SIZEOF

The struct size in bytes.

public static final int
STRUCTSIZE

The struct member offsets.

public static final int
THREADCOUNT

The struct member offsets.

public static final int
UASTC

The struct member offsets.

public static final int
UASTCFLAGS

The struct member offsets.

public static final int
UASTCRDO

The struct member offsets.

public static final int
UASTCRDODICTSIZE

The struct member offsets.

public static final int
UASTCRDODONTFAVORSIMPLERMODES

The struct member offsets.

public static final int
UASTCRDOMAXSMOOTHBLOCKERRORSCALE

The struct member offsets.

public static final int
UASTCRDOMAXSMOOTHBLOCKSTDDEV

The struct member offsets.

public static final int
UASTCRDONOMULTITHREADING

The struct member offsets.

public static final int
UASTCRDOQUALITYSCALAR

The struct member offsets.

public static final int
VERBOSE

The struct member offsets.

Inherited from org.lwjgl.system.Struct:
containerDEFAULT_ALIGN_ASDEFAULT_PACK_ALIGNMENT

Constructor Summary

AccessConstructor and Description
protected
ktxBasisParams(long address, ByteBuffer container)

public
ktxBasisParams(ByteBuffer container)

Creates a ktxBasisParams instance at the current position of the specified ByteBuffer container.

Method Summary

Modifier and TypeMethod and Description
public static ktxBasisParams
calloc()

Returns a new ktxBasisParams instance allocated with memCalloc.

public static ktxBasisParams.Buffer
calloc(int
the buffer capacity
capacity
)

Returns a new ktxBasisParams.Buffer instance allocated with memCalloc.

public static ktxBasisParams
calloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new ktxBasisParams instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static ktxBasisParams.Buffer
calloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new ktxBasisParams.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.

public int
compressionLevel()

Encoding speed vs. quality tradeoff.

public ktxBasisParams
compressionLevel(int value)

Sets the specified value to the compressionLevel field.

protected ktxBasisParams
create(long
the struct memory address
address
,
ByteBuffer
an optional container buffer, to be referenced strongly by the struct instance.
container
)

Implements abstract org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.
public static ktxBasisParams
create()

Returns a new ktxBasisParams instance allocated with BufferUtils.

public static ktxBasisParams
create(long address)

Returns a new ktxBasisParams instance for the specified memory address.

public static ktxBasisParams.Buffer
create(int
the buffer capacity
capacity
)

Returns a new ktxBasisParams.Buffer instance allocated with BufferUtils.

public static ktxBasisParams.Buffer
create(long
the memory address
address
,
int
the buffer capacity
capacity
)

Create a ktxBasisParams.Buffer instance at the specified memory.

public static ktxBasisParams
createSafe(long address)

Like create, but returns null if address is NULL.

public static ktxBasisParams.Buffer
createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

public float
endpointRDOThreshold()

Set endpoint RDO quality threshold.

public ktxBasisParams
endpointRDOThreshold(float value)

Sets the specified value to the endpointRDOThreshold field.

public ByteBuffer
inputSwizzle()

A swizzle to apply before encoding.

public byte
inputSwizzle(int index)

A swizzle to apply before encoding.

public ktxBasisParams
inputSwizzle(ByteBuffer value)

Copies the specified ByteBuffer to the inputSwizzle field.

public ktxBasisParams
inputSwizzle(int index, byte value)

Sets the specified value at the specified index of the inputSwizzle field.

public static ktxBasisParams
malloc()

Returns a new ktxBasisParams instance allocated with memAlloc.

public static ktxBasisParams.Buffer
malloc(int
the buffer capacity
capacity
)

Returns a new ktxBasisParams.Buffer instance allocated with memAlloc.

public static ktxBasisParams
malloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new ktxBasisParams instance allocated on the specified MemoryStack.

public static ktxBasisParams.Buffer
malloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new ktxBasisParams.Buffer instance allocated on the specified MemoryStack.

public int
maxEndpoints()

Manually set the max number of color endpoint clusters.

public ktxBasisParams
maxEndpoints(int value)

Sets the specified value to the maxEndpoints field.

public int
maxSelectors()

Manually set the max number of color selector clusters.

public ktxBasisParams
maxSelectors(int value)

Sets the specified value to the maxSelectors field.

public static int
ncompressionLevel(long struct)

Unsafe version of compressionLevel.

public static void
ncompressionLevel(long struct, int value)

Unsafe version of compressionLevel.

public static float
nendpointRDOThreshold(long struct)

Unsafe version of endpointRDOThreshold.

public static void
nendpointRDOThreshold(long struct, float value)

Unsafe version of endpointRDOThreshold.

public static ByteBuffer
ninputSwizzle(long struct)

Unsafe version of inputSwizzle.

public static byte
ninputSwizzle(long struct, int index)

Unsafe version of inputSwizzle.

public static void
ninputSwizzle(long struct, ByteBuffer value)

Unsafe version of inputSwizzle.

public static void
ninputSwizzle(long struct, int index, byte value)

Unsafe version of inputSwizzle.

public static int
nmaxEndpoints(long struct)

Unsafe version of maxEndpoints.

public static void
nmaxEndpoints(long struct, int value)

Unsafe version of maxEndpoints.

public static int
nmaxSelectors(long struct)

Unsafe version of maxSelectors.

public static void
nmaxSelectors(long struct, int value)

Unsafe version of maxSelectors.

public static boolean
nnoEndpointRDO(long struct)

Unsafe version of noEndpointRDO.

public static void
nnoEndpointRDO(long struct, boolean value)

Unsafe version of noEndpointRDO.

public static boolean
nnormalMap(long struct)

Unsafe version of normalMap.

public static void
nnormalMap(long struct, boolean value)

Unsafe version of normalMap.

public static boolean
nnoSelectorRDO(long struct)

Unsafe version of noSelectorRDO.

public static void
nnoSelectorRDO(long struct, boolean value)

Unsafe version of noSelectorRDO.

public static boolean
nnoSSE(long struct)

Unsafe version of noSSE.

public static void
nnoSSE(long struct, boolean value)

Unsafe version of noSSE.

public boolean
noEndpointRDO()

Disable endpoint rate distortion optimizations.

public ktxBasisParams
noEndpointRDO(boolean value)

Sets the specified value to the noEndpointRDO field.

public boolean
normalMap()

Tunes codec parameters for better quality on normal maps (no selector RDO, no endpoint RDO) and sets the texture's DFD appropriately.

public ktxBasisParams
normalMap(boolean value)

Sets the specified value to the normalMap field.

public boolean
noSelectorRDO()

Disable selector rate distortion optimizations.

public ktxBasisParams
noSelectorRDO(boolean value)

Sets the specified value to the noSelectorRDO field.

public boolean
noSSE()

True to forbid use of the SSE instruction set.

public ktxBasisParams
noSSE(boolean value)

Sets the specified value to the noSSE field.

public static boolean
npreSwizzle(long struct)

Unsafe version of preSwizzle.

public static void
npreSwizzle(long struct, boolean value)

Unsafe version of preSwizzle.

public static int
nqualityLevel(long struct)

Unsafe version of qualityLevel.

public static void
nqualityLevel(long struct, int value)

Unsafe version of qualityLevel.

public static float
nselectorRDOThreshold(long struct)

Unsafe version of selectorRDOThreshold.

public static void
nselectorRDOThreshold(long struct, float value)

Unsafe version of selectorRDOThreshold.

public static boolean
nseparateRGToRGB_A(long struct)

Unsafe version of separateRGToRGB_A.

public static void
nseparateRGToRGB_A(long struct, boolean value)

Unsafe version of separateRGToRGB_A.

public static int
nstructSize(long struct)

Unsafe version of structSize.

public static void
nstructSize(long struct, int value)

Unsafe version of structSize.

public static int
nthreadCount(long struct)

Unsafe version of threadCount.

public static void
nthreadCount(long struct, int value)

Unsafe version of threadCount.

public static boolean
nuastc(long struct)

Unsafe version of uastc.

public static void
nuastc(long struct, boolean value)

Unsafe version of uastc.

public static int
nuastcFlags(long struct)

Unsafe version of uastcFlags.

public static void
nuastcFlags(long struct, int value)

Unsafe version of uastcFlags.

public static boolean
nuastcRDO(long struct)

Unsafe version of uastcRDO.

public static void
nuastcRDO(long struct, boolean value)

Unsafe version of uastcRDO.

public static int
nuastcRDODictSize(long struct)

Unsafe version of uastcRDODictSize.

public static void
nuastcRDODictSize(long struct, int value)

Unsafe version of uastcRDODictSize.

public static boolean
public static void
nuastcRDODontFavorSimplerModes(long struct, boolean value)

Unsafe version of uastcRDODontFavorSimplerModes.

public static float
public static void
nuastcRDOMaxSmoothBlockErrorScale(long struct, float value)

Unsafe version of uastcRDOMaxSmoothBlockErrorScale.

public static float
public static void
nuastcRDOMaxSmoothBlockStdDev(long struct, float value)

Unsafe version of uastcRDOMaxSmoothBlockStdDev.

public static boolean
nuastcRDONoMultithreading(long struct)

Unsafe version of uastcRDONoMultithreading.

public static void
nuastcRDONoMultithreading(long struct, boolean value)

Unsafe version of uastcRDONoMultithreading.

public static float
nuastcRDOQualityScalar(long struct)

Unsafe version of uastcRDOQualityScalar.

public static void
nuastcRDOQualityScalar(long struct, float value)

Unsafe version of uastcRDOQualityScalar.

public static boolean
nverbose(long struct)

Unsafe version of verbose.

public static void
nverbose(long struct, boolean value)

Unsafe version of verbose.

public boolean
preSwizzle()

If the texture has KTXswizzle metadata, apply it before compressing.

public ktxBasisParams
preSwizzle(boolean value)

Sets the specified value to the preSwizzle field.

public int
qualityLevel()

Compression quality.

public ktxBasisParams
qualityLevel(int value)

Sets the specified value to the qualityLevel field.

public float
selectorRDOThreshold()

Set selector RDO quality threshold.

public ktxBasisParams
selectorRDOThreshold(float value)

Sets the specified value to the selectorRDOThreshold field.

public boolean
separateRGToRGB_A()

deprecated

public ktxBasisParams
separateRGToRGB_A(boolean value)

Sets the specified value to the separateRGToRGB_A field.

public ktxBasisParams
set(int structSize, boolean uastc, boolean verbose, boolean noSSE, int threadCount, int compressionLevel, int qualityLevel, int maxEndpoints, float endpointRDOThreshold, int maxSelectors, float selectorRDOThreshold, ByteBuffer inputSwizzle, boolean normalMap, boolean separateRGToRGB_A, boolean preSwizzle, boolean noEndpointRDO, boolean noSelectorRDO, int uastcFlags, boolean uastcRDO, float uastcRDOQualityScalar, int uastcRDODictSize, float uastcRDOMaxSmoothBlockErrorScale, float uastcRDOMaxSmoothBlockStdDev, boolean uastcRDODontFavorSimplerModes, boolean uastcRDONoMultithreading)

Initializes this struct with the specified values.

public ktxBasisParams

Returns:

this struct
set
(ktxBasisParams
the source struct
src
)

Copies the specified struct data to this struct.

public int
sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).
public int
structSize()

Size of this struct.

public ktxBasisParams
structSize(int value)

Sets the specified value to the structSize field.

public int
threadCount()

Number of threads used for compression.

public ktxBasisParams
threadCount(int value)

Sets the specified value to the threadCount field.

public boolean
uastc()

True to use UASTC base, false to use ETC1S base.

public ktxBasisParams
uastc(boolean value)

Sets the specified value to the uastc field.

public int
uastcFlags()

A set of ktx_pack_uastc_flag_bits_e controlling UASTC encoding.

public ktxBasisParams
uastcFlags(int value)

Sets the specified value to the uastcFlags field.

public boolean
uastcRDO()

Enable Rate Distortion Optimization (RDO) post-processing.

public ktxBasisParams
uastcRDO(boolean value)

Sets the specified value to the uastcRDO field.

public int
uastcRDODictSize()

UASTC RDO dictionary size in bytes.

public ktxBasisParams
uastcRDODictSize(int value)

Sets the specified value to the uastcRDODictSize field.

public boolean
uastcRDODontFavorSimplerModes()

Do not favor simpler UASTC modes in RDO mode.

public ktxBasisParams
uastcRDODontFavorSimplerModes(boolean value)

Sets the specified value to the uastcRDODontFavorSimplerModes field.

public float
uastcRDOMaxSmoothBlockErrorScale()

UASTC RDO max smooth block error scale.

public ktxBasisParams
uastcRDOMaxSmoothBlockErrorScale(float value)

Sets the specified value to the uastcRDOMaxSmoothBlockErrorScale field.

public float
uastcRDOMaxSmoothBlockStdDev()

UASTC RDO max smooth block standard deviation.

public ktxBasisParams
uastcRDOMaxSmoothBlockStdDev(float value)

Sets the specified value to the uastcRDOMaxSmoothBlockStdDev field.

public boolean
uastcRDONoMultithreading()

Disable RDO multithreading (slightly higher compression, deterministic).

public ktxBasisParams
uastcRDONoMultithreading(boolean value)

Sets the specified value to the uastcRDONoMultithreading field.

public float
uastcRDOQualityScalar()

UASTC RDO quality scalar (lambda).

public ktxBasisParams
uastcRDOQualityScalar(float value)

Sets the specified value to the uastcRDOQualityScalar field.

public boolean
verbose()

If true, prints Basis Universal encoder operation details to stdout.

public ktxBasisParams
verbose(boolean value)

Sets the specified value to the verbose field.

Inherited from org.lwjgl.system.Struct:
__array__array__array__checkContainer__checkMalloc__create__getContainer__getContainer__member__member__member__padding__padding__struct__struct__union__unionclearfreeisNullvalidate