The .drft container · interface
DrftTexture
An embedded image, still compressed. Decoding is the consumer's, through createImageBitmap.
Explained in The .drft container.
interface DrftTextureimport type { DrftTexture } from '@driftengine/drft';Properties
| Name | Type | Description |
|---|---|---|
namereadonly | string | What the source called this image. Empty for a file written before names existed. |
codecreadonly | number | |
widthreadonly | number | |
heightreadonly | number | |
bytesreadonly | Uint8Array | A view over the fetched buffer, not a copy, exactly like the vertex arrays.MoreIt 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. |