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

Support setting enumcs for CMYK and EYCC color space #1529

Merged
merged 2 commits into from
Jun 14, 2024
Merged

Support setting enumcs for CMYK and EYCC color space #1529

merged 2 commits into from
Jun 14, 2024

Conversation

radarhere
Copy link
Contributor

As per

openjpeg/src/lib/openjp2/jp2.c

Lines 2874 to 2884 in 70e6263

if (jp2->enumcs == 16) {
(*p_image)->color_space = OPJ_CLRSPC_SRGB;
} else if (jp2->enumcs == 17) {
(*p_image)->color_space = OPJ_CLRSPC_GRAY;
} else if (jp2->enumcs == 18) {
(*p_image)->color_space = OPJ_CLRSPC_SYCC;
} else if (jp2->enumcs == 24) {
(*p_image)->color_space = OPJ_CLRSPC_EYCC;
} else if (jp2->enumcs == 12) {
(*p_image)->color_space = OPJ_CLRSPC_CMYK;
} else {

adds CMYK and EYCC to

openjpeg/src/lib/openjp2/jp2.c

Lines 1992 to 1998 in 70e6263

if (image->color_space == 1) {
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) {
jp2->enumcs = 18; /* YUV */
}

@@ -1995,6 +1995,10 @@ OPJ_BOOL opj_jp2_setup_encoder(opj_jp2_t *jp2,
jp2->enumcs = 17; /* greyscale */
} else if (image->color_space == 3) {
jp2->enumcs = 18; /* YUV */
} else if (image->color_space == 4) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would you mind using the OPJ_CLRSPC_xxxx enumeration values (for those new entries as well as for the 3 above existing ones?)

@rouault rouault merged commit 2f5a299 into uclouvain:master Jun 14, 2024
11 of 12 checks passed
@radarhere radarhere deleted the cmyk branch June 14, 2024 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants