Remove canonical mod and remove it from benches

This commit is contained in:
Ivan Smirnov 2021-12-29 22:40:41 +03:00
parent 24775b1014
commit 6ed5f13487
3 changed files with 0 additions and 48 deletions

View file

@ -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<Vec<u8>> {
Ok(qoi_fast::canonical::qoi_encode_to_vec(
&img.data,
img.width,
img.height,
img.channels,
0,
)?)
}
fn decode(data: &[u8], img: &Image) -> Result<Vec<u8>> {
Ok(qoi_fast::qoi_decode_to_vec(data, img.channels)?.1)
}
}
struct CodecQoiC; struct CodecQoiC;
impl CodecQoiC { impl CodecQoiC {
@ -319,7 +297,6 @@ fn bench_png(filename: &Path) -> Result<()> {
let mut bench = ImageBench::new(img, 5.); let mut bench = ImageBench::new(img, 5.);
bench.run::<CodecQoiC>()?; bench.run::<CodecQoiC>()?;
bench.run::<CodecQoiFast>()?; bench.run::<CodecQoiFast>()?;
bench.run::<CodecQoiFastCanonical>()?;
bench.report(true); bench.report(true);
Ok(()) Ok(())
} }

View file

@ -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<ColorSpace>,
) -> Result<Vec<u8>> {
encode_to_vec_impl::<true>(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<ColorSpace>,
) -> Result<usize> {
encode_to_buf_impl::<true>(
out.as_mut(),
data.as_ref(),
width,
height,
channels,
colorspace.into(),
)
}

View file

@ -18,7 +18,6 @@ mod header;
mod pixel; mod pixel;
mod utils; mod utils;
pub mod canonical;
pub mod consts; pub mod consts;
pub use crate::colorspace::ColorSpace; pub use crate::colorspace::ColorSpace;