mirror of
https://github.com/bend-n/fimg.git
synced 2024-12-22 02:28:19 -06:00
22 lines
471 B
Rust
22 lines
471 B
Rust
|
use fimg::{scale::*, Image};
|
||
|
|
||
|
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],
|
||
|
];
|