LCMS2 threading
This commit is contained in:
@@ -160,7 +160,8 @@ void ImProcFunctions::firstAnalysis (Imagefloat* original, const ProcParams* par
|
|||||||
if (monitor) {
|
if (monitor) {
|
||||||
cmsHPROFILE iprof = iccStore->getXYZProfile ();
|
cmsHPROFILE iprof = iccStore->getXYZProfile ();
|
||||||
lcmsMutex->lock ();
|
lcmsMutex->lock ();
|
||||||
monitorTransform = cmsCreateTransform (iprof, TYPE_RGB_FLT, monitor, TYPE_RGB_8, settings->colorimetricIntent, cmsFLAGS_NOOPTIMIZE);
|
monitorTransform = cmsCreateTransform (iprof, TYPE_RGB_FLT, monitor, TYPE_RGB_8, settings->colorimetricIntent,
|
||||||
|
cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE ); // NOCACHE is important for thread safety
|
||||||
lcmsMutex->unlock ();
|
lcmsMutex->unlock ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -63,6 +63,9 @@ void ImProcFunctions::lab2rgb (LabImage* lab, Image8* image) {
|
|||||||
int ix = 0;
|
int ix = 0;
|
||||||
float g;
|
float g;
|
||||||
float* buffer = new float [3*lab->W];
|
float* buffer = new float [3*lab->W];
|
||||||
|
|
||||||
|
// cmsDoTransform is relatively expensive
|
||||||
|
#pragma omp parallel for if (multiThread)
|
||||||
for (int i=0; i<lab->H; i++) {
|
for (int i=0; i<lab->H; i++) {
|
||||||
float* rL = lab->L[i];
|
float* rL = lab->L[i];
|
||||||
float* ra = lab->a[i];
|
float* ra = lab->a[i];
|
||||||
@@ -134,11 +137,15 @@ Image8* ImProcFunctions::lab2rgb (LabImage* lab, int cx, int cy, int cw, int ch,
|
|||||||
if (oprof) {
|
if (oprof) {
|
||||||
cmsHPROFILE iprof = iccStore->getXYZProfile ();
|
cmsHPROFILE iprof = iccStore->getXYZProfile ();
|
||||||
lcmsMutex->lock ();
|
lcmsMutex->lock ();
|
||||||
cmsHTRANSFORM hTransform = cmsCreateTransform (iprof, TYPE_RGB_16, oprof, TYPE_RGB_8, settings->colorimetricIntent, cmsFLAGS_NOOPTIMIZE);
|
cmsHTRANSFORM hTransform = cmsCreateTransform (iprof, TYPE_RGB_16, oprof, TYPE_RGB_8, settings->colorimetricIntent,
|
||||||
|
cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE ); // NOCACHE is important for thread safety
|
||||||
lcmsMutex->unlock ();
|
lcmsMutex->unlock ();
|
||||||
int ix = 0;
|
int ix = 0;
|
||||||
float g;
|
float g;
|
||||||
short* buffer = new short [3*cw];
|
short* buffer = new short [3*cw];
|
||||||
|
|
||||||
|
// cmsDoTransform is relatively expensive
|
||||||
|
#pragma omp parallel for if (multiThread)
|
||||||
for (int i=cy; i<cy+ch; i++) {
|
for (int i=cy; i<cy+ch; i++) {
|
||||||
float* rL = lab->L[i];
|
float* rL = lab->L[i];
|
||||||
float* ra = lab->a[i];
|
float* ra = lab->a[i];
|
||||||
|
Reference in New Issue
Block a user