diff --git a/rtdata/languages/default b/rtdata/languages/default index 564d69ac5..5bcf160a3 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2168,6 +2168,7 @@ TP_LOCALLAB_MERFOU;Multiply TP_LOCALLAB_MERFIV;Addition TP_LOCALLAB_MERSIX;Divide TP_LOCALLAB_MERSEV;Soft Light +TP_LOCALLAB_MERSEV2;Hard Light TP_LOCALLAB_MERHEI;Overlay TP_LOCALLAB_MERNIN;Screen TP_LOCALLAB_MERTEN;Darken only diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 18d3b419d..ec280fb9d 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -609,14 +609,16 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.mergecolMethod = 5; } else if (locallab.spots.at(sp).mergecolMethod == "sev") { lp.mergecolMethod = 6; - } else if (locallab.spots.at(sp).mergecolMethod == "hei") { + } else if (locallab.spots.at(sp).mergecolMethod == "sev2") { lp.mergecolMethod = 7; - } else if (locallab.spots.at(sp).mergecolMethod == "nin") { + } else if (locallab.spots.at(sp).mergecolMethod == "hei") { lp.mergecolMethod = 8; - } else if (locallab.spots.at(sp).mergecolMethod == "ten") { + } else if (locallab.spots.at(sp).mergecolMethod == "nin") { lp.mergecolMethod = 9; - } else if (locallab.spots.at(sp).mergecolMethod == "ele") { + } else if (locallab.spots.at(sp).mergecolMethod == "ten") { lp.mergecolMethod = 10; + } else if (locallab.spots.at(sp).mergecolMethod == "ele") { + lp.mergecolMethod = 11; } lp.opacol = 0.01f * locallab.spots.at(sp).opacol; @@ -11880,7 +11882,29 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } } - else if(lp.mergecolMethod == 7) {//overlay overlay (float &a, float &b) + else if(lp.mergecolMethod == 7) {//hard light overlay (float &b, float &a) +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + for (int y = 0; y < bfh ; y++) { + for (int x = 0; x < bfw; x++) { + float a = tmpImageorig->r(y, x); + float b = tmpImagereserv->r(y, x); + overlay(b, a); + tmpImageorig->r(y, x) = lp.opacol * LIM(a, 0.f, 2.f) + (1.f - lp.opacol) * tmpImageorig->r(y, x); + a = tmpImageorig->g(y, x); + b = tmpImagereserv->g(y, x); + overlay(b, a); + tmpImageorig->g(y, x) = lp.opacol * LIM(a, 0.f, 2.f) + (1.f - lp.opacol) * tmpImageorig->g(y, x); + a = tmpImageorig->b(y, x); + b = tmpImagereserv->b(y, x); + overlay(b, a); + tmpImageorig->b(y, x) = lp.opacol * LIM(a, 0.f, 2.f) + (1.f - lp.opacol) * tmpImageorig->b(y, x); + } + } + } + + else if(lp.mergecolMethod == 8) {//overlay overlay(float &a, float &b) #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif @@ -11902,7 +11926,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } } - else if(lp.mergecolMethod == 8) {//screen screen (float &a, float &b) + else if(lp.mergecolMethod == 9) {//screen screen (float &a, float &b) #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif @@ -11923,7 +11947,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } } } - else if(lp.mergecolMethod == 9) {//darken only + else if(lp.mergecolMethod == 10) {//darken only #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif @@ -11935,7 +11959,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } } } - else if(lp.mergecolMethod == 10) {//lighten only + else if(lp.mergecolMethod == 11) {//lighten only #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 007c4e9ae..e73838e9e 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -637,6 +637,7 @@ Locallab::Locallab(): mergecolMethod->append(M("TP_LOCALLAB_MERFIV")); mergecolMethod->append(M("TP_LOCALLAB_MERSIX")); mergecolMethod->append(M("TP_LOCALLAB_MERSEV")); + mergecolMethod->append(M("TP_LOCALLAB_MERSEV2")); mergecolMethod->append(M("TP_LOCALLAB_MERHEI")); mergecolMethod->append(M("TP_LOCALLAB_MERNIN")); mergecolMethod->append(M("TP_LOCALLAB_MERTEN")); @@ -3506,12 +3507,14 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) } else if (mergecolMethod->get_active_row_number() == 6) { pp->locallab.spots.at(pp->locallab.selspot).mergecolMethod = "sev"; } else if (mergecolMethod->get_active_row_number() == 7) { - pp->locallab.spots.at(pp->locallab.selspot).mergecolMethod = "hei"; + pp->locallab.spots.at(pp->locallab.selspot).mergecolMethod = "sev2"; } else if (mergecolMethod->get_active_row_number() == 8) { - pp->locallab.spots.at(pp->locallab.selspot).mergecolMethod = "nin"; + pp->locallab.spots.at(pp->locallab.selspot).mergecolMethod = "hei"; } else if (mergecolMethod->get_active_row_number() == 9) { - pp->locallab.spots.at(pp->locallab.selspot).mergecolMethod = "ten"; + pp->locallab.spots.at(pp->locallab.selspot).mergecolMethod = "nin"; } else if (mergecolMethod->get_active_row_number() == 10) { + pp->locallab.spots.at(pp->locallab.selspot).mergecolMethod = "ten"; + } else if (mergecolMethod->get_active_row_number() == 11) { pp->locallab.spots.at(pp->locallab.selspot).mergecolMethod = "ele"; } @@ -8577,14 +8580,16 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con mergecolMethod->set_active(5); } else if (pp->locallab.spots.at(index).mergecolMethod == "sev") { mergecolMethod->set_active(6); - } else if (pp->locallab.spots.at(index).mergecolMethod == "hei") { + } else if (pp->locallab.spots.at(index).mergecolMethod == "sev2") { mergecolMethod->set_active(7); - } else if (pp->locallab.spots.at(index).mergecolMethod == "nin") { + } else if (pp->locallab.spots.at(index).mergecolMethod == "hei") { mergecolMethod->set_active(8); - } else if (pp->locallab.spots.at(index).mergecolMethod == "ten") { + } else if (pp->locallab.spots.at(index).mergecolMethod == "nin") { mergecolMethod->set_active(9); - } else if (pp->locallab.spots.at(index).mergecolMethod == "ele") { + } else if (pp->locallab.spots.at(index).mergecolMethod == "ten") { mergecolMethod->set_active(10); + } else if (pp->locallab.spots.at(index).mergecolMethod == "ele") { + mergecolMethod->set_active(11); }