fast image operations
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
use fimg::{Image, scale::*};

macro_rules! bench {
    ($([$a: ident, $alg:ident]),+ $(,)?) => {
        $(fn $a() {
            let img: Image<_, 3> = Image::open("tdata/cat.png");
            iai::black_box(img.scale::<$alg>(267, 178));
        })+

        iai::main!($($a,)+);
    };
}
bench![
    [nearest, Nearest],
    [bilinear, Bilinear],
    [boxs, Box],
    [lanczos3, Lanczos3],
    [catmull, CatmullRom],
    [mitchell, Mitchell],
    [hamming, Hamming],
];