(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:
Antonin Descampe
2010-12-08 11:06:41 +00:00
parent 59d9b97ffe
commit d08a96e251
45 changed files with 1144 additions and 740 deletions

View File

@@ -35,38 +35,35 @@
#include <stdlib.h>
#include <math.h>
#include "opj_config.h"
#include "openjpeg.h"
#include "compat/getopt.h"
#include "convert.h"
#ifdef WIN32
#ifdef _WIN32
#include "windirent.h"
#else
#include <dirent.h>
#endif /* WIN32 */
#include "index.h"
#endif /* _WIN32 */
#ifndef WIN32
#ifdef _WIN32
#include <windows.h>
#else
#include <strings.h>
#define _stricmp strcasecmp
#define _strnicmp strncasecmp
#endif /* _WIN32 */
#include "opj_config.h"
#include "openjpeg.h"
#include "getopt.h"
#include "convert.h"
#include "index.h"
#ifdef HAVE_LIBLCMS2
#include <lcms2.h>
#endif
#ifdef HAVE_LIBLCMS1
#include <lcms.h>
#endif
#include "color.h"
/* ----------------------------------------------------------------------- */
#define J2K_CFMT 0
#define JP2_CFMT 1
#define JPT_CFMT 2
#define PXM_DFMT 10
#define PGX_DFMT 11
#define BMP_DFMT 12
#define YUV_DFMT 13
#define TIF_DFMT 14
#define RAW_DFMT 15
#define TGA_DFMT 16
#define PNG_DFMT 17
/* ----------------------------------------------------------------------- */
#include "format_defs.h"
typedef struct dircnt{
/** Buffer for holding images read from Directory*/
@@ -740,6 +737,21 @@ int main(int argc, char **argv) {
free(src);
src = NULL;
if(image->color_space == CLRSPC_SYCC)
{
color_sycc_to_rgb(image);
}
if(image->icc_profile_buf)
{
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
color_apply_icc_profile(image);
#endif
free(image->icc_profile_buf);
image->icc_profile_buf = NULL; image->icc_profile_len = 0;
}
/* create output image */
/* ------------------- */
switch (parameters.cod_format) {