From d9bc767c26718dba82fbfe7c360f8dd84af83968 Mon Sep 17 00:00:00 2001 From: kageru Date: Wed, 19 Feb 2020 20:24:08 +0100 Subject: [PATCH] make white output more likely in float mask --- src/mask.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mask.rs b/src/mask.rs index 7e96337..bc3226a 100644 --- a/src/mask.rs +++ b/src/mask.rs @@ -31,12 +31,12 @@ fn get_mask_value(x: f32, y: f32, luma_scaling: f32) -> f32 { } macro_rules! from_property { - ($prop: expr) => ( + ($prop: expr) => { match $prop { Property::Constant(p) => p, Property::Variable => unreachable!(), } - ) + }; } macro_rules! int_filter { @@ -81,7 +81,7 @@ fn filter_for_float(frame: &mut FrameRefMut, src_frame: FrameRef, average: f32, .zip(src_frame.plane_row::(0, row).iter()) { unsafe { - ptr::write(pixel, lut[(src_pixel * 255f32) as usize]); + ptr::write(pixel, lut[(src_pixel * 255.99f32) as usize]); } } }