Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make reductions return a new uncompressed image #158

Merged
merged 10 commits into from
Jan 27, 2019
6 changes: 3 additions & 3 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ optional = true
version = "2.0.0"

[target.'cfg(any(target_arch = "x86_64", target_arch = "aarch64"))'.dependencies]
cloudflare-zlib = "^0.2.0"
cloudflare-zlib = "^0.2.2"

[dependencies.image]
default-features = false
Expand Down
40 changes: 20 additions & 20 deletions benches/deflate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn deflate_16_bits_strategy_0(b: &mut Bencher) {

b.iter(|| {
let min = AtomicMin::new(None);
deflate(png.raw_data.as_ref(), 9, 0, 15, &min)
deflate(png.raw.data.as_ref(), 9, 0, 15, &min)
});
}

Expand All @@ -25,7 +25,7 @@ fn deflate_8_bits_strategy_0(b: &mut Bencher) {

b.iter(|| {
let min = AtomicMin::new(None);
deflate(png.raw_data.as_ref(), 9, 0, 15, &min)
deflate(png.raw.data.as_ref(), 9, 0, 15, &min)
});
}

Expand All @@ -38,7 +38,7 @@ fn deflate_4_bits_strategy_0(b: &mut Bencher) {

b.iter(|| {
let min = AtomicMin::new(None);
deflate(png.raw_data.as_ref(), 9, 0, 15, &min)
deflate(png.raw.data.as_ref(), 9, 0, 15, &min)
});
}

Expand All @@ -51,7 +51,7 @@ fn deflate_2_bits_strategy_0(b: &mut Bencher) {

b.iter(|| {
let min = AtomicMin::new(None);
deflate(png.raw_data.as_ref(), 9, 0, 15, &min)
deflate(png.raw.data.as_ref(), 9, 0, 15, &min)
});
}

Expand All @@ -64,7 +64,7 @@ fn deflate_1_bits_strategy_0(b: &mut Bencher) {

b.iter(|| {
let min = AtomicMin::new(None);
deflate(png.raw_data.as_ref(), 9, 0, 15, &min)
deflate(png.raw.data.as_ref(), 9, 0, 15, &min)
});
}

Expand All @@ -75,7 +75,7 @@ fn deflate_16_bits_strategy_1(b: &mut Bencher) {

b.iter(|| {
let min = AtomicMin::new(None);
deflate(png.raw_data.as_ref(), 9, 1, 15, &min)
deflate(png.raw.data.as_ref(), 9, 1, 15, &min)
});
}

Expand All @@ -86,7 +86,7 @@ fn deflate_8_bits_strategy_1(b: &mut Bencher) {

b.iter(|| {
let min = AtomicMin::new(None);
deflate(png.raw_data.as_ref(), 9, 1, 15, &min)
deflate(png.raw.data.as_ref(), 9, 1, 15, &min)
});
}

Expand All @@ -99,7 +99,7 @@ fn deflate_4_bits_strategy_1(b: &mut Bencher) {

b.iter(|| {
let min = AtomicMin::new(None);
deflate(png.raw_data.as_ref(), 9, 1, 15, &min)
deflate(png.raw.data.as_ref(), 9, 1, 15, &min)
});
}

Expand All @@ -112,7 +112,7 @@ fn deflate_2_bits_strategy_1(b: &mut Bencher) {

b.iter(|| {
let min = AtomicMin::new(None);
deflate(png.raw_data.as_ref(), 9, 1, 15, &min)
deflate(png.raw.data.as_ref(), 9, 1, 15, &min)
});
}

Expand All @@ -125,7 +125,7 @@ fn deflate_1_bits_strategy_1(b: &mut Bencher) {

b.iter(|| {
let min = AtomicMin::new(None);
deflate(png.raw_data.as_ref(), 9, 1, 15, &min)
deflate(png.raw.data.as_ref(), 9, 1, 15, &min)
});
}

Expand All @@ -136,7 +136,7 @@ fn deflate_16_bits_strategy_2(b: &mut Bencher) {

b.iter(|| {
let min = AtomicMin::new(None);
deflate(png.raw_data.as_ref(), 9, 2, 15, &min)
deflate(png.raw.data.as_ref(), 9, 2, 15, &min)
});
}

