summaryrefslogtreecommitdiff
path: root/codec/j2k_dump.c
diff options
context:
space:
mode:
authorAntonin Descampe <antonin@gmail.com>2010-12-08 11:06:41 +0000
committerAntonin Descampe <antonin@gmail.com>2010-12-08 11:06:41 +0000
commitd08a96e2517c545b8ff2d7b89c7778eb5b1fd4ba (patch)
tree16f839d4499afc2ead2b759b22907a50bd012de3 /codec/j2k_dump.c
parent59d9b97ffe35f17c71b25a749b885054cb4727d9 (diff)
(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.
Diffstat (limited to 'codec/j2k_dump.c')
-rw-r--r--codec/j2k_dump.c43
1 files changed, 18 insertions, 25 deletions
diff --git a/codec/j2k_dump.c b/codec/j2k_dump.c
index 83fc1c94..3c3e8d91 100644
--- a/codec/j2k_dump.c
+++ b/codec/j2k_dump.c
@@ -29,40 +29,29 @@
#include <stdlib.h>
#include <math.h>
-#include "opj_config.h"
-#include "openjpeg.h"
-#include "../libopenjpeg/j2k.h"
-#include "../libopenjpeg/jp2.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
+#endif /* _WIN32 */
-/* ----------------------------------------------------------------------- */
-
-#define J2K_CFMT 0
-#define JP2_CFMT 1
-#define JPT_CFMT 2
+#include "opj_config.h"
+#include "openjpeg.h"
+#include "../libopenjpeg/j2k.h"
+#include "../libopenjpeg/jp2.h"
+#include "getopt.h"
+#include "convert.h"
+#include "index.h"
-#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*/
@@ -477,6 +466,10 @@ int main(int argc, char *argv[])
return 1;
}
/* dump image */
+ if(image->icc_profile_buf)
+ {
+ free(image->icc_profile_buf); image->icc_profile_buf = NULL;
+ }
j2k_dump_image(stdout, image);
/* dump cp */