Skip to content

Commit

Permalink
Merge pull request #11 from SalOne22/features/api-rewrite
Browse files Browse the repository at this point in the history
Features/api rewrite
  • Loading branch information
SalOne22 authored Mar 27, 2023
2 parents bbec0fb + caa6939 commit 73b1b14
Show file tree
Hide file tree
Showing 19 changed files with 1,351 additions and 359 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/target
/.vscode
cachegrind.*
dhat.*
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## v0.2.0

- [Added] struct `ImageData` for storing images data
- [Added] struct `Decoder` to decode images
- [Added] struct `Encoder` to encode images
- [Added] structs for errors in `rimage::errors`

- [Added] image processing from stdio
- [Added] info option
- [Added] suffix option

- [Changed] `decoders::decode_image` and `encoders::encode_image` now deprecated, use `Decoder` and `Encoder` structs instead
- [Improvement] Added documentation to almost all functions and structs with examples

## v0.1.3

- [Bugfix] Fixed long processing of png images
Expand Down
114 changes: 60 additions & 54 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 13 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,21 @@ exclude = ["test/*", "images/", ".*"]
repository = "https://github.com/SalOne22/rimage"
license = "MIT OR Apache-2.0"

version = "0.1.3"
version = "0.2.0"
edition = "2021"

[profile.release]
lto = true
codegen-units = 1

[profile.profiling]
inherits = "release"
debug = 1

[dependencies]
bytemuck = "1.13.1"
clap = { version = "4.1.11", features = ["derive"] }
imagequant = "4.1.1"
indicatif = "0.17.3"
mozjpeg = "0.9.4"
oxipng = "8.0.0"
Expand All @@ -28,19 +34,20 @@ wild = "2.1.0"

[dev-dependencies]
criterion = { version = "0.4.0", features = ["html_reports"] }
regex = "1.7.2"

[[bench]]
name = "decode_large_jpg"
name = "decode_jpg"
harness = false

[[bench]]
name = "decode_large_png"
name = "decode_png"
harness = false

[[bench]]
name = "encode_large_jpg"
name = "encode_jpg"
harness = false

[[bench]]
name = "encode_large_png"
harness = false
name = "encode_png"
harness = false
27 changes: 27 additions & 0 deletions benches/decode_jpg.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
use std::{
fs,
path::{Path, PathBuf},
};

use criterion::{black_box, criterion_group, criterion_main, Criterion};
#[allow(deprecated)]
use rimage::decoders::decode_image;
use rimage::Decoder;

#[allow(deprecated)]
fn bench_decode_jpg(c: &mut Criterion) {
let mut group = c.benchmark_group("decode_jpg");
group.bench_function("decoders", |b| {
b.iter(|| decode_image(black_box(&PathBuf::from("tests/files/basi6a08.jpg"))))
});
group.bench_function("Decoder", |b| {
b.iter(|| {
let data = fs::read(&Path::new("tests/files/basi6a08.jpg")).unwrap();
Decoder::new(black_box(&Path::new("tests/files/basi6a08.jpg")), &data).decode()
})
});
group.finish();
}

criterion_group!(benches, bench_decode_jpg);
criterion_main!(benches);
23 changes: 0 additions & 23 deletions benches/decode_large_jpg.rs

This file was deleted.

Loading

0 comments on commit 73b1b14

Please sign in to comment.