Skip to content

Commit

Permalink
Support setting enumcs for CMYK and EYCC color space (#1529)
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere authored Jun 14, 2024
1 parent 1bca4d2 commit 2f5a299
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/lib/openjp2/jp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1989,12 +1989,16 @@ OPJ_BOOL opj_jp2_setup_encoder(opj_jp2_t *jp2,
jp2->enumcs = 0;
} else {
jp2->meth = 1;
if (image->color_space == 1) {
if (image->color_space == OPJ_CLRSPC_SRGB) {
jp2->enumcs = 16; /* sRGB as defined by IEC 61966-2-1 */
} else if (image->color_space == 2) {
jp2->enumcs = 17; /* greyscale */
} else if (image->color_space == 3) {
} else if (image->color_space == OPJ_CLRSPC_GRAY) {
jp2->enumcs = 17;
} else if (image->color_space == OPJ_CLRSPC_SYCC) {
jp2->enumcs = 18; /* YUV */
} else if (image->color_space == OPJ_CLRSPC_EYCC) {
jp2->enumcs = 24;
} else if (image->color_space == OPJ_CLRSPC_CMYK) {
jp2->enumcs = 12;
}
}

Expand Down

0 comments on commit 2f5a299

Please sign in to comment.