Replace ClampingToneMapper::new() with derive(Default)
This commit is contained in:
parent
d98144ab74
commit
c0d0f81335
|
|
@ -149,13 +149,10 @@ pub trait ToneMapper<T: RealField> {
|
||||||
fn apply_tone_mapping(&self, image_in: &ImageRgbF<T>, image_out: &mut ImageRgbU8);
|
fn apply_tone_mapping(&self, image_in: &ImageRgbF<T>, image_out: &mut ImageRgbU8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
pub struct ClampingToneMapper {}
|
pub struct ClampingToneMapper {}
|
||||||
|
|
||||||
impl ClampingToneMapper {
|
impl ClampingToneMapper {
|
||||||
pub fn new() -> ClampingToneMapper {
|
|
||||||
ClampingToneMapper {}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn clamp<T: RealField + NormalizedAsByte>(v: &T) -> u8 {
|
fn clamp<T: RealField + NormalizedAsByte>(v: &T) -> u8 {
|
||||||
clamp(v, &T::zero(), &T::one()).normalized_to_byte()
|
clamp(v, &T::zero(), &T::one()).normalized_to_byte()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue