From 9fdaaa3316b362f538c2ea51888c93dc9a7452d4 Mon Sep 17 00:00:00 2001 From: Antonin Descampe Date: Wed, 8 Dec 2010 11:06:41 +0000 Subject: [PATCH] (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. --- Makefile.nix | 2 -- codec/convert.c | 4 ++-- codec/jp3d_to_volume.c | 6 ++++-- codec/volume_to_jp3d.c | 6 ++++-- libjp3dvm/event.c | 4 ++-- libjp3dvm/jp3d_lib.c | 8 ++++---- libjp3dvm/openjpeg.c | 8 ++++---- 7 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Makefile.nix b/Makefile.nix index 0dd57ea3..4ca053e5 100644 --- a/Makefile.nix +++ b/Makefile.nix @@ -21,8 +21,6 @@ INCLS = ./libjp3dvm/t1_3d.h ./libjp3dvm/bio.h ./libjp3dvm/cio.h \ INCLUDE = -I.. -Ilibjp3dvm -AR = ar - INSTALL_LIBDIR = $(prefix)/lib headerdir = openjpeg3d-$(JP3D_MAJOR).$(JP3D_MINOR) INSTALL_INCLUDE = $(prefix)/include/$(headerdir) diff --git a/codec/convert.c b/codec/convert.c index b9aa656f..99eb7f2e 100755 --- a/codec/convert.c +++ b/codec/convert.c @@ -32,11 +32,11 @@ #include #include #include "../libjp3dvm/openjpeg.h" -#ifdef WIN32 +#ifdef _WIN32 #include "windirent.h" #else #include -#endif /* WIN32 */ +#endif /* _WIN32 */ diff --git a/codec/jp3d_to_volume.c b/codec/jp3d_to_volume.c index ee4425f2..995faaec 100755 --- a/codec/jp3d_to_volume.c +++ b/codec/jp3d_to_volume.c @@ -37,10 +37,12 @@ #include "getopt.h" #include "convert.h" -#ifndef WIN32 +#ifdef _WIN32 +#include +#else #define stricmp strcasecmp #define strnicmp strncasecmp -#endif +#endif /* _WIN32 */ /* ----------------------------------------------------------------------- */ static double calc_PSNR(opj_volume_t *original, opj_volume_t *decoded) diff --git a/codec/volume_to_jp3d.c b/codec/volume_to_jp3d.c index 238c47f5..d448fbe1 100755 --- a/codec/volume_to_jp3d.c +++ b/codec/volume_to_jp3d.c @@ -36,10 +36,12 @@ #include "getopt.h" #include "convert.h" -#ifndef WIN32 +#ifdef _WIN32 +#include +#else #define stricmp strcasecmp #define strnicmp strncasecmp -#endif +#endif /* _WIN32 */ /* ----------------------------------------------------------------------- */ diff --git a/libjp3dvm/event.c b/libjp3dvm/event.c index 6fe8ae2e..c558218c 100755 --- a/libjp3dvm/event.c +++ b/libjp3dvm/event.c @@ -30,7 +30,7 @@ // Utility functions // ========================================================== -#ifndef WIN32 +#ifndef _WIN32 static char* i2a(unsigned i, char *a, unsigned r) { if (i/r > 0) a = i2a(i/r,a,r); @@ -57,7 +57,7 @@ _itoa(int i, char *a, int r) { return a; } -#endif // !WIN32 +#endif // !_WIN32 /* ----------------------------------------------------------------------- */ diff --git a/libjp3dvm/jp3d_lib.c b/libjp3dvm/jp3d_lib.c index fe19ab8b..b2303991 100755 --- a/libjp3dvm/jp3d_lib.c +++ b/libjp3dvm/jp3d_lib.c @@ -24,17 +24,17 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifdef WIN32 +#ifdef _WIN32 #include #else #include #include #include -#endif /* WIN32 */ +#endif /* _WIN32 */ #include "opj_includes.h" double opj_clock() { -#ifdef WIN32 +#ifdef _WIN32 /* WIN32: use QueryPerformance (very accurate) */ LARGE_INTEGER freq , t ; /* freq is the clock speed of the CPU */ @@ -54,7 +54,7 @@ double opj_clock() { procTime = t.ru_utime.tv_sec + t.ru_stime.tv_sec; /* (2b) More precisely! Get the microseconds part ! */ return ( procTime + (t.ru_utime.tv_usec + t.ru_stime.tv_usec) * 1e-6 ) ; -#endif +#endif /* _WIN32 */ } void* opj_malloc( size_t size ) { diff --git a/libjp3dvm/openjpeg.c b/libjp3dvm/openjpeg.c index eb4c39bf..8e3a0782 100755 --- a/libjp3dvm/openjpeg.c +++ b/libjp3dvm/openjpeg.c @@ -25,14 +25,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifdef WIN32 +#ifdef _WIN32 #include -#endif /* WIN32 */ +#endif /* _WIN32 */ #include "opj_includes.h" #define JP3D_VERSION "1.3.0" /* ---------------------------------------------------------------------- */ -#ifdef WIN32 +#ifdef _WIN32 #ifndef OPJ_STATIC BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { @@ -49,7 +49,7 @@ DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { return TRUE; } #endif /* OPJ_STATIC */ -#endif /* WIN32 */ +#endif /* _WIN32 */ /* ---------------------------------------------------------------------- */