From 425a81a29b8adf1fc2d913dfc679d6ca62cd05fa Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 19 Sep 2011 06:32:19 +0000 Subject: remove WITH_* defines from image formats, instead just dont build the files at all. --- source/blender/imbuf/CMakeLists.txt | 14 ++++++-- source/blender/imbuf/SConscript | 6 ++++ source/blender/imbuf/intern/IMB_anim.h | 55 +++++++++++++++--------------- source/blender/imbuf/intern/IMB_indexer.h | 2 +- source/blender/imbuf/intern/imbuf.h | 25 ++++++-------- source/blender/imbuf/intern/jp2.c | 5 --- source/blender/imbuf/intern/radiance_hdr.c | 7 +--- source/blender/imbuf/intern/tiff.c | 4 --- 8 files changed, 58 insertions(+), 60 deletions(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt index 1547d2ee9ce..26be64bc268 100644 --- a/source/blender/imbuf/CMakeLists.txt +++ b/source/blender/imbuf/CMakeLists.txt @@ -58,13 +58,11 @@ set(SRC intern/indexer.c intern/indexer_dv.c intern/iris.c - intern/jp2.c intern/jpeg.c intern/md5.c intern/metadata.c intern/module.c intern/png.c - intern/radiance_hdr.c intern/readimage.c intern/rectop.c intern/rotate.c @@ -72,7 +70,6 @@ set(SRC intern/targa.c intern/thumbs.c intern/thumbs_blend.c - intern/tiff.c intern/util.c intern/writeimage.c @@ -119,6 +116,10 @@ if(WITH_IMAGE_TIFF) list(APPEND INC_SYS ${TIFF_INCLUDE_DIR} ) + list(APPEND SRC + intern/tiff.c + ) + add_definitions(-DWITH_TIFF) endif() @@ -126,6 +127,10 @@ if(WITH_IMAGE_OPENJPEG) list(APPEND INC_SYS ${OPENJPEG_INCLUDE_DIRS} ) + list(APPEND SRC + intern/jp2.c + ) + add_definitions(-DWITH_OPENJPEG) endif() @@ -165,6 +170,9 @@ if(WITH_IMAGE_CINEON) endif() if(WITH_IMAGE_HDR) + list(APPEND SRC + intern/radiance_hdr.c + ) add_definitions(-DWITH_HDR) endif() diff --git a/source/blender/imbuf/SConscript b/source/blender/imbuf/SConscript index a80f92b4421..7c5b94b9e12 100644 --- a/source/blender/imbuf/SConscript +++ b/source/blender/imbuf/SConscript @@ -22,6 +22,8 @@ if env['WITH_BF_OPENEXR']: if env['WITH_BF_TIFF']: defs.append('WITH_TIFF') +else: + sources.remove('intern/tiff.c') if env['WITH_BF_DDS']: defs.append('WITH_DDS') @@ -31,6 +33,8 @@ if env['WITH_BF_CINEON']: if env['WITH_BF_HDR']: defs.append('WITH_HDR') +else: + sources.remove('intern/radiance_hdr.c') if env['WITH_BF_FFMPEG']: defs.append('WITH_FFMPEG') @@ -39,6 +43,8 @@ if env['WITH_BF_FFMPEG']: if env['WITH_BF_OPENJPEG']: defs.append('WITH_OPENJPEG') incs += ' ' + env['BF_OPENJPEG_INC'] +else: + sources.remove('intern/jp2.c') if env['WITH_BF_REDCODE']: defs.append('WITH_REDCODE') diff --git a/source/blender/imbuf/intern/IMB_anim.h b/source/blender/imbuf/intern/IMB_anim.h index 8436846bf2e..cd60c0362ad 100644 --- a/source/blender/imbuf/intern/IMB_anim.h +++ b/source/blender/imbuf/intern/IMB_anim.h @@ -38,21 +38,21 @@ #define IMB_ANIM_H #ifdef _WIN32 -#define INC_OLE2 -#include -#include -#include -#include -#include - -#ifndef FREE_WINDOWS -#include -#endif +# define INC_OLE2 +# include +# include +# include +# include +# include + +# ifndef FREE_WINDOWS +# include +# endif -#undef AVIIF_KEYFRAME // redefined in AVI_avi.h -#undef AVIIF_LIST // redefined in AVI_avi.h +# undef AVIIF_KEYFRAME // redefined in AVI_avi.h +# undef AVIIF_LIST // redefined in AVI_avi.h -#define FIXCC(fcc) if (fcc == 0) fcc = mmioFOURCC('N', 'o', 'n', 'e'); \ +# define FIXCC(fcc) if (fcc == 0) fcc = mmioFOURCC('N', 'o', 'n', 'e'); \ if (fcc == BI_RLE8) fcc = mmioFOURCC('R', 'l', 'e', '8'); #endif @@ -60,10 +60,11 @@ #include #include #include -#ifndef _WIN32 -#include + +#ifdef _WIN32 +# include #else -#include +# include #endif #include "BLI_blenlib.h" /* BLI_remlink BLI_filesize BLI_addtail @@ -74,23 +75,23 @@ #include "AVI_avi.h" #ifdef WITH_QUICKTIME -#if defined(_WIN32) || defined(__APPLE__) -#include "quicktime_import.h" -#endif /* _WIN32 || __APPLE__ */ +# if defined(_WIN32) || defined(__APPLE__) +# include "quicktime_import.h" +# endif /* _WIN32 || __APPLE__ */ #endif /* WITH_QUICKTIME */ #ifdef WITH_FFMPEG -#include -#include -#include +# include +# include +# include #endif #ifdef WITH_REDCODE -#ifdef _WIN32 /* on windows we use the one in extern instead */ -#include "libredcode/format.h" -#else -#include "libredcode/format.h" -#endif +# ifdef _WIN32 /* on windows we use the one in extern instead */ +# include "libredcode/format.h" +# else +# include "libredcode/format.h" +# endif #endif #include "IMB_imbuf_types.h" diff --git a/source/blender/imbuf/intern/IMB_indexer.h b/source/blender/imbuf/intern/IMB_indexer.h index f55420fd106..bd5a455df98 100644 --- a/source/blender/imbuf/intern/IMB_indexer.h +++ b/source/blender/imbuf/intern/IMB_indexer.h @@ -28,7 +28,7 @@ #define IMB_INDEXER_H #ifdef WIN32 -#include +# include #endif #include diff --git a/source/blender/imbuf/intern/imbuf.h b/source/blender/imbuf/intern/imbuf.h index cd7d385ed92..88be4ffbb5f 100644 --- a/source/blender/imbuf/intern/imbuf.h +++ b/source/blender/imbuf/intern/imbuf.h @@ -44,7 +44,7 @@ #include #ifndef WIN32 -#include +# include #endif #include @@ -53,11 +53,8 @@ #include #ifndef WIN32 -#include -#endif - -#if !defined(WIN32) -#define O_BINARY 0 +# include +# define O_BINARY 0 #endif #define SWAP_SHORT(x) (((x & 0xff) << 8) | ((x >> 8) & 0xff)) @@ -66,15 +63,15 @@ #define ENDIAN_NOP(x) (x) #if defined(__sgi) || defined(__sparc) || defined(__sparc__) || defined (__PPC__) || defined (__hppa__) || (defined (__APPLE__) && !defined(__LITTLE_ENDIAN__)) -#define LITTLE_SHORT SWAP_SHORT -#define LITTLE_LONG SWAP_LONG -#define BIG_SHORT ENDIAN_NOP -#define BIG_LONG ENDIAN_NOP +# define LITTLE_SHORT SWAP_SHORT +# define LITTLE_LONG SWAP_LONG +# define BIG_SHORT ENDIAN_NOP +# define BIG_LONG ENDIAN_NOP #else -#define LITTLE_SHORT ENDIAN_NOP -#define LITTLE_LONG ENDIAN_NOP -#define BIG_SHORT SWAP_SHORT -#define BIG_LONG SWAP_LONG +# define LITTLE_SHORT ENDIAN_NOP +# define LITTLE_LONG ENDIAN_NOP +# define BIG_SHORT SWAP_SHORT +# define BIG_LONG SWAP_LONG #endif typedef unsigned char uchar; diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c index af7f098585e..4872896bf3a 100644 --- a/source/blender/imbuf/intern/jp2.c +++ b/source/blender/imbuf/intern/jp2.c @@ -25,9 +25,6 @@ * \ingroup imbuf */ - -#ifdef WITH_OPENJPEG - #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" @@ -751,5 +748,3 @@ int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags) { return 1; } - -#endif /* WITH_OPENJPEG */ diff --git a/source/blender/imbuf/intern/radiance_hdr.c b/source/blender/imbuf/intern/radiance_hdr.c index ddddec1c09f..9dd330ca88b 100644 --- a/source/blender/imbuf/intern/radiance_hdr.c +++ b/source/blender/imbuf/intern/radiance_hdr.c @@ -33,9 +33,6 @@ * \ingroup imbuf */ - -#ifdef WITH_HDR - /* ---------------------------------------------------------------------- Radiance High Dynamic Range image file IO For description and code for reading/writing of radiance hdr files @@ -45,7 +42,7 @@ */ #ifdef WIN32 -#include +# include #endif #include "MEM_guardedalloc.h" @@ -369,5 +366,3 @@ int imb_savehdr(struct ImBuf *ibuf, const char *name, int flags) fclose(file); return 1; } - -#endif /* WITH_HDR */ diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c index 7beb853fe62..ccb271393a4 100644 --- a/source/blender/imbuf/intern/tiff.c +++ b/source/blender/imbuf/intern/tiff.c @@ -45,8 +45,6 @@ * used to compress images. */ -#ifdef WITH_TIFF - #include #include "imbuf.h" @@ -836,5 +834,3 @@ int imb_savetiff(ImBuf *ibuf, const char *name, int flags) if(pixels16) _TIFFfree(pixels16); return (1); } - -#endif /* WITH_TIFF */ -- cgit v1.2.3 From 83a2f02a78cd01aaf31b9b4ae8a217a1ecea6a49 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 19 Sep 2011 08:02:17 +0000 Subject: cleanup endian handling - define __BIG_ENDIAN__ or __LITTLE_ENDIAN__ with cmake & scons. - ENDIAN_ORDER is now a define rather than a global short. - replace checks like this with single ifdef: #if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__) - remove BKE_endian.h which isn't used --- source/blender/imbuf/intern/IMB_anim.h | 10 +++++----- source/blender/imbuf/intern/imbuf.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/intern/IMB_anim.h b/source/blender/imbuf/intern/IMB_anim.h index cd60c0362ad..43168b97b88 100644 --- a/source/blender/imbuf/intern/IMB_anim.h +++ b/source/blender/imbuf/intern/IMB_anim.h @@ -108,12 +108,12 @@ #define SWAP_S(x) (((x << 8) & 0xff00) | ((x >> 8) & 0xff)) /* more endianness... should move to a separate file... */ -#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__) -#define GET_ID GET_BIG_LONG -#define LITTLE_LONG SWAP_LONG +#ifdef __BIG_ENDIAN__ +# define GET_ID GET_BIG_LONG +# define LITTLE_LONG SWAP_LONG #else -#define GET_ID GET_LITTLE_LONG -#define LITTLE_LONG ENDIAN_NOP +# define GET_ID GET_LITTLE_LONG +# define LITTLE_LONG ENDIAN_NOP #endif /* anim.curtype, runtime only */ diff --git a/source/blender/imbuf/intern/imbuf.h b/source/blender/imbuf/intern/imbuf.h index 88be4ffbb5f..22481241812 100644 --- a/source/blender/imbuf/intern/imbuf.h +++ b/source/blender/imbuf/intern/imbuf.h @@ -62,7 +62,7 @@ #define ENDIAN_NOP(x) (x) -#if defined(__sgi) || defined(__sparc) || defined(__sparc__) || defined (__PPC__) || defined (__hppa__) || (defined (__APPLE__) && !defined(__LITTLE_ENDIAN__)) +#ifdef __BIG_ENDIAN__ # define LITTLE_SHORT SWAP_SHORT # define LITTLE_LONG SWAP_LONG # define BIG_SHORT ENDIAN_NOP -- cgit v1.2.3 From 4e9ab6d04c4ae6306be77cccbb403804ec8d9108 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 19 Sep 2011 08:11:30 +0000 Subject: replace WORDS_BIGENDIAN with __BIG_ENDIAN__ --- source/blender/imbuf/intern/md5.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/intern/md5.c b/source/blender/imbuf/intern/md5.c index 18148143eb9..2192fa32f19 100644 --- a/source/blender/imbuf/intern/md5.c +++ b/source/blender/imbuf/intern/md5.c @@ -28,11 +28,11 @@ #include "md5.h" -#ifdef WORDS_BIGENDIAN -# define SWAP(n) \ +#ifdef __BIG_ENDIAN__ +# define SWAP(n) \ (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) #else -# define SWAP(n) (n) +# define SWAP(n) (n) #endif -- cgit v1.2.3