pub struct HdrToSdrConfig {
pub curve: TonemapCurve,
pub source_peak_nits: f64,
pub target_peak_nits: f64,
pub desat_strength: f64,
}Expand description
Configuration for HDR→SDR tonemapping.
Fields§
§curve: TonemapCurveTonemapping curve.
source_peak_nits: f64Source peak luminance (cd/m²).
target_peak_nits: f64Target peak luminance (cd/m²) — typically 100 for SDR.
desat_strength: f64Desaturation strength (0.0 = none, 1.0 = full grey at peak).
Implementations§
Source§impl HdrToSdrConfig
impl HdrToSdrConfig
Sourcepub fn default_1000nit() -> Self
pub fn default_1000nit() -> Self
Creates a default HDR→SDR configuration for 1000 nit source.
Sourcepub fn validate(&self) -> Result<(), HdrError>
pub fn validate(&self) -> Result<(), HdrError>
Validates the tonemapping configuration.
§Errors
Returns HdrError::OutOfRange if luminance or desaturation values are invalid.
Sourcepub fn tonemap_reinhard(&self, l: f64) -> f64
pub fn tonemap_reinhard(&self, l: f64) -> f64
Applies the Reinhard tonemapping operator to a linear-light value.
Sourcepub fn tonemap_hable(&self, l: f64) -> f64
pub fn tonemap_hable(&self, l: f64) -> f64
Applies the Hable (Uncharted 2) filmic curve.
Sourcepub fn tonemap_aces(&self, l: f64) -> f64
pub fn tonemap_aces(&self, l: f64) -> f64
Applies the ACES filmic curve approximation.
Trait Implementations§
Source§impl Clone for HdrToSdrConfig
impl Clone for HdrToSdrConfig
Source§fn clone(&self) -> HdrToSdrConfig
fn clone(&self) -> HdrToSdrConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HdrToSdrConfig
impl Debug for HdrToSdrConfig
Source§impl<'de> Deserialize<'de> for HdrToSdrConfig
impl<'de> Deserialize<'de> for HdrToSdrConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for HdrToSdrConfig
impl PartialEq for HdrToSdrConfig
Source§impl Serialize for HdrToSdrConfig
impl Serialize for HdrToSdrConfig
impl StructuralPartialEq for HdrToSdrConfig
Auto Trait Implementations§
impl Freeze for HdrToSdrConfig
impl RefUnwindSafe for HdrToSdrConfig
impl Send for HdrToSdrConfig
impl Sync for HdrToSdrConfig
impl Unpin for HdrToSdrConfig
impl UnsafeUnpin for HdrToSdrConfig
impl UnwindSafe for HdrToSdrConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more