remove imbuf crect and profile_filename when building without LCMS
authorCampbell Barton <ideasman42@gmail.com>
Fri, 13 May 2011 04:53:20 +0000 (04:53 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 13 May 2011 04:53:20 +0000 (04:53 +0000)
source/blender/imbuf/CMakeLists.txt
source/blender/imbuf/IMB_imbuf_types.h
source/blender/imbuf/SConscript
source/blender/imbuf/intern/allocimbuf.c

index 6404ae3de75c3b6fa7c97401507b40d0c1e250ce..24f04098d0ca839b327505d7e0f1b837e2e37948 100644 (file)
@@ -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}")
index 81512adf065b685f74b858f2212f628cb2d086cd..52afe2ed8546a88a612a03ace85ff8bc64801fc9 100644 (file)
@@ -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 */
index ecb9a89c274d5fd2cd991cb3a7bed0c6e15c0a45..59b938c3373231cb83a084119574246cf64b63af 100644 (file)
@@ -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] )
index a8b9e21331dd26cd00e3d9417672c1461d1338a5..efa37aa119661128ffe296a2fe2a69471a7e8a0a 100644 (file)
@@ -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;
 }