Documentation / @debuffjp/core / CompressedTexture
Class: CompressedTexture
Defined in: spryte/dist/ktx2.d.ts:8
A block-compressed image, ready to upload as it is: it stays compressed in video memory, at 1 byte per pixel instead of 4. Make one with parseKtx2 and draw it like any image. Only the WebGL2 backend can draw it, and only when the GPU supports its format: check draw.compressedFormats and load another file otherwise.
Constructors
Constructor
new CompressedTexture(
width,height,format,levels,premultiplied):CompressedTexture
Defined in: spryte/dist/ktx2.d.ts:16
Parameters
width
number
height
number
format
levels
readonly Uint8Array<ArrayBufferLike>[]
Mip levels, largest first.
premultiplied
boolean
Whether colour was multiplied by alpha when encoded. spryte draws premultiplied colour, so encode it that way.
Returns
CompressedTexture
Properties
format
readonlyformat:CompressedFormat
Defined in: spryte/dist/ktx2.d.ts:11
height
readonlyheight:number
Defined in: spryte/dist/ktx2.d.ts:10
levels
readonlylevels: readonlyUint8Array<ArrayBufferLike>[]
Defined in: spryte/dist/ktx2.d.ts:13
Mip levels, largest first.
premultiplied
readonlypremultiplied:boolean
Defined in: spryte/dist/ktx2.d.ts:15
Whether colour was multiplied by alpha when encoded. spryte draws premultiplied colour, so encode it that way.
width
readonlywidth:number
Defined in: spryte/dist/ktx2.d.ts:9