improve stability for ICC storage and avoid race conditions.

preparation step 1 for making dcraw multithread safe.
This commit is contained in:
Steve Herrell
2010-10-28 17:31:05 +02:00
parent 6770a2c4a0
commit d22d77c507
9 changed files with 60 additions and 32 deletions

View File

@@ -114,10 +114,10 @@ Image8* ImProcFunctions::lab2rgb (LabImage* lab, int cx, int cy, int cw, int ch,
Image8* image = new Image8 (cw, ch);
cmsHPROFILE oprof = iccStore.getProfile (profile);
cmsHPROFILE oprof = iccStore->getProfile (profile);
if (oprof) {
cmsHPROFILE iprof = iccStore.getXYZProfile ();
cmsHPROFILE iprof = iccStore->getXYZProfile ();
lcmsMutex->lock ();
cmsHTRANSFORM hTransform = cmsCreateTransform (iprof, TYPE_RGB_16, oprof, TYPE_RGB_8, settings->colorimetricIntent, 0);
lcmsMutex->unlock ();
@@ -193,7 +193,7 @@ Image16* ImProcFunctions::lab2rgb16 (LabImage* lab, int cx, int cy, int cw, int
Image16* image = new Image16 (cw, ch);
cmsHPROFILE oprof = iccStore.getProfile (profile);
cmsHPROFILE oprof = iccStore->getProfile (profile);
if (oprof) {
#pragma omp parallel for if (multiThread)
@@ -222,7 +222,7 @@ Image16* ImProcFunctions::lab2rgb16 (LabImage* lab, int cx, int cy, int cw, int
za[j-cx] = CLIP(z_);
}
}
cmsHPROFILE iprof = iccStore.getXYZProfile ();
cmsHPROFILE iprof = iccStore->getXYZProfile ();
lcmsMutex->lock ();
cmsHTRANSFORM hTransform = cmsCreateTransform (iprof, TYPE_RGB_16_PLANAR, oprof, TYPE_RGB_16_PLANAR, settings->colorimetricIntent, 0);
lcmsMutex->unlock ();