Expand All @@ -147,7 +147,7 @@ fn deflate_8_bits_strategy_2(b: &mut Bencher) {

b.iter(|| {
let min = AtomicMin::new(None);
deflate(png.raw_data.as_ref(), 9, 2, 15, &min)
deflate(png.raw.data.as_ref(), 9, 2, 15, &min)
});
}

Expand All @@ -160,7 +160,7 @@ fn deflate_4_bits_strategy_2(b: &mut Bencher) {

b.iter(|| {
let min = AtomicMin::new(None);
deflate(png.raw_data.as_ref(), 9, 2, 15, &min)
deflate(png.raw.data.as_ref(), 9, 2, 15, &min)
});
}

Expand All @@ -173,7 +173,7 @@ fn deflate_2_bits_strategy_2(b: &mut Bencher) {

b.iter(|| {
let min = AtomicMin::new(None);
deflate(png.raw_data.as_ref(), 9, 2, 15, &min)
deflate(png.raw.data.as_ref(), 9, 2, 15, &min)
});
}

Expand All @@ -186,7 +186,7 @@ fn deflate_1_bits_strategy_2(b: &mut Bencher) {

b.iter(|| {
let min = AtomicMin::new(None);
deflate(png.raw_data.as_ref(), 9, 2, 15, &min)
deflate(png.raw.data.as_ref(), 9, 2, 15, &min)
});
}

Expand All @@ -197,7 +197,7 @@ fn deflate_16_bits_strategy_3(b: &mut Bencher) {

b.iter(|| {
let min = AtomicMin::new(None);
deflate(png.raw_data.as_ref(), 9, 3, 15, &min)
deflate(png.raw.data.as_ref(), 9, 3, 15, &min)
});
}

Expand All @@ -208,7 +208,7 @@ fn deflate_8_bits_strategy_3(b: &mut Bencher) {

b.iter(|| {
let min = AtomicMin::new(None);
deflate(png.raw_data.as_ref(), 9, 3, 15, &min)
deflate(png.raw.data.as_ref(), 9, 3, 15, &min)
});
}

Expand All @@ -221,7 +221,7 @@ fn deflate_4_bits_strategy_3(b: &mut Bencher) {

b.iter(|| {
let min = AtomicMin::new(None);
deflate(png.raw_data.as_ref(), 9, 3, 15, &min)
deflate(png.raw.data.as_ref(), 9, 3, 15, &min)
});
}

Expand All @@ -234,7 +234,7 @@ fn deflate_2_bits_strategy_3(b: &mut Bencher) {

b.iter(|| {
let min = AtomicMin::new(None);
deflate(png.raw_data.as_ref(), 9, 3, 15, &min)
deflate(png.raw.data.as_ref(), 9, 3, 15, &min)
});
}

Expand All @@ -247,7 +247,7 @@ fn deflate_1_bits_strategy_3(b: &mut Bencher) {

b.iter(|| {
let min = AtomicMin::new(None);
deflate(png.raw_data.as_ref(), 9, 3, 15, &min)
deflate(png.raw.data.as_ref(), 9, 3, 15, &min)
});
}

Expand Down
40 changes: 20 additions & 20 deletions benches/reductions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn reductions_16_to_8_bits(b: &mut Bencher) {

b.iter(|| {
let mut safe_png = png.clone();
safe_png.reduce_bit_depth();
safe_png.reduce_bit_depth()
});
}

Expand All @@ -27,7 +27,7 @@ fn reductions_8_to_4_bits(b: &mut Bencher) {

b.iter(|| {
let mut safe_png = png.clone();
safe_png.reduce_bit_depth();
safe_png.reduce_bit_depth()
});
}

Expand All @@ -40,7 +40,7 @@ fn reductions_8_to_2_bits(b: &mut Bencher) {

b.iter(|| {
let mut safe_png = png.clone();
safe_png.reduce_bit_depth();
safe_png.reduce_bit_depth()
});
}

Expand All @@ -53,7 +53,7 @@ fn reductions_8_to_1_bits(b: &mut Bencher) {

b.iter(|| {
let mut safe_png = png.clone();
safe_png.reduce_bit_depth();
safe_png.reduce_bit_depth()
});
}

