Skip to content

Commit 53ecac3

Browse files
committed
Rename qoi-fast -> qoi (qoi-rust) + update repo
1 parent 3cc5a26 commit 53ecac3

File tree

10 files changed

+35
-35
lines changed

10 files changed

+35
-35
lines changed

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[package]
2-
name = "qoi-fast"
3-
version = "0.2.0"
4-
description = "Fast encoder/decoder for QOI (Quite Okay Image) format"
2+
name = "qoi"
3+
version = "0.4.0"
4+
description = "VERY fast encoder/decoder for QOI (Quite Okay Image) format"
55
authors = ["Ivan Smirnov <rust@ivan.smirnov.ie>"]
66
edition = "2018"
77
readme = "README.md"
88
license = "MIT/Apache-2.0"
9-
repository = "https://github.com/aldanor/qoi-fast"
10-
homepage = "https://github.com/aldanor/qoi-fast"
11-
documentation = "https://docs.rs/qoi-fast"
9+
repository = "https://github.com/aldanor/qoi-rust"
10+
homepage = "https://github.com/aldanor/qoi-rust"
11+
documentation = "https://docs.rs/qoi"
1212
categories = ["multimedia::images", "multimedia::encoding"]
1313
keywords = ["qoi", "graphics", "image", "encoding"]
1414
exclude = [
@@ -37,7 +37,7 @@ rand = "0.8"
3737
libqoi = { path = "libqoi"}
3838

3939
[lib]
40-
name = "qoi_fast"
40+
name = "qoi"
4141
path = "src/lib.rs"
4242
doctest = false
4343

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# [qoi-fast](https://crates.io/crates/qoi-fast)
1+
# [qoi](https://crates.io/crates/qoi)
22

3-
[![Build](https://github.com/aldanor/qoi-fast/workflows/CI/badge.svg)](https://github.com/aldanor/qoi-fast/actions?query=branch%3Amaster)
4-
[![Latest Version](https://img.shields.io/crates/v/qoi-fast.svg)](https://crates.io/crates/qoi-fast)
5-
[![Documentation](https://img.shields.io/docsrs/qoi-fast)](https://docs.rs/qoi-fast)
3+
[![Build](https://github.com/aldanor/qoi-rust/workflows/CI/badge.svg)](https://github.com/aldanor/qoi-rust/actions?query=branch%3Amaster)
4+
[![Latest Version](https://img.shields.io/crates/v/qoi.svg)](https://crates.io/crates/qoi)
5+
[![Documentation](https://img.shields.io/docsrs/qoi)](https://docs.rs/qoi)
66
[![Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
77
[![MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
88
[![unsafe forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance)
@@ -19,7 +19,7 @@ Fast encoder/decoder for [QOI image format](https://qoiformat.org/), implemented
1919
### Examples
2020

2121
```rust
22-
use qoi_fast::{encode_to_vec, decode_to_vec};
22+
use qoi::{encode_to_vec, decode_to_vec};
2323

2424
let encoded = encode_to_vec(&pixels, width, height)?;
2525
let (header, decoded) = decode_to_vec(&encoded)?;
@@ -34,7 +34,7 @@ assert_eq!(decoded, pixels);
3434
```
3535
decode:Mp/s encode:Mp/s decode:MB/s encode:MB/s
3636
qoi.h 282.9 225.3 978.3 778.9
37-
qoi-fast 427.4 290.0 1477.7 1002.9
37+
qoi-rust 427.4 290.0 1477.7 1002.9
3838
```
3939

4040
- Reference C implementation:

bench/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ publish = false
99
[dependencies]
1010
# internal
1111
libqoi = { path = "../libqoi" }
12-
qoi-fast = { path = ".." }
12+
qoi = { path = ".." }
1313
# external
1414
anyhow = "1.0"
1515
bytemuck = "1.7"

bench/src/main.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,21 +129,21 @@ trait Codec {
129129
fn decode(data: &[u8], img: &Image) -> Result<Self::Output>;
130130
}
131131

132-
struct CodecQoiFast;
132+
struct CodecQoiRust;
133133

134-
impl Codec for CodecQoiFast {
134+
impl Codec for CodecQoiRust {
135135
type Output = Vec<u8>;
136136

137137
fn name() -> &'static str {
138-
"qoi-fast"
138+
"qoi-rust"
139139
}
140140

141141
fn encode(img: &Image) -> Result<Vec<u8>> {
142-
Ok(qoi_fast::encode_to_vec(&img.data, img.width, img.height)?)
142+
Ok(qoi::encode_to_vec(&img.data, img.width, img.height)?)
143143
}
144144

145145
fn decode(data: &[u8], _img: &Image) -> Result<Vec<u8>> {
146-
Ok(qoi_fast::decode_to_vec(data)?.1)
146+
Ok(qoi::decode_to_vec(data)?.1)
147147
}
148148
}
149149

@@ -215,7 +215,7 @@ impl ImageBench {
215215
let (decoded, t_decode) = timeit(|| C::decode(encoded.as_ref(), img));
216216
let decoded = decoded?;
217217
let roundtrip = decoded.as_ref() == img.data.as_slice();
218-
if C::name() == "qoi-fast" {
218+
if C::name() == "qoi-rust" {
219219
assert!(roundtrip, "{}: decoded data doesn't roundtrip", C::name());
220220
} else {
221221
ensure!(roundtrip, "{}: decoded data doesn't roundtrip", C::name());
@@ -374,7 +374,7 @@ fn bench_png(filename: &Path, seconds: f64, use_median: bool) -> Result<ImageBen
374374
);
375375
let mut bench = ImageBench::new(&img);
376376
bench.run::<CodecQoiC>(&img, seconds)?;
377-
bench.run::<CodecQoiFast>(&img, seconds)?;
377+
bench.run::<CodecQoiRust>(&img, seconds)?;
378378
bench.report(use_median);
379379
Ok(bench)
380380
}

fuzz/fuzz_targets/decode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![no_main]
22
use libfuzzer_sys::fuzz_target;
33

4-
use qoi_fast::{decode_header, decode_to_vec, Channels, ColorSpace, Header};
4+
use qoi::{decode_header, decode_to_vec, Channels, ColorSpace, Header};
55

66
fuzz_target!(|input: (u16, u16, bool, &[u8])| {
77
let (w, h, is_4, data) = input;

fuzz/fuzz_targets/encode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![no_main]
22
use libfuzzer_sys::fuzz_target;
33

4-
use qoi_fast::{encode_size_limit, encode_to_vec};
4+
use qoi::{encode_size_limit, encode_to_vec};
55

66
fuzz_target!(|input: (bool, u8, &[u8])| {
77
let (is_4, w_frac, data) = input;

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//! ### Examples
1111
//!
1212
//! ```rust
13-
//! use qoi_fast::{encode_to_vec, decode_to_vec};
13+
//! use qoi::{encode_to_vec, decode_to_vec};
1414
//!
1515
//! let encoded = encode_to_vec(&pixels, width, height)?;
1616
//! let (header, decoded) = decode_to_vec(&encoded)?;
@@ -25,7 +25,7 @@
2525
//! ```
2626
//! decode:Mp/s encode:Mp/s decode:MB/s encode:MB/s
2727
//! qoi.h 282.9 225.3 978.3 778.9
28-
//! qoi-fast 427.4 290.0 1477.7 1002.9
28+
//! qoi-rust 427.4 290.0 1477.7 1002.9
2929
//! ```
3030
//!
3131
//! - Reference C implementation:

tests/test_chunks.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ mod common;
22

33
use bytemuck::{cast_slice, Pod};
44

5-
use qoi_fast::consts::{
5+
use qoi::consts::{
66
QOI_HEADER_SIZE, QOI_OP_DIFF, QOI_OP_INDEX, QOI_OP_LUMA, QOI_OP_RGB, QOI_OP_RGBA, QOI_OP_RUN,
77
QOI_PADDING_SIZE,
88
};
9-
use qoi_fast::{decode_to_vec, encode_to_vec};
9+
use qoi::{decode_to_vec, encode_to_vec};
1010

1111
use self::common::hash;
1212

tests/test_gen.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ use rand::{
1212
};
1313

1414
use libqoi::{qoi_decode, qoi_encode};
15-
use qoi_fast::consts::{
15+
use qoi::consts::{
1616
QOI_HEADER_SIZE, QOI_MASK_2, QOI_OP_DIFF, QOI_OP_INDEX, QOI_OP_LUMA, QOI_OP_RGB, QOI_OP_RGBA,
1717
QOI_OP_RUN, QOI_PADDING_SIZE,
1818
};
19-
use qoi_fast::{decode_header, decode_to_vec, encode_to_vec};
19+
use qoi::{decode_header, decode_to_vec, encode_to_vec};
2020

2121
use self::common::hash;
2222

@@ -291,20 +291,20 @@ fn test_generated() {
291291
let encode_c = |data: &[u8], size| qoi_encode(data, size, 1, channels as _);
292292
let decode_c = |data: &[u8]| qoi_decode(data, channels as _).map(|r| r.1);
293293

294-
check_roundtrip("qoi-fast -> qoi-fast", &img, channels as _, encode, decode);
295-
check_roundtrip("qoi-fast -> qoi.h", &img, channels as _, encode, decode_c);
296-
check_roundtrip("qoi.h -> qoi-fast", &img, channels as _, encode_c, decode);
294+
check_roundtrip("qoi-rust -> qoi-rust", &img, channels as _, encode, decode);
295+
check_roundtrip("qoi-rust -> qoi.h", &img, channels as _, encode, decode_c);
296+
check_roundtrip("qoi.h -> qoi-rust", &img, channels as _, encode_c, decode);
297297

298298
let size = (img.len() / channels) as u32;
299299
let encoded = encode(&img, size).unwrap();
300300
let encoded_c = encode_c(&img, size).unwrap();
301301
cfg_if! {
302302
if #[cfg(feature = "reference")] {
303303
let eq = encoded.as_slice() == encoded_c.as_ref();
304-
assert!(eq, "qoi-fast [reference mode] doesn't match qoi.h");
304+
assert!(eq, "qoi-rust [reference mode] doesn't match qoi.h");
305305
} else {
306306
let eq = encoded.len() == encoded_c.len();
307-
assert!(eq, "qoi-fast [non-reference mode] length doesn't match qoi.h");
307+
assert!(eq, "qoi-rust [non-reference mode] length doesn't match qoi.h");
308308
}
309309
}
310310

tests/test_ref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use anyhow::{bail, Result};
55
use cfg_if::cfg_if;
66
use walkdir::{DirEntry, WalkDir};
77

8-
use qoi_fast::{decode_to_vec, encode_to_vec};
8+
use qoi::{decode_to_vec, encode_to_vec};
99

1010
fn find_qoi_png_pairs(root: impl AsRef<Path>) -> Vec<(PathBuf, PathBuf)> {
1111
let root = root.as_ref();

0 commit comments

Comments
 (0)