From 6ed5f1348741ac0e47053c38c76edaa7ba6bd883 Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Wed, 29 Dec 2021 22:40:41 +0300 Subject: [PATCH] Remove `canonical` mod and remove it from benches --- qoi-bench/src/main.rs | 23 ----------------------- src/canonical.rs | 24 ------------------------ src/lib.rs | 1 - 3 files changed, 48 deletions(-) delete mode 100644 src/canonical.rs diff --git a/qoi-bench/src/main.rs b/qoi-bench/src/main.rs index 1789711..7f1db0a 100644 --- a/qoi-bench/src/main.rs +++ b/qoi-bench/src/main.rs @@ -131,28 +131,6 @@ impl Codec for CodecQoiFast { } } -struct CodecQoiFastCanonical; - -impl Codec for CodecQoiFastCanonical { - fn name() -> &'static str { - "qoi-fast(c)" - } - - fn encode(img: &Image) -> Result> { - Ok(qoi_fast::canonical::qoi_encode_to_vec( - &img.data, - img.width, - img.height, - img.channels, - 0, - )?) - } - - fn decode(data: &[u8], img: &Image) -> Result> { - Ok(qoi_fast::qoi_decode_to_vec(data, img.channels)?.1) - } -} - struct CodecQoiC; impl CodecQoiC { @@ -319,7 +297,6 @@ fn bench_png(filename: &Path) -> Result<()> { let mut bench = ImageBench::new(img, 5.); bench.run::()?; bench.run::()?; - bench.run::()?; bench.report(true); Ok(()) } diff --git a/src/canonical.rs b/src/canonical.rs deleted file mode 100644 index f0ca717..0000000 --- a/src/canonical.rs +++ /dev/null @@ -1,24 +0,0 @@ -use crate::colorspace::ColorSpace; -use crate::encode::{encode_to_buf_impl, encode_to_vec_impl}; -use crate::error::Result; - -pub fn qoi_encode_to_vec( - data: impl AsRef<[u8]>, width: u32, height: u32, channels: u8, - colorspace: impl Into, -) -> Result> { - encode_to_vec_impl::(data.as_ref(), width, height, channels, colorspace.into()) -} - -pub fn qoi_encode_to_buf( - mut out: impl AsMut<[u8]>, data: impl AsRef<[u8]>, width: u32, height: u32, channels: u8, - colorspace: impl Into, -) -> Result { - encode_to_buf_impl::( - out.as_mut(), - data.as_ref(), - width, - height, - channels, - colorspace.into(), - ) -} diff --git a/src/lib.rs b/src/lib.rs index 5a49b4d..bf7eae6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -18,7 +18,6 @@ mod header; mod pixel; mod utils; -pub mod canonical; pub mod consts; pub use crate::colorspace::ColorSpace;