/** * ISO 21496-1 binary gain map metadata (de)serialization * Based on libultrahdr gainmapmetadata.cpp implementation * * Layout (big endian): * - u16 minimum_version, u16 writer_version * - u8 flags (bit 7: multichannel, bit 6: use base colour space, bit 2: backward direction, bit 3: common denominator) * - headroom: base_hdr_headroom, alternate_hdr_headroom (unsigned fractions) * - per channel: gain_map_min (s), gain_map_max (s), gamma (u), base_offset (s), alternate_offset (s) * * Fractions are written as numerator + denominator, or numerator only when the common denominator flag is set. */ import { type GainMapMetadata } from './types'; /** * Namespace identifying an ISO 21496-1 APP2 segment (null terminated) */ export declare const ISO_NAMESPACE = "urn:iso:std:iso:ts:21496:-1\0"; /** * The version-only payload stored in the primary image (minimum_version = 0, writer_version = 0) */ export declare const ISO_VERSION_ONLY: Uint8Array; /** * Serializes gain map metadata into an ISO 21496-1 binary payload * (without namespace), to be stored in the gain map image. * * Values are already in the expected space: gainMapMin/Max and hdrCapacityMin/Max * are log2, gamma and offsets are linear. * * @param metadata * @returns */ export declare const encodeISOGainMapMetadata: (metadata: GainMapMetadata) => Uint8Array; /** * Parses an ISO 21496-1 binary payload (without namespace) * * @param data * @returns the parsed metadata * @throws {Error} if the payload is unsupported (version, backward direction) or malformed */ export declare const decodeISOGainMapMetadata: (data: Uint8Array) => GainMapMetadata;