pub struct DisplayLuminance(/* private fields */);Expand description
Display luminance after tone-mapping: a scalar in [0, 1).
This is the output domain of SceneLuminance::to_display. The closed
half-open range comes from the asymptote of L/(1+L) at L → ∞: 1 is
approached but never reached, so any displayable pixel value lives
strictly below 1. The closed-form inverse below relies on that.
Implementations§
Source§impl DisplayLuminance
impl DisplayLuminance
Sourcepub fn new(ld: f64) -> Option<Self>
pub fn new(ld: f64) -> Option<Self>
Construct a display luminance. Returns None for inputs outside
[0, 1), NaN, or non-finite values. 1.0 is rejected because it
is unreachable by the forward curve (and the inverse blows up).
Sourcepub fn to_scene(self) -> SceneLuminance
pub fn to_scene(self) -> SceneLuminance
Inverse of SceneLuminance::to_display:
L = Ld / (1 − Ld)
Derived by solving Ld = L/(1+L) for L. Total on the
half-open construction range [0, 1). The result is non-negative
and finite (it grows without bound as Ld → 1, but the
constructor refuses Ld == 1.0, so we never hit infinity here).
Trait Implementations§
Source§impl Clone for DisplayLuminance
impl Clone for DisplayLuminance
Source§fn clone(&self) -> DisplayLuminance
fn clone(&self) -> DisplayLuminance
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DisplayLuminance
Source§impl Debug for DisplayLuminance
impl Debug for DisplayLuminance
Source§impl PartialEq for DisplayLuminance
impl PartialEq for DisplayLuminance
Source§fn eq(&self, other: &DisplayLuminance) -> bool
fn eq(&self, other: &DisplayLuminance) -> bool
self and other values to be equal, and is used by ==.