The .drft container · interface

DrftTexture

An embedded image, still compressed. Decoding is the consumer's, through createImageBitmap.

Explained in The .drft container.

interface DrftTexture
import type { DrftTexture } from '@driftengine/drft';

Properties

NameTypeDescription
namereadonlystringWhat the source called this image. Empty for a file written before names existed.
codecreadonlynumber
widthreadonlynumber
heightreadonlynumber
bytesreadonlyUint8ArrayA view over the fetched buffer, not a copy, exactly like the vertex arrays.
More

It therefore keeps the whole file alive for as long as it is held. That is the intended trade for a load that allocates nothing, and it is why a consumer decoding these should drop its reference to the asset afterwards rather than keep it beside the GPU textures.