From 91bddf2b13c61644d60ce909123068609769fbf0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 13 May 2011 04:53:20 +0000 Subject: remove imbuf crect and profile_filename when building without LCMS --- source/blender/imbuf/CMakeLists.txt | 4 ++++ source/blender/imbuf/IMB_imbuf_types.h | 9 ++++++--- source/blender/imbuf/SConscript | 3 +++ source/blender/imbuf/intern/allocimbuf.c | 10 ++++++---- 4 files changed, 19 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt index 6404ae3de75..24f04098d0c 100644 --- a/source/blender/imbuf/CMakeLists.txt +++ b/source/blender/imbuf/CMakeLists.txt @@ -146,4 +146,8 @@ if(WITH_IMAGE_HDR) add_definitions(-DWITH_HDR) endif() +if(WITH_LCMS) + add_definitions(-DWITH_LCMS) +endif() + blender_add_lib(bf_imbuf "${SRC}" "${INC}") diff --git a/source/blender/imbuf/IMB_imbuf_types.h b/source/blender/imbuf/IMB_imbuf_types.h index 81512adf065..52afe2ed854 100644 --- a/source/blender/imbuf/IMB_imbuf_types.h +++ b/source/blender/imbuf/IMB_imbuf_types.h @@ -84,11 +84,15 @@ typedef struct ImBuf { /* pixels */ unsigned int *rect; /* pixel values stored here */ - unsigned int *crect; /* color corrected pixel values stored here */ float *rect_float; /* floating point Rect equivalent Linear RGB color space - may need gamma correction to sRGB when generating 8bit representations */ - + +#ifdef WITH_LCMS + unsigned int *crect; /* color corrected pixel values stored here */ + char profile_filename[256]; /* to be implemented properly, specific filename for custom profiles */ +#endif + /* tiled pixel storage */ int tilex, tiley; int xtiles, ytiles; @@ -101,7 +105,6 @@ typedef struct ImBuf { /* parameters used by conversion between byte and float */ float dither; /* random dither value, for conversion from float -> byte rect */ short profile; /* color space/profile preset that the byte rect buffer represents */ - char profile_filename[256]; /* to be implemented properly, specific filename for custom profiles */ /* mipmapping */ struct ImBuf *mipmap[IB_MIPMAP_LEVELS]; /* MipMap levels, a series of halved images */ diff --git a/source/blender/imbuf/SConscript b/source/blender/imbuf/SConscript index ecb9a89c274..59b938c3373 100644 --- a/source/blender/imbuf/SConscript +++ b/source/blender/imbuf/SConscript @@ -48,4 +48,7 @@ if env['WITH_BF_QUICKTIME']: incs += ' ../quicktime ' + env['BF_QUICKTIME_INC'] defs.append('WITH_QUICKTIME') +if env['WITH_BF_LCMS']: + defs.append('WITH_LCMS') + env.BlenderLib ( libname = 'bf_imbuf', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [185,115] ) diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c index a8b9e21331d..efa37aa1196 100644 --- a/source/blender/imbuf/intern/allocimbuf.c +++ b/source/blender/imbuf/intern/allocimbuf.c @@ -84,17 +84,19 @@ void imb_freerectfloatImBuf(ImBuf *ibuf) void imb_freerectImBuf(ImBuf *ibuf) { if(ibuf==NULL) return; - + +#ifdef WITH_LCMS if(ibuf->crect) MEM_freeN(ibuf->crect); + ibuf->crect= NULL; +#endif if(ibuf->rect && (ibuf->mall & IB_rect)) MEM_freeN(ibuf->rect); + ibuf->rect= NULL; imb_freemipmapImBuf(ibuf); - - ibuf->rect= NULL; - ibuf->crect= NULL; + ibuf->mall &= ~IB_rect; } -- cgit v1.2.3