Skip to content

Commit

Permalink
Drop old methods
Browse files Browse the repository at this point in the history
  • Loading branch information
awxkee committed Dec 17, 2024
1 parent fea58bd commit b7cf70a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
1 change: 0 additions & 1 deletion src/dynimage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
24 changes: 2 additions & 22 deletions src/imageops/sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1002,25 +1002,6 @@ pub fn blur<I: GenericImageView>(
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)
}

Expand All @@ -1046,9 +1027,8 @@ fn get_gaussian_kernel_1d(width: usize, sigma: f32) -> Vec<f32> {
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);

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b7cf70a

Please sign in to comment.