LCMS code removed, was an experiment but never finished.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 16 May 2011 13:34:42 +0000 (13:34 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 16 May 2011 13:34:42 +0000 (13:34 +0000)
21 files changed:
CMakeLists.txt
build_files/cmake/macros.cmake
build_files/scons/config/win32-vc-config.py
build_files/scons/config/win64-vc-config.py
build_files/scons/tools/Blender.py
build_files/scons/tools/btools.py
source/blender/blenkernel/BKE_colortools.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/SConscript
source/blender/blenkernel/intern/colortools.c
source/blender/editors/space_image/CMakeLists.txt
source/blender/editors/space_image/SConscript
source/blender/editors/space_image/image_draw.c
source/blender/imbuf/CMakeLists.txt
source/blender/imbuf/IMB_imbuf_types.h
source/blender/imbuf/SConscript
source/blender/imbuf/intern/allocimbuf.c
source/blender/makesrna/SConscript
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/SConscript
source/blender/makesrna/intern/rna_space.c

index 4304686..83e6705 100644 (file)
@@ -202,9 +202,6 @@ if(APPLE)
        option(WITH_LIBS10.5  "Use 10.5 libs (needed for 64bit builds)" OFF)
 endif()
 
-# only for developers who want to make this functional
-# option(WITH_LCMS          "Enable color correction with lcms" OFF)
-
 if(NOT WITH_GAMEENGINE AND WITH_PLAYER)
        message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
 endif()
@@ -379,13 +376,6 @@ if(UNIX AND NOT APPLE)
 
        find_package(ZLIB REQUIRED)
 
-       if(WITH_LCMS)
-               set(LCMS /usr CACHE FILEPATH "LCMS directory")
-               set(LCMS_INCLUDE_DIR ${LCMS}/include)
-               set(LCMS_LIBRARY lcms)
-               set(LCMS_LIBPATH ${LCMS}/lib)
-       endif()
-
        if(WITH_CODEC_FFMPEG)
                set(FFMPEG /usr CACHE FILEPATH "FFMPEG Directory")
                mark_as_advanced(FFMPEG)
@@ -640,14 +630,7 @@ elseif(WIN32)
                        set(OPENCOLLADA_LIB OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser xml2 buffer ftoa UTF)
                        set(PCRE_LIB pcre)
                endif()
-               
-               if(WITH_LCMS)
-                       set(LCMS ${LIBDIR}/lcms)
-                       set(LCMS_INCLUDE_DIR ${LCMS}/include)
-                       set(LCMS_LIBPATH ${LCMS}/lib)
-                       set(LCMS_LIB lcms)
-               endif()
-
+       
                if(WITH_CODEC_FFMPEG)
                        set(FFMPEG ${LIBDIR}/ffmpeg)
                        set(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include/msvc)
@@ -910,13 +893,6 @@ elseif(APPLE)
                set(OPENEXR_LIBPATH ${OPENEXR}/lib)
        endif()
 
-       if(WITH_LCMS)
-               set(LCMS ${LIBDIR}/lcms)
-               set(LCMS_INCLUDE_DIR ${LCMS}/include)
-               set(LCMS_LIBRARY lcms)
-               set(LCMS_LIBPATH ${LCMS}/lib)
-       endif()
-
        if(WITH_CODEC_FFMPEG)
                set(FFMPEG ${LIBDIR}/ffmpeg)
                set(FFMPEG_INC ${FFMPEG}/include)
index 8a1f687..14bed88 100644 (file)
@@ -88,9 +88,6 @@ macro(SETUP_LIBDIRS)
        if(WITH_IMAGE_OPENJPEG AND UNIX AND NOT APPLE)
                link_directories(${OPENJPEG_LIBPATH})
        endif()
-       if(WITH_LCMS)
-               link_directories(${LCMS_LIBPATH})
-       endif()
        if(WITH_CODEC_QUICKTIME)
                link_directories(${QUICKTIME_LIBPATH})
        endif()
@@ -193,9 +190,6 @@ macro(setup_liblinks
        if(WITH_IMAGE_OPENJPEG AND UNIX AND NOT APPLE)
                target_link_libraries(${target} ${OPENJPEG_LIB})
        endif()
-       if(WITH_LCMS)
-               target_link_libraries(${target} ${LCMS_LIBRARY})
-       endif()
        if(WITH_CODEC_FFMPEG)
                target_link_libraries(${target} ${FFMPEG_LIB})
        endif()
@@ -217,12 +211,6 @@ macro(setup_liblinks
                        target_link_libraries(${target} ${EXPAT_LIB})
                endif()
        endif()
-       if(WITH_LCMS)
-               if(WIN32 AND NOT UNIX)
-                       target_link_libraries(${target} debug ${LCMS_LIB}_d)
-                       target_link_libraries(${target} optimized ${LCMS_LIB})
-               endif()
-       endif()
        if(WITH_MEM_JEMALLOC)
                target_link_libraries(${target} ${JEMALLOC_LIBRARY})
        endif()
index eeb50a9..65076be 100644 (file)
@@ -149,12 +149,6 @@ BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
 BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml2 pcre buffer ftoa UTF'
 BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
 
-WITH_BF_LCMS = False
-BF_LCMS = LIBDIR + '/lcms'
-BF_LCMS_INC = '${BF_LCMS}/include'
-BF_LCMS_LIB = 'lcms'
-BF_LCMS_LIBPATH = '${BF_LCMS}/lib'
-
 #Ray trace optimization
 WITH_BF_RAYOPTIMIZATION = True
 BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE']
index 2dcbe8a..2c99094 100644 (file)
@@ -151,12 +151,6 @@ BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
 BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml2 pcre buffer ftoa UTF'
 BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
 
-WITH_BF_LCMS = False
-BF_LCMS = LIBDIR + '/lcms'
-BF_LCMS_INC = '${BF_LCMS}/include'
-BF_LCMS_LIB = 'lcms'
-BF_LCMS_LIBPATH = '${BF_LCMS}/lib'
-
 #Ray trace optimization
 WITH_BF_RAYOPTIMIZATION = True
 BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE','/arch:SSE2']
index 90c2c35..4bfa185 100644 (file)
@@ -148,8 +148,6 @@ def setup_staticlibs(lenv):
         libincs += Split(lenv['BF_OPENEXR_LIBPATH'])
         if lenv['WITH_BF_STATICOPENEXR']:
             statlibs += Split(lenv['BF_OPENEXR_LIB_STATIC'])
-    if lenv['WITH_BF_LCMS']:
-        libincs += Split(lenv['BF_LCMS_LIBPATH'])
     if lenv['WITH_BF_TIFF']:
         libincs += Split(lenv['BF_TIFF_LIBPATH'])
         if lenv['WITH_BF_STATICTIFF']:
@@ -258,8 +256,6 @@ def setup_syslibs(lenv):
         syslibs += Split(lenv['BF_OPENGL_LIB'])
     if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw','linuxcross', 'win64-vc'):
         syslibs += Split(lenv['BF_PTHREADS_LIB'])
-    if lenv['WITH_BF_LCMS']:
-        syslibs.append(lenv['BF_LCMS_LIB'])
     if lenv['WITH_BF_COLLADA']:
         syslibs.append(lenv['BF_PCRE_LIB'])
         syslibs += Split(lenv['BF_OPENCOLLADA_LIB'])
index fda88d7..fe6b092 100644 (file)
@@ -125,7 +125,6 @@ def validate_arguments(args, bc):
             'BF_FANCY', 'BF_QUIET', 'BF_LINE_OVERWRITE',
             'BF_X264_CONFIG',
             'BF_XVIDCORE_CONFIG',
-            'WITH_BF_LCMS', 'BF_LCMS', 'BF_LCMS_INC', 'BF_LCMS_LIB', 'BF_LCMS_LIBPATH',
             'WITH_BF_DOCS',
             'BF_NUMJOBS',
             'BF_MSVS',
@@ -334,12 +333,6 @@ def read_opts(env, cfg, args):
         ('BF_TIFF_LIBPATH', 'TIFF library path', ''),
         ('BF_TIFF_LIB_STATIC', 'TIFF static library', ''),
 
-        (BoolVariable('WITH_BF_LCMS', 'Enable color correction with lcms', False)),
-        ('BF_LCMS', 'LCMS base path', ''),
-        ('BF_LCMS_INC', 'LCMS include path', ''),
-        ('BF_LCMS_LIB', 'LCMS library', ''),
-        ('BF_LCMS_LIBPATH', 'LCMS library path', ''),
-
         (BoolVariable('WITH_BF_ZLIB', 'Use ZLib if true', True)),
         (BoolVariable('WITH_BF_STATICZLIB', 'Staticly link to ZLib', False)),
         ('BF_ZLIB', 'ZLib base path', ''),
index b370985..744ed9d 100644 (file)
@@ -78,7 +78,6 @@ void                          curvemapping_premultiply(struct CurveMapping *cumap, int restore);
 int                                    curvemapping_RGBA_does_something(struct CurveMapping *cumap);
 void                           curvemapping_initialize(struct CurveMapping *cumap);
 void                           curvemapping_table_RGBA(struct CurveMapping *cumap, float **array, int *size);
-void                           colorcorrection_do_ibuf(struct ImBuf *ibuf, const char *profile);
 
 void                           scopes_update(struct Scopes *scopes, struct ImBuf *ibuf, int use_color_management);
 void                           scopes_free(struct Scopes *scopes);
index b7976c4..2831636 100644 (file)
@@ -277,11 +277,6 @@ if(WITH_CODEC_FFMPEG)
        add_definitions(-DWITH_FFMPEG)
 endif()
 
-if(WITH_LCMS)
-       list(APPEND INC ${LCMS_INCLUDE_DIR})
-       add_definitions(-DWITH_LCMS)
-endif()
-
 if(WITH_PYTHON)
        list(APPEND INC ../python ${PYTHON_INCLUDE_DIRS})
        add_definitions(-DWITH_PYTHON)
index dc327ab..ea19b51 100644 (file)
@@ -78,10 +78,6 @@ if env['OURPLATFORM'] == 'darwin':
 if env['BF_NO_ELBEEM']:
     defs.append('DISABLE_ELBEEM')
 
-if env['WITH_BF_LCMS']:
-    defs.append('WITH_LCMS')
-    incs += ' ' + env['BF_LCMS_INC']
-
 if env['WITH_BF_LZO']:
     incs += ' #/extern/lzo/minilzo'
     defs.append('WITH_LZO')
index 1d7481b..9a6c2cc 100644 (file)
 #include <stdlib.h>
 #include <float.h>
 
-#ifdef WITH_LCMS
-#include <lcms.h>
-#endif
-
 #include "MEM_guardedalloc.h"
 
 #include "DNA_color_types.h"
@@ -789,60 +785,6 @@ void curvemapping_evaluate_premulRGBF(CurveMapping *cumap, float *vecout, const
 }
 
 
-#ifdef WITH_LCMS
-/* basic error handler, if we dont do this blender will exit */
-static int ErrorReportingFunction(int ErrorCode, const char *ErrorText)
-{
-       fprintf(stderr, "%s:%d\n", ErrorText, ErrorCode);
-       return 1;
-}
-#endif
-
-void colorcorrection_do_ibuf(ImBuf *ibuf, const char *profile)
-{
-#ifdef WITH_LCMS
-       if (ibuf->crect == NULL)
-       {
-               cmsHPROFILE proofingProfile;
-               
-               /* TODO, move to initialization area of code */
-               //cmsSetLogErrorHandler(ErrorReportingFunction);
-               cmsSetErrorHandler(ErrorReportingFunction);
-               
-               /* will return NULL if the file isn't fount */
-               proofingProfile = cmsOpenProfileFromFile(profile, "r");
-
-               cmsErrorAction(LCMS_ERROR_SHOW);
-
-               if(proofingProfile) {
-                       cmsHPROFILE imageProfile;
-                       cmsHTRANSFORM hTransform;
-
-                       ibuf->crect = MEM_mallocN(ibuf->x*ibuf->y*sizeof(int), "imbuf crect");
-
-                       imageProfile  = cmsCreate_sRGBProfile();
-
-
-                       hTransform = cmsCreateProofingTransform(imageProfile, TYPE_RGBA_8, imageProfile, TYPE_RGBA_8, 
-                                                                                                 proofingProfile,
-                                                                                                 INTENT_ABSOLUTE_COLORIMETRIC,
-                                                                                                 INTENT_ABSOLUTE_COLORIMETRIC,
-                                                                                                 cmsFLAGS_SOFTPROOFING);
-               
-                       cmsDoTransform(hTransform, ibuf->rect, ibuf->crect, ibuf->x * ibuf->y);
-
-                       cmsDeleteTransform(hTransform);
-                       cmsCloseProfile(imageProfile);
-                       cmsCloseProfile(proofingProfile);
-               }
-       }
-#else
-       /* unused */
-       (void)ibuf;
-       (void)profile;
-#endif
-}
-
 /* only used for image editor curves */
 void curvemapping_do_ibuf(CurveMapping *cumap, ImBuf *ibuf)
 {
index 8e73b1b..286f1f3 100644 (file)
@@ -59,9 +59,4 @@ if(WITH_IMAGE_CINEON)
        add_definitions(-DWITH_CINEON)
 endif()
 
-if(WITH_LCMS)
-       set(INC ${INC} ${LCMS_INCLUDE_DIR})
-       add_definitions(-DWITH_LCMS)
-endif()
-
 blender_add_lib(bf_editor_space_image "${SRC}" "${INC}")
index e84afcd..27696e3 100644 (file)
@@ -9,9 +9,6 @@ incs += ' ../../render/extern/include ../../makesrna ../../blenloader'
 
 defs = []
 
-if env['WITH_BF_LCMS']:
-    defs.append('WITH_LCMS')
-    incs += ' ' + env['BF_LCMS_INC']
 if env['WITH_BF_OPENEXR']:
     defs.append('WITH_OPENEXR')
 if env['WITH_BF_OPENJPEG']:
index 4cdac36..1123597 100644 (file)
 #include "BKE_image.h"
 #include "BKE_paint.h"
 
-#ifdef WITH_LCMS
-#include "BKE_colortools.h"
-#endif
-
 #include "BIF_gl.h"
 #include "BIF_glutil.h"
 
@@ -452,20 +448,6 @@ static void sima_draw_alpha_pixelsf(float x1, float y1, int rectx, int recty, fl
 //     glColorMask(1, 1, 1, 1);
 }
 
-#ifdef WITH_LCMS
-static int sima_draw_colorcorrected_pixels(float x1, float y1, ImBuf *ibuf)
-{
-       colorcorrection_do_ibuf(ibuf, "MONOSCNR.ICM"); /* path is hardcoded here, find some place better */
-
-       if(ibuf->crect) {
-               glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->crect);
-               return 1;
-       }
-
-       return 0;
-}
-#endif
-
 static void sima_draw_zbuf_pixels(float x1, float y1, int rectx, int recty, int *recti)
 {
        /* zbuffer values are signed, so we need to shift color range */
@@ -544,17 +526,6 @@ static void draw_image_buffer(SpaceImage *sima, ARegion *ar, Scene *scene, Image
                else if(ibuf->channels==1)
                        sima_draw_zbuffloat_pixels(scene, x, y, ibuf->x, ibuf->y, ibuf->rect_float);
        }
-#ifdef WITH_LCMS
-       else if(sima->flag & SI_COLOR_CORRECTION) {
-               image_verify_buffer_float(ima, ibuf, color_manage);
-               
-               if(sima_draw_colorcorrected_pixels(x, y, ibuf)==0) {
-                       unsigned char col1[3]= {100, 0, 100}, col2[3]= {160, 0, 160}; /* pink says 'warning' in blender land */
-                       sima_draw_alpha_backdrop(x, y, ibuf->x, ibuf->y, zoomx, zoomy, col1, col2);
-               }
-
-       }
-#endif
        else {
                if(sima->flag & SI_USE_ALPHA) {
                        unsigned char col1[3]= {100, 100, 100}, col2[3]= {160, 160, 160};
index 24f0409..6404ae3 100644 (file)
@@ -146,8 +146,4 @@ 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 5717a92..f5e2bf7 100644 (file)
@@ -88,11 +88,6 @@ typedef struct ImBuf {
                                                        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
-
        /* resolution - pixels per meter */
        double ppm[2];
 
index 59b938c..ecb9a89 100644 (file)
@@ -48,7 +48,4 @@ 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 91583f0..5977277 100644 (file)
@@ -85,12 +85,6 @@ 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;
index 86ba81a..b706db5 100644 (file)
@@ -42,10 +42,6 @@ if env['WITH_BF_QUICKTIME']:
     defs.append('WITH_QUICKTIME')
     incs += ' ../quicktime'
 
-if env['WITH_BF_LCMS']:
-    defs.append('WITH_LCMS')
-    incs += ' ' + env['BF_LCMS_INC']
-    
 if env['WITH_BF_GAMEENGINE']:
     defs.append('WITH_GAMEENGINE')
 
index 350ca9f..79edb91 100644 (file)
@@ -175,11 +175,6 @@ if(WITH_CODEC_FFMPEG)
        add_definitions(-DWITH_FFMPEG)
 endif()
 
-if(WITH_LCMS)
-       list(APPEND INC ${LCMS_INCLUDE_DIR})
-       add_definitions(-DWITH_LCMS)
-endif()
-
 if(NOT WITH_MOD_FLUID)
        add_definitions(-DDISABLE_ELBEEM)
 endif()
index c48b479..421c3a6 100644 (file)
@@ -65,9 +65,6 @@ if env['WITH_BF_QUICKTIME']:
     defs.append('WITH_QUICKTIME')
     incs += ' ../../quicktime'
 
-if env['WITH_BF_LCMS']:
-    defs.append('WITH_LCMS')
-
 if env['WITH_BF_GAMEENGINE']:
     defs.append('WITH_GAMEENGINE')
     
index d8ae0f3..a9bcabf 100644 (file)
@@ -76,9 +76,6 @@ static EnumPropertyItem draw_channels_items[] = {
        {SI_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", "Draw image with RGB colors and alpha transparency"},
        {SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"},
        {SI_SHOW_ZBUF, "Z_BUFFER", ICON_IMAGE_ZDEPTH, "Z-Buffer", "Draw Z-buffer associated with image (mapped from camera clip start to end)"},
-#ifdef WITH_LCMS
-       {SI_COLOR_CORRECTION, "COLOR_CORRECTED", ICON_IMAGE_ALPHA, "Color Corrected", "Display color corrected image"},
-#endif
        {0, NULL, 0, NULL, NULL}};
 
 static EnumPropertyItem transform_orientation_items[] = {
@@ -498,10 +495,6 @@ static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *C, P
                RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ZBUF);
        }
 
-#ifdef WITH_LCMS
-       RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_COLOR_CORRECTION);
-#endif
-
        RNA_enum_item_end(&item, &totitem);
        *free= 1;