LCMS code removed, was an experiment but never finished.
[blender.git] / source / blender / blenkernel / intern / colortools.c
index 1d7481b365a472601a391f229741926e985c7876..9a6c2cc7e311b46b07a6bd4f564711ded0400400 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)
 {