Expand All @@ -66,7 +66,7 @@ fn reductions_4_to_2_bits(b: &mut Bencher) {

b.iter(|| {
let mut safe_png = png.clone();
safe_png.reduce_bit_depth();
safe_png.reduce_bit_depth()
});
}

Expand All @@ -79,7 +79,7 @@ fn reductions_4_to_1_bits(b: &mut Bencher) {

b.iter(|| {
let mut safe_png = png.clone();
safe_png.reduce_bit_depth();
safe_png.reduce_bit_depth()
});
}

Expand All @@ -92,7 +92,7 @@ fn reductions_2_to_1_bits(b: &mut Bencher) {

b.iter(|| {
let mut safe_png = png.clone();
safe_png.reduce_bit_depth();
safe_png.reduce_bit_depth()
});
}

Expand All @@ -103,7 +103,7 @@ fn reductions_rgba_to_rgb_16(b: &mut Bencher) {

b.iter(|| {
let mut safe_png = png.clone();
safe_png.reduce_color_type();
safe_png.reduce_color_type()
});
}

Expand All @@ -114,7 +114,7 @@ fn reductions_rgba_to_rgb_8(b: &mut Bencher) {

b.iter(|| {
let mut safe_png = png.clone();
safe_png.reduce_color_type();
safe_png.reduce_color_type()
});
}

Expand All @@ -127,7 +127,7 @@ fn reductions_rgba_to_grayscale_alpha_16(b: &mut Bencher) {

b.iter(|| {
let mut safe_png = png.clone();
safe_png.reduce_color_type();
safe_png.reduce_color_type()
});
}

Expand All @@ -140,7 +140,7 @@ fn reductions_rgba_to_grayscale_alpha_8(b: &mut Bencher) {

b.iter(|| {
let mut safe_png = png.clone();
safe_png.reduce_color_type();
safe_png.reduce_color_type()
});
}

Expand All @@ -153,7 +153,7 @@ fn reductions_rgba_to_grayscale_16(b: &mut Bencher) {

b.iter(|| {
let mut safe_png = png.clone();
safe_png.reduce_color_type();
safe_png.reduce_color_type()
});
}

Expand All @@ -166,7 +166,7 @@ fn reductions_rgba_to_grayscale_8(b: &mut Bencher) {

b.iter(|| {
let mut safe_png = png.clone();
safe_png.reduce_color_type();
safe_png.reduce_color_type()
});
}

Expand All @@ -179,7 +179,7 @@ fn reductions_rgb_to_grayscale_16(b: &mut Bencher) {

b.iter(|| {
let mut safe_png = png.clone();
safe_png.reduce_color_type();
safe_png.reduce_color_type()
});
}

Expand All @@ -190,7 +190,7 @@ fn reductions_rgb_to_grayscale_8(b: &mut Bencher) {

b.iter(|| {
let mut safe_png = png.clone();
safe_png.reduce_color_type();
safe_png.reduce_color_type()
});
}

Expand All @@ -201,7 +201,7 @@ fn reductions_rgba_to_palette_8(b: &mut Bencher) {

b.iter(|| {
let mut safe_png = png.clone();
safe_png.reduce_color_type();
safe_png.reduce_color_type()
});
}

Expand All @@ -212,7 +212,7 @@ fn reductions_rgb_to_palette_8(b: &mut Bencher) {

b.iter(|| {
let mut safe_png = png.clone();
safe_png.reduce_color_type();
safe_png.reduce_color_type()
});
}

Expand All @@ -225,7 +225,7 @@ fn reductions_palette_duplicate_reduction(b: &mut Bencher) {

b.iter(|| {
let mut safe_png = png.clone();
safe_png.reduce_palette();
safe_png.reduce_palette()
});
}

Expand All @@ -238,7 +238,7 @@ fn reductions_palette_unused_reduction(b: &mut Bencher) {

b.iter(|| {
let mut safe_png = png.clone();
safe_png.reduce_palette();
safe_png.reduce_palette()
});
}

Expand All @@ -251,7 +251,7 @@ fn reductions_palette_full_reduction(b: &mut Bencher) {

b.iter(|| {
let mut safe_png = png.clone();
safe_png.reduce_palette();
safe_png.reduce_palette()
});
}

Expand Down
Loading