diff --git a/rtdata/languages/default b/rtdata/languages/default index e22781cb3..9b404f5ab 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1075,6 +1075,7 @@ HISTORY_MSG_835;Local - Vib gradient strength L HISTORY_MSG_836;Local - Vib gradient angle HISTORY_MSG_837;Local - Vib gradient strength C HISTORY_MSG_838;Local - Vib gradient strength H +HISTORY_MSG_839;Local - Software complexity HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -2138,6 +2139,11 @@ TP_LENSPROFILE_USE_CA;Chromatic aberration TP_LENSPROFILE_USE_GEOMETRIC;Geometric distortion TP_LENSPROFILE_USE_HEADER;Correct TP_LENSPROFILE_USE_VIGNETTING;Vignetting +TP_LOCALLAB_COMPLEX_METHOD;Software Complexity +TP_LOCALLAB_COMPLEX_TOOLTIP; Allow user to select Local adjustements rubrics. +TP_LOCALLAB_SIM;Simple +TP_LOCALLAB_MED;Medium +TP_LOCALLAB_ALL;All rubrics TP_LOCALLAB_ACTIV;Luminance only TP_LOCALLAB_ADJ;Equalizer blue-red TP_LOCALLAB_AMOUNT;Amount diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 76154e2ca..6de812d70 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -303,7 +303,7 @@ public: void transit_shapedetect2(int senstype, const LabImage * bufexporig, const LabImage * bufexpfin, LabImage * originalmask, const float hueref, const float chromaref, const float lumaref, float sobelref, float meansobel, float ** blend2, const struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk); void transit_shapedetect_retinex(int call, int senstype, LabImage * bufexporig, LabImage * bufmask, LabImage * buforigmas, float **buflight, float **bufchro, const float hueref, const float chromaref, const float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk); - void transit_shapedetect(int senstype, const LabImage *bufexporig, LabImage * originalmask, float **buflight, float **bufchro, bool HHutili, const float hueref, const float chromaref, const float lumaref, float sobelref, float meansobel, float ** blend2, const struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk); + void transit_shapedetect(int senstype, const LabImage *bufexporig, LabImage * originalmask, float **bufchro, bool HHutili, const float hueref, const float chromaref, const float lumaref, float sobelref, float meansobel, float ** blend2, const struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk); void exlabLocal(local_params& lp, int bfh, int bfw, LabImage* bufexporig, LabImage* lab, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, float mean); void Exclude_Local(float **deltaso, float hueref, float chromaref, float lumaref, float sobelref, float meansobel, const struct local_params & lp, const LabImage * original, LabImage * transformed, const LabImage * rsv, const LabImage * reserv, int cx, int cy, int sk); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 1a1393f30..8f7461877 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -4203,6 +4203,12 @@ void ImProcFunctions::transit_shapedetect2(int senstype, const LabImage * bufexp varsens = lp.sensv; } else if (senstype == 9) { //shadowshighlight varsens = lp.senshs; + } else if (senstype == 3) { //softlight + varsens = lp.senssf; + } else if (senstype == 30) { //dehaze + varsens = lp.sensh; + } else if (senstype == 8) { //TM + varsens = lp.senstm; } //sobel @@ -4225,11 +4231,13 @@ void ImProcFunctions::transit_shapedetect2(int senstype, const LabImage * bufexp const bool vibshow = ((lp.showmaskvibmet == 1 || lp.showmaskvibmet == 2) && senstype == 2); const bool colshow = ((lp.showmaskcolmet == 1 || lp.showmaskcolmet == 2) && senstype == 0); const bool SHshow = ((lp.showmaskSHmet == 1 || lp.showmaskSHmet == 2) && senstype == 9); + const bool tmshow = ((lp.showmasktmmet == 1 || lp.showmasktmmet == 2) && senstype == 8); const bool previewvib = ((lp.showmaskvibmet == 4) && senstype == 2); const bool previewexp = ((lp.showmaskexpmet == 5) && senstype == 1); const bool previewcol = ((lp.showmaskcolmet == 5) && senstype == 0); const bool previewSH = ((lp.showmaskSHmet == 4) && senstype == 9); + const bool previewtm = ((lp.showmasktmmet == 4) && senstype == 8); float radius = 3.f / sk; @@ -4256,7 +4264,8 @@ void ImProcFunctions::transit_shapedetect2(int senstype, const LabImage * bufexp const bool usemaskexp = (lp.showmaskexpmet == 2 || lp.enaExpMask || lp.showmaskexpmet == 5) && senstype == 1; const bool usemaskcol = (lp.showmaskcolmet == 2 || lp.enaColorMask || lp.showmaskcolmet == 5) && senstype == 0; const bool usemaskSH = (lp.showmaskSHmet == 2 || lp.enaSHMask || lp.showmaskSHmet == 4) && senstype == 9; - const bool usemaskall = (usemaskexp || usemaskvib || usemaskcol || usemaskSH); + const bool usemasktm = (lp.showmasktmmet == 2 || lp.enatmMask || lp.showmasktmmet == 4) && senstype == 8; + const bool usemaskall = (usemaskexp || usemaskvib || usemaskcol || usemaskSH || usemasktm); //blur a little mask if (usemaskall) { @@ -4374,7 +4383,7 @@ void ImProcFunctions::transit_shapedetect2(int senstype, const LabImage * bufexp difb = 328.f * factorx * realstrbdE; float maxdifab = max(fabs(difa), fabs(difb)); - if (expshow || vibshow || colshow || SHshow) {//show modifications + if (expshow || vibshow || colshow || SHshow || tmshow) {//show modifications if (diflc < 1000.f) {//if too low to be view use ab diflc += 0.5f * maxdifab; } @@ -4382,7 +4391,7 @@ void ImProcFunctions::transit_shapedetect2(int senstype, const LabImage * bufexp transformed->L[y + ystart][x + xstart] = CLIP(12000.f + diflc); transformed->a[y + ystart][x + xstart] = CLIPC(difa); transformed->b[y + ystart][x + xstart] = CLIPC(difb); - } else if (previewexp || previewvib || previewcol || previewSH) {//show deltaE + } else if (previewexp || previewvib || previewcol || previewSH || previewtm) {//show deltaE if (fabs(difb) < 500.f) {//if too low to be view use L difb += 0.5f * diflc; } @@ -4604,7 +4613,7 @@ void ImProcFunctions::transit_shapedetect_retinex(int call, int senstype, LabIma } -void ImProcFunctions::transit_shapedetect(int senstype, const LabImage * bufexporig, LabImage * originalmask, float **buflight, float **bufchro, bool HHutili, const float hueref, const float chromaref, const float lumaref, float sobelref, float meansobel, float ** blend2, const struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk) +void ImProcFunctions::transit_shapedetect(int senstype, const LabImage * bufexporig, LabImage * originalmask, float **bufchro, bool HHutili, const float hueref, const float chromaref, const float lumaref, float sobelref, float meansobel, float ** blend2, const struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk) { BENCHFUN { @@ -4618,13 +4627,7 @@ void ImProcFunctions::transit_shapedetect(int senstype, const LabImage * bufexpo const float ach = lp.trans / 100.f; float varsens = lp.sensex; - if (senstype == 3) //soft light - { - varsens = lp.senssf; - } else if (senstype == 30) //dehaze - { - varsens = lp.sensh; - } else if (senstype == 6 || senstype == 7) //cbdl + if (senstype == 6 || senstype == 7) //cbdl { varsens = lp.senscb; } else if (senstype == 8) //TM @@ -4635,7 +4638,7 @@ void ImProcFunctions::transit_shapedetect(int senstype, const LabImage * bufexpo varsens = lp.senslc; } - //sobel + //sobel //keep in case of, not used sobelref /= 100.f; meansobel /= 100.f; @@ -4659,18 +4662,18 @@ void ImProcFunctions::transit_shapedetect(int senstype, const LabImage * bufexpo std::unique_ptr origblurmask; float radius = 3.f / sk; - - if (senstype == 1) - { - radius = (2.f + 0.2f * lp.blurexp) / sk; - } else if (senstype == 0 || senstype == 100) - { - radius = (2.f + 0.2f * lp.blurcol) / sk; - } else if (senstype == 9) - { - radius = (2.f + 0.2f * lp.blurSH) / sk; - } - + /* + if (senstype == 1) + { + radius = (2.f + 0.2f * lp.blurexp) / sk; + } else if (senstype == 0 || senstype == 100) + { + radius = (2.f + 0.2f * lp.blurcol) / sk; + } else if (senstype == 9) + { + radius = (2.f + 0.2f * lp.blurSH) / sk; + } + */ //balance deltaE float kL = lp.balance; float kab = 1.f; @@ -4818,7 +4821,7 @@ void ImProcFunctions::transit_shapedetect(int senstype, const LabImage * bufexpo const float rL = origblur->L[y - ystart][x - xstart] / 327.68f; float rsob = 0.f; - if (blend2 && ((senstype == 1 && lp.struexp > 0.f) || ((senstype == 0 || senstype == 100) && lp.struco > 0.f))) { + if (blend2 && ((senstype == 1 && lp.struexp > 0.f) || ((senstype == 0 || senstype == 100) && lp.struco > 0.f))) {//keep in case of, not used const float csob = xlogf(1.f + std::min(blend2[y - ystart][x - xstart] / 100.f, 60.f) + 0.001f); float rs; @@ -4838,7 +4841,6 @@ void ImProcFunctions::transit_shapedetect(int senstype, const LabImage * bufexpo const float dE = rsob + sqrt(kab * (SQR(refa - maskptr->a[y - ystart][x - xstart]) + SQR(refb - maskptr->b[y - ystart][x - xstart])) + kL * SQR(refL - maskptr->L[y - ystart][x - xstart])); - const float cli = buflight[y - ystart][x - xstart]; const float clc = (previewcb) ? settings->previewselection * 100.f : bufchro[y - ystart][x - xstart]; @@ -4846,126 +4848,61 @@ void ImProcFunctions::transit_shapedetect(int senstype, const LabImage * bufexpo float reducdE; calcreducdE(dE, maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, varsens, reducdE); - const float realstrdE = reducdE * cli; const float realstrchdE = reducdE * clc; if (rL > 0.1f) { //to avoid crash with very low gamut in rare cases ex : L=0.01 a=0.5 b=-0.9 - switch (zone) { - case 1: { // inside transition zone - float factorx = localFactor; - float difL = 0.f; - - if (senstype == 6 || senstype == 8 || senstype == 10) { - difL = (bufexporig->L[y - ystart][x - xstart] - original->L[y][x]) * localFactor * reducdE; - transformed->L[y][x] = CLIP(original->L[y][x] + difL); - } else if (senstype == 3 || senstype == 30) { - - transformed->L[y][x] = CLIP(original->L[y][x] + 328.f * factorx * realstrdE); - // diflc = 328.f * factorx * realstrdE; - } - - if (senstype == 7) { - float difab = bufexporig->L[y - ystart][x - xstart] - sqrt(SQR(original->a[y][x]) + SQR(original->b[y][x])); - float2 sincosval = xsincosf(rhue); - float difa = difab * sincosval.y; - float difb = difab * sincosval.x; - difa *= factorx * (100.f + realstrchdE) / 100.f; - difb *= factorx * (100.f + realstrchdE) / 100.f; - transformed->a[y][x] = CLIPC(original->a[y][x] + difa); - transformed->b[y][x] = CLIPC(original->b[y][x] + difb); - } else { - float flia = 1.f; - float flib = 1.f; - float chra = bufexporig->a[y - ystart][x - xstart]; - float chrb = bufexporig->b[y - ystart][x - xstart]; - - if (senstype == 3 || senstype == 30 || senstype == 8 || senstype == 6 || senstype == 10) { - flia = flib = ((100.f + realstrchdE) / 100.f); - } - - - float difa = chra * flia - original->a[y][x]; - float difb = chrb * flib - original->b[y][x]; - difa *= factorx; - difb *= factorx; - - transformed->a[y][x] = CLIPC(original->a[y][x] + difa); - transformed->b[y][x] = CLIPC(original->b[y][x] + difb); - - - if (cbshow || tmshow) { - transformed->L[y][x] = CLIP(12000.f + difL); - transformed->a[y][x] = CLIPC(difa); - transformed->b[y][x] = CLIPC(difb); - } else if (previewcb || previewtm) { - if (fabs(difb) < 500.f) { - difb += difL; - } - - transformed->a[y][x] = 0.f; - transformed->b[y][x] = previewint * difb; - } - } - - break; + if (zone > 0) { + float factorx = localFactor; + float difL = 0.f; + if (senstype == 6 || senstype == 8 || senstype == 10) { + difL = (bufexporig->L[y - ystart][x - xstart] - original->L[y][x]) * localFactor * reducdE; + transformed->L[y][x] = CLIP(original->L[y][x] + difL); } - case 2: { // inside selection => full effect, no transition - float difL = 0.f; + if (senstype == 7) { + float difab = bufexporig->L[y - ystart][x - xstart] - sqrt(SQR(original->a[y][x]) + SQR(original->b[y][x])); + float2 sincosval = xsincosf(rhue); + float difa = difab * sincosval.y; + float difb = difab * sincosval.x; + difa *= factorx * (100.f + realstrchdE) / 100.f; + difb *= factorx * (100.f + realstrchdE) / 100.f; + transformed->a[y][x] = CLIPC(original->a[y][x] + difa); + transformed->b[y][x] = CLIPC(original->b[y][x] + difb); + } else { + float flia = 1.f; + float flib = 1.f; + float chra = bufexporig->a[y - ystart][x - xstart]; + float chrb = bufexporig->b[y - ystart][x - xstart]; - if (senstype == 6 || senstype == 8 || senstype == 10) { - difL = (bufexporig->L[y - ystart][x - xstart] - original->L[y][x]) * reducdE; - transformed->L[y][x] = CLIP(original->L[y][x] + difL); - - } else if (senstype == 3 || senstype == 30) { - - transformed->L[y][x] = CLIP(original->L[y][x] + 328.f * realstrdE);//kch fach - // diflc = 328.f * realstrdE; + if (senstype == 3 || senstype == 30 || senstype == 8 || senstype == 6 || senstype == 10) { + flia = flib = ((100.f + realstrchdE) / 100.f); } - if (senstype == 7) {//cbdl chroma - float difab = bufexporig->L[y - ystart][x - xstart] - sqrt(SQR(original->a[y][x]) + SQR(original->b[y][x])); - float2 sincosval = xsincosf(rhue); - float difa = difab * sincosval.y; - float difb = difab * sincosval.x; - difa *= (100.f + realstrchdE) / 100.f; - difb *= (100.f + realstrchdE) / 100.f; - transformed->a[y][x] = CLIPC(original->a[y][x] + difa); - transformed->b[y][x] = CLIPC(original->b[y][x] + difb); - } else { - float flia = 1.f; - float flib = 1.f; - float chra = bufexporig->a[y - ystart][x - xstart]; - float chrb = bufexporig->b[y - ystart][x - xstart]; + + float difa = chra * flia - original->a[y][x]; + float difb = chrb * flib - original->b[y][x]; + difa *= factorx; + difb *= factorx; + + transformed->a[y][x] = CLIPC(original->a[y][x] + difa); + transformed->b[y][x] = CLIPC(original->b[y][x] + difb); - if (senstype == 3 || senstype == 30 || senstype == 8 || senstype == 6 || senstype == 10) { - flia = flib = (100.f + realstrchdE) / 100.f; - + if (cbshow || tmshow) { + transformed->L[y][x] = CLIP(12000.f + difL); + transformed->a[y][x] = CLIPC(difa); + transformed->b[y][x] = CLIPC(difb); + } else if (previewcb || previewtm) { + if (fabs(difb) < 500.f) { + difb += difL; } - float difa = chra * flia - original->a[y][x]; - float difb = chrb * flib - original->b[y][x]; - - transformed->a[y][x] = CLIPC(original->a[y][x] + difa); - transformed->b[y][x] = CLIPC(original->b[y][x] + difb); - - - if (cbshow || tmshow) { - transformed->L[y][x] = CLIP(12000.f + difL); - transformed->a[y][x] = CLIPC(difa); - transformed->b[y][x] = CLIPC(difb); - } else if (previewcb || previewtm) { - if (fabs(difb) < 500.f) { - difb += difL; - } - - transformed->a[y][x] = 0.f; - transformed->b[y][x] = previewint * difb; - } + transformed->a[y][x] = 0.f; + transformed->b[y][x] = previewint * difb; } } + } } } @@ -8891,7 +8828,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } - transit_shapedetect(6, loctemp.get(), originalmaskcb.get(), buflight, bufchrom, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); + transit_shapedetect(6, loctemp.get(), originalmaskcb.get(), bufchrom, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); bool nochroma = (lp.showmaskcbmet == 2 || lp.showmaskcbmet == 1); @@ -8959,7 +8896,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } } - transit_shapedetect(7, loctemp.get(), nullptr, buflight, bufchrom, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); + transit_shapedetect(7, loctemp.get(), nullptr, bufchrom, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); buflight.free(); bufsh.free(); @@ -9432,7 +9369,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o // // transit_shapedetect_retinex(call, 4, bufgb.get(),bufmaskorigtm.get(), originalmasktm.get(), buflight, bufchro, hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); - transit_shapedetect(8, tmp1.get(), originalmasktm.get(), buflight, bufchro, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); + transit_shapedetect(8, tmp1.get(), originalmasktm.get(), bufchro, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); bufgb.reset(); if (params->locallab.spots.at(sp).recurs) { @@ -9846,8 +9783,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o std::unique_ptr bufexporig(new LabImage(bfw, bfh)); //buffer for data in zone limit std::unique_ptr bufexpfin(new LabImage(bfw, bfh)); //buffer for data in zone limit - JaggedArray buflight(bfw, bfh); - JaggedArray bufl_ab(bfw, bfh); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) @@ -9905,19 +9840,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o delete [] dE; } -#ifdef _OPENMP - #pragma omp parallel for schedule(dynamic,16) -#endif - - for (int y = 0; y < bfh; y++) { - for (int x = 0; x < bfw; x++) { - buflight[y][x] = CLIPRET((bufexpfin->L[y][x] - bufexporig->L[y][x]) / 328.f); - bufl_ab[y][x] = CLIPRET((sqrt(SQR(bufexpfin->a[y][x]) + SQR(bufexpfin->b[y][x])) - sqrt(SQR(bufexporig->a[y][x]) + SQR(bufexporig->b[y][x]))) / 250.f); - } - } - - bufexpfin.reset(); - transit_shapedetect(3, bufexporig.get(), nullptr, buflight, bufl_ab, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); + transit_shapedetect2(3, bufexporig.get(), bufexpfin.get(), nullptr, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); @@ -10384,8 +10307,10 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } } + // not good transit_shapedetect2(0, tmp1.get(), bufgb.get(), nullptr, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); + bufgb.reset(); - transit_shapedetect(10, tmp1.get(), nullptr, buflight, bufchro, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); + transit_shapedetect(10, tmp1.get(), nullptr, bufchro, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); tmp1.reset(); if (params->locallab.spots.at(sp).recurs) { @@ -10471,8 +10396,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (bfh >= mSP && bfw >= mSP) { std::unique_ptr bufexporig(new LabImage(bfw, bfh)); //buffer for data in zone limit std::unique_ptr bufexpfin(new LabImage(bfw, bfh)); //buffer for data in zone limit - JaggedArray buflight(bfw, bfh); - JaggedArray bufl_ab(bfw, bfh); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) @@ -10505,59 +10428,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o delete tmpImage; } - -#ifdef _OPENMP - #pragma omp parallel for schedule(dynamic,16) -#endif - - for (int y = 0; y < bfh; y++) { - for (int x = 0; x < bfw; x++) { - buflight[y][x] = CLIPRET((bufexpfin->L[y][x] - bufexporig->L[y][x])); - bufl_ab[y][x] = CLIPRET((sqrt(SQR(bufexpfin->a[y][x]) + SQR(bufexpfin->b[y][x])) - sqrt(SQR(bufexporig->a[y][x]) + SQR(bufexporig->b[y][x])))); - } - } - - float minL = bufexpfin->L[0][0] - bufexporig->L[0][0]; - float maxL = minL; - float minC = sqrt(SQR(bufexpfin->a[0][0]) + SQR(bufexpfin->b[0][0])) - sqrt(SQR(bufexporig->a[0][0]) + SQR(bufexporig->b[0][0])); - float maxC = minC; - -#ifdef _OPENMP - #pragma omp parallel for reduction(min:minL) reduction(min:minC) reduction(max:maxL) reduction(max:maxC) schedule(dynamic,16) -#endif - - for (int ir = 0; ir < bfh; ir++) { - for (int jr = 0; jr < bfw; jr++) { - buflight[ir][jr] = bufexpfin->L[ir][jr] - bufexporig->L[ir][jr]; - bufl_ab[ir][jr] = sqrt(SQR(bufexpfin->a[ir][jr]) + SQR(bufexpfin->b[ir][jr])) - sqrt(SQR(bufexporig->a[ir][jr]) + SQR(bufexporig->b[ir][jr])); - minL = rtengine::min(minL, buflight[ir][jr]); - maxL = rtengine::max(maxL, buflight[ir][jr]); - minC = rtengine::min(minC, bufl_ab[ir][jr]); - maxC = rtengine::max(maxC, bufl_ab[ir][jr]); - } - } - - float coef = 0.01f * (max(fabs(minL), fabs(maxL))); - float coefC = 0.01f * (max(fabs(minC), fabs(maxC))); - - if (coef == 0.f) { - coef = 1.f; - } - - if (coefC == 0.f) { - coefC = 1.f; - } - - - for (int ir = 0; ir < bfh; ir++) { - for (int jr = 0; jr < bfw; jr++) { - buflight[ir][jr] /= coef; - bufl_ab[ir][jr] /= coefC; - } - } - - bufexpfin.reset(); - transit_shapedetect(30, bufexporig.get(), nullptr, buflight, bufl_ab, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); + transit_shapedetect2(30, bufexporig.get(), bufexpfin.get(), nullptr, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 7e68ebcab..e4ffbcfc3 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -862,6 +862,7 @@ enum ProcEventCode { Evlocallabangvib = 835, Evlocallabstrvibab = 836, Evlocallabstrvibh = 837, + EvLocallabSpotcomplexMethod = 838, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index abec639f5..f517389e9 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2431,6 +2431,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : centerY(0), circrad(18), qualityMethod("enh"), + complexMethod("mod"), transit(60.), feather(25.), thresh(2.0), @@ -2786,6 +2787,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && centerY == other.centerY && circrad == other.circrad && qualityMethod == other.qualityMethod + && complexMethod == other.complexMethod && transit == other.transit && feather == other.feather && thresh == other.thresh @@ -4136,6 +4138,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).centerY, "Locallab", "CenterY_" + std::to_string(i), spot.centerY, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).circrad, "Locallab", "Circrad_" + std::to_string(i), spot.circrad, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).qualityMethod, "Locallab", "QualityMethod_" + std::to_string(i), spot.qualityMethod, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).complexMethod, "Locallab", "ComplexMethod_" + std::to_string(i), spot.complexMethod, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).transit, "Locallab", "Transit_" + std::to_string(i), spot.transit, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).feather, "Locallab", "Feather_" + std::to_string(i), spot.feather, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).thresh, "Locallab", "Thresh_" + std::to_string(i), spot.thresh, keyFile); @@ -5593,6 +5596,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "CenterY_" + std::to_string(i), pedited, spot.centerY, spotEdited.centerY); assignFromKeyfile(keyFile, "Locallab", "Circrad_" + std::to_string(i), pedited, spot.circrad, spotEdited.circrad); assignFromKeyfile(keyFile, "Locallab", "QualityMethod_" + std::to_string(i), pedited, spot.qualityMethod, spotEdited.qualityMethod); + assignFromKeyfile(keyFile, "Locallab", "ComplexMethod_" + std::to_string(i), pedited, spot.complexMethod, spotEdited.complexMethod); assignFromKeyfile(keyFile, "Locallab", "Transit_" + std::to_string(i), pedited, spot.transit, spotEdited.transit); assignFromKeyfile(keyFile, "Locallab", "Feather_" + std::to_string(i), pedited, spot.feather, spotEdited.feather); assignFromKeyfile(keyFile, "Locallab", "Thresh_" + std::to_string(i), pedited, spot.thresh, spotEdited.thresh); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index d8f789aba..000d206b4 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -974,6 +974,7 @@ struct LocallabParams { int centerY; int circrad; Glib::ustring qualityMethod; // none, std, enh, enhsup, contr, sob2 + Glib::ustring complexMethod; // sim, mod, all double transit; double feather; double thresh; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 591848653..26d409276 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -865,7 +865,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, //Evlocallabstrvib LUMINANCECURVE, //Evlocallabangvib LUMINANCECURVE, //Evlocallabstrvibab - LUMINANCECURVE //Evlocallabstrvibh + LUMINANCECURVE, //Evlocallabstrvibh + LUMINANCECURVE // EvLocallabSpotcomplexMethod }; diff --git a/rtgui/controlspotpanel.cc b/rtgui/controlspotpanel.cc index 0ac938b3f..199a71094 100644 --- a/rtgui/controlspotpanel.cc +++ b/rtgui/controlspotpanel.cc @@ -51,7 +51,7 @@ ControlSpotPanel::ControlSpotPanel(): spotMethod_(Gtk::manage(new MyComboBoxText())), shapeMethod_(Gtk::manage(new MyComboBoxText())), qualityMethod_(Gtk::manage(new MyComboBoxText())), -// mergeMethod_(Gtk::manage(new MyComboBoxText())), + complexMethod_(Gtk::manage(new MyComboBoxText())), sensiexclu_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIEXCLU"), 0, 100, 1, 12))), structexclu_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))), @@ -270,6 +270,24 @@ ControlSpotPanel::ControlSpotPanel(): ctboxqualitymethod->pack_start(*qualityMethod_); pack_start(*ctboxqualitymethod); + + Gtk::HBox* const ctboxcomplexmethod = Gtk::manage(new Gtk::HBox()); + Gtk::Label* const labelcomplexmethod = Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_COMPLEX_METHOD") + ":")); + ctboxcomplexmethod->pack_start(*labelcomplexmethod, Gtk::PACK_SHRINK, 4); + + if (showtooltip) { + ctboxcomplexmethod->set_tooltip_markup(M("TP_LOCALLAB_COMPLEXMETHOD_TOOLTIP")); + } + + complexMethod_->append(M("TP_LOCALLAB_SIM")); + complexMethod_->append(M("TP_LOCALLAB_MED")); + complexMethod_->append(M("TP_LOCALLAB_ALL")); + complexMethod_->set_active(1); + complexMethodconn_ = complexMethod_->signal_changed().connect( + sigc::mem_fun( + *this, &ControlSpotPanel::complexMethodChanged)); + ctboxcomplexmethod->pack_start(*complexMethod_); + Gtk::Frame* const transitFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_TRANSIT"))); transitFrame->set_label_align(0.025, 0.5); @@ -400,6 +418,13 @@ ControlSpotPanel::ControlSpotPanel(): // maskBox->pack_start(*savrest_); maskFrame->add(*maskBox); pack_start(*maskFrame); + Gtk::HSeparator *separatormet = Gtk::manage(new Gtk::HSeparator()); + pack_start(*separatormet, Gtk::PACK_SHRINK, 2); + +// pack_start(*ctboxcomplexmethod); + if (showtooltip) { + complexMethod_->set_tooltip_markup(M("TP_LOCALLAB_COMPLEX_TOOLTIP")); + } show_all(); @@ -701,6 +726,7 @@ void ControlSpotPanel::load_ControlSpot_param() centerY_->setValue((double)row[spots_.centerY]); circrad_->setValue((double)row[spots_.circrad]); qualityMethod_->set_active(row[spots_.qualityMethod]); + complexMethod_->set_active(row[spots_.complexMethod]); transit_->setValue((double)row[spots_.transit]); feather_->setValue((double)row[spots_.feather]); thresh_->setValue((double)row[spots_.thresh]); @@ -911,6 +937,38 @@ void ControlSpotPanel::qualityMethodChanged() } } +void ControlSpotPanel::complexMethodChanged() +{ + // printf("qualityMethodChanged\n"); + + // Get selected control spot + const auto s = treeview_->get_selection(); + + if (!s->count_selected_rows()) { + return; + } + + const auto iter = s->get_selected(); + Gtk::TreeModel::Row row = *iter; + + row[spots_.complexMethod] = complexMethod_->get_active_row_number(); + + if (multiImage && complexMethod_->get_active_text() == M("GENERAL_UNCHANGED")) { + // excluFrame->show(); + } else if (complexMethod_->get_active_row_number() == 0) { //sim + // excluFrame->hide(); + } else if (complexMethod_->get_active_row_number() == 1){ // mod + // excluFrame->show(); + } else if (complexMethod_->get_active_row_number() == 2){ // all + // excluFrame->show(); + } + + // Raise event + if (listener) { + listener->panelChanged(EvLocallabSpotcomplexMethod, complexMethod_->get_active_text()); + } +} + void ControlSpotPanel::updateParamVisibility() { // printf("updateParamVisibility\n"); @@ -1428,6 +1486,7 @@ void ControlSpotPanel::disableParamlistener(bool cond) centerY_->block(cond); circrad_->block(cond); qualityMethodconn_.block(cond); + complexMethodconn_.block(cond); transit_->block(cond); feather_->block(cond); thresh_->block(cond); @@ -1464,6 +1523,7 @@ void ControlSpotPanel::setParamEditable(bool cond) centerY_->set_sensitive(cond); circrad_->set_sensitive(cond); qualityMethod_->set_sensitive(cond); + complexMethod_->set_sensitive(cond); transit_->set_sensitive(cond); feather_->set_sensitive(cond); thresh_->set_sensitive(cond); @@ -2108,6 +2168,7 @@ ControlSpotPanel::SpotRow* ControlSpotPanel::getSpot(const int id) r->centerY = row[spots_.centerY]; r->circrad = row[spots_.circrad]; r->qualityMethod = row[spots_.qualityMethod]; + r->complexMethod = row[spots_.complexMethod]; r->transit = row[spots_.transit]; r->feather = row[spots_.feather]; r->thresh = row[spots_.thresh]; @@ -2243,6 +2304,7 @@ void ControlSpotPanel::addControlSpot(SpotRow* newSpot) row[spots_.centerY] = newSpot->centerY; row[spots_.circrad] = newSpot->circrad; row[spots_.qualityMethod] = newSpot->qualityMethod; + row[spots_.complexMethod] = newSpot->complexMethod; row[spots_.transit] = newSpot->transit; row[spots_.feather] = newSpot->feather; row[spots_.thresh] = newSpot->thresh; @@ -2297,6 +2359,7 @@ int ControlSpotPanel::updateControlSpot(SpotRow* spot) row[spots_.centerY] = spot->centerY; row[spots_.circrad] = spot->circrad; row[spots_.qualityMethod] = spot->qualityMethod; + row[spots_.complexMethod] = spot->complexMethod; row[spots_.transit] = spot->transit; row[spots_.feather] = spot->feather; row[spots_.thresh] = spot->thresh; @@ -2397,6 +2460,7 @@ ControlSpotPanel::SpotEdited* ControlSpotPanel::getEditedStates() se-> centerY = centerY_->getEditedState(); se->circrad = circrad_->getEditedState(); se->qualityMethod = qualityMethod_->get_active_text() != M("GENERAL_UNCHANGED"); + se->complexMethod = complexMethod_->get_active_text() != M("GENERAL_UNCHANGED"); se->transit = transit_->getEditedState(); se->feather = feather_->getEditedState(); se->thresh = thresh_->getEditedState(); @@ -2479,6 +2543,10 @@ void ControlSpotPanel::setEditedStates(SpotEdited* se) qualityMethod_->set_active_text(M("GENERAL_UNCHANGED")); } + if (!se->complexMethod) { + complexMethod_->set_active_text(M("GENERAL_UNCHANGED")); + } + transit_->setEditedState(se->transit ? Edited : UnEdited); feather_->setEditedState(se->feather ? Edited : UnEdited); thresh_->setEditedState(se->thresh ? Edited : UnEdited); @@ -2623,6 +2691,7 @@ void ControlSpotPanel::setBatchMode(bool batchMode) // mergeMethod_->append(M("GENERAL_UNCHANGED")); shapeMethod_->append(M("GENERAL_UNCHANGED")); qualityMethod_->append(M("GENERAL_UNCHANGED")); + complexMethod_->append(M("GENERAL_UNCHANGED")); } //----------------------------------------------------------------------------- @@ -2650,6 +2719,7 @@ ControlSpotPanel::ControlSpots::ControlSpots() add(centerY); add(circrad); add(qualityMethod); + add(complexMethod); add(transit); add(feather); add(thresh); diff --git a/rtgui/controlspotpanel.h b/rtgui/controlspotpanel.h index e289d59ec..59195c638 100644 --- a/rtgui/controlspotpanel.h +++ b/rtgui/controlspotpanel.h @@ -74,7 +74,8 @@ public: bool deltae; bool shortc; bool savrest; -// int mergeMethod; // 0 = None, 1 = short circuit, 2 = original + int complexMethod; // 0 = Simple, 1 = Moderate, 2 = all + }; /** @@ -114,7 +115,7 @@ public: bool deltae; bool shortc; bool savrest; -// bool mergeMethod; + bool complexMethod; }; /** @@ -273,6 +274,8 @@ private: void shapeMethodChanged(); // void mergeMethodChanged(); void qualityMethodChanged(); + void complexMethodChanged(); + void updateParamVisibility(); void adjusterChanged(Adjuster* a, double newval); void adjusterAutoToggled(Adjuster* a, bool newval); @@ -342,7 +345,7 @@ private: Gtk::TreeModelColumn deltae; Gtk::TreeModelColumn shortc; Gtk::TreeModelColumn savrest; -// Gtk::TreeModelColumn mergeMethod; // 0 = None, 1 = short cir, 2 = original + Gtk::TreeModelColumn complexMethod; // 0 = Simple, 1 = mod, 2 = all }; class RenameDialog: @@ -389,8 +392,8 @@ private: sigc::connection shapeMethodconn_; MyComboBoxText* const qualityMethod_; sigc::connection qualityMethodconn_; -// MyComboBoxText* const mergeMethod_; - // sigc::connection mergeMethodconn_; + MyComboBoxText* const complexMethod_; + sigc::connection complexMethodconn_; Adjuster* const sensiexclu_; Adjuster* const structexclu_; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index d0b46e6fc..5038b0568 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -642,11 +642,10 @@ pe(nullptr) { ToolVBox* const panel = Gtk::manage(new ToolVBox()); const bool showtooltip = options.showtooltip; + complexsoft = options.complexity; CurveListener::setMulti(true); - rtengine::procparams::LocallabParams::LocallabSpot defSpot; - // Settings expsettings->getExpander()->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expsettings->getExpander())); expsettings->setLevel(2); @@ -734,7 +733,8 @@ pe(nullptr) gridMethod->append(M("TP_LOCALLAB_GRIDTWO")); gridMethod->set_active(0); gridMethodConn = gridMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::gridMethodChanged)); - + + merMethod->append(M("TP_LOCALLAB_MRONE")); merMethod->append(M("TP_LOCALLAB_MRTWO")); merMethod->append(M("TP_LOCALLAB_MRTHR")); @@ -1005,7 +1005,7 @@ pe(nullptr) gridBox->pack_start(*gridMethod); gridBox->pack_start(*strengthgrid); gridFrame->add(*gridBox); - superBox->pack_start(*gridFrame); + if(complexsoft < 10) superBox->pack_start(*gridFrame); superFrame->add(*superBox); colorBox->pack_start(*superFrame); @@ -1063,7 +1063,7 @@ pe(nullptr) maskcolBox->pack_start(*blendmaskcol, Gtk::PACK_SHRINK, 0); toolcolBox->pack_start(*radmaskcol, Gtk::PACK_SHRINK, 0); - toolcolBox->pack_start(*lapmaskcol, Gtk::PACK_SHRINK, 0); + if(complexsoft < 10) toolcolBox->pack_start(*lapmaskcol, Gtk::PACK_SHRINK, 0); toolcolBox->pack_start(*chromaskcol, Gtk::PACK_SHRINK, 0); toolcolBox->pack_start(*gammaskcol, Gtk::PACK_SHRINK, 0); toolcolBox->pack_start(*slomaskcol, Gtk::PACK_SHRINK, 0); @@ -3322,6 +3322,14 @@ void Locallab::read(const rtengine::procparams::ProcParams* pp, const ParamsEdit r->qualityMethod = 1; } + if (pp->locallab.spots.at(i).complexMethod == "sim") { + r->complexMethod = 0; + } else if (pp->locallab.spots.at(i).complexMethod == "mod") { + r->complexMethod = 1; + } else if (pp->locallab.spots.at(i).complexMethod == "all") { + r->complexMethod = 2; + } + r->transit = pp->locallab.spots.at(i).transit; r->feather = pp->locallab.spots.at(i).feather; r->thresh = pp->locallab.spots.at(i).thresh; @@ -3487,6 +3495,14 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited r->qualityMethod = 1; } + if (newSpot->complexMethod == "sim") { + r->complexMethod = 0; + } else if (newSpot->complexMethod == "mod") { + r->complexMethod = 1; + } else if (newSpot->complexMethod == "all") { + r->complexMethod = 2; + } + r->transit = newSpot->transit; r->feather = newSpot->feather; r->thresh = newSpot->thresh; @@ -3738,6 +3754,14 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited r->qualityMethod = 1; } + if (newSpot->complexMethod == "sim") { + r->complexMethod = 0; + } else if (newSpot->complexMethod == "mod") { + r->complexMethod = 1; + } else if (newSpot->complexMethod == "all") { + r->complexMethod = 2; + } + r->transit = newSpot->transit; r->feather = newSpot->feather; r->thresh = newSpot->thresh; @@ -3889,6 +3913,14 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pp->locallab.spots.at(pp->locallab.selspot).qualityMethod = "enhden"; } + if (r->complexMethod == 0) { + pp->locallab.spots.at(pp->locallab.selspot).complexMethod = "sim"; + } else if (r->complexMethod == 1) { + pp->locallab.spots.at(pp->locallab.selspot).complexMethod = "mod"; + } else if (r->complexMethod == 2) { + pp->locallab.spots.at(pp->locallab.selspot).complexMethod = "all"; + } + pp->locallab.spots.at(pp->locallab.selspot).transit = r->transit; pp->locallab.spots.at(pp->locallab.selspot).feather = r->feather; pp->locallab.spots.at(pp->locallab.selspot).thresh = r->thresh; @@ -4400,6 +4432,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pe->locallab.spots.at(pp->locallab.selspot).centerY = pe->locallab.spots.at(pp->locallab.selspot).centerY || se->centerY; pe->locallab.spots.at(pp->locallab.selspot).circrad = pe->locallab.spots.at(pp->locallab.selspot).circrad || se->circrad; pe->locallab.spots.at(pp->locallab.selspot).qualityMethod = pe->locallab.spots.at(pp->locallab.selspot).qualityMethod || se->qualityMethod; + pe->locallab.spots.at(pp->locallab.selspot).complexMethod = pe->locallab.spots.at(pp->locallab.selspot).complexMethod || se->complexMethod; pe->locallab.spots.at(pp->locallab.selspot).transit = pe->locallab.spots.at(pp->locallab.selspot).transit || se->transit; pe->locallab.spots.at(pp->locallab.selspot).feather = pe->locallab.spots.at(pp->locallab.selspot).feather || se->feather; pe->locallab.spots.at(pp->locallab.selspot).thresh = pe->locallab.spots.at(pp->locallab.selspot).thresh || se->thresh; @@ -4761,6 +4794,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pedited->locallab.spots.at(pp->locallab.selspot).centerY = pedited->locallab.spots.at(pp->locallab.selspot).centerY || se->centerY; pedited->locallab.spots.at(pp->locallab.selspot).circrad = pedited->locallab.spots.at(pp->locallab.selspot).circrad || se->circrad; pedited->locallab.spots.at(pp->locallab.selspot).qualityMethod = pedited->locallab.spots.at(pp->locallab.selspot).qualityMethod || se->qualityMethod; + pedited->locallab.spots.at(pp->locallab.selspot).complexMethod = pedited->locallab.spots.at(pp->locallab.selspot).complexMethod || se->complexMethod; pedited->locallab.spots.at(pp->locallab.selspot).transit = pedited->locallab.spots.at(pp->locallab.selspot).transit || se->transit; pedited->locallab.spots.at(pp->locallab.selspot).feather = pedited->locallab.spots.at(pp->locallab.selspot).feather || se->feather; pedited->locallab.spots.at(pp->locallab.selspot).thresh = pedited->locallab.spots.at(pp->locallab.selspot).thresh || se->thresh; @@ -5671,6 +5705,7 @@ void Locallab::qualitycurveMethodChanged() void Locallab::gridMethodChanged() { // printf("qualitycurveMethodChanged\n"); + if(complexsoft < 10) gridMethod->hide(); if (getEnabled() && expcolor->getEnabled()) { if (listener) { @@ -5710,7 +5745,7 @@ void Locallab::merMethodChanged() sensi->set_sensitive(false); structcol->set_sensitive(false); blurcolde->set_sensitive(false); - H2CurveEditorG->set_sensitive(false); + H2CurveEditorG->set_sensitive(true); rgbCurveEditorG->set_sensitive(false); special->set_sensitive(false); invers->set_sensitive(false); @@ -5721,7 +5756,7 @@ void Locallab::merMethodChanged() sensi->set_sensitive(false); structcol->set_sensitive(false); blurcolde->set_sensitive(false); - H2CurveEditorG->set_sensitive(false); + H2CurveEditorG->set_sensitive(true); rgbCurveEditorG->set_sensitive(false); special->set_sensitive(false); invers->set_sensitive(false); @@ -5735,7 +5770,7 @@ void Locallab::merMethodChanged() blurcolde->set_sensitive(false); sensi->set_sensitive(false); structcol->set_sensitive(false); - H2CurveEditorG->set_sensitive(false); + H2CurveEditorG->set_sensitive(true); rgbCurveEditorG->set_sensitive(false); special->set_sensitive(false); invers->set_sensitive(false); @@ -10197,6 +10232,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con se->centerY = spotState->centerY; se->circrad = spotState->circrad; se->qualityMethod = spotState->qualityMethod; + se->complexMethod = spotState->complexMethod; se->transit = spotState->transit; se->feather = spotState->feather; se->thresh = spotState->thresh; @@ -10674,7 +10710,7 @@ void Locallab::updateSpecificGUIState() strcolh->set_sensitive(true); sensi->set_sensitive(false); blurcolde->set_sensitive(false); - H2CurveEditorG->set_sensitive(false); + H2CurveEditorG->set_sensitive(true); rgbCurveEditorG->set_sensitive(false); special->set_sensitive(false); invers->set_sensitive(false); @@ -10686,7 +10722,7 @@ void Locallab::updateSpecificGUIState() sensi->set_sensitive(false); blurcolde->set_sensitive(false); strcolh->set_sensitive(true); - H2CurveEditorG->set_sensitive(false); + H2CurveEditorG->set_sensitive(true); rgbCurveEditorG->set_sensitive(false); special->set_sensitive(false); invers->set_sensitive(false); @@ -10698,7 +10734,7 @@ void Locallab::updateSpecificGUIState() strcolh->set_sensitive(true); sensi->set_sensitive(false); blurcolde->set_sensitive(false); - H2CurveEditorG->set_sensitive(false); + H2CurveEditorG->set_sensitive(true); rgbCurveEditorG->set_sensitive(false); special->set_sensitive(false); invers->set_sensitive(false); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 0e6517fbc..c8f4ac344 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -553,6 +553,7 @@ private: double nextminT; double nextmaxT; double nextsigma; + int complexsoft; /** * Used to store the default ProcParams when setDefaults function is called * When an other spot is selected, this default ProcParams is used to update adjusters default values diff --git a/rtgui/options.cc b/rtgui/options.cc index 91886102e..c61d823e3 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -479,6 +479,7 @@ void Options::setDefaults() menuGroupProfileOperations = true; menuGroupExtProg = true; showtooltip = true; + complexity = 0; ICCPC_primariesPreset = "sRGB", ICCPC_redPrimaryX = 0.6400; @@ -1424,6 +1425,7 @@ void Options::readFromFile(Glib::ustring fname) navHSVUnit = (NavigatorUnit)keyFile.get_integer("GUI", "NavigatorHSVUnit"); } + if (keyFile.has_key("GUI", "ShowFilmStripToolBar")) { showFilmStripToolBar = keyFile.get_boolean("GUI", "ShowFilmStripToolBar"); } @@ -1447,6 +1449,11 @@ void Options::readFromFile(Glib::ustring fname) if (keyFile.has_key("GUI", "CurveBBoxPosition")) { curvebboxpos = keyFile.get_integer("GUI", "CurveBBoxPosition"); } + + if (keyFile.has_key("GUI", "Complexity")) { + complexity = keyFile.get_integer("GUI", "Complexity"); + } + } if (keyFile.has_group("Crop Settings")) { @@ -1644,6 +1651,7 @@ void Options::readFromFile(Glib::ustring fname) rtSettings.previewselection = keyFile.get_integer("Color Management", "Previewselection"); } + if (keyFile.has_key("Color Management", "Cbdlsensi")) {//sensibility to crash for cbdl rtSettings.cbdlsensi = keyFile.get_double("Color Management", "Cbdlsensi"); } @@ -2188,6 +2196,7 @@ void Options::saveToFile(Glib::ustring fname) keyFile.set_boolean("GUI", "HistogramWorking", rtSettings.HistogramWorking); keyFile.set_integer("GUI", "CurveBBoxPosition", curvebboxpos); keyFile.set_boolean("GUI", "Showtooltip", showtooltip); + keyFile.set_integer("GUI", "Complexity", complexity); //Glib::ArrayHandle crvopen = crvOpen; //keyFile.set_integer_list ("GUI", "CurvePanelsExpanded", crvopen); diff --git a/rtgui/options.h b/rtgui/options.h index 4e1c737e7..b8858f9bd 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -280,6 +280,7 @@ public: bool renameUseTemplates; bool internalThumbIfUntouched; bool overwriteOutputFile; + int complexity; std::vector thumbnailZoomRatios; bool overlayedFileNames; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 6bf68a628..29b55f4b0 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -967,6 +967,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).centerY = locallab.spots.at(j).centerY && pSpot.centerY == otherSpot.centerY; locallab.spots.at(j).circrad = locallab.spots.at(j).circrad && pSpot.circrad == otherSpot.circrad; locallab.spots.at(j).qualityMethod = locallab.spots.at(j).qualityMethod && pSpot.qualityMethod == otherSpot.qualityMethod; + locallab.spots.at(j).complexMethod = locallab.spots.at(j).complexMethod && pSpot.complexMethod == otherSpot.complexMethod; locallab.spots.at(j).transit = locallab.spots.at(j).transit && pSpot.transit == otherSpot.transit; locallab.spots.at(j).feather = locallab.spots.at(j).feather && pSpot.feather == otherSpot.feather; locallab.spots.at(j).thresh = locallab.spots.at(j).thresh && pSpot.thresh == otherSpot.thresh; @@ -2832,6 +2833,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).qualityMethod = mods.locallab.spots.at(i).qualityMethod; } + if (locallab.spots.at(i).complexMethod) { + toEdit.locallab.spots.at(i).complexMethod = mods.locallab.spots.at(i).complexMethod; + } + if (locallab.spots.at(i).transit) { toEdit.locallab.spots.at(i).transit = mods.locallab.spots.at(i).transit; } @@ -5099,6 +5104,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : centerY(v), circrad(v), qualityMethod(v), + complexMethod(v), transit(v), feather(v), thresh(v), @@ -5450,6 +5456,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) centerY = v; circrad = v; qualityMethod = v; + complexMethod = v; transit = v; feather = v; thresh = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 66f9ed3bb..2ddaf162f 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -401,6 +401,7 @@ public: bool centerY; bool circrad; bool qualityMethod; + bool complexMethod; bool transit; bool feather; bool thresh;