Output image color space set when decoding a JP2 file

This commit is contained in:
Francois-Olivier Devaux 2007-06-21 08:26:03 +00:00
parent 92398409a5
commit c924975434
2 changed files with 13 additions and 0 deletions

View File

@ -5,6 +5,9 @@ What's New for OpenJPEG
! : changed
+ : added
June 21, 2007
* [FOD] Output image color space set when decoding a JP2 file in jp2.c
June 18, 2007
* [GB] Reload image doesn't crash in OPJViewer; more settings saved to registry

View File

@ -563,6 +563,16 @@ opj_image_t* jp2_decode(opj_jp2_t *jp2, opj_cio_t *cio) {
opj_event_msg(cinfo, EVT_ERROR, "Failed to decode J2K image\n");
}
/* Set Image Color Space */
if (jp2->enumcs == 16)
image->color_space = CLRSPC_SRGB;
else if (jp2->enumcs == 17)
image->color_space = CLRSPC_GRAY;
else if (jp2->enumcs == 18)
image->color_space = CLRSPC_SYCC;
else
image->color_space = CLRSPC_UNKNOWN;
return image;
}