From dd114226dab66a5315e852619cdd5d339f5ae4e3 Mon Sep 17 00:00:00 2001 From: Desmis Date: Thu, 14 Feb 2019 18:44:18 +0100 Subject: [PATCH] Add chroma compensation to exposure --- rtdata/languages/default | 2 + rtengine/iplocallab.cc | 120 ++++++++++++++++++++++++++++++--------- rtengine/procevents.h | 1 + rtengine/procparams.cc | 4 ++ rtengine/procparams.h | 1 + rtengine/refreshmap.cc | 3 +- rtgui/locallab.cc | 18 ++++++ rtgui/locallab.h | 1 + rtgui/paramsedited.cc | 9 ++- rtgui/paramsedited.h | 1 + 10 files changed, 130 insertions(+), 30 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 6ccdc97ac..35678eae6 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -875,6 +875,7 @@ HISTORY_MSG_619;Local - Use Exp Mask HISTORY_MSG_620;Local - Blur col HISTORY_MSG_621;Local - Exp inverse HISTORY_MSG_622;Local - Exclude structure +HISTORY_MSG_623;Local - Exp Chroma compensation HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -1988,6 +1989,7 @@ TP_LOCALLAB_EXCLUTYPE_TOOLTIP;Normal spot use recursive data.\nExcluding spot re TP_LOCALLAB_EXNORM;Normal spot TP_LOCALLAB_EXECLU;Excluding spot TP_LOCALLAB_EXPOSE;Exposure +TP_LOCALLAB_EXPCHROMA;Chroma compensation TP_LOCALLAB_LOC_CONTRAST;Local contrast TP_LOCALLAB_REFLABEL;Ref. (0..1) Chroma=%1 Luma=%2 Hue=%3 TP_LOCALLAB_NOISELUMFINE;Luminance fine (Wav) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index c39b84e3e..d555e614f 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -226,6 +226,7 @@ struct local_params { int hlcomp; int hlcompthr; double expcomp; + float expchroma; int excmet; int strucc; int war; @@ -589,6 +590,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.hlcomp = locallab.spots.at(sp).hlcompr; lp.hlcompthr = locallab.spots.at(sp).hlcomprthresh; lp.expcomp = locallab.spots.at(sp).expcomp / 100.; + lp.expchroma = locallab.spots.at(sp).expchroma / 100.; lp.sensex = local_sensiex; // lp.strucc = local_struc; lp.war = local_warm; @@ -1727,7 +1729,7 @@ void ImProcFunctions::exlabLocal(const local_params& lp, int bfh, int bfw, LabIm for (int j = jstart, tj = 0; j < tW; j++, tj++) { Ltemp[ti * TSE + tj] = bufexporig->L[i][j]; atemp[ti * TSE + tj] = bufexporig->a[i][j]; - btemp[ti * TSE + tj] = bufexporig->b[i][j];; + btemp[ti * TSE + tj] = bufexporig->b[i][j]; } } @@ -1738,6 +1740,7 @@ void ImProcFunctions::exlabLocal(const local_params& lp, int bfh, int bfw, LabIm for (int j = jstart, tj = 0; j < tW; j++, tj++) { float L = Ltemp[ti * TSE + tj]; + float tonefactor = (2 * L < MAXVALF ? hltonecurve[2 * L] : CurveFactory::hlcurve(exp_scale, comp, hlrange, 2 * L)); // niv)); Ltemp[ti * TSE + tj] = L * tonefactor; } @@ -1758,7 +1761,6 @@ void ImProcFunctions::exlabLocal(const local_params& lp, int bfh, int bfw, LabIm for (int j = jstart, tj = 0; j < tW; j++, tj++) { Ltemp[ti * TSE + tj] = tonecurve[Ltemp[ti * TSE + tj] ]; - } } @@ -1769,7 +1771,6 @@ void ImProcFunctions::exlabLocal(const local_params& lp, int bfh, int bfw, LabIm // ready, fill lab for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { - lab->L[i][j] = Ltemp[ti * TSE + tj]; lab->a[i][j] = atemp[ti * TSE + tj]; lab->b[i][j] = btemp[ti * TSE + tj]; @@ -3450,10 +3451,10 @@ void ImProcFunctions::Exclude_Local(int sen, float **deltaso, float **buflight, // float rhue = xatan2f(origblur->b[y][x], origblur->a[y][x]); #endif float rL = origblur->L[y][x] / 327.68f; - // float rLor = original->L[y][x] / 327.68f; + // float rLor = original->L[y][x] / 327.68f; - float cli = 1.f; - float clc = 1.f; + // float cli = 1.f; + // float clc = 1.f; float csob = 0.f; float rs = 0.f; @@ -3489,12 +3490,13 @@ void ImProcFunctions::Exclude_Local(int sen, float **deltaso, float **buflight, affsob = 1.f / pow((1.f + rsob), SQR(SQR(rs - minrs))); } } - // affsob = 1.f; - dE = sqrt(SQR(refa - origblur->a[y][x] / 327.68f) + SQR(refb - origblur->b[y][x] / 327.68f) + SQR(lumaref - rL)); - // float dEor = affde * sqrt(SQR(refa - original->a[y][x] / 327.68f) + SQR(refb - original->b[y][x] / 327.68f) + SQR(lumaref - rLor)); - cli = (buflight[loy - begy][lox - begx]); - clc = (bufchro[loy - begy][lox - begx]); + // affsob = 1.f; + dE = sqrt(SQR(refa - origblur->a[y][x] / 327.68f) + SQR(refb - origblur->b[y][x] / 327.68f) + SQR(lumaref - rL)); + // float dEor = affde * sqrt(SQR(refa - original->a[y][x] / 327.68f) + SQR(refb - original->b[y][x] / 327.68f) + SQR(lumaref - rLor)); + + // cli = (buflight[loy - begy][lox - begx]); + // clc = (bufchro[loy - begy][lox - begx]); float reducdE = 0.f; // float reducdEor = 0.f; @@ -3508,6 +3510,7 @@ void ImProcFunctions::Exclude_Local(int sen, float **deltaso, float **buflight, if (dE > maxdE) { reducdE = 0.f; } + // if (dEor > maxdE) { // reducdEor = 0.f; // } @@ -3515,6 +3518,7 @@ void ImProcFunctions::Exclude_Local(int sen, float **deltaso, float **buflight, if (dE > mindE && dE <= maxdE) { reducdE = ar * dE + br; } + // if (dEor > mindE && dEor <= maxdE) { // reducdEor = ar * dEor + br; // } @@ -3522,6 +3526,7 @@ void ImProcFunctions::Exclude_Local(int sen, float **deltaso, float **buflight, if (dE <= mindE) { reducdE = 1.f; } + // if (dEor <= mindE) { // reducdEor = 1.f; // } @@ -3535,10 +3540,10 @@ void ImProcFunctions::Exclude_Local(int sen, float **deltaso, float **buflight, affde = reducdE; - // float realstrdE = reducdE * cli; - // float realstrchdE = reducdE * clc; - float realstrdE = cli; - float realstrchdE = clc; + // float realstrdE = reducdE * cli; + // float realstrchdE = reducdE * clc; + // float realstrdE = cli; + // float realstrchdE = 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 @@ -3577,15 +3582,15 @@ void ImProcFunctions::Exclude_Local(int sen, float **deltaso, float **buflight, float difL; difL = rsv->L[loy - begy][lox - begx] - original->L[y][x]; - // difL *= (100.f + realstrdE) / 100.f; + // difL *= (100.f + realstrdE) / 100.f; - transformed->L[y][x] = CLIP(original->L[y][x] + difL * affsob* affde); + transformed->L[y][x] = CLIP(original->L[y][x] + difL * affsob * affde); float difa, difb; difa = rsv->a[loy - begy][lox - begx] - original->a[y][x]; difb = rsv->b[loy - begy][lox - begx] - original->b[y][x]; - // difa *= (100.f + realstrchdE) / 100.f; - // difb *= (100.f + realstrchdE) / 100.f; + // difa *= (100.f + realstrchdE) / 100.f; + // difb *= (100.f + realstrchdE) / 100.f; transformed->a[y][x] = CLIPC(original->a[y][x] + difa * affsob * affde); transformed->b[y][x] = CLIPC(original->b[y][x] + difb * affsob * affde); @@ -3939,8 +3944,9 @@ void ImProcFunctions::transit_shapedetect(int senstype, LabImage * bufexporig, L if (senstype == 4 || senstype == 6 || senstype == 2 || senstype == 3 || senstype == 0) { flia = flib = ((100.f + realstrchdE) / 100.f); } else if (senstype == 1) { - flia = (100.f + realstradE) / 100.f; - flib = (100.f + realstrbdE) / 100.f; + // printf("rdE=%f chdE=%f", realstradE, realstrchdE); + flia = (100.f + realstradE + 100.f * realstrchdE) / 100.f; + flib = (100.f + realstrbdE + 100.f * realstrchdE) / 100.f; } difa = chra * flia - original->a[y][x]; @@ -4027,8 +4033,8 @@ void ImProcFunctions::transit_shapedetect(int senstype, LabImage * bufexporig, L if (senstype == 4 || senstype == 6 || senstype == 2 || senstype == 3 || senstype == 0) { flia = flib = (100.f + realstrchdE) / 100.f; } else if (senstype == 1) { - flia = (100.f + realstradE) / 100.f; - flib = (100.f + realstrbdE) / 100.f; + flia = (100.f + realstradE + 100.f * realstrchdE) / 100.f; + flib = (100.f + realstrbdE + 100.f * realstrchdE) / 100.f; } difa = chra * flia - original->a[y][x]; @@ -4140,6 +4146,32 @@ void ImProcFunctions::InverseColorLight_Local(int sp, int senstype, const struct if (senstype == 1) { //exposure temp = new LabImage(GW, GH); + float chprosl = 0.f; + /* + if (lp.expchroma != 0.f) { + float ch; + float ampli = 70.f; + ch = (1.f + 0.03f * lp.expchroma) ; + + if (ch <= 1.f) {//convert data curve near values of slider -100 + 100, to be used after to detection shape + chprosl = 99.f * ch - 99.f; + } else { + chprosl = CLIPCHRO(ampli * ch - ampli); //ampli = 25.f arbitrary empirical coefficient between 5 and 50 + } + #ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) + #endif + + for (int y = 0; y < transformed->H; y++) { + for (int x = 0; x < transformed->W; x++) { + original->a[y][x] *= 0.01f * (100.f + 100.f * chprosl); + } + } + } + + // } + */ + ImProcFunctions::exlabLocal(lp, GH, GW, original, temp, hltonecurveloc, shtonecurveloc, tonecurveloc); if (exlocalcurve) { @@ -4156,6 +4188,29 @@ void ImProcFunctions::InverseColorLight_Local(int sp, int senstype, const struct } } + if (lp.expchroma != 0.f) { + float ch; + float ampli = 70.f; + ch = (1.f + 0.02f * lp.expchroma) ; + + if (ch <= 1.f) {//convert data curve near values of slider -100 + 100, to be used after to detection shape + chprosl = 99.f * ch - 99.f; + } else { + chprosl = CLIPCHRO(ampli * ch - ampli); //ampli = 25.f arbitrary empirical coefficient between 5 and 50 + } + +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int y = 0; y < transformed->H; y++) { + for (int x = 0; x < transformed->W; x++) { + temp->a[y][x] *= 0.01f * (100.f + 100.f * chprosl); + temp->b[y][x] *= 0.01f * (100.f + 100.f * chprosl); + } + } + } + if (lp.war != 0) { ImProcFunctions::ciecamloc_02float(sp, temp, temp); } @@ -7772,6 +7827,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o //to do Modulate bufexporig and bufexptemp with blend L, H, C and masks + float chprosl = 1.f; if (exlocalcurve && localexutili) {// L=f(L) curve enhanced #ifdef _OPENMP @@ -7821,8 +7877,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } } - - #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif @@ -7833,6 +7887,20 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o int loy = cy + y; if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { + if (lp.expchroma != 0.f) { + float ch; + float ampli = 70.f; + ch = (1.f + 0.02f * lp.expchroma) ; + + if (ch <= 1.f) {//convert data curve near values of slider -100 + 100, to be used after to detection shape + chprosl = 99.f * ch - 99.f; + } else { + chprosl = CLIPCHRO(ampli * ch - ampli); //ampli = 25.f arbitrary empirical coefficient between 5 and 50 + } + + bufl_ab[loy - begy][lox - begx] = chprosl; + } + float rL; rL = CLIPRET((bufcat02fin->L[loy - begy][lox - begx] - bufexporig->L[loy - begy][lox - begx]) / 328.f); @@ -7870,7 +7938,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } //inverse else if (lp.invex && (lp.expcomp != 0 || lp.war != 0 || (exlocalcurve && localexutili)) && lp.exposena) { - float adjustr = 2.f; + float adjustr = 2.f; InverseColorLight_Local(sp, 1, lp, lightCurveloc, hltonecurveloc, shtonecurveloc, tonecurveloc, exlocalcurve, cclocalcurve, adjustr, localcutili, lllocalcurve, locallutili, original, transformed, cx, cy, hueref, chromaref, lumaref, sk); } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 8400fa5b6..24cab3e8b 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -649,6 +649,7 @@ enum ProcEventCode { Evlocallabblurcolde = 619, Evlocallabinversex = 620, Evlocallabstructexlu = 621, + Evlocallabexpchroma = 622, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index cc8faafa5..44050bc9e 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2383,6 +2383,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : hlcomprthresh(33), black(0), shcompr(50), + expchroma(0), warm(0), sensiex(15), structexp(0), @@ -2527,6 +2528,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && hlcomprthresh == other.hlcomprthresh && black == other.black && shcompr == other.shcompr + && expchroma == other.expchroma && warm == other.warm && sensiex == other.sensiex && structexp == other.structexp @@ -3624,6 +3626,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).hlcomprthresh, "Locallab", "Hlcomprthresh_" + std::to_string(i), spot.hlcomprthresh, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).black, "Locallab", "Black_" + std::to_string(i), spot.black, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).shcompr, "Locallab", "Shcompr_" + std::to_string(i), spot.shcompr, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).shcompr, "Locallab", "Expchroma_" + std::to_string(i), spot.expchroma, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).warm, "Locallab", "Warm_" + std::to_string(i), spot.warm, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sensiex, "Locallab", "Sensiex_" + std::to_string(i), spot.sensiex, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).structexp, "Locallab", "Structexp_" + std::to_string(i), spot.structexp, keyFile); @@ -4853,6 +4856,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Hlcomprthresh_" + std::to_string(i), pedited, spot.hlcomprthresh, spotEdited.hlcomprthresh); assignFromKeyfile(keyFile, "Locallab", "Black_" + std::to_string(i), pedited, spot.black, spotEdited.black); assignFromKeyfile(keyFile, "Locallab", "Shcompr_" + std::to_string(i), pedited, spot.shcompr, spotEdited.shcompr); + assignFromKeyfile(keyFile, "Locallab", "Expchroma_" + std::to_string(i), pedited, spot.expchroma, spotEdited.expchroma); assignFromKeyfile(keyFile, "Locallab", "Warm_" + std::to_string(i), pedited, spot.warm, spotEdited.warm); assignFromKeyfile(keyFile, "Locallab", "Sensiex_" + std::to_string(i), pedited, spot.sensiex, spotEdited.sensiex); assignFromKeyfile(keyFile, "Locallab", "Structexp_" + std::to_string(i), pedited, spot.structexp, spotEdited.structexp); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 892560582..2a5c50a23 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -983,6 +983,7 @@ struct LocallabParams { int hlcomprthresh; int black; int shcompr; + int expchroma; int warm; int sensiex; int structexp; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 0e1a0ba8d..4c2bf839a 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -648,7 +648,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // EvLocallabEnaExpMask LUMINANCECURVE, // Evlocallabblurcolde LUMINANCECURVE, // Evlocallabinversex - LUMINANCECURVE // Evlocallabstructexclu + LUMINANCECURVE, // Evlocallabstructexclu + LUMINANCECURVE // Evlocallabexpchroma }; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 45ee20801..21feda668 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -86,6 +86,7 @@ Locallab::Locallab(): hlcomprthresh(Gtk::manage(new Adjuster(M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 33))), black(Gtk::manage(new Adjuster(M("TP_EXPOSURE_BLACKLEVEL"), -16384, 32768, 50, 0))), shcompr(Gtk::manage(new Adjuster(M("TP_EXPOSURE_COMPRSHADOWS"), 0, 100, 1, 50))), + expchroma(Gtk::manage(new Adjuster(M("TP_LOCALLAB_EXPCHROMA"), -50, 100, 1, 0))), warm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_WARM"), -100., 100., 1., 0., Gtk::manage(new RTImage("circle-blue-small.png")), Gtk::manage(new RTImage("circle-orange-small.png"))))), sensiex(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 15))), structexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))), @@ -390,6 +391,7 @@ Locallab::Locallab(): black->setAdjusterListener(this); shcompr->setAdjusterListener(this); + expchroma->setAdjusterListener(this); warm->set_tooltip_text(M("TP_LOCALLAB_WARM_TOOLTIP")); warm->setAdjusterListener(this); @@ -458,6 +460,7 @@ Locallab::Locallab(): exposeBox->pack_start(*hlcomprthresh); exposeBox->pack_start(*black); exposeBox->pack_start(*shcompr); + exposeBox->pack_start(*expchroma); exposeBox->pack_start(*warm); exposeBox->pack_start(*sensiex); exposeBox->pack_start(*structexp); @@ -1545,6 +1548,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pp->locallab.spots.at(pp->locallab.selspot).hlcomprthresh = hlcomprthresh->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).black = black->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).shcompr = shcompr->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).expchroma = expchroma->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).warm = warm->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).sensiex = sensiex->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).structexp = structexp->getIntValue(); @@ -1707,6 +1711,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pe->locallab.spots.at(pp->locallab.selspot).hlcomprthresh = pe->locallab.spots.at(pp->locallab.selspot).hlcomprthresh || hlcomprthresh->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).black = pe->locallab.spots.at(pp->locallab.selspot).black || black->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).shcompr = pe->locallab.spots.at(pp->locallab.selspot).shcompr || shcompr->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).expchroma = pe->locallab.spots.at(pp->locallab.selspot).expchroma || expchroma->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).warm = pe->locallab.spots.at(pp->locallab.selspot).warm || warm->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).sensiex = pe->locallab.spots.at(pp->locallab.selspot).sensiex || sensiex->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).structexp = pe->locallab.spots.at(pp->locallab.selspot).structexp || structexp->getEditedState(); @@ -1856,6 +1861,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pedited->locallab.spots.at(pp->locallab.selspot).hlcomprthresh = pedited->locallab.spots.at(pp->locallab.selspot).hlcomprthresh || hlcomprthresh->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).black = pedited->locallab.spots.at(pp->locallab.selspot).black || black->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).shcompr = pedited->locallab.spots.at(pp->locallab.selspot).shcompr || shcompr->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).expchroma = pedited->locallab.spots.at(pp->locallab.selspot).expchroma || expchroma->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).warm = pedited->locallab.spots.at(pp->locallab.selspot).warm || warm->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).sensiex = pedited->locallab.spots.at(pp->locallab.selspot).sensiex || sensiex->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).structexp = pedited->locallab.spots.at(pp->locallab.selspot).structexp || structexp->getEditedState(); @@ -2603,6 +2609,7 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe hlcomprthresh->setDefault((double)defSpot->hlcomprthresh); black->setDefault((double)defSpot->black); shcompr->setDefault((double)defSpot->shcompr); + expchroma->setDefault((double)defSpot->expchroma); warm->setDefault((double)defSpot->warm); sensiex->setDefault((double)defSpot->sensiex); structexp->setDefault((double)defSpot->structexp); @@ -2683,6 +2690,7 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe hlcomprthresh->setDefaultEditedState(Irrelevant); black->setDefaultEditedState(Irrelevant); shcompr->setDefaultEditedState(Irrelevant); + expchroma->setDefaultEditedState(Irrelevant); warm->setDefaultEditedState(Irrelevant); sensiex->setDefaultEditedState(Irrelevant); structexp->setDefaultEditedState(Irrelevant); @@ -2767,6 +2775,7 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe hlcomprthresh->setDefaultEditedState(defSpotState->hlcomprthresh ? Edited : UnEdited); black->setDefaultEditedState(defSpotState->black ? Edited : UnEdited); shcompr->setDefaultEditedState(defSpotState->shcompr ? Edited : UnEdited); + expchroma->setDefaultEditedState(defSpotState->expchroma ? Edited : UnEdited); warm->setDefaultEditedState(defSpotState->warm ? Edited : UnEdited); sensiex->setDefaultEditedState(defSpotState->sensiex ? Edited : UnEdited); structexp->setDefaultEditedState(defSpotState->structexp ? Edited : UnEdited); @@ -2959,6 +2968,12 @@ void Locallab::adjusterChanged(Adjuster * a, double newval) } } + if (a == expchroma) { + if (listener) { + listener->panelChanged(Evlocallabexpchroma, expchroma->getTextValue()); + } + } + if (a == warm) { if (listener) { listener->panelChanged(Evlocallabwarm, warm->getTextValue()); @@ -3383,6 +3398,7 @@ void Locallab::setBatchMode(bool batchMode) hlcomprthresh->showEditedCB(); black->showEditedCB(); shcompr->showEditedCB(); + expchroma->showEditedCB(); warm->showEditedCB(); sensiex->showEditedCB(); structexp->showEditedCB(); @@ -3719,6 +3735,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con hlcomprthresh->setValue(pp->locallab.spots.at(index).hlcomprthresh); black->setValue(pp->locallab.spots.at(index).black); shcompr->setValue(pp->locallab.spots.at(index).shcompr); + expchroma->setValue(pp->locallab.spots.at(index).expchroma); warm->setValue(pp->locallab.spots.at(index).warm); sensiex->setValue(pp->locallab.spots.at(index).sensiex); structexp->setValue(pp->locallab.spots.at(index).structexp); @@ -3909,6 +3926,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con black->setEditedState(spotState->black ? Edited : UnEdited); warm->setEditedState(spotState->warm ? Edited : UnEdited); shcompr->setEditedState(spotState->shcompr ? Edited : UnEdited); + expchroma->setEditedState(spotState->expchroma ? Edited : UnEdited); sensiex->setEditedState(spotState->sensiex ? Edited : UnEdited); structexp->setEditedState(spotState->structexp ? Edited : UnEdited); blurexpde->setEditedState(spotState->blurexpde ? Edited : UnEdited); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 867814fda..097df41c9 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -102,6 +102,7 @@ private: Adjuster* const hlcomprthresh; Adjuster* const black; Adjuster* const shcompr; + Adjuster* const expchroma; Adjuster* const warm; Adjuster* const sensiex; Adjuster* const structexp; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 143e0bc6c..b1cd97299 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -969,6 +969,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).hlcomprthresh = locallab.spots.at(j).hlcomprthresh && pSpot.hlcomprthresh == otherSpot.hlcomprthresh; locallab.spots.at(j).black = locallab.spots.at(j).black && pSpot.black == otherSpot.black; locallab.spots.at(j).shcompr = locallab.spots.at(j).shcompr && pSpot.shcompr == otherSpot.shcompr; + locallab.spots.at(j).expchroma = locallab.spots.at(j).expchroma && pSpot.expchroma == otherSpot.expchroma; locallab.spots.at(j).warm = locallab.spots.at(j).warm && pSpot.warm == otherSpot.warm; locallab.spots.at(j).sensiex = locallab.spots.at(j).sensiex && pSpot.sensiex == otherSpot.sensiex; locallab.spots.at(j).structexp = locallab.spots.at(j).structexp && pSpot.structexp == otherSpot.structexp; @@ -2661,10 +2662,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).black = mods.locallab.spots.at(i).black; } - if (locallab.spots.at(i).shcompr) { - toEdit.locallab.spots.at(i).shcompr = mods.locallab.spots.at(i).shcompr; + if (locallab.spots.at(i).expchroma) { + toEdit.locallab.spots.at(i).expchroma = mods.locallab.spots.at(i).expchroma; } - + if (locallab.spots.at(i).warm) { toEdit.locallab.spots.at(i).warm = mods.locallab.spots.at(i).warm; } @@ -3981,6 +3982,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : hlcomprthresh(v), black(v), shcompr(v), + expchroma(v), warm(v), sensiex(v), structexp(v), @@ -4122,6 +4124,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) hlcomprthresh = v; black = v; shcompr = v; + expchroma = v; warm = v; sensiex = v; structexp = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 3a94afdb6..754ffb652 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -508,6 +508,7 @@ public: bool hlcomprthresh; bool black; bool shcompr; + bool expchroma; bool warm; bool sensiex; bool structexp;