]> granicus.if.org Git - openjpeg/commitdiff
[trunk] use everywhere the new opj_ prefix for HAVE variables and use the opj_apps_co...
authorMickael Savinaud <savmickael@users.noreply.github.com>
Sun, 17 Mar 2013 17:03:00 +0000 (17:03 +0000)
committerMickael Savinaud <savmickael@users.noreply.github.com>
Sun, 17 Mar 2013 17:03:00 +0000 (17:03 +0000)
CMakeLists.txt
src/bin/common/color.c
src/bin/jp2/opj_compress.c
src/bin/jp2/opj_decompress.c
src/bin/jpwl/convert.c
src/bin/jpwl/opj_jpwl_compress.c
src/bin/jpwl/opj_jpwl_decompress.c
src/bin/mj2/opj_mj2_compress.c
src/bin/mj2/opj_mj2_decompress.c
thirdparty/CMakeLists.txt

index 1c56f081f12c2bb9a92ab4f86debf7606cf3164c..6bb62e61224612b25a3883bf73cb1a8e4995bed5 100644 (file)
@@ -180,7 +180,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
 endif()
 
 #-----------------------------------------------------------------------------
-# opj_config.h generation
+# opj_config.h generation (1/2)
 
 # Check if some include files are provided by the system
 include(EnsureFileInclude)
@@ -211,11 +211,7 @@ CHECK_INCLUDE_FILE("unistd.h"       HAVE_UNISTD_H)
 include(TestLargeFiles)
 OPJ_TEST_LARGE_FILES(OPJ_HAVE_LARGEFILES)
 
-configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjp2/opj_config.h.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}/src/lib/openjp2/opj_config.h
- @ONLY
- )
+
 
 #-----------------------------------------------------------------------------
 # Build Library
@@ -246,6 +242,14 @@ if(BUILD_CODEC OR BUILD_MJ2)
 endif ()
 add_subdirectory(wrapping)
 
+#-----------------------------------------------------------------------------
+# opj_config.h generation (2/2)
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjp2/opj_config.h.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/src/lib/openjp2/opj_config.h
+ @ONLY
+ )
+
 #-----------------------------------------------------------------------------
 # Build DOCUMENTATION (not in ALL target and only if Doxygen is found)
 option(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF)
index ce9ccde3f47526b1ef62cb430ca28c453984f87e..f18eb801d5becb2a583407c4f0d76259bda381c2 100644 (file)
@@ -265,8 +265,8 @@ void color_sycc_to_rgb(opj_image_t *img)
 
 }/* color_sycc_to_rgb() */
 
-#if defined(HAVE_LIBLCMS2) || defined(HAVE_LIBLCMS1)
-#ifdef HAVE_LIBLCMS1
+#if defined(OPJ_HAVE_LIBLCMS2) || defined(OPJ_HAVE_LIBLCMS1)
+#ifdef OPJ_HAVE_LIBLCMS1
 /* Bob Friesenhahn proposed:*/
 #define cmsSigXYZData   icSigXYZData
 #define cmsSigLabData   icSigLabData
@@ -280,7 +280,7 @@ void color_sycc_to_rgb(opj_image_t *img)
 #define cmsColorSpaceSignature icColorSpaceSignature
 #define cmsGetHeaderRenderingIntent cmsTakeRenderingIntent
 
-#endif /* HAVE_LIBLCMS1 */
+#endif /* OPJ_HAVE_LIBLCMS1 */
 
 void color_apply_icc_profile(opj_image_t *image)
 {
@@ -365,7 +365,7 @@ in_type,out_type
        transform = cmsCreateTransform(in_prof, in_type,
         out_prof, out_type, intent, 0);
 
-#ifdef HAVE_LIBLCMS2
+#ifdef OPJ_HAVE_LIBLCMS2
 /* Possible for: LCMS_VERSION >= 2000 :*/
        cmsCloseProfile(in_prof);
        cmsCloseProfile(out_prof);
@@ -378,7 +378,7 @@ fprintf(stderr,"%s:%d:color_apply_icc_profile\n\tcmsCreateTransform failed. "
 "ICC Profile ignored.\n",__FILE__,__LINE__);
 #endif
        image->color_space = oldspace;
-#ifdef HAVE_LIBLCMS1
+#ifdef OPJ_HAVE_LIBLCMS1
        cmsCloseProfile(in_prof);
        cmsCloseProfile(out_prof);
 #endif
@@ -461,11 +461,11 @@ fprintf(stderr,"%s:%d:color_apply_icc_profile\n\tcmsCreateTransform failed. "
 
        cmsDeleteTransform(transform);
 
-#ifdef HAVE_LIBLCMS1
+#ifdef OPJ_HAVE_LIBLCMS1
        cmsCloseProfile(in_prof);
        cmsCloseProfile(out_prof);
 #endif
 }/* color_apply_icc_profile() */
 
-#endif /* HAVE_LIBLCMS2 || HAVE_LIBLCMS1 */
+#endif /* OPJ_HAVE_LIBLCMS2 || OPJ_HAVE_LIBLCMS1 */
 
index 71e767b5418de9a6c46ade90e63bb85a40ad4062..9b79e999292790214da086203db46da81dc03f81 100644 (file)
@@ -1773,7 +1773,7 @@ int main(int argc, char **argv) {
                }
 
 /* Can happen if input file is TIFF or PNG 
- * and HAVE_LIBTIF or OPJ_HAVE_LIBPNG is undefined
+ * and OPJ_HAVE_LIBTIF or OPJ_HAVE_LIBPNG is undefined
 */
                if( !image) {
                        fprintf(stderr, "Unable to load file: got no image\n");
index 3fced21d4b4d9be7db1ed8ca6581fc912f2f58a8..0c65d85286369ac21325a4bad3676226cf2f5ac2 100644 (file)
 #include "convert.h"
 #include "index.h"
 
-#ifdef HAVE_LIBLCMS2
+#ifdef OPJ_HAVE_LIBLCMS2
 #include <lcms2.h>
 #endif
-#ifdef HAVE_LIBLCMS1
+#ifdef OPJ_HAVE_LIBLCMS1
 #include <lcms.h>
 #endif
 #include "color.h"
@@ -852,7 +852,7 @@ int main(int argc, char **argv)
                }
 
                if(image->icc_profile_buf) {
-#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
+#if defined(OPJ_HAVE_LIBLCMS1) || defined(OPJ_HAVE_LIBLCMS2)
                        color_apply_icc_profile(image); /* FIXME */
 #endif
                        free(image->icc_profile_buf);
@@ -935,7 +935,7 @@ int main(int argc, char **argv)
                        break;
 #endif /* OPJ_HAVE_LIBPNG */
 /* Can happen if output file is TIFF or PNG
- * and HAVE_LIBTIF or OPJ_HAVE_LIBPNG is undefined
+ * and OPJ_HAVE_LIBTIF or OPJ_HAVE_LIBPNG is undefined
 */
                        default:
                                fprintf(stderr,"Outfile %s not generated\n",parameters.outfile);
index 11e89f7b61434140448e6cab90e4723fc32470d1..98f3c62c2641c66124a4f858c95b6db1a3298196 100644 (file)
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-#include "opj_config.h"
+#include "opj_apps_config.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
 
-#ifdef HAVE_LIBTIFF
+#ifdef OPJ_HAVE_LIBTIFF
 #include <tiffio.h>
-#endif /* HAVE_LIBTIFF */
+#endif /* OPJ_HAVE_LIBTIFF */
 
-#ifdef HAVE_LIBPNG
+#ifdef OPJ_HAVE_LIBPNG
 #include <zlib.h>
 #include <png.h>
-#endif /* HAVE_LIBPNG */
+#endif /* OPJ_HAVE_LIBPNG */
 
 #include "openjpeg.h"
 #include "convert.h"
@@ -2074,7 +2074,7 @@ int imagetopnm(opj_image_t * image, const char *outfile)
        return 0;
 }/* imagetopnm() */
 
-#ifdef HAVE_LIBTIFF
+#ifdef OPJ_HAVE_LIBTIFF
 /* -->> -->> -->> -->>
 
        TIFF IMAGE FORMAT
@@ -2781,7 +2781,7 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
 
 }/* tiftoimage() */
 
-#endif /* HAVE_LIBTIFF */
+#endif /* OPJ_HAVE_LIBTIFF */
 
 /* -->> -->> -->> -->>
 
@@ -3027,7 +3027,7 @@ int imagetoraw(opj_image_t * image, const char *outfile)
        return 0;
 }
 
-#ifdef HAVE_LIBPNG
+#ifdef OPJ_HAVE_LIBPNG
 
 #define PNG_MAGIC "\x89PNG\x0d\x0a\x1a\x0a"
 #define MAGIC_SIZE 8
@@ -3560,4 +3560,4 @@ fin:
 
        return fails;
 }/* imagetopng() */
-#endif /* HAVE_LIBPNG */
+#endif /* OPJ_HAVE_LIBPNG */
index c98eea17fada6196d984c5bde05909ffcdd5f33d..b5bfc05bb330165be9c6b88a3ef97b04d18bce73 100644 (file)
@@ -49,7 +49,7 @@
 #include <strings.h>
 #endif /* _WIN32 */
 
-#include "opj_config.h"
+#include "opj_apps_config.h"
 #include "openjpeg.h"
 #include "opj_getopt.h"
 #include "convert.h"
@@ -1627,7 +1627,7 @@ int main(int argc, char **argv) {
                                                return 1;
                                        }
                                        break;
-#ifdef HAVE_LIBTIFF
+#ifdef OPJ_HAVE_LIBTIFF
                                case TIF_DFMT:
                                        image = tiftoimage(parameters.infile, &parameters);
                                        if (!image) {
@@ -1635,7 +1635,7 @@ int main(int argc, char **argv) {
                                                return 1;
                                        }
                                break;
-#endif /* HAVE_LIBTIFF */
+#endif /* OPJ_HAVE_LIBTIFF */
                                case RAW_DFMT:
                                        image = rawtoimage(parameters.infile, &parameters, &raw_cp);
                                        if (!image) {
@@ -1651,7 +1651,7 @@ int main(int argc, char **argv) {
                                                return 1;
                                        }
                                break;
-#ifdef HAVE_LIBPNG
+#ifdef OPJ_HAVE_LIBPNG
                                case PNG_DFMT:
                                        image = pngtoimage(parameters.infile, &parameters);
                                        if (!image) {
@@ -1659,10 +1659,10 @@ int main(int argc, char **argv) {
                                                return 1;
                                        }
                                        break;
-#endif /* HAVE_LIBPNG */
+#endif /* OPJ_HAVE_LIBPNG */
                }
 /* Can happen if input file is TIFF or PNG 
- * and HAVE_LIBTIF or HAVE_LIBPNG is undefined
+ * and OPJ_HAVE_LIBTIF or OPJ_HAVE_LIBPNG is undefined
 */
                        if( !image)
                   {
index 36967b27241b33d2b11338bd7afc824324218475..860c078c8a10d3ea24795d1d3d64da099d39d1d3 100644 (file)
 #define _strnicmp strncasecmp
 #endif /* _WIN32 */
 
-#include "opj_config.h"
+#include "opj_apps_config.h"
 #include "openjpeg.h"
 #include "opj_getopt.h"
 #include "convert.h"
 #include "index.h"
 
-#ifdef HAVE_LIBLCMS2
+#ifdef OPJ_HAVE_LIBLCMS2
 #include <lcms2.h>
 #endif
-#ifdef HAVE_LIBLCMS1
+#ifdef OPJ_HAVE_LIBLCMS1
 #include <lcms.h>
 #endif
 #include "color.h"
@@ -753,7 +753,7 @@ int main(int argc, char **argv) {
 
        if(image->icc_profile_buf)
    {
-#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
+#if defined(OPJ_HAVE_LIBLCMS1) || defined(OPJ_HAVE_LIBLCMS2)
        color_apply_icc_profile(image);
 #endif
 
@@ -790,7 +790,7 @@ int main(int argc, char **argv) {
                                fprintf(stdout,"Generated Outfile %s\n",parameters.outfile);
                        }
                        break;
-#ifdef HAVE_LIBTIFF
+#ifdef OPJ_HAVE_LIBTIFF
                case TIF_DFMT:                  /* TIFF */
                        if(imagetotif(image, parameters.outfile)){
                                fprintf(stdout,"Outfile %s not generated\n",parameters.outfile);
@@ -799,7 +799,7 @@ int main(int argc, char **argv) {
                                fprintf(stdout,"Generated Outfile %s\n",parameters.outfile);
                        }
                        break;
-#endif /* HAVE_LIBTIFF */
+#endif /* OPJ_HAVE_LIBTIFF */
                case RAW_DFMT:                  /* RAW */
                        if(imagetoraw(image, parameters.outfile)){
                                fprintf(stdout,"Error generating raw file. Outfile %s not generated\n",parameters.outfile);
@@ -817,7 +817,7 @@ int main(int argc, char **argv) {
                                fprintf(stdout,"Successfully generated Outfile %s\n",parameters.outfile);
                        }
                        break;
-#ifdef HAVE_LIBPNG
+#ifdef OPJ_HAVE_LIBPNG
                case PNG_DFMT:                  /* PNG */
                        if(imagetopng(image, parameters.outfile)){
                                fprintf(stdout,"Error generating png file. Outfile %s not generated\n",parameters.outfile);
@@ -826,9 +826,9 @@ int main(int argc, char **argv) {
                                fprintf(stdout,"Successfully generated Outfile %s\n",parameters.outfile);
                        }
                        break;
-#endif /* HAVE_LIBPNG */
+#endif /* OPJ_HAVE_LIBPNG */
 /* Can happen if output file is TIFF or PNG
- * and HAVE_LIBTIF or HAVE_LIBPNG is undefined
+ * and OPJ_HAVE_LIBTIF or OPJ_HAVE_LIBPNG is undefined
 */
                        default:
                                fprintf(stderr,"Outfile %s not generated\n",parameters.outfile);
index 73ddcbe80b99966d9e48dac05131752408a48b48..c8f6642b4e16f35408be82fcccd6934086287f6c 100644 (file)
@@ -29,7 +29,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "opj_config.h"
+#include "opj_apps_config.h"
 #include "openjpeg.h"
 #include "j2k_lib.h"
 #include "cio.h"
index ee312f6164941b74aac388873588b325569cb704..e9278a50a9e217500dd74c1169d428cdb1a86a4d 100644 (file)
@@ -29,7 +29,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "opj_config.h"
+#include "opj_apps_config.h"
 #include "openjpeg.h"
 #include "j2k_lib.h"
 #include "cio.h"
 #include "mj2.h"
 #include "mj2_convert.h"
 
-#ifdef HAVE_LIBLCMS2
+#ifdef OPJ_HAVE_LIBLCMS2
 #include <lcms2.h>
 #endif
-#ifdef HAVE_LIBLCMS1
+#ifdef OPJ_HAVE_LIBLCMS1
 #include <lcms.h>
 #endif
 #include "color.h"
@@ -188,7 +188,7 @@ int main(int argc, char *argv[]) {
 
        if(img->icc_profile_buf)
   {
-#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
+#if defined(OPJ_HAVE_LIBLCMS1) || defined(OPJ_HAVE_LIBLCMS2)
        color_apply_icc_profile(img);
 #endif
 
index 844d1831d821769319bfe7e37796ae460420f92a..089ce149158b0a6187da623656a77134ee2fb1b6 100644 (file)
@@ -29,8 +29,8 @@ IF(BUILD_THIRDPARTY)
   # Try to build it
   message(STATUS "We will build PNG lib from thirdparty")
   ADD_SUBDIRECTORY(libpng)
-  SET(HAVE_PNG_H 1 PARENT_SCOPE)
-  SET(HAVE_LIBPNG 1 PARENT_SCOPE)
+  SET(OPJ_HAVE_PNG_H 1 PARENT_SCOPE)
+  SET(OPJ_HAVE_LIBPNG 1 PARENT_SCOPE)
   SET(PNG_LIBNAME png PARENT_SCOPE)
   SET(PNG_INCLUDE_DIRNAME ${OPENJPEG_SOURCE_DIR}/thirdparty/libpng PARENT_SCOPE)
 ELSE (BUILD_THIRDPARTY)
@@ -38,13 +38,13 @@ ELSE (BUILD_THIRDPARTY)
     FIND_PACKAGE(PNG)
     IF(PNG_FOUND)
       message(STATUS "Your system seems to have a PNG lib available, we will use it")
-      SET(HAVE_PNG_H 1 PARENT_SCOPE)
-      SET(HAVE_LIBPNG 1 PARENT_SCOPE)
+      SET(OPJ_HAVE_PNG_H 1 PARENT_SCOPE)
+      SET(OPJ_HAVE_LIBPNG 1 PARENT_SCOPE)
       SET(PNG_LIBNAME ${PNG_LIBRARIES} PARENT_SCOPE)
       SET(PNG_INCLUDE_DIRNAME ${PNG_PNG_INCLUDE_DIR} PARENT_SCOPE)
     ELSE(PNG_FOUND) # not found
-      SET(HAVE_PNG_H 0 PARENT_SCOPE)
-      SET(HAVE_LIBPNG 0 PARENT_SCOPE)
+      SET(OPJ_HAVE_PNG_H 0 PARENT_SCOPE)
+      SET(OPJ_HAVE_LIBPNG 0 PARENT_SCOPE)
       message(STATUS "PNG lib not found, activate BUILD_THIRDPARTY if you want build it")
     ENDIF(PNG_FOUND)
   ENDIF (ZLIB_FOUND)
@@ -62,27 +62,27 @@ IF(BUILD_THIRDPARTY)
     ${OPENJPEG_SOURCE_DIR}/thirdparty/libtiff
     ${OPENJPEG_BINARY_DIR}/thirdparty/libtiff
     PARENT_SCOPE)
-  SET(HAVE_TIFF_H 1 PARENT_SCOPE)
-  SET(HAVE_LIBTIFF 1 PARENT_SCOPE)
+  SET(OPJ_HAVE_TIFF_H 1 PARENT_SCOPE)
+  SET(OPJ_HAVE_LIBTIFF 1 PARENT_SCOPE)
 ELSE (BUILD_THIRDPARTY)
   FIND_PACKAGE(TIFF)
   IF(TIFF_FOUND)
     message(STATUS "Your system seems to have a TIFF lib available, we will use it")
-    SET(HAVE_TIFF_H 1 PARENT_SCOPE)
-    SET(HAVE_LIBTIFF 1 PARENT_SCOPE)
+    SET(OPJ_HAVE_TIFF_H 1 PARENT_SCOPE)
+    SET(OPJ_HAVE_LIBTIFF 1 PARENT_SCOPE)
     SET(TIFF_LIBNAME ${TIFF_LIBRARIES} PARENT_SCOPE)
     SET(TIFF_INCLUDE_DIRNAME ${TIFF_INCLUDE_DIR} PARENT_SCOPE)
   ELSE (TIFF_FOUND) # not found
-    SET(HAVE_TIFF_H 0 PARENT_SCOPE)
-    SET(HAVE_LIBTIFF 0 PARENT_SCOPE)
+    SET(OPJ_HAVE_TIFF_H 0 PARENT_SCOPE)
+    SET(OPJ_HAVE_LIBTIFF 0 PARENT_SCOPE)
     message(STATUS "TIFF lib not found, activate BUILD_THIRDPARTY if you want build it")
   ENDIF(TIFF_FOUND)
 ENDIF(BUILD_THIRDPARTY)
 
 #------------
 # Try to find lib LCMS2 (or by default LCMS)
-SET(HAVE_LCMS_H 0 PARENT_SCOPE)
-SET(HAVE_LIBLCMS 0 PARENT_SCOPE)
+SET(OPJ_HAVE_LCMS_H 0 PARENT_SCOPE)
+SET(OPJ_HAVE_LIBLCMS 0 PARENT_SCOPE)
 
 IF( BUILD_THIRDPARTY)
   # Try to build lcms2
@@ -90,14 +90,14 @@ IF( BUILD_THIRDPARTY)
   ADD_SUBDIRECTORY(liblcms2)
   SET(LCMS_LIBNAME lcms2 PARENT_SCOPE)
   SET(LCMS_INCLUDE_DIRNAME ${OPENJPEG_SOURCE_DIR}/thirdparty/liblcms2/include PARENT_SCOPE) #
-  SET(HAVE_LCMS2_H 1 PARENT_SCOPE)
-  SET(HAVE_LIBLCMS2 1 PARENT_SCOPE)
+  SET(OPJ_HAVE_LCMS2_H 1 PARENT_SCOPE)
+  SET(OPJ_HAVE_LIBLCMS2 1 PARENT_SCOPE)
 ELSE (BUILD_THIRDPARTY)
   FIND_PACKAGE(LCMS2)
   IF(LCMS2_FOUND)
     message(STATUS "Your system seems to have a LCMS2 lib available, we will use it")
-    SET(HAVE_LCMS2_H 1 PARENT_SCOPE)
-    SET(HAVE_LIBLCMS2 1 PARENT_SCOPE)
+    SET(OPJ_HAVE_LCMS2_H 1 PARENT_SCOPE)
+    SET(OPJ_HAVE_LIBLCMS2 1 PARENT_SCOPE)
     SET(LCMS_LIBNAME ${LCMS2_LIBRARIES} PARENT_SCOPE)
     SET(LCMS_INCLUDE_DIRNAME ${LCMS2_INCLUDE_DIRS} PARENT_SCOPE)
   ELSE (LCMS2_FOUND) # not found lcms2
@@ -105,13 +105,13 @@ ELSE (BUILD_THIRDPARTY)
     FIND_PACKAGE(LCMS)
     IF(LCMS_FOUND)
       message(STATUS "Your system seems to have a LCMS lib available, we will use it")
-      SET(HAVE_LCMS_H 1 PARENT_SCOPE)
-      SET(HAVE_LIBLCMS 1 PARENT_SCOPE)
+      SET(OPJ_HAVE_LCMS_H 1 PARENT_SCOPE)
+      SET(OPJ_HAVE_LIBLCMS 1 PARENT_SCOPE)
       SET(LCMS_LIBNAME ${LCMS_LIBRARIES} PARENT_SCOPE)
       SET(LCMS_INCLUDE_DIRNAME ${LCMS_INCLUDE_DIRS} PARENT_SCOPE)
     ELSE (LCMS_FOUND) # not found lcms
-      SET(HAVE_LCMS2_H 0 PARENT_SCOPE)
-      SET(HAVE_LIBLCMS2 0 PARENT_SCOPE)
+      SET(OPJ_HAVE_LCMS2_H 0 PARENT_SCOPE)
+      SET(OPJ_HAVE_LIBLCMS2 0 PARENT_SCOPE)
       message(STATUS "LCMS2 or LCMS lib not found, activate BUILD_THIRDPARTY if you want build it")
     ENDIF (LCMS_FOUND)
   ENDIF(LCMS2_FOUND)