decodeGainMap

fun decodeGainMap(data: ByteArray, cancellationCheck: () -> Unit? = null): HeifGainMap?(source)

The HDR gain map of a HEIC or AVIF file, decoded, with its parameters, or null when it has none (#153): the gain map image of a tone-mapped (tmap) item that is the primary item or whose base image the primary item is, with its ISO 21496-1 metadata, else the Apple gain map auxiliary image with the MakerNote tags that go with it. HeifGainMap says what its samples mean. The map is returned, not applied. A file of any other format gives null; the gain map of an Ultra HDR JPEG comes from readMetadata. cancellationCheck works as for decode.

Throws

on a malformed file, gain map item or tmap payload

when the gain map image needs a codec this build lacks, or the metadata is of a version this reader does not know