Skip to content

Commit

Permalink
jpeg_reader: add additional SPIFF CS
Browse files Browse the repository at this point in the history
Add all color space parameter specifications from T.81 - map known ones,
add commented-out case for the rest.
  • Loading branch information
MartinPulec committed Oct 9, 2024
1 parent 76d6884 commit 97be584
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/utils/jpeg_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,10 +584,12 @@ read_spiff_header(uint8_t** image, enum jpeg_color_spec *color_space, bool *in_s
}

switch (spiff_color_space) {
// case 0: // Bi-level - one-bit, 1 = black
case 1: // NOLINT
*color_space = JPEG_COLOR_SPEC_YCBCR_709;
break;
case 2: // NOLINT
MSG_ONCE(WARNING, "SPIFF color space not specified by header!\n");
break;
case 3: // NOLINT
case 8: /* grayscale */ // NOLINT
Expand All @@ -596,9 +598,22 @@ read_spiff_header(uint8_t** image, enum jpeg_color_spec *color_space, bool *in_s
case 4: // NOLINT
*color_space = JPEG_COLOR_SPEC_YCBCR_601;
break;
// case 5: // reserved
// case 6: // -"-
// case 7: // -"-
// case 9: // PhotoYCC
case 10: // NOLINT
*color_space = JPEG_COLOR_SPEC_RGB;
break;
// case 11: // CMY
case 12: // NOLINT
*color_space = JPEG_COLOR_SPEC_CMYK;
break;
case 13: // NOLINT
*color_space = JPEG_COLOR_SPEC_YCCK;
break;
// case 14: // CIELab
// case 15: // Bi-level - one-bit, 1 = white
default:
error_msg(
"Unsupported or unrecongnized SPIFF color space %d!\n",
Expand Down

0 comments on commit 97be584

Please sign in to comment.