pub fn signed_weight(
metadata: &GainMapMetadata,
display_headroom_stops: f32,
) -> Option<f32>Expand description
Compute the ISO 21496-1 signed application weight for display_headroom_stops using
exact i128 rational cross-products (never divides by zero or yields NaN on close
valid rationals):
- Returns
Noneifdisplay_headroom_stopsis non-finite orH_base == H_alt. - Returns
0.0at or beyond the base endpoint (amount == 0.0), signaling exact base-rendition identity bypass. - Returns
sign(H_alt - H_base) * clamp((H - H_base) / (H_alt - H_base), 0, 1)(+amountfor Forward SDR→HDR,-amountfor Reverse HDR→SDR).