Function: decodeColormapSprite()
Defined in: decode-colormap-sprite.ts:25
Decode a colormap sprite image into ImageData. Does not require a GPU
Device, so it can run during app startup in parallel with the
device-creation path; pair with createColormapTexture once the device
is available.
Supported source forms:
ArrayBuffer/Uint8Array: wrapped in aBloband decoded viacreateImageBitmap.ImageBitmap: drawn into anOffscreenCanvasto extract pixels.
To decode from a URL, fetch the bytes first:
const bytes = await (await fetch(colormapsUrl)).arrayBuffer();
const imageData = await decodeColormapSprite(bytes);
Avoiding a string overload here keeps the helper from having to
disambiguate URL / base64 / data-URL inputs.