Skip to content

Commit e4ef58f

Browse files
committed
Do not pass width to color conversion functions, it's implicitly passed in slice length
1 parent dced125 commit e4ef58f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/decoder.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ fn compute_image_parallel(components: &[Component],
841841
.enumerate()
842842
.for_each(|(row, line)| {
843843
upsampler.upsample_and_interleave_row(&data, row, output_size.width as usize, line);
844-
color_convert_func(line, output_size.width as usize);
844+
color_convert_func(line);
845845
});
846846

847847
Ok(image)
@@ -870,7 +870,7 @@ fn compute_image_parallel(components: &[Component],
870870
fn choose_color_convert_func(component_count: usize,
871871
_is_jfif: bool,
872872
color_transform: Option<AdobeColorTransform>)
873-
-> Result<fn(&mut [u8], usize)> {
873+
-> Result<fn(&mut [u8])> {
874874
match component_count {
875875
3 => {
876876
// http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/JPEG.html#Adobe
@@ -894,10 +894,10 @@ fn choose_color_convert_func(component_count: usize,
894894
}
895895
}
896896

897-
fn color_convert_line_null(_data: &mut [u8], _width: usize) {
897+
fn color_convert_line_null(_data: &mut [u8]) {
898898
}
899899

900-
fn color_convert_line_ycbcr(data: &mut [u8], _width: usize) {
900+
fn color_convert_line_ycbcr(data: &mut [u8]) {
901901
for chunk in data.chunks_exact_mut(3) {
902902
let (r, g, b) = ycbcr_to_rgb(chunk[0], chunk[1], chunk[2]);
903903
chunk[0] = r;
@@ -906,7 +906,7 @@ fn color_convert_line_ycbcr(data: &mut [u8], _width: usize) {
906906
}
907907
}
908908

909-
fn color_convert_line_ycck(data: &mut [u8], _width: usize) {
909+
fn color_convert_line_ycck(data: &mut [u8]) {
910910
for chunk in data.chunks_exact_mut(4) {
911911
let (r, g, b) = ycbcr_to_rgb(chunk[0], chunk[1], chunk[2]);
912912
let k = chunk[3];
@@ -918,7 +918,7 @@ fn color_convert_line_ycck(data: &mut [u8], _width: usize) {
918918
}
919919
}
920920

921-
fn color_convert_line_cmyk(data: &mut [u8], _width: usize) {
921+
fn color_convert_line_cmyk(data: &mut [u8]) {
922922
for chunk in data.chunks_exact_mut(4) {
923923
chunk[0] = 255 - chunk[0];
924924
chunk[1] = 255 - chunk[1];

0 commit comments

Comments
 (0)