fast image operations
Diffstat (limited to 'benches/scaling.rs')
-rw-r--r--benches/scaling.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/benches/scaling.rs b/benches/scaling.rs
new file mode 100644
index 0000000..3a55a6a
--- /dev/null
+++ b/benches/scaling.rs
@@ -0,0 +1,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],
+];