HeifCodec

interface HeifCodec(source)

The codec of one coded item type of HEIF (ISO/IEC 23008-12), such as hvc1 for HEVC. The core reads the container: it finds the items, joins grids, applies alpha, crops, turns and converts to RGB. A codec only turns the coded data of one item, or of one sample of a track, into planes.

Register a codec with ImageKodec.registerHeifCodec.

Properties

Link copied to clipboard

The four-character type of the item property that configures the codec, such as hvcC.

Link copied to clipboard
abstract val itemType: String

The four-character item type this codec decodes, such as hvc1.

Link copied to clipboard
abstract val sampleEntryTypes: Set<String>

The four-character sample entry types of a track this codec decodes, such as hvc1 and hev1.

Functions

Link copied to clipboard
abstract fun inspect(configuration: ByteArray?, data: ByteArray?): HeifCodecInfo

What the coded data says about the picture, without decoding it. configuration is the payload of the configurationType property, without its box header, or null when the item has none. data is the coded data of the item or of the first sample, or null when it is not available, as when a caller probes the first bytes of a file. Throws ImageDecodeException for data that is malformed.

Link copied to clipboard
abstract fun open(configuration: ByteArray?): HeifCodecSession

A session that decodes the coded samples of one item or of one track, in order. A session keeps state across the samples of a track, so the core opens one session for each.