pub enum Curve {
Identity,
Gamma(f64),
Parametric {
kind: u16,
p: [f64; 7],
},
Table(Vec<f32>),
}Expand description
A tone reproduction curve.
Gamma and parametric curves are evaluated analytically, including outside [0, 1] (negative
inputs mirror, values above 1 extend the formula), so unbounded float transforms keep HDR
values. Sampled tables clamp their input to [0, 1].
Variants§
Identity
Gamma(f64)
y = x^g.
Parametric
ICC parametricCurveType function kind (0–4) with parameters [g, a, b, c, d, e, f]
(unused ones are 0).
Table(Vec<f32>)
Samples at evenly spaced inputs over [0, 1], normalised outputs.
Implementations§
Source§impl Curve
impl Curve
Sourcepub fn param_count(kind: u16) -> usize
pub fn param_count(kind: u16) -> usize
Number of parameters stored for a parametric function type.
pub fn is_identity(&self) -> bool
pub fn eval(&self, x: f32) -> f32
Sourcepub fn eval_inverse64(&self, y: f64) -> f64
pub fn eval_inverse64(&self, y: f64) -> f64
Evaluates the inverse curve at y.
pub fn eval_inverse(&self, y: f32) -> f32
Sourcepub fn is_monotonic(&self) -> bool
pub fn is_monotonic(&self) -> bool
true when the curve never decreases over [0, 1].
Trait Implementations§
impl StructuralPartialEq for Curve
Auto Trait Implementations§
impl Forget for Curve
impl Freeze for Curve
impl Move for Curve
impl RefUnwindSafe for Curve
impl Send for Curve
impl Sync for Curve
impl Unpin for Curve
impl UnsafeUnpin for Curve
impl UnwindSafe for Curve
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> 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