From e6d1ff5cf43dc749715fbe00a3fe798976edc4cd Mon Sep 17 00:00:00 2001 From: Desmis Date: Sun, 14 Apr 2019 18:39:38 +0200 Subject: [PATCH] Active mask for CBDL and some improvments --- rtengine/iplocallab.cc | 16 ++++++---------- rtgui/locallab.cc | 22 +++++++++++++++------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 7c8e1c112..44bf10a11 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -419,8 +419,6 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall } else if (locallab.spots.at(sp).gridMethod == "two") { lp.gridmet = 1; } -printf("llcbmask=%i\n", llcbMask); -printf("llSHmask=%i\n", llSHMask); lp.showmaskcolmet = llColorMask; lp.showmaskexpmet = llExpMask; @@ -2589,11 +2587,11 @@ void ImProcFunctions::transit_shapedetect(int senstype, const LabImage *bufexpor float diflc = 0.f; float newhr = 0.f; - if (senstype == 6 || senstype == 2 || senstype == 3 || senstype == 8) {//all except color and light (TODO) and exposure + if (senstype == 2 || senstype == 3 || senstype == 8) {//all except color and light (TODO) and exposure const float lightc = bufexporig->L[y - ystart][x - xstart]; const float fli = (100.f + realstrdE) / 100.f; transformed->L[y][x] = CLIP(original->L[y][x] + (lightc * fli - original->L[y][x]) * factorx); - } else if (senstype == 1 || senstype == 0 || senstype == 9) { + } else if (senstype == 1 || senstype == 0 || senstype == 9 || senstype == 6) { if (HHutili) { const float hhro = bufhh[y - ystart][x - xstart]; @@ -2705,11 +2703,11 @@ void ImProcFunctions::transit_shapedetect(int senstype, const LabImage *bufexpor float diflc = 0.f; float newhr = 0.f; - if (senstype == 6 || senstype == 2 || senstype == 3 || senstype == 8) { //retinex & cbdl - float lightc = bufexporig->L[y - ystart][x - xstart]; - float fli = ((100.f + realstrdE) / 100.f); + if (senstype == 2 || senstype == 3 || senstype == 8) { //retinex & cbdl + const float lightc = bufexporig->L[y - ystart][x - xstart]; + const float fli = (100.f + realstrdE) / 100.f; transformed->L[y][x] = CLIP(original->L[y][x] + lightc * fli - original->L[y][x]); - } else if (senstype == 1 || senstype == 0 || senstype == 9) { + } else if (senstype == 1 || senstype == 0 || senstype == 9 || senstype == 6) { if (HHutili) { const float hhro = bufhh[y - ystart][x - xstart]; @@ -4978,7 +4976,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o std::unique_ptr bufmaskorigcb; std::unique_ptr bufmaskblurcb; std::unique_ptr originalmaskcb; -printf("showmet=%i \n", lp.showmaskcbmet); if (lp.showmaskcbmet == 2 || lp.enacbMask || lp.showmaskcbmet == 3 || lp.showmaskcbmet == 4) { bufmaskorigcb.reset(new LabImage(bfw, bfh)); bufmaskblurcb.reset(new LabImage(bfw, bfh)); @@ -5074,7 +5071,6 @@ printf("showmet=%i \n", lp.showmaskcbmet); float radiusb = 1.f / sk; if (lp.showmaskcbmet == 2 || lp.enacbMask || lp.showmaskcbmet == 3 || lp.showmaskcbmet == 4) { -printf("OK show\n"); #ifdef _OPENMP #pragma omp parallel diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index cdf1be708..44fbbb623 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -1025,7 +1025,7 @@ Locallab::Locallab(): cbdlBox->pack_start(*residFrame); cbdlBox->pack_start(*softradiuscb); cbdlBox->pack_start(*sensicb); - // cbdlBox->pack_start(*maskcbFrame); + cbdlBox->pack_start(*maskcbFrame); expcbdl->add(*cbdlBox); expcbdl->setLevel(2); @@ -2657,7 +2657,9 @@ void Locallab::showmaskcolMethodChanged() // When one mask state is changed, other masks are deactivated disableListener(); - showmaskexpMethod->set_active(0); + showmaskexpMethod->set_active(0); + showmaskSHMethod->set_active(0); + showmaskcbMethod->set_active(0); enableListener(); if (listener) { @@ -2671,7 +2673,9 @@ void Locallab::showmaskexpMethodChanged() // When one mask state is changed, other masks are deactivated disableListener(); - showmaskcolMethod->set_active(0); + showmaskcolMethod->set_active(0); + showmaskcbMethod->set_active(0); + showmaskSHMethod->set_active(0); enableListener(); if (listener) { @@ -2685,7 +2689,9 @@ void Locallab::showmaskSHMethodChanged() // When one mask state is changed, other masks are deactivated disableListener(); - showmaskcolMethod->set_active(0); + showmaskcolMethod->set_active(0); + showmaskexpMethod->set_active(0); + showmaskcbMethod->set_active(0); enableListener(); if (listener) { @@ -2699,7 +2705,9 @@ void Locallab::showmaskcbMethodChanged() // When one mask state is changed, other masks are deactivated disableListener(); - //showmaskcbMethod->set_active(0); + showmaskcolMethod->set_active(0); + showmaskSHMethod->set_active(0); + showmaskexpMethod->set_active(0); enableListener(); if (listener) { @@ -2726,8 +2734,8 @@ Locallab::llMaskVisibility* Locallab::getMaskVisibility() maskStruct->expMask = showmaskexpMethod->get_active_row_number(); maskStruct->SHMask = showmaskSHMethod->get_active_row_number(); maskStruct->cbMask = showmaskcbMethod->get_active_row_number(); - printf("SHmask=%i \n", maskStruct->SHMask); - printf("cbmask=%i \n", maskStruct->cbMask); + // printf("SHmask=%i \n", maskStruct->SHMask); + // printf("cbmask=%i \n", maskStruct->cbMask); return maskStruct; }