Ktx2Reader

class Ktx2Reader(engine: Engine, quiet: Boolean = false) : AutoCloseable

Allows clients to create Filament textures from KTX2 containers.

Contains a cache of the transcoding state. Call requestFormat at least once before load.

Parameters

quiet

don't log errors

Constructors

Link copied to clipboard
constructor(engine: Engine, quiet: Boolean = false)

Types

Link copied to clipboard
class Async

A texture whose mipmap levels asyncCreate leaves to transcode and upload.

Link copied to clipboard

How requestFormat, load and the async transcoding went.

Link copied to clipboard

The transfer function the KTX2 data must declare in its metadata.

Properties

Link copied to clipboard

The native object, for interop with code calling the Fila* C API directly. Read-only: this wrapper owns it.

Functions

Link copied to clipboard

Creates a texture without transcoding it yet, so mipmap levels can be populated asynchronously; data is copied. Returns null if none of the requested formats can be extracted from it.

Link copied to clipboard

Frees async and the source data it copied, but not its texture.

Link copied to clipboard
open override fun close()

Same as destroy; lets this be used with use { } and try-with-resources.

Link copied to clipboard
fun destroy()

Frees the reader and its transcoding cache.

Link copied to clipboard

Creates and loads a texture from a KTX2 blob, or null if none of the requested formats can be extracted from it.

Link copied to clipboard

Enables a given texture format, for load to consider; formats requested early are preferred. This must be called at least once before load.

Link copied to clipboard

Removes a format from the list requestFormat builds.