Headroom Adaptive Gain Curve
Work with SMPTE ST 2094-50 tone-mapping metadata shared between HDR stills and video.
Overview
A Headroom Adaptive Gain Curve (HAGC) is tone-mapping metadata that describes how an HDR image or video adapts its highlights, midtones, and shadows for a display. The metadata takes effect when a display’s headroom, the brightness it can show above reference white, is less than the content needs. An HAGC combines an HDR reference white anchor, the content value mapped to the display’s reference white, and an optional set of gain curves, following the SMPTE ST 2094-50 standard and the matching ICC HAGC profile tag. Because still images and video share one binary representation, you can move the metadata you add to a still into a video stream, and move metadata from a video stream into a still.
ColorSync provides HAGC through two APIs that describe the same data:
In Swift, use ColorSyncProfile.HeadroomAdaptiveGainCurve to check the curve’s structure at compile time and report invalid values by throwing an error.
In a C dictionary or binary API, use ColorSyncProfile to read an info dictionary or the raw SMPTE ST 2094-50 binary payload, and create a copy of an ICC profile with the HAGC tag attached.
When Image I/O decodes an ISO 21496-1 gain-map image to HDR with kCGImageSourceDecodeToHDR, it derives HAGC metadata automatically by analyzing the ISO gain map.
When the SDR target isn’t known or can’t be computed, the HAGC metadata can indicate a default headroom-adaptive tone mapping, the Reference White Tone Mapping Operator (RWTMO), which is the recommended tone mapping for ISO 22028-5 images.
The system applies HAGC metadata embedded in HDR images and video automatically. Stills render through Core Graphics, Core Image, and Core Animation, including the UIImageView and NSImageView classes. Video plays through AVFoundation, which carries the HAGC metadata as a SMPTE ST 2094-50 binary payload in a timed-metadata it35 (ITU-T T.35) mebx track, identified by it35/B500900001:SMPTE-ST2094-50.
Topics
Authoring a gain curve
Detecting a curve
Reading a curve in Swift
Describing a curve in Swift
ColorSyncProfile.HeadroomAdaptiveGainCurveColorSyncProfile.HeadroomAdaptiveGainCurve.ColorVolumeTransformColorSyncProfile.HeadroomAdaptiveGainCurve.ColorVolumeTransform.ToneMappingColorSyncProfile.HeadroomAdaptiveGainCurve.ColorVolumeTransform.ToneMapping.MethodColorSyncProfile.HeadroomAdaptiveGainCurve.Error
Attaching a curve in Swift
adding(headroomAdaptiveGainCurve:)adding(headroomAdaptiveGainCurveMetadata:options:)ColorSyncProfile.HeadroomAdaptiveGainCurveOptions
Structuring the info dictionary
kColorSyncAlternateCurveCountkColorSyncAlternateGainCurveInfokColorSyncBaselineHeadroomStopskColorSyncCustomHDRReferenceWhitekColorSyncHeadroomAdaptiveGainCurveApplicationVersionkColorSyncHeadroomAdaptiveGainCurveColorVolumeTransformkColorSyncHeadroomAdaptiveGainCurveInfokColorSyncHeadroomAdaptiveToneMappingInfo
Describing gain curves
kColorSyncAlternateCurveHeadroomStopskColorSyncCommonComponentMixingkColorSyncCommonCurveParameterskColorSyncComponentMixkColorSyncControlPointSlopeskColorSyncControlPointsXkColorSyncControlPointsYkColorSyncGainCurveChromaticitieskColorSyncInterpolateSlopeskColorSyncMaxControlPointIndex