Skip to content

Commit

Permalink
removed parralelism (will be reimplemented correctly in a later optim…
Browse files Browse the repository at this point in the history
…isation-focused PR)
  • Loading branch information
morgane.baizeau committed Apr 30, 2024
1 parent 0305484 commit 8f67df0
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/morphology.rs
Original file line number Diff line number Diff line change
Expand Up @@ -685,15 +685,6 @@ impl Mask {
/// # }
/// ```
pub fn grayscale_dilate(image: &GrayImage, mask: &Mask) -> GrayImage {
#[cfg(feature = "rayon")]
let result = GrayImage::from_par_fn(image.width(), image.height(), |x, y| {
Luma([mask
.apply(image, x, y)
.map(|l| l.0[0])
.max()
.unwrap_or(u8::MIN)]) // default is u8::MIN because it's the neutral element of max
});
#[cfg(not(feature = "rayon"))]
let result = GrayImage::from_fn(image.width(), image.height(), |x, y| {
Luma([mask
.apply(image, x, y)
Expand Down Expand Up @@ -787,15 +778,6 @@ pub fn grayscale_dilate(image: &GrayImage, mask: &Mask) -> GrayImage {
/// # }
/// ```
pub fn grayscale_erode(image: &GrayImage, mask: &Mask) -> GrayImage {
#[cfg(feature = "rayon")]
let result = GrayImage::from_par_fn(image.width(), image.height(), |x, y| {
Luma([mask
.apply(image, x, y)
.map(|l| l.0[0])
.min()
.unwrap_or(u8::MAX)]) // default is u8::MAX because it's the neutral element of min
});
#[cfg(not(feature = "rayon"))]
let result = GrayImage::from_fn(image.width(), image.height(), |x, y| {
Luma([mask
.apply(image, x, y)
Expand Down

0 comments on commit 8f67df0

Please sign in to comment.