diff options
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/CMakeLists.txt | 5 | ||||
-rw-r--r-- | source/blender/imbuf/IMB_imbuf_types.h | 3 | ||||
-rw-r--r-- | source/blender/imbuf/IMB_thumbs.h | 3 | ||||
-rw-r--r-- | source/blender/imbuf/SConscript | 6 | ||||
-rw-r--r-- | source/blender/imbuf/intern/allocimbuf.c | 5 | ||||
-rw-r--r-- | source/blender/imbuf/intern/amiga.c | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/anim.c | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/cineon/SConscript | 4 | ||||
-rw-r--r-- | source/blender/imbuf/intern/cineon/cineon_dpx.c | 20 | ||||
-rw-r--r-- | source/blender/imbuf/intern/cineon/cineonlib.c | 6 | ||||
-rw-r--r-- | source/blender/imbuf/intern/cineon/dpxlib.c | 8 | ||||
-rw-r--r-- | source/blender/imbuf/intern/dds/SConscript | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/openexr/SConscript | 4 | ||||
-rw-r--r-- | source/blender/imbuf/intern/thumbs.c | 15 | ||||
-rw-r--r-- | source/blender/imbuf/intern/tiff.c | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/writeimage.c | 2 |
16 files changed, 52 insertions, 37 deletions
diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt index 9894aa8136e..391f6e9e1a2 100644 --- a/source/blender/imbuf/CMakeLists.txt +++ b/source/blender/imbuf/CMakeLists.txt @@ -36,11 +36,6 @@ SET(INC ${OPENJPEG_INC} ) -IF(WITH_VERSE) - ADD_DEFINITIONS(-DWITH_VERSE) - SET(INC ${INC} VERSE_INC) -ENDIF(WITH_VERSE) - IF(WITH_OPENEXR) ADD_DEFINITIONS(-DWITH_OPENEXR) ENDIF(WITH_OPENEXR) diff --git a/source/blender/imbuf/IMB_imbuf_types.h b/source/blender/imbuf/IMB_imbuf_types.h index eadd7affe6a..79da0cb1c41 100644 --- a/source/blender/imbuf/IMB_imbuf_types.h +++ b/source/blender/imbuf/IMB_imbuf_types.h @@ -83,6 +83,7 @@ typedef struct ImBuf { int ftype; /**< File type we are going to save as */ unsigned int *cmap; /**< Color map data. */ unsigned int *rect; /**< pixel values stored here */ + unsigned int *crect; /**< color corrected pixel values stored here */ unsigned int **planes; /**< bitplanes */ int flags; /**< Controls which components should exist. */ int mall; /**< what is malloced internal, and can be freed */ @@ -97,7 +98,7 @@ typedef struct ImBuf { unsigned int encodedsize; /**< Size of data written to encodedbuffer */ unsigned int encodedbuffersize; /**< Size of encodedbuffer */ - float *rect_float; /**< floating point Rect equivilant */ + float *rect_float; /**< floating point Rect equivalent */ int channels; /**< amount of channels in rect_float (0 = 4 channel default) */ float dither; /**< random dither value, for conversion from float -> byte rect */ diff --git a/source/blender/imbuf/IMB_thumbs.h b/source/blender/imbuf/IMB_thumbs.h index 4f4b77ff000..53b63b4d304 100644 --- a/source/blender/imbuf/IMB_thumbs.h +++ b/source/blender/imbuf/IMB_thumbs.h @@ -67,7 +67,8 @@ void IMB_thumb_delete(const char* dir, const char* file, ThumbSize size); /* return the state of the thumb, needed to determine how to manage the thumb */ ImBuf* IMB_thumb_manage(const char* dir, const char* file, ThumbSize size, ThumbSource source); - +/* create the necessary dirs to store the thumbnails */ +void IMB_thumb_makedirs(); #endif /* _IMB_THUMBS_H */ diff --git a/source/blender/imbuf/SConscript b/source/blender/imbuf/SConscript index a8c49c0394e..9da0cf21596 100644 --- a/source/blender/imbuf/SConscript +++ b/source/blender/imbuf/SConscript @@ -13,10 +13,6 @@ incs += ' ' + env['BF_ZLIB_INC'] defs = [] -if env['WITH_BF_VERSE']: - defs.append('WITH_VERSE') - incs += ' ' + env['BF_VERSE_INCLUDE'] - if env['WITH_BF_OPENEXR']: defs.append('WITH_OPENEXR') @@ -39,4 +35,4 @@ if env['WITH_BF_QUICKTIME']: incs += ' ../quicktime ' + env['BF_QUICKTIME_INC'] defs.append('WITH_QUICKTIME') -env.BlenderLib ( libname = 'bf_imbuf', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [80, 40] ) +env.BlenderLib ( libname = 'bf_imbuf', sources = sources, includes = Split(incs), defines = defs, libtype=['core'], priority = [190] ) diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c index ad7b1dce2e0..b561f0a583d 100644 --- a/source/blender/imbuf/intern/allocimbuf.c +++ b/source/blender/imbuf/intern/allocimbuf.c @@ -93,6 +93,10 @@ void imb_freerectImBuf(struct ImBuf * ibuf) { if (ibuf==NULL) return; + if (ibuf->crect && ibuf->crect != ibuf->rect) { + MEM_freeN(ibuf->crect); + } + if (ibuf->rect) { if (ibuf->mall & IB_rect) { MEM_freeN(ibuf->rect); @@ -102,6 +106,7 @@ void imb_freerectImBuf(struct ImBuf * ibuf) imb_freemipmapImBuf(ibuf); ibuf->rect= NULL; + ibuf->crect= NULL; ibuf->mall &= ~IB_rect; } diff --git a/source/blender/imbuf/intern/amiga.c b/source/blender/imbuf/intern/amiga.c index 534e4945aa3..f84740826ae 100644 --- a/source/blender/imbuf/intern/amiga.c +++ b/source/blender/imbuf/intern/amiga.c @@ -532,7 +532,7 @@ struct ImBuf *imb_loadamiga(int *iffmem,int flags) if (ibuf) { if (ibuf->rect) - if (G.order == B_ENDIAN) IMB_convert_rgba_to_abgr(ibuf); + if (ENDIAN_ORDER == B_ENDIAN) IMB_convert_rgba_to_abgr(ibuf); } return (ibuf); diff --git a/source/blender/imbuf/intern/anim.c b/source/blender/imbuf/intern/anim.c index 3e09eb5e306..a2dbdfbe483 100644 --- a/source/blender/imbuf/intern/anim.c +++ b/source/blender/imbuf/intern/anim.c @@ -778,7 +778,7 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) { } } - if (G.order == B_ENDIAN) { + if (ENDIAN_ORDER == B_ENDIAN) { int * dstStride = anim->pFrameRGB->linesize; uint8_t** dst = anim->pFrameRGB->data; diff --git a/source/blender/imbuf/intern/cineon/SConscript b/source/blender/imbuf/intern/cineon/SConscript index 7bfaa8dbdf2..ef9c44b85c8 100644 --- a/source/blender/imbuf/intern/cineon/SConscript +++ b/source/blender/imbuf/intern/cineon/SConscript @@ -13,5 +13,5 @@ incs = ['.', '../../../makesdna'] defs = [] - -env.BlenderLib ('bf_cineon', source_files, incs, defs, libtype=['core','player'], priority = [90, 200]) + +env.BlenderLib ('bf_cineon', source_files, incs, defs, libtype=['core','player'], priority = [220, 75]) diff --git a/source/blender/imbuf/intern/cineon/cineon_dpx.c b/source/blender/imbuf/intern/cineon/cineon_dpx.c index 203eb8fe314..45f23d34405 100644 --- a/source/blender/imbuf/intern/cineon/cineon_dpx.c +++ b/source/blender/imbuf/intern/cineon/cineon_dpx.c @@ -40,18 +40,22 @@ #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" -#include "MEM_guardedalloc.h" - -/* ugly bad level, should be fixed */ -#include "DNA_scene_types.h" #include "BKE_global.h" +#include "MEM_guardedalloc.h" + static void cineon_conversion_parameters(LogImageByteConversionParameters *params) { - params->blackPoint = G.scene?G.scene->r.cineonblack:95; - params->whitePoint = G.scene?G.scene->r.cineonwhite:685; - params->gamma = G.scene?G.scene->r.cineongamma:1.7f; - params->doLogarithm = G.scene?G.scene->r.subimtype & R_CINEON_LOG:0; +// params->blackPoint = scene?scene->r.cineonblack:95; +// params->whitePoint = scene?scene->r.cineonwhite:685; +// params->gamma = scene?scene->r.cineongamma:1.7f; +// params->doLogarithm = scene?scene->r.subimtype & R_CINEON_LOG:0; + + params->blackPoint = 95; + params->whitePoint = 685; + params->gamma = 1.7f; + params->doLogarithm = 0; + } static struct ImBuf *imb_load_dpx_cineon(unsigned char *mem, int use_cineon, int size, int flags) diff --git a/source/blender/imbuf/intern/cineon/cineonlib.c b/source/blender/imbuf/intern/cineon/cineonlib.c index 75516bbf3ae..85b7ef0d5e9 100644 --- a/source/blender/imbuf/intern/cineon/cineonlib.c +++ b/source/blender/imbuf/intern/cineon/cineonlib.c @@ -558,7 +558,7 @@ cineonOpen(const char* filename) { cineon->pixelBuffer = malloc(cineon->lineBufferLength * 3 * sizeof(unsigned short)); if (cineon->pixelBuffer == 0) { if (verbose) d_printf("Couldn't malloc pixel buffer of size %d\n", - (cineon->width * cineon->depth) * sizeof(unsigned short)); + (cineon->width * cineon->depth) * (int)sizeof(unsigned short)); cineonClose(cineon); return 0; } @@ -658,7 +658,7 @@ cineonOpenFromMem(unsigned char *mem, unsigned int size) { cineon->pixelBuffer = malloc(cineon->lineBufferLength * 3 * sizeof(unsigned short)); if (cineon->pixelBuffer == 0) { if (verbose) d_printf("Couldn't malloc pixel buffer of size %d\n", - (cineon->width * cineon->depth) * sizeof(unsigned short)); + (cineon->width * cineon->depth) * (int)sizeof(unsigned short)); cineonClose(cineon); return 0; } @@ -744,7 +744,7 @@ cineonCreate(const char* filename, int width, int height, int depth) { cineon->pixelBuffer = malloc(cineon->lineBufferLength * 3 * sizeof(unsigned short)); if (cineon->pixelBuffer == 0) { if (verbose) d_printf("Couldn't malloc pixel buffer of size %d\n", - (cineon->width * cineon->depth) * sizeof(unsigned short)); + (cineon->width * cineon->depth) * (int)sizeof(unsigned short)); cineonClose(cineon); return 0; } diff --git a/source/blender/imbuf/intern/cineon/dpxlib.c b/source/blender/imbuf/intern/cineon/dpxlib.c index 37e7ef3fc33..8459eb0f989 100644 --- a/source/blender/imbuf/intern/cineon/dpxlib.c +++ b/source/blender/imbuf/intern/cineon/dpxlib.c @@ -240,7 +240,7 @@ dpxGetRowBytes(DpxFile* dpx, unsigned short* row, int y) { /* read enough longwords */ readLongs = pixelsToLongs(numPixels - dpx->pixelBufferUsed); if (logimage_fread(dpx->lineBuffer, 4, readLongs, dpx) != readLongs) { - if (verbose) d_printf("Couldn't read line %d length %d\n", y, readLongs * 4); + if (verbose) d_printf("Couldn't read line %d length %d\n", y, (int)readLongs * 4); return 1; } ++dpx->fileYPos; @@ -352,7 +352,7 @@ dpxSetRowBytes(DpxFile* dpx, const unsigned short* row, int y) { /* write them */ if (fwrite(dpx->lineBuffer, 4, writeLongs, dpx->file) != writeLongs) { - if (verbose) d_printf("Couldn't write line %d length %d\n", y, writeLongs * 4); + if (verbose) d_printf("Couldn't write line %d length %d\n", y, (int)writeLongs * 4); return 1; } ++dpx->fileYPos; @@ -462,7 +462,7 @@ intern_dpxOpen(int mode, const char* bytestuff, int bufsize) { dpx->pixelBuffer = malloc((dpx->lineBufferLength * 3 + 2) * sizeof(unsigned short)); if (dpx->pixelBuffer == 0) { if (verbose) d_printf("Couldn't malloc pixel buffer of size %d\n", - (dpx->width * dpx->depth + 2 + 2) * sizeof(unsigned short)); + (dpx->width * dpx->depth + 2 + 2) * (int)sizeof(unsigned short)); dpxClose(dpx); return 0; } @@ -604,7 +604,7 @@ dpxCreate(const char* filename, int width, int height, int depth) { dpx->pixelBuffer = malloc((dpx->lineBufferLength * 3 + 2) * sizeof(unsigned short)); if (dpx->pixelBuffer == 0) { if (verbose) d_printf("Couldn't malloc pixel buffer of size %d\n", - (dpx->width * dpx->depth + 2 + 2) * sizeof(unsigned short)); + (dpx->width * dpx->depth + 2 + 2) * (int)sizeof(unsigned short)); dpxClose(dpx); return 0; } diff --git a/source/blender/imbuf/intern/dds/SConscript b/source/blender/imbuf/intern/dds/SConscript index d005bae02be..cec6023648b 100644 --- a/source/blender/imbuf/intern/dds/SConscript +++ b/source/blender/imbuf/intern/dds/SConscript @@ -16,4 +16,4 @@ incs = ['.', defs = ['WITH_DDS'] -env.BlenderLib ('bf_dds', source_files, incs, defs, libtype=['core','player'], priority = [90, 200]) +env.BlenderLib ('bf_dds', source_files, incs, defs, libtype=['core','player'], priority = [230, 105]) diff --git a/source/blender/imbuf/intern/openexr/SConscript b/source/blender/imbuf/intern/openexr/SConscript index 1b0a0ed6110..aa166a1983c 100644 --- a/source/blender/imbuf/intern/openexr/SConscript +++ b/source/blender/imbuf/intern/openexr/SConscript @@ -14,5 +14,5 @@ incs = ['.', incs += Split(env['BF_OPENEXR_INC']) defs = [] - -env.BlenderLib ('bf_openexr', source_files, incs, defs, libtype=['core','player'], priority = [90, 200]) + +env.BlenderLib ('bf_openexr', source_files, incs, defs, libtype=['core','player'], priority = [225, 85]) diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c index 718b0537b48..86ca43824f3 100644 --- a/source/blender/imbuf/intern/thumbs.c +++ b/source/blender/imbuf/intern/thumbs.c @@ -27,9 +27,10 @@ * ***** END GPL LICENSE BLOCK ***** */ -/* also defined in BKE_utildefines, repeated here to avoid dependency */ -#define FILE_MAX 240 +#include <stdio.h> +#include "BKE_global.h" +#include "BKE_utildefines.h" #include "BLI_blenlib.h" #include "MEM_guardedalloc.h" @@ -231,6 +232,16 @@ static int thumbpath_from_uri(const char* uri, char* path, ThumbSize size) return rv; } +void IMB_thumb_makedirs() +{ + char tpath[FILE_MAX]; + if (get_thumb_dir(tpath, THB_NORMAL)) { + BLI_recurdir_fileops(tpath); + } + if (get_thumb_dir(tpath, THB_FAIL)) { + BLI_recurdir_fileops(tpath); + } +} /* create thumbnail for file and returns new imbuf for thumbnail */ ImBuf* IMB_thumb_create(const char* dir, const char* file, ThumbSize size, ThumbSource source) diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c index 194082d3e19..b2465d6cc2f 100644 --- a/source/blender/imbuf/intern/tiff.c +++ b/source/blender/imbuf/intern/tiff.c @@ -410,7 +410,7 @@ struct ImBuf *imb_loadtiff(unsigned char *mem, int size, int flags) /* close the client layer interface to the in-memory file */ libtiff_TIFFClose(image); - if (G.order == B_ENDIAN) IMB_convert_rgba_to_abgr(ibuf); + if (ENDIAN_ORDER == B_ENDIAN) IMB_convert_rgba_to_abgr(ibuf); /* return successfully */ return (ibuf); diff --git a/source/blender/imbuf/intern/writeimage.c b/source/blender/imbuf/intern/writeimage.c index 5df0595d97f..7e1120bf3e4 100644 --- a/source/blender/imbuf/intern/writeimage.c +++ b/source/blender/imbuf/intern/writeimage.c @@ -33,6 +33,8 @@ #include <io.h> #endif +#include <stdio.h> + #include "BKE_global.h" #include "BLI_blenlib.h" |