(thanks to Winfried for his help)
* [antonin] changed remaining "WIN32" to "_WIN32"
! [antonin] libopenjpeg has no more dependency on LCMS lib. Everything concerning color (icc profile, conversion to rgb, etc) has been put outside libopenjpeg and is used in j2k_to_image.c and mj2_to_frames.c.
- [antonin] removed "opj_convert{.c,.h}"
+ [antonin] added a directory "common/" that contains "getopt{.c,.h}" (previously in "codec/compat").
+ [antonin] added files "color{.c,.h}" in "common/" that define the code for icc profile management and sycc_to_rgb conversion
+ [antonin] added "common/format_defs.h" that contains common definitions used in image_to_j2k, j2k_to_image, j2k_dump.
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "opj_config.h"
|
||||
#include "openjpeg.h"
|
||||
#include "../libopenjpeg/j2k_lib.h"
|
||||
#include "../libopenjpeg/j2k.h"
|
||||
@@ -36,6 +37,13 @@
|
||||
#include "mj2.h"
|
||||
#include "mj2_convert.h"
|
||||
|
||||
#ifdef HAVE_LIBLCMS2
|
||||
#include <lcms2.h>
|
||||
#endif
|
||||
#ifdef HAVE_LIBLCMS1
|
||||
#include <lcms.h>
|
||||
#endif
|
||||
#include "color.h"
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
@@ -168,7 +176,24 @@ int main(int argc, char *argv[]) {
|
||||
cio = opj_cio_open((opj_common_ptr)dinfo, frame_codestream, sample->sample_size-8);
|
||||
|
||||
img = opj_decode(dinfo, cio); // Decode J2K to image
|
||||
|
||||
|
||||
#ifdef WANT_SYCC_TO_RGB
|
||||
if(img->color_space == CLRSPC_SYCC)
|
||||
{
|
||||
color_sycc_to_rgb(img);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(img->icc_profile_buf)
|
||||
{
|
||||
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
|
||||
color_apply_icc_profile(img);
|
||||
#endif
|
||||
|
||||
free(img->icc_profile_buf);
|
||||
img->icc_profile_buf = NULL; img->icc_profile_len = 0;
|
||||
}
|
||||
|
||||
if (((img->numcomps == 3) && (img->comps[0].dx == img->comps[1].dx / 2)
|
||||
&& (img->comps[0].dx == img->comps[2].dx / 2 ) && (img->comps[0].dx == 1))
|
||||
|| (img->numcomps == 1)) {
|
||||
|
||||
Reference in New Issue
Block a user