pub struct AppleHdrInfo {
pub hdr_headroom: Option<f64>,
pub hdr_gain: f64,
pub hdr_image_type: Option<i32>,
}Expand description
HDR information recovered from an Apple MakerNote.
Fields§
§hdr_headroom: Option<f64>0x21 HDRHeadroom (“maker33”). None when the tag is absent — which
means there is no Apple HDR gain-map signal at all.
hdr_gain: f640x30 HDRGain (“maker48”). Defaults to 0.0 when the tag is absent
(Apple omits it on many captures; the formula treats absent as zero).
hdr_image_type: Option<i32>0x0a HDRImageType: Some(3) = HDR Image, Some(4) = Original/SDR.
Implementations§
Source§impl AppleHdrInfo
impl AppleHdrInfo
Sourcepub fn headroom_stops(&self) -> Option<f64>
pub fn headroom_stops(&self) -> Option<f64>
HDR headroom in stops (log2 luminance ratio), or None when no
HDRHeadroom (0x21) tag was present.
Piecewise mapping of maker33 (HDRHeadroom) and maker48
(HDRGain), clamped to be non-negative:
if maker33 < 1: stops = maker48 <= 0.01 ? -20·maker48 + 1.8 : -0.101·maker48 + 1.601
else: stops = maker48 <= 0.01 ? -70·maker48 + 3.0 : -0.44 ·maker48 + 2.86
stops = max(stops, 0)Sourcepub fn has_gain_map(&self) -> bool
pub fn has_gain_map(&self) -> bool
Whether any Apple HDR gain-map signal is present (the 0x21 tag).
Trait Implementations§
Source§impl Clone for AppleHdrInfo
impl Clone for AppleHdrInfo
Source§fn clone(&self) -> AppleHdrInfo
fn clone(&self) -> AppleHdrInfo
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AppleHdrInfo
Source§impl Debug for AppleHdrInfo
impl Debug for AppleHdrInfo
Source§impl Default for AppleHdrInfo
impl Default for AppleHdrInfo
Source§fn default() -> AppleHdrInfo
fn default() -> AppleHdrInfo
Returns the “default value” for a type. Read more
Source§impl PartialEq for AppleHdrInfo
impl PartialEq for AppleHdrInfo
impl StructuralPartialEq for AppleHdrInfo
Auto Trait Implementations§
impl Freeze for AppleHdrInfo
impl RefUnwindSafe for AppleHdrInfo
impl Send for AppleHdrInfo
impl Sync for AppleHdrInfo
impl Unpin for AppleHdrInfo
impl UnsafeUnpin for AppleHdrInfo
impl UnwindSafe for AppleHdrInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more