Skip to main content

Module apple

Module apple 

Source
Expand description

Apple iOS MakerNote HDR gain-map metadata extraction.

Apple HEIC/JPEG captures encode their HDR gain-map headroom inside the EXIF MakerNote (TIFF tag 0x927C), not in XMP — the embedded gain-map image’s XMP carries only HDRGainMapVersion. The headroom is derived from two Apple MakerNote tags, per exiftool’s Image::ExifTool::Apple:

TagNameTypeRole
0x0021HDRHeadroomrational64s“maker33”
0x0030HDRGainrational64s“maker48”
0x000AHDRImageTypeint32s3 = HDR, 4 = SDR

The headroom (in stops, i.e. log2 luminance ratio) is computed from maker33 and maker48 with the community/Apple-derived piecewise formula (see AppleHdrInfo::headroom_stops). The exact constants are not in a published Apple specification; final fidelity is validated by the gain-map round-trip test, not asserted to be bit-exact here.

References:

This module is pure byte parsing: no_std + alloc, no transcendental math, zero new dependencies. The IFD-walk mechanics mirror the proven reader in zenraw::apple, with the corrected exiftool tag IDs.

Modules§

compatibility
Compatibility with ultrahdr-core 0.6.0’s published Apple helpers.
tags
Apple MakerNote tag IDs (per exiftool Apple.pm).

Structs§

AppleHdrInfo
HDR information recovered from an Apple MakerNote.
AppleMakerNote
Apple MakerNote inspection view. Other vendors remain opaque. No allocation or value copies; unknown entries are visible for audit/diff.
MakerNoteEntry
One borrowed vendor entry, including unknown/private tags.
MakerNoteEntryError
An entry that could not be read. Inspection does not silently hide it.

Functions§

from_apple_headroom
Map recovered Apple headroom to the canonical GainMapMetadata (= zencodec::GainMapParams).
parse_apple_makernote
Parse an Apple iOS MakerNote blob ("Apple iOS\0" + version + byte-order marker + IFD) and pull out the HDR tags.
parse_exif_for_apple_hdr
Extract Apple HDR info directly from EXIF TIFF bytes (e.g. the payload of a HEIF Exif item or a JPEG APP1 segment, with any leading TIFF-offset prefix tolerated).