image-effects 0.1.0

An assortment of effects that can be applied to an image with the help of `image`.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
pub type RgbPixelRepr = [u8; 3];
pub type RgbaPixelRepr = [u8; 4];

pub type RgbImageRepr = Vec<Vec<RgbPixelRepr>>;
pub type RgbaImageRepr = Vec<Vec<RgbaPixelRepr>>;

pub(crate) fn get_dimensions_of_matrix<T>(
    matrix: &Vec<Vec<T>>
) -> (usize, usize)
{
    let ydim = matrix.len();
    let xdim = matrix.get(0).map(|row| row.len()).unwrap_or(0);
    (xdim, ydim)
}