diff options
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/CMakeLists.txt | 25 | ||||
-rw-r--r-- | source/blender/imbuf/IMB_imbuf_types.h | 12 | ||||
-rw-r--r-- | source/blender/imbuf/SConscript | 6 | ||||
-rw-r--r-- | source/blender/imbuf/intern/Makefile | 11 | ||||
-rw-r--r-- | source/blender/imbuf/intern/allocimbuf.c | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/cineon/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/imbuf/intern/dds/CMakeLists.txt | 5 | ||||
-rw-r--r-- | source/blender/imbuf/intern/filetype.c | 4 | ||||
-rw-r--r-- | source/blender/imbuf/intern/openexr/CMakeLists.txt | 5 | ||||
-rw-r--r-- | source/blender/imbuf/intern/radiance_hdr.c | 3 | ||||
-rw-r--r-- | source/blender/imbuf/intern/thumbs.c | 1 | ||||
-rw-r--r-- | source/blender/imbuf/intern/util.c | 154 |
12 files changed, 137 insertions, 92 deletions
diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt index 98cb3dcefd9..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,9 +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}") -#env.BlenderLib ( libname = 'bf_imbuf', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [80, 40] ) diff --git a/source/blender/imbuf/IMB_imbuf_types.h b/source/blender/imbuf/IMB_imbuf_types.h index e0dcc344016..203a7268581 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) @@ -216,5 +222,9 @@ typedef struct ImBuf { #define IB_PROFILE_SRGB 2 #define IB_PROFILE_CUSTOM 3 -#endif +extern const char *imb_ext_image[]; +extern const char *imb_ext_image_qt[]; +extern const char *imb_ext_movie[]; +extern const char *imb_ext_audio[]; +#endif 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/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c index 606913dd590..8e00c7c7cf1 100644 --- a/source/blender/imbuf/intern/allocimbuf.c +++ b/source/blender/imbuf/intern/allocimbuf.c @@ -77,7 +77,7 @@ void imb_freerectImBuf(ImBuf *ibuf) { if(ibuf==NULL) return; - if(ibuf->crect && ibuf->crect != ibuf->rect) + if(ibuf->crect) MEM_freeN(ibuf->crect); if(ibuf->rect && (ibuf->mall & IB_rect)) diff --git a/source/blender/imbuf/intern/cineon/CMakeLists.txt b/source/blender/imbuf/intern/cineon/CMakeLists.txt index 588be3305d9..cd887b6fc4e 100644 --- a/source/blender/imbuf/intern/cineon/CMakeLists.txt +++ b/source/blender/imbuf/intern/cineon/CMakeLists.txt @@ -38,4 +38,3 @@ SET(INC ) BLENDERLIB(bf_cineon "${SRC}" "${INC}") -#env.BlenderLib ('bf_cineon', source_files, incs, defs, libtype=['core','player'], priority = [90, 200]) diff --git a/source/blender/imbuf/intern/dds/CMakeLists.txt b/source/blender/imbuf/intern/dds/CMakeLists.txt index 364dd41e744..376dd3d61f4 100644 --- a/source/blender/imbuf/intern/dds/CMakeLists.txt +++ b/source/blender/imbuf/intern/dds/CMakeLists.txt @@ -37,9 +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}") -#env.BlenderLib ('bf_dds', source_files, incs, defs, libtype=['core','player'], priority = [90, 200]) 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 7dc295a8aae..cfc977ff155 100644 --- a/source/blender/imbuf/intern/openexr/CMakeLists.txt +++ b/source/blender/imbuf/intern/openexr/CMakeLists.txt @@ -38,9 +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}") -#env.BlenderLib ('bf_openexr', source_files, incs, defs, libtype=['core','player'], priority = [90, 200]) 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/thumbs.c b/source/blender/imbuf/intern/thumbs.c index dcbd6df7ced..1624e9c2b01 100644 --- a/source/blender/imbuf/intern/thumbs.c +++ b/source/blender/imbuf/intern/thumbs.c @@ -29,7 +29,6 @@ #include <stdio.h> -#include "BKE_global.h" #include "BKE_utildefines.h" #include "BLI_blenlib.h" #include "MEM_guardedalloc.h" diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index e6f4e226caa..3a642e1256c 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -68,6 +68,80 @@ #define UTIL_DEBUG 0 +const char *imb_ext_image[] = { + ".png", + ".tga", + ".bmp", + ".jpg", ".jpeg", + ".sgi", ".rgb", ".rgba", +#ifdef WITH_TIFF + ".tif", ".tiff", ".tx", +#endif +#ifdef WITH_BF_OPENJPEG + ".jp2", +#endif +#ifdef WITH_HDR + ".hdr", +#endif +#ifdef WITH_DDS + ".dds", +#endif +#ifdef WITH_CINEON + ".dpx", + ".cin", +#endif +#ifdef WITH_BF_OPENEXR + ".exr", +#endif + NULL}; + +const char *imb_ext_image_qt[] = { + ".gif", + ".psd", + ".pct", ".pict", + ".pntg", + ".qtif", + NULL}; + +const char *imb_ext_movie[] = { + ".avi", + ".flc", + ".mov", + ".movie", + ".mp4", + ".m4v", + ".m2v", + ".m2t", + ".mts", + ".mv", + ".avs", + ".wmv", + ".ogv", + ".dv", + ".mpeg", + ".mpg", + ".mpg2", + ".vob", + ".mkv", + ".flv", + ".divx", + ".xvid", + NULL}; + +/* sort of wrong being here... */ +const char *imb_ext_audio[] = { + ".wav", + ".ogg", + ".oga", + ".mp3", + ".mp2", + ".ac3", + ".aac", + ".flac", + ".wma", + ".eac3", + NULL}; + static int IMB_ispic_name(char *name) { ImFileType *type; @@ -105,80 +179,16 @@ static int IMB_ispic_name(char *name) int IMB_ispic(char *filename) { if(U.uiflag & USER_FILTERFILEEXTS) { - if (BLI_testextensie(filename, ".tif") - || BLI_testextensie(filename, ".tiff") - || BLI_testextensie(filename, ".tx")) { - return IMB_ispic_name(filename); + if( (BLI_testextensie_array(filename, imb_ext_image)) || + (G.have_quicktime && BLI_testextensie_array(filename, imb_ext_image_qt)) + ) { + return IMB_ispic_name(filename); } - if (G.have_quicktime){ - if( BLI_testextensie(filename, ".jpg") - || BLI_testextensie(filename, ".jpeg") -#ifdef WITH_TIFF - || BLI_testextensie(filename, ".tif") - || BLI_testextensie(filename, ".tiff") - || BLI_testextensie(filename, ".tx") -#endif - || BLI_testextensie(filename, ".hdr") - || BLI_testextensie(filename, ".tga") - || BLI_testextensie(filename, ".rgb") - || BLI_testextensie(filename, ".bmp") - || BLI_testextensie(filename, ".png") -#ifdef WITH_DDS - || BLI_testextensie(filename, ".dds") -#endif - || BLI_testextensie(filename, ".iff") - || BLI_testextensie(filename, ".lbm") - || BLI_testextensie(filename, ".gif") - || BLI_testextensie(filename, ".psd") - || BLI_testextensie(filename, ".pct") - || BLI_testextensie(filename, ".pict") - || BLI_testextensie(filename, ".pntg") //macpaint - || BLI_testextensie(filename, ".qtif") - || BLI_testextensie(filename, ".cin") -#ifdef WITH_BF_OPENEXR - || BLI_testextensie(filename, ".exr") -#endif -#ifdef WITH_BF_OPENJPEG - || BLI_testextensie(filename, ".jp2") -#endif - || BLI_testextensie(filename, ".sgi")) { - return IMB_ispic_name(filename); - } else { - return(FALSE); - } - } else { /* no quicktime */ - if( BLI_testextensie(filename, ".jpg") - || BLI_testextensie(filename, ".jpeg") -#ifdef WITH_TIFF - || BLI_testextensie(filename, ".tif") - || BLI_testextensie(filename, ".tiff") - || BLI_testextensie(filename, ".tx") -#endif - || BLI_testextensie(filename, ".hdr") - || BLI_testextensie(filename, ".tga") - || BLI_testextensie(filename, ".rgb") - || BLI_testextensie(filename, ".bmp") - || BLI_testextensie(filename, ".png") - || BLI_testextensie(filename, ".cin") -#ifdef WITH_DDS - || BLI_testextensie(filename, ".dds") -#endif -#ifdef WITH_BF_OPENEXR - || BLI_testextensie(filename, ".exr") -#endif -#ifdef WITH_BF_OPENJPEG - || BLI_testextensie(filename, ".jp2") -#endif - || BLI_testextensie(filename, ".iff") - || BLI_testextensie(filename, ".lbm") - || BLI_testextensie(filename, ".sgi")) { - return IMB_ispic_name(filename); - } - else { - return(FALSE); - } + else { + return FALSE; } - } else { /* no FILTERFILEEXTS */ + } + else { /* no FILTERFILEEXTS */ return IMB_ispic_name(filename); } } |