Class: TranscoderWorker

PIXI.BasisLoader.TranscoderWorker

Worker class for transcoding *.basis files in background threads.

To enable asynchronous transcoding, you need to provide the URL to the basis_universal transcoding library.

new PIXI.BasisLoader.TranscoderWorker ()

Members

PIXI.BasisLoader.TranscoderWorker.bindingURL static

URL for the script containing the basis_universal library.

PIXI.BasisLoader.TranscoderWorker.workerURL static

Generated URL for the transcoder worker script.

onMessage protected

Handles responses from the web-worker

Methods

PIXI.BasisLoader.TranscoderWorker.loadTranscoder (jsURL, wasmURL) Promise static

Loads the transcoder source code

Name Type Description
jsURL string
wasmURL string
Returns:
Type Description
Promise

PIXI.BasisLoader.TranscoderWorker.setTranscoder (jsSource, wasmSource) void static

Set the transcoder source code directly

Name Type Description
jsSource string
wasmSource ArrayBuffer

initAsync () Promise

Returns:
Type Description
Promise a promise that is resolved when the web-worker is initialized

transcodeAsync (basisData, rgbaFormat, rgbFormat) Promise

Name Type Description
basisData Uint8Array

*.basis file contents

rgbaFormat BASIS_FORMATS

transcoding format for RGBA files

rgbFormat BASIS_FORMATS

transcoding format for RGB files

Returns:
Type Description
Promise a promise that is resolved with the transcoding response of the web-worker