diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 2ab9caa59..f7ce7bbb5 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -1133,14 +1133,13 @@ void Crop::update(int todo) show = 1; } - #ifdef _OPENMP #pragma omp parallel for #endif for (int x = 0; x < labnCrop->H; x++) for (int y = 0; y < labnCrop->W; y++) { - labnCrop->L[x][y] = (1.f + mL0) * (unshar->L[x][y]) + show * background - mL * indic * labnCrop->L[x][y]; + labnCrop->L[x][y] = LIM((1.f + mL0) * (unshar->L[x][y]) + show * background - mL * indic * labnCrop->L[x][y], 0.f, 32768.f); labnCrop->a[x][y] = (1.f + mC0) * (unshar->a[x][y]) - mC * indic * labnCrop->a[x][y]; labnCrop->b[x][y] = (1.f + mC0) * (unshar->b[x][y]) - mC * indic * labnCrop->b[x][y]; } diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index d04a29518..d746ff9c6 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -1024,7 +1024,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) for (int x = 0; x < pH; x++) for (int y = 0; y < pW; y++) { - nprevl->L[x][y] = (1.f + mL0) * (unshar->L[x][y]) + show * background - mL * indic * nprevl->L[x][y]; + nprevl->L[x][y] = LIM((1.f + mL0) * (unshar->L[x][y]) + show * background - mL * indic * nprevl->L[x][y], 0.f, 32768.f); nprevl->a[x][y] = (1.f + mC0) * (unshar->a[x][y]) - mC * indic * nprevl->a[x][y]; nprevl->b[x][y] = (1.f + mC0) * (unshar->b[x][y]) - mC * indic * nprevl->b[x][y]; } diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 9311d2736..b7d807808 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -1265,7 +1265,7 @@ private: for (int x = 0; x < fh; x++) for (int y = 0; y < fw; y++) { - labView->L[x][y] = (1.f + mL0) * (unshar->L[x][y]) - mL * labView->L[x][y]; + labView->L[x][y] = LIM((1.f + mL0) * (unshar->L[x][y]) - mL * labView->L[x][y], 0.f, 32768.f); labView->a[x][y] = (1.f + mC0) * (unshar->a[x][y]) - mC * labView->a[x][y]; labView->b[x][y] = (1.f + mC0) * (unshar->b[x][y]) - mC * labView->b[x][y]; }