Replace ClampingToneMapper::new() with derive(Default)

This commit is contained in:
Matthew Gordon 2019-12-07 10:28:49 -05:00
parent d98144ab74
commit c0d0f81335
1 changed files with 1 additions and 4 deletions

View File

@ -149,13 +149,10 @@ pub trait ToneMapper<T: RealField> {
fn apply_tone_mapping(&self, image_in: &ImageRgbF<T>, image_out: &mut ImageRgbU8);
}
#[derive(Default)]
pub struct ClampingToneMapper {}
impl ClampingToneMapper {
pub fn new() -> ClampingToneMapper {
ClampingToneMapper {}
}
fn clamp<T: RealField + NormalizedAsByte>(v: &T) -> u8 {
clamp(v, &T::zero(), &T::one()).normalized_to_byte()
}