From e6196158efa107261eea89eaa6cee80c296b7829 Mon Sep 17 00:00:00 2001 From: Oliver Duis Date: Sat, 9 Apr 2011 23:48:05 +0200 Subject: [PATCH] Fixed the weird colors in clipped region in thumbs (hopefully) --- rtengine/rawimagesource.cc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index fc5869974..6263e5033 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -1679,13 +1679,18 @@ void RawImageSource::colorSpaceConversion16 (Image16* im, ColorManagementParams if (inProfile=="(camera)" || inProfile=="" || (inProfile=="(embedded)" && !embedded)) { - // in this case we avoid using the slllllooooooowwww lcms - - // out = iccStore->workingSpace (wProfile); - // hTransform = cmsCreateTransform (in, TYPE_RGB_16_PLANAR, out, TYPE_RGB_16_PLANAR, settings->colorimetricIntent, cmsFLAGS_MATRIXINPUT | cmsFLAGS_MATRIXOUTPUT);//cmsFLAGS_MATRIXINPUT | cmsFLAGS_MATRIXOUTPUT); - // cmsDoTransform (hTransform, im->data, im->data, im->planestride/2); - // cmsDeleteTransform(hTransform); - TMatrix work = iccStore->workingSpaceInverseMatrix (cmp.working); + + out = iccStore->workingSpace (cmp.working); + + lcmsMutex->lock (); + cmsHTRANSFORM hTransform = cmsCreateTransform (in, TYPE_RGB_16_PLANAR, out, TYPE_RGB_16_PLANAR, settings->colorimetricIntent, cmsFLAGS_NOCACHE); //cmsFLAGS_MATRIXINPUT | cmsFLAGS_MATRIXOUTPUT);//cmsFLAGS_MATRIXINPUT | cmsFLAGS_MATRIXOUTPUT); + lcmsMutex->unlock (); + + im->ExecCMSTransform(hTransform); + cmsDeleteTransform(hTransform); +/* // TODO: This short cut does not work any more it seems. Because of + // in this case we avoid using the slllllooooooowwww lcms +TMatrix work = iccStore->workingSpaceInverseMatrix (cmp.working); double mat[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; for (int i=0; i<3; i++) for (int j=0; j<3; j++) @@ -1703,7 +1708,7 @@ void RawImageSource::colorSpaceConversion16 (Image16* im, ColorManagementParams im->r[i][j] = (newr); im->g[i][j] = (newg); im->b[i][j] = (newb); - } + }*/ } else { out = iccStore->workingSpace (cmp.working);