Rename qoi-fast -> qoi (qoi-rust) + update repo

This commit is contained in:
Ivan Smirnov 2022-01-06 03:59:32 +03:00
commit 53ecac38a9
10 changed files with 35 additions and 35 deletions

View file

@ -12,11 +12,11 @@ use rand::{
};
use libqoi::{qoi_decode, qoi_encode};
use qoi_fast::consts::{
use qoi::consts::{
QOI_HEADER_SIZE, QOI_MASK_2, QOI_OP_DIFF, QOI_OP_INDEX, QOI_OP_LUMA, QOI_OP_RGB, QOI_OP_RGBA,
QOI_OP_RUN, QOI_PADDING_SIZE,
};
use qoi_fast::{decode_header, decode_to_vec, encode_to_vec};
use qoi::{decode_header, decode_to_vec, encode_to_vec};
use self::common::hash;
@ -291,9 +291,9 @@ fn test_generated() {
let encode_c = |data: &[u8], size| qoi_encode(data, size, 1, channels as _);
let decode_c = |data: &[u8]| qoi_decode(data, channels as _).map(|r| r.1);
check_roundtrip("qoi-fast -> qoi-fast", &img, channels as _, encode, decode);
check_roundtrip("qoi-fast -> qoi.h", &img, channels as _, encode, decode_c);
check_roundtrip("qoi.h -> qoi-fast", &img, channels as _, encode_c, decode);
check_roundtrip("qoi-rust -> qoi-rust", &img, channels as _, encode, decode);
check_roundtrip("qoi-rust -> qoi.h", &img, channels as _, encode, decode_c);
check_roundtrip("qoi.h -> qoi-rust", &img, channels as _, encode_c, decode);
let size = (img.len() / channels) as u32;
let encoded = encode(&img, size).unwrap();
@ -301,10 +301,10 @@ fn test_generated() {
cfg_if! {
if #[cfg(feature = "reference")] {
let eq = encoded.as_slice() == encoded_c.as_ref();
assert!(eq, "qoi-fast [reference mode] doesn't match qoi.h");
assert!(eq, "qoi-rust [reference mode] doesn't match qoi.h");
} else {
let eq = encoded.len() == encoded_c.len();
assert!(eq, "qoi-fast [non-reference mode] length doesn't match qoi.h");
assert!(eq, "qoi-rust [non-reference mode] length doesn't match qoi.h");
}
}