diff options
| author | Francois-Olivier Devaux <fodevaux@users.noreply.github.com> | 2007-06-21 08:26:03 +0000 |
|---|---|---|
| committer | Francois-Olivier Devaux <fodevaux@users.noreply.github.com> | 2007-06-21 08:26:03 +0000 |
| commit | c92497543471bb2550451f08a57c1c20cc43f29f (patch) | |
| tree | 56d2550b1a03add64e934ca203b50fbba7a1c0e6 | |
| parent | 92398409a561d9a1b5e24e14b7d78d963696f6a3 (diff) | |
Output image color space set when decoding a JP2 file
| -rw-r--r-- | ChangeLog | 3 | ||||
| -rw-r--r-- | libopenjpeg/jp2.c | 10 |
2 files changed, 13 insertions, 0 deletions
@@ -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 diff --git a/libopenjpeg/jp2.c b/libopenjpeg/jp2.c index d102349d..a40e56d4 100644 --- a/libopenjpeg/jp2.c +++ b/libopenjpeg/jp2.c @@ -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; } |
