PIXI.BasisLoader.TranscoderWorker

class 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.

Summary


Properties from TranscoderWorker

string
static bindingURL

URL for the script containing the basis_universal library.

static onTranscoderInitialized

a promise that when reslved means the transcoder is ready to be used

string
static workerURL

Generated URL for the transcoder worker script.

protected onMessage

Public Properties


bindingURL TranscoderWorker.ts:19
static bindingURL: string

URL for the script containing the basis_universal library.

onTranscoderInitialized TranscoderWorker.ts:26
static onTranscoderInitialized

a promise that when reslved means the transcoder is ready to be used

workerURL TranscoderWorker.ts:42
static workerURL: string

Generated URL for the transcoder worker script.

Protected Properties


onMessage TranscoderWorker.ts:130
protected onMessage

Handles responses from the web-worker

Parameters:
Name Type Description
e

a message event containing the transcoded response

Public Methods


loadTranscoder TranscoderWorker.ts:167
static loadTranscoder(jsURL: string, wasmURL: string) → {Promise<[void, void]>}

Loads the transcoder source code

Parameters:
Name Type Description
jsURL string

URL to the javascript basis transcoder

wasmURL string

URL to the wasm basis transcoder

Returns:
Type Description
Promise<[void, void]>

A promise that resolves when both the js and wasm transcoders have been loaded.

setTranscoder TranscoderWorker.ts:191
static setTranscoder(jsSource: string, wasmSource: ArrayBuffer) → {void}

Set the transcoder source code directly

Parameters:
Name Type Description
jsSource string

source for the javascript basis transcoder

wasmSource ArrayBuffer

source for the wasm basis transcoder

Returns:
Type Description
void
initAsync TranscoderWorker.ts:89
initAsync() → {Promise<void>}
Returns:
Type Description
Promise<void>

a promise that is resolved when the web-worker is initialized

transcodeAsync TranscoderWorker.ts:95
transcodeAsync(basisData: Uint8Array, rgbaFormat: BASIS_FORMATS, rgbFormat: BASIS_FORMATS) → {Promise<ITranscodeResponse>}

Creates a promise that will resolve when the transcoding of a *.basis file is complete.

Parameters:
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<ITranscodeResponse>

a promise that is resolved with the transcoding response of the web-worker


Powered by webdoc!