ImageDecoder

The ImageDecoder interface of the WebCodecs API provides a way to unpack and decode encoded image data. Available only in secure contexts.

MDN Reference

Constructors

Link copied to clipboard
constructor(init: ImageDecoderInit)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The complete read-only property of the ImageDecoder interface returns true if encoded data has completed buffering.

Link copied to clipboard

The completed read-only property of the ImageDecoder interface returns a promise that resolves once encoded data has finished buffering.

Link copied to clipboard

The tracks read-only property of the ImageDecoder interface returns a list of the tracks in the encoded image data.

Link copied to clipboard

The type read-only property of the ImageDecoder interface reflects the MIME type configured during construction.

Functions

Link copied to clipboard
fun close()

The close() method of the ImageDecoder interface ends all pending work and releases system resources.

Link copied to clipboard
inline suspend fun ImageDecoder.decode(): ImageDecodeResult

The decode() method of the ImageDecoder interface enqueues a control message to decode the frame of an image.

Link copied to clipboard
fun decodeAsync(options: ImageDecodeOptions = definedExternally): Promise<ImageDecodeResult>

The decode() method of the ImageDecoder interface enqueues a control message to decode the frame of an image.

Link copied to clipboard
fun reset()

The reset() method of the ImageDecoder interface aborts all pending decode() operations; rejecting all pending promises.