From b7cf70aac93e2d22f0aa0a5783e5af623bb94add Mon Sep 17 00:00:00 2001 From: Radzivon Bartoshyk Date: Tue, 17 Dec 2024 00:34:29 +0000 Subject: [PATCH] Drop old methods --- src/dynimage.rs | 1 - src/imageops/sample.rs | 24 ++---------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/dynimage.rs b/src/dynimage.rs index ee0d15327a..a86b8a85f0 100644 --- a/src/dynimage.rs +++ b/src/dynimage.rs @@ -831,7 +831,6 @@ impl DynamicImage { #[must_use] pub fn blur(&self, sigma: f32) -> DynamicImage { gaussian_blur_dyn_image(self, sigma) - // dynamic_map!(*self, ref p => imageops::blur(p, sigma)) } /// Performs a fast blur on this image. diff --git a/src/imageops/sample.rs b/src/imageops/sample.rs index d4dd8665b2..9b0a0743f7 100644 --- a/src/imageops/sample.rs +++ b/src/imageops/sample.rs @@ -1002,25 +1002,6 @@ pub fn blur( where I::Pixel: 'static, { - // let sigma = if sigma <= 0.0 { 1.0 } else { sigma }; - // - // let mut method = Filter { - // kernel: Box::new(|x| gaussian(x, sigma)), - // support: 2.0 * sigma, - // }; - // - // let (width, height) = image.dimensions(); - // let is_empty = width == 0 || height == 0; - // - // if is_empty { - // return ImageBuffer::new(width, height); - // } - // - // // Keep width and height the same for horizontal and - // // vertical sampling. - // // Note: tmp is not necessarily actually Rgba - // let tmp: Rgba32FImage = vertical_sample(image, height, &mut method); - // horizontal_sample(&tmp, width, &mut method) gaussian_blur_indirect(image, sigma) } @@ -1046,9 +1027,8 @@ fn get_gaussian_kernel_1d(width: usize, sigma: f32) -> Vec { kernel } -/// In previous implementation sigma means radius, which is not the same one pub(crate) fn gaussian_blur_dyn_image(image: &DynamicImage, sigma: f32) -> DynamicImage { - let min_sigma = sigma.max(0.1); + let min_sigma = sigma.max(1.0f32); let kernel_size = min_sigma as usize * 2 + 1; let gaussian_kernel = get_gaussian_kernel_1d(kernel_size, min_sigma); @@ -1252,7 +1232,7 @@ where let mut transient_dst = vec![0f32; image.width() as usize * image.height() as usize * CN]; - let min_sigma = sigma.max(0.1); + let min_sigma = sigma.max(1.0); let kernel_size = min_sigma as usize * 2 + 1; let gaussian_kernel = get_gaussian_kernel_1d(kernel_size, min_sigma);