From 957976882d084d9951760b154f414724d6ddb8be Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 3 Aug 2010 11:25:34 +0000 Subject: build options to disable image formats WITH_CINEON, WITH_HDR. - updated cmake, make & scons. - renamed CMake build options WITH_TIFF -> WITH_IMAGE_TIFF, same for DDS, OPENJPEG etc. --- source/blender/imbuf/CMakeLists.txt | 24 ++++++++++++++-------- source/blender/imbuf/IMB_imbuf_types.h | 6 ++++++ source/blender/imbuf/SConscript | 6 ++++++ source/blender/imbuf/intern/Makefile | 11 +++++++++- source/blender/imbuf/intern/dds/CMakeLists.txt | 4 ++-- source/blender/imbuf/intern/filetype.c | 4 ++++ source/blender/imbuf/intern/openexr/CMakeLists.txt | 4 ++-- source/blender/imbuf/intern/radiance_hdr.c | 3 +++ source/blender/imbuf/intern/util.c | 10 +++++++++ 9 files changed, 59 insertions(+), 13 deletions(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt index 57f7e830f41..49886bdc46f 100644 --- a/source/blender/imbuf/CMakeLists.txt +++ b/source/blender/imbuf/CMakeLists.txt @@ -44,19 +44,19 @@ IF(WIN32) SET(INC ${INC} ${PTHREADS_INC}) ENDIF(WIN32) -IF(WITH_OPENEXR) +IF(WITH_IMAGE_OPENEXR) ADD_DEFINITIONS(-DWITH_OPENEXR) -ENDIF(WITH_OPENEXR) +ENDIF(WITH_IMAGE_OPENEXR) -IF(WITH_TIFF) +IF(WITH_IMAGE_TIFF) SET(INC ${INC} ${TIFF_INCLUDE_DIR}) ADD_DEFINITIONS(-DWITH_TIFF) -ENDIF(WITH_TIFF) +ENDIF(WITH_IMAGE_TIFF) -IF(WITH_OPENJPEG) +IF(WITH_IMAGE_OPENJPEG) SET(INC ${INC} ${OPENJPEG_INC}) ADD_DEFINITIONS(-DWITH_OPENJPEG) -ENDIF(WITH_OPENJPEG) +ENDIF(WITH_IMAGE_OPENJPEG) IF(WITH_QUICKTIME) SET(INC ${INC} ../quicktime ${QUICKTIME_INC}) @@ -68,8 +68,16 @@ IF(WITH_FFMPEG) ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) -IF(WITH_DDS) +IF(WITH_IMAGE_DDS) ADD_DEFINITIONS(-DWITH_DDS) -ENDIF(WITH_DDS) +ENDIF(WITH_IMAGE_DDS) + +IF(WITH_IMAGE_CINEON) + ADD_DEFINITIONS(-DWITH_CINEON) +ENDIF(WITH_IMAGE_CINEON) + +IF(WITH_IMAGE_HDR) + ADD_DEFINITIONS(-DWITH_HDR) +ENDIF(WITH_IMAGE_HDR) BLENDERLIB(bf_imbuf "${SRC}" "${INC}") diff --git a/source/blender/imbuf/IMB_imbuf_types.h b/source/blender/imbuf/IMB_imbuf_types.h index e0dcc344016..7408a43ee65 100644 --- a/source/blender/imbuf/IMB_imbuf_types.h +++ b/source/blender/imbuf/IMB_imbuf_types.h @@ -173,16 +173,22 @@ typedef struct ImBuf { #define QUICKTIME (1 << 25) #endif +#ifdef WITH_HDR #define RADHDR (1 << 24) +#endif +#ifdef WITH_TIFF #define TIF (1 << 23) #define TIF_16BIT (1 << 8 ) +#endif #define OPENEXR (1 << 22) #define OPENEXR_HALF (1 << 8 ) #define OPENEXR_COMPRESS (7) +#ifdef WITH_CINEON #define CINEON (1 << 21) #define DPX (1 << 20) +#endif #ifdef WITH_DDS #define DDS (1 << 19) diff --git a/source/blender/imbuf/SConscript b/source/blender/imbuf/SConscript index 439cdecdf5b..6b3360a16c5 100644 --- a/source/blender/imbuf/SConscript +++ b/source/blender/imbuf/SConscript @@ -26,6 +26,12 @@ if env['WITH_BF_TIFF']: if env['WITH_BF_DDS']: defs.append('WITH_DDS') +if env['WITH_BF_CINEON']: + defs.append('WITH_CINEON') + +if env['WITH_BF_HDR']: + defs.append('WITH_HDR') + if env['WITH_BF_FFMPEG']: defs.append('WITH_FFMPEG') incs += ' ' + env['BF_FFMPEG_INC'] diff --git a/source/blender/imbuf/intern/Makefile b/source/blender/imbuf/intern/Makefile index 5f8029ddf72..f3fa17385fe 100644 --- a/source/blender/imbuf/intern/Makefile +++ b/source/blender/imbuf/intern/Makefile @@ -36,7 +36,12 @@ include nan_subdirs.mk include nan_compile.mk include nan_definitions.mk -DIRS = cineon +DIRS = + +ifeq ($(WITH_CINEON), true) + DIRS += cineon + CPPFLAGS += -DWITH_CINEON +endif ifeq ($(WITH_OPENEXR), true) DIRS += openexr @@ -89,3 +94,7 @@ ifeq ($(WITH_TIFF), true) CPPFLAGS += -DWITH_TIFF CPPFLAGS += -I$(NAN_TIFF)/include endif + +ifeq ($(WITH_HDR), true) + CPPFLAGS += -DWITH_HDR +endif diff --git a/source/blender/imbuf/intern/dds/CMakeLists.txt b/source/blender/imbuf/intern/dds/CMakeLists.txt index 64a37e03a88..376dd3d61f4 100644 --- a/source/blender/imbuf/intern/dds/CMakeLists.txt +++ b/source/blender/imbuf/intern/dds/CMakeLists.txt @@ -37,8 +37,8 @@ SET(INC ../../../../../intern/guardedalloc ) -if(WITH_DDS) +if(WITH_IMAGE_DDS) ADD_DEFINITIONS(-DWITH_DDS) -ENDIF(WITH_DDS) +ENDIF(WITH_IMAGE_DDS) BLENDERLIB(bf_dds "${SRC}" "${INC}") diff --git a/source/blender/imbuf/intern/filetype.c b/source/blender/imbuf/intern/filetype.c index c2140e12013..db2eef759dc 100644 --- a/source/blender/imbuf/intern/filetype.c +++ b/source/blender/imbuf/intern/filetype.c @@ -60,14 +60,18 @@ ImFileType IMB_FILE_TYPES[]= { {NULL, NULL, imb_is_a_png, imb_ftype_default, imb_loadpng, imb_savepng, NULL, 0, PNG}, {NULL, NULL, imb_is_a_bmp, imb_ftype_default, imb_bmp_decode, imb_savebmp, NULL, 0, BMP}, {NULL, NULL, imb_is_a_targa, imb_ftype_default, imb_loadtarga, imb_savetarga, NULL, 0, TGA}, +#ifdef WITH_CINEON {NULL, NULL, imb_is_dpx, imb_ftype_default, imb_loaddpx, imb_save_dpx, NULL, IM_FTYPE_FLOAT, DPX}, {NULL, NULL, imb_is_cineon, imb_ftype_default, imb_loadcineon, imb_savecineon, NULL, IM_FTYPE_FLOAT, CINEON}, +#endif #ifdef WITH_TIFF {imb_inittiff, NULL, imb_is_a_tiff, imb_ftype_default, imb_loadtiff, imb_savetiff, imb_loadtiletiff, 0, TIF}, #elif defined(__APPLE__) && defined(IMBUF_COCOA) {NULL, NULL, imb_is_a_cocoa, imb_ftype_cocoa, imb_imb_cocoaLoadImage, imb_savecocoa, NULL, 0, TIF}, #endif +#ifdef WITH_HDR {NULL, NULL, imb_is_a_hdr, imb_ftype_default, imb_loadhdr, imb_savehdr, NULL, IM_FTYPE_FLOAT, RADHDR}, +#endif #ifdef WITH_OPENEXR {NULL, NULL, imb_is_a_openexr, imb_ftype_default, imb_load_openexr, imb_save_openexr, NULL, IM_FTYPE_FLOAT, OPENEXR}, #endif diff --git a/source/blender/imbuf/intern/openexr/CMakeLists.txt b/source/blender/imbuf/intern/openexr/CMakeLists.txt index 1a098c89aa4..cfc977ff155 100644 --- a/source/blender/imbuf/intern/openexr/CMakeLists.txt +++ b/source/blender/imbuf/intern/openexr/CMakeLists.txt @@ -38,8 +38,8 @@ SET(INC ${OPENEXR_INC} ) -IF(WITH_OPENEXR) +IF(WITH_IMAGE_OPENEXR) ADD_DEFINITIONS(-DWITH_OPENEXR) -ENDIF(WITH_OPENEXR) +ENDIF(WITH_IMAGE_OPENEXR) BLENDERLIB(bf_openexr "${SRC}" "${INC}") diff --git a/source/blender/imbuf/intern/radiance_hdr.c b/source/blender/imbuf/intern/radiance_hdr.c index dabb6780ea3..a0942c281e3 100644 --- a/source/blender/imbuf/intern/radiance_hdr.c +++ b/source/blender/imbuf/intern/radiance_hdr.c @@ -29,6 +29,8 @@ * ***** END GPL LICENSE BLOCK ***** */ +#ifdef WITH_HDR + /* ---------------------------------------------------------------------- Radiance High Dynamic Range image file IO For description and code for reading/writing of radiance hdr files @@ -358,3 +360,4 @@ int imb_savehdr(struct ImBuf *ibuf, char *name, int flags) return 1; } +#endif /* WITH_HDR */ diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index e6f4e226caa..726a8fe2f36 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -118,7 +118,9 @@ int IMB_ispic(char *filename) || BLI_testextensie(filename, ".tiff") || BLI_testextensie(filename, ".tx") #endif +#ifdef WITH_HDR || BLI_testextensie(filename, ".hdr") +#endif || BLI_testextensie(filename, ".tga") || BLI_testextensie(filename, ".rgb") || BLI_testextensie(filename, ".bmp") @@ -134,7 +136,10 @@ int IMB_ispic(char *filename) || BLI_testextensie(filename, ".pict") || BLI_testextensie(filename, ".pntg") //macpaint || BLI_testextensie(filename, ".qtif") +#ifdef WITH_CINEON + || BLI_testextensie(filename, ".dpx") || BLI_testextensie(filename, ".cin") +#endif #ifdef WITH_BF_OPENEXR || BLI_testextensie(filename, ".exr") #endif @@ -154,12 +159,17 @@ int IMB_ispic(char *filename) || BLI_testextensie(filename, ".tiff") || BLI_testextensie(filename, ".tx") #endif +#ifdef WITH_HDR || BLI_testextensie(filename, ".hdr") +#endif || BLI_testextensie(filename, ".tga") || BLI_testextensie(filename, ".rgb") || BLI_testextensie(filename, ".bmp") || BLI_testextensie(filename, ".png") +#ifdef WITH_CINEON || BLI_testextensie(filename, ".cin") + || BLI_testextensie(filename, ".dpx") +#endif #ifdef WITH_DDS || BLI_testextensie(filename, ".dds") #endif -- cgit v1.2.3