pub fn diamond(radius: u8) -> Self {
        let cap = 1 + 2 * usize::from(radius) * (usize::from(radius) + 1);
        let mut elements = Vec::with_capacity(cap);
        let radius = i16::from(radius);
        let points = (-radius..=radius)
            .flat_map(|y| ((y.abs() - radius)..=(radius - y.abs())).map(move |x| Point::new(x, y)));
        elements.extend(points);
        Self::new(elements)
    }
Creates a diamond-shaped mask containing all points with `L1` norm at most `radius`.

# Example
```
# extern crate image;
# #[macro_use]
# extern crate imageproc;
# fn main() {
use imageproc::morphology::Mask;

// Mask::diamond(1) is a 3x3 cross centered at the origin.
let diamond_1 = gray_image!(
0, 255,   0;
255, 255, 255;
0, 255,   0
);
assert_eq!(Mask::diamond(1), Mask::from_image(&diamond_1, 1, 1));

// Mask::diamond(2) is a 5x5 diamond centered at the origin.
let diamond_2 = gray_image!(
0,   0, 255,   0,   0;
0, 255, 255, 255,   0;
255, 255, 255, 255, 255;
0, 255, 255, 255,   0;
0,   0, 255,   0,   0
);
assert_eq!(Mask::diamond(2), Mask::from_image(&diamond_2, 2, 2));
# }
```
src/morphology.rs