From 678971c4ddd271bb41c000606656326b7b7da9c1 Mon Sep 17 00:00:00 2001 From: Alex Severin Date: Mon, 27 May 2024 20:55:39 +0300 Subject: [PATCH] remove generics --- src/gradients.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gradients.rs b/src/gradients.rs index 01faac4d..5529cc34 100644 --- a/src/gradients.rs +++ b/src/gradients.rs @@ -7,9 +7,9 @@ use crate::map::{ChannelMap, WithChannel}; use image::{GenericImage, GenericImageView, GrayImage, Luma, Pixel}; use itertools::multizip; -/// A special version of `gradient()` function for grayscale images which doesn't require giving a +/// A special version of `gradient` function for grayscale images which doesn't require giving a /// pixel mapping function. -pub fn gradients_grayscale( +pub fn gradients_grayscale( image: &GrayImage, horizontal_kernel: Kernel, vertical_kernel: Kernel, @@ -193,21 +193,19 @@ pub fn vertical_prewitt(image: &GrayImage) -> Image> { /// Returns the magnitudes of gradients in an image using Sobel filters. pub fn sobel_gradients(image: &GrayImage) -> Image> { - gradients( + gradients_grayscale( image, kernel::SOBEL_HORIZONTAL_3X3, kernel::SOBEL_VERTICAL_3X3, - |p| p, ) } /// Returns the magnitudes of gradients in an image using Prewitt filters. pub fn prewitt_gradients(image: &GrayImage) -> Image> { - gradients( + gradients_grayscale( image, kernel::PREWITT_HORIZONTAL_3X3, kernel::PREWITT_VERTICAL_3X3, - |p| p, ) }