Add QoiDecoder, handle padding properly + refactor

This commit is contained in:
Ivan Smirnov 2022-01-02 00:02:08 +03:00
commit 0eb8a7ade7
4 changed files with 87 additions and 45 deletions

View file

@ -126,8 +126,8 @@ impl Codec for CodecQoiFast {
Ok(qoi_fast::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)
fn decode(data: &[u8], _img: &Image) -> Result<Vec<u8>> {
Ok(qoi_fast::qoi_decode_to_vec(data)?.1)
}
}