diff --git a/rtdata/languages/default b/rtdata/languages/default index a2f8a7044..cff036866 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -822,6 +822,9 @@ HISTORY_MSG_572;Local - Exp black HISTORY_MSG_573;Local - Exp Shcompr HISTORY_MSG_574;Local - Exp Scope HISTORY_MSG_575;Local - Exp Contrast curve +HISTORY_MSG_576;Local - Centerbuf +HISTORY_MSG_577;Local - adjblur +HISTORY_MSG_578;Local - cut past HISTORY_NEWSNAPSHOT;Add HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s HISTORY_SNAPSHOT;Snapshot @@ -1786,6 +1789,7 @@ TP_LENSPROFILE_USECA;Chromatic aberration correction TP_LENSPROFILE_USEDIST;Distortion correction TP_LENSPROFILE_USEVIGN;Vignetting correction TP_LOCALLAB_ACTIV;Blur luminance only +TP_LOCALLAB_ADJBLUR;Adjust and Blur TP_LOCALLAB_ARTIF;Reduce artifacts - Improve algoritm TP_LOCALLAB_ARTIF_TOOLTIP;Only active for Color-light, Exposure, Retinex, Vibrance, ToneMapping, CBDL. TP_LOCALLAB_AVOID;Avoid color shift @@ -1802,7 +1806,9 @@ TP_LOCALLAB_CURV;Lightness - Contrast "Super" TP_LOCALLAB_CURVNONE;Disable curves TP_LOCALLAB_CURVCURR;Normal TP_LOCALLAB_CURVENH;Super +TP_LOCALLAB_CUTPAST;Copy past buffer TP_LOCALLAB_DENOIS;Denoise +TP_LOCALLAB_DUST;Dust Spot Removal TP_LOCALLAB_LUM;Curves TP_LOCALLAB_CURVEEDITOR_TONES_TOOLTIP;L=f(L), can be used with L(H) in Color and Light TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP;To be active, you must check button 'Enable curves' diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index bce7a0db3..d89b55036 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -1024,6 +1024,16 @@ void Crop::update (int todo) params.locallab.shcompr = parent->shcomprs[sp]; params.locallab.sensiex = parent->sensiexs[sp]; + params.locallab.centerXbuf = parent->centerxbufs[sp]; + params.locallab.centerYbuf = parent->centerybufs[sp]; + params.locallab.adjblur = parent->adjblurs[sp]; + + if (parent->cutpasts[sp] == 0) { + params.locallab.cutpast = false; + } else { + params.locallab.cutpast = true; + } + std::vector cretie; for (int j = 0; j < parent->sizeretics[sp]; j++) { @@ -1344,6 +1354,19 @@ void Crop::update (int todo) parent->shcomprs[sp] = params.locallab.shcompr = parent->shcomprs[0]; parent->sensiexs[sp] = params.locallab.sensiex = parent->sensiexs[0]; + parent->centerxbufs[sp] = params.locallab.centerXbuf = parent->centerxbufs[0]; + parent->centerybufs[sp] = params.locallab.centerYbuf = parent->centerybufs[0]; + parent->adjblurs[sp] = params.locallab.adjblur = parent->adjblurs[0]; + + if (parent->cutpasts[0] == 0) { + params.locallab.cutpast = false; + parent->cutpasts[sp] = 0; + } else { + params.locallab.cutpast = true; + parent->cutpasts[sp] = 1; + + } + std::vector ccret; for (int j = 0; j < parent->sizeretics[sp]; j++) { diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index e7aad1562..3be594e79 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -104,6 +104,11 @@ ImProcCoordinator::ImProcCoordinator () circrads (500, -10000), centerx (500, -10000), centery (500, -10000), + centerxbufs (500, -10000), + centerybufs (500, -10000), + adjblurs (500, -10000), + cutpasts (500, -10000), + locx (500, -10000), locy (500, -10000), locxl (500, -10000), @@ -833,7 +838,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) }; - int maxdata = 73; + int maxdata = 77;//73 for 10011 if (fic0) { //find current version mip @@ -876,7 +881,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { for (int sp = 1; sp < maxspot; sp++) { // spots default int t_sp = sp; - int t_mipversion = 10011;//new value for tone mapping + int t_mipversion = 10012;//new value for tone mapping int t_circrad = 18; int t_locX = 250; int t_locY = 250; @@ -976,6 +981,13 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) //10011 std::string t_curvex = "3000A0B0C1000D1000E"; + //10012 + int t_centerXbuf = 0; + int t_centerYbuf = 0; + int t_adjblur = 0; + int t_cutpast = 0; + + //all variables except locRETgainCurve 'coomon for all) fic << "Mipversion=" << t_mipversion << '@' << endl; fic << "Spot=" << t_sp << '@' << endl; @@ -1053,6 +1065,11 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) fic << "Shcompr=" << t_shcompr << '@' << endl; fic << "Sensiex=" << t_sensiex << '@' << endl; + fic << "CenterXbuf=" << t_centerXbuf << '@' << endl; + fic << "CenterYbuf=" << t_centerYbuf << '@' << endl; + fic << "Adjblur=" << t_adjblur << '@' << endl; + fic << "Cutpast=" << t_cutpast << '@' << endl; + fic << "curveReti=" << t_curvret << '@' << endl; fic << "curveLL=" << t_curvll << '@' << endl; fic << "curveLH=" << t_curvlh << '@' << endl; @@ -1062,6 +1079,8 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) fic << "pthres=" << t_psthres << '@' << endl; fic << "curveex=" << t_curvex << '@' << endl; + + fic << endl; } @@ -1257,6 +1276,16 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) dataspot[68][0] = shcomprs[0] = params.locallab.shcompr; dataspot[69][0] = sensiexs[0] = params.locallab.sensiex; + dataspot[70][0] = centerxbufs[0] = params.locallab.centerXbuf; + dataspot[71][0] = centerybufs[0] = params.locallab.centerYbuf; + dataspot[72][0] = adjblurs[0] = params.locallab.adjblur; + + if (!params.locallab.cutpast) { + dataspot[73][0] = cutpasts[0] = 0; + } else { + dataspot[73][0] = cutpasts[0] = 1; + } + //curve Reti local int siz = params.locallab.localTgaincurve.size(); @@ -1520,9 +1549,9 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) // I have forgotten 10010 ==> probably crash...but now it's passed... //enabled this code after... -// if (versionmip == 10011) { -// maxind = 70; -// } + if (versionmip == 10011) { + maxind = 70; + } while (getline (fich, line)) { spotline = line; @@ -1669,7 +1698,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) } if (versionmip == 10008) { - //vibrance + //vibrance for (int sp = 1; sp < maxspot; sp++) { // spots default dataspot[58][sp] = 19; @@ -1704,6 +1733,17 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) } } + + if (versionmip == 10011) { + + for (int sp = 1; sp < maxspot; sp++) { // spots default + dataspot[70][sp] = 0; + dataspot[71][sp] = 0; + dataspot[72][sp] = 0; + dataspot[73][sp] = 0; + } + } + // printf("ns=%i \n", ns); if (ns < (maxspot - 1)) { @@ -1712,7 +1752,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) for (int sp = ns + 1 ; sp < maxspot; sp++) { // spots default int t_sp = sp; - int t_mipversion = 10011; + int t_mipversion = 10012; int t_circrad = 18; int t_locX = 250; int t_locY = 250; @@ -1804,6 +1844,12 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) //10010 std::string t_curvex = "3000A0B0C1000D1000E"; + //10012 + int t_centerXbuf = 0; + int t_centerYbuf = 0; + int t_adjblur = 0; + int t_cutpast = 0; + fic << "Mipversion=" << t_mipversion << '@' << endl; fic << "Spot=" << t_sp << '@' << endl; fic << "Circrad=" << t_circrad << '@' << endl; @@ -1878,6 +1924,11 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) fic << "Shcompr=" << t_shcompr << '@' << endl; fic << "Sensiex=" << t_sensiex << '@' << endl; + fic << "CenterXbuf=" << t_centerXbuf << '@' << endl; + fic << "CenterYbuf=" << t_centerYbuf << '@' << endl; + fic << "Adjblur=" << t_adjblur << '@' << endl; + fic << "Cutpast=" << t_cutpast << '@' << endl; + fic << "curveReti=" << t_curvret << '@' << endl; fic << "curveLL=" << t_curvll << '@' << endl; fic << "curveLH=" << t_curvlh << '@' << endl; @@ -1887,6 +1938,8 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) fic << "pthres=" << t_psthres << '@' << endl; fic << "curveex=" << t_curvex << '@' << endl; + + fic << endl; } @@ -2169,6 +2222,18 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) params.locallab.shcompr = shcomprs[sp] = dataspot[68][sp]; params.locallab.sensiex = sensiexs[sp] = dataspot[69][sp]; + params.locallab.centerXbuf = centerxbufs[sp] = dataspot[70][sp]; + params.locallab.centerYbuf = centerybufs[sp] = dataspot[71][sp]; + params.locallab.adjblur = adjblurs[sp] = dataspot[72][sp]; + + if (dataspot[73][sp] == 0) { + cutpasts[sp] = 0; + params.locallab.cutpast = false; + } else { + cutpasts[sp] = 1; + params.locallab.cutpast = true; + } + int *s_datc; s_datc = new int[70]; @@ -2635,6 +2700,19 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) dataspot[68][sp] = shcomprs[sp] = params.locallab.shcompr = dataspot[68][0]; dataspot[69][sp] = sensiexs[sp] = params.locallab.sensiex = dataspot[69][0]; + dataspot[70][sp] = centerxbufs[sp] = params.locallab.centerXbuf = dataspot[70][0]; + dataspot[71][sp] = centerybufs[sp] = params.locallab.centerYbuf = dataspot[71][0]; + dataspot[72][sp] = adjblurs[sp] = params.locallab.adjblur = dataspot[72][0]; + + if (dataspot[73][0] == 0) { + params.locallab.cutpast = false; + dataspot[73][sp] = 0; + cutpasts[sp] = 0; + } else { + params.locallab.cutpast = true; + dataspot[73][sp] = 1; + cutpasts[sp] = 1; + } int *s_datc; @@ -2874,7 +2952,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) for (int spe = 1; spe < maxspot; spe++) { int t_sp = spe; - int t_mipversion = 100011; + int t_mipversion = 10012; int t_circrad = dataspot[2][spe]; int t_locX = dataspot[3][spe]; int t_locY = dataspot[4][spe]; @@ -2947,6 +3025,11 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) int t_shcompr = dataspot[68][spe]; int t_sensiex = dataspot[69][spe]; + int t_centerXbuf = dataspot[70][spe]; + int t_centerYbuf = dataspot[71][spe]; + int t_adjblur = dataspot[72][spe]; + int t_cutpast = dataspot[73][spe]; + int t_hueref = dataspot[maxdata - 3][spe]; int t_chromaref = dataspot[maxdata - 2][spe]; int t_lumaref = dataspot[maxdata - 1][spe]; @@ -3037,6 +3120,10 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) fou << "Shcompr=" << t_shcompr << '@' << endl; fou << "Sensiex=" << t_sensiex << '@' << endl; + fou << "CenterXbuf=" << t_centerXbuf << '@' << endl; + fou << "CenterYbuf=" << t_centerYbuf << '@' << endl; + fou << "Adjblur=" << t_adjblur << '@' << endl; + fou << "Cutpast=" << t_cutpast << '@' << endl; fou << "hueref=" << t_hueref << '@' << endl; fou << "chromaref=" << t_chromaref << '@' << endl; diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index 4b4c452df..ff1e72fbc 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -251,6 +251,11 @@ protected: LUTi circrads; LUTi centerx; LUTi centery; + LUTi centerxbufs; + LUTi centerybufs; + LUTi adjblurs; + LUTi cutpasts; + LUTi locx; LUTi locy; LUTi locxl; diff --git a/rtengine/procevents.h b/rtengine/procevents.h index e32ab41bb..e279e6a5e 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -602,6 +602,9 @@ enum ProcEvent { Evlocallabshcompr = 572, Evlocallabsensiex = 573, Evlocallabshape = 574, + EvlocallabCenterbuf = 575, + Evlocallabadjblur = 576, + Evlocallabcutpast = 577, NUMOFEVENTS diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index e09044077..38149063e 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -52,7 +52,7 @@ const int br = (int) options.rtSettings.bot_right; const int tl = (int) options.rtSettings.top_left; const int bl = (int) options.rtSettings.bot_left; -const char *LensProfParams::methodstring[static_cast(LensProfParams::LcMode::LCP) + 1u] = {"none", "lfauto", "lfmanual", "lcp"}; +const char *LensProfParams::methodstring[static_cast (LensProfParams::LcMode::LCP) + 1u] = {"none", "lfauto", "lfmanual", "lcp"}; const char *RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::numMethods] = {"amaze", "igv", "lmmse", "eahd", "hphd", "vng4", "dcb", "ahd", "fast", "mono", "none", "pixelshift" }; const char *RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::numMethods] = {"3-pass (best)", "1-pass (medium)", "fast", "mono", "none" }; @@ -977,6 +977,9 @@ void LocallabParams::setDefaults() centerX = 0; centerY = 0; circrad = 18; + centerXbuf = 0; + centerYbuf = 0; + adjblur = 0; if (options.locaaju == 0) { qualityMethod = "std"; @@ -1031,6 +1034,7 @@ void LocallabParams::setDefaults() Smethod = "IND"; retinexMethod = "high"; invers = false; + cutpast = false; curvactiv = false; activlum = false; radius = 1; @@ -2837,13 +2841,15 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b } if (!pedited || pedited->lensProf.lfCameraMake) { - keyFile.set_string("LensProfile", "LFCameraMake", lensProf.lfCameraMake); + keyFile.set_string ("LensProfile", "LFCameraMake", lensProf.lfCameraMake); } + if (!pedited || pedited->lensProf.lfCameraModel) { - keyFile.set_string("LensProfile", "LFCameraModel", lensProf.lfCameraModel); + keyFile.set_string ("LensProfile", "LFCameraModel", lensProf.lfCameraModel); } + if (!pedited || pedited->lensProf.lfLens) { - keyFile.set_string("LensProfile", "LFLens", lensProf.lfLens); + keyFile.set_string ("LensProfile", "LFLens", lensProf.lfLens); } // save perspective correction @@ -2959,6 +2965,10 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b keyFile.set_boolean ("Locallab", "Invers", locallab.invers); } + if (!pedited || pedited->locallab.cutpast) { + keyFile.set_boolean ("Locallab", "Cutpast", locallab.cutpast); + } + if (!pedited || pedited->locallab.curvactiv) { keyFile.set_boolean ("Locallab", "Curvactiv", locallab.curvactiv); } @@ -3027,6 +3037,18 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b keyFile.set_integer ("Locallab", "Circrad", locallab.circrad); } + if (!pedited || pedited->locallab.centerXbuf) { + keyFile.set_integer ("Locallab", "CenterXbuf", locallab.centerXbuf); + } + + if (!pedited || pedited->locallab.centerYbuf) { + keyFile.set_integer ("Locallab", "CenterYbuf", locallab.centerYbuf); + } + + if (!pedited || pedited->locallab.adjblur) { + keyFile.set_integer ("Locallab", "Adjblur", locallab.adjblur); + } + if (!pedited || pedited->locallab.thres) { keyFile.set_integer ("Locallab", "Thres", locallab.thres); } @@ -3255,8 +3277,8 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b keyFile.set_integer ("Locallab", "Rewei", locallab.rewei); } - - + + // save post-crop vignette if (!pedited || pedited->pcvignette.enabled) { keyFile.set_boolean ("PCVignette", "Enabled", pcvignette.enabled); @@ -4738,6 +4760,14 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } + if (keyFile.has_key ("Locallab", "Cutpast")) { + locallab.cutpast = keyFile.get_boolean ("Locallab", "Cutpast"); + + if (pedited) { + pedited->locallab.cutpast = true; + } + } + if (keyFile.has_key ("Locallab", "Curvactiv")) { locallab.curvactiv = keyFile.get_boolean ("Locallab", "Curvactiv"); @@ -4875,6 +4905,30 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } + if (keyFile.has_key ("Locallab", "CenterXbuf")) { + locallab.centerXbuf = keyFile.get_integer ("Locallab", "CenterXbuf"); + + if (pedited) { + pedited->locallab.centerXbuf = true; + } + } + + if (keyFile.has_key ("Locallab", "CenterYbuf")) { + locallab.centerYbuf = keyFile.get_integer ("Locallab", "CenterYbuf"); + + if (pedited) { + pedited->locallab.centerYbuf = true; + } + } + + if (keyFile.has_key ("Locallab", "Adjblur")) { + locallab.adjblur = keyFile.get_integer ("Locallab", "Adjblur"); + + if (pedited) { + pedited->locallab.adjblur = true; + } + } + if (keyFile.has_key ("Locallab", "Thres")) { locallab.thres = keyFile.get_integer ("Locallab", "Thres"); @@ -5325,7 +5379,7 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } - + // load channel mixer curve if (keyFile.has_group ("Channel Mixer")) { if (keyFile.has_key ("Channel Mixer", "Red") && keyFile.has_key ("Channel Mixer", "Green") && keyFile.has_key ("Channel Mixer", "Blue")) { @@ -7200,7 +7254,7 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) pedited->lensProf.lcpFile = true; } - if(ppVersion < 327 && !lensProf.lcpFile.empty()) { + if (ppVersion < 327 && !lensProf.lcpFile.empty()) { lensProf.lcMode = LensProfParams::LcMode::LCP; } } @@ -7229,22 +7283,25 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } - if (keyFile.has_key("LensProfile", "LFCameraMake")) { - lensProf.lfCameraMake = keyFile.get_string("LensProfile", "LFCameraMake"); + if (keyFile.has_key ("LensProfile", "LFCameraMake")) { + lensProf.lfCameraMake = keyFile.get_string ("LensProfile", "LFCameraMake"); + if (pedited) { pedited->lensProf.lfCameraMake = true; } } - if (keyFile.has_key("LensProfile", "LFCameraModel")) { - lensProf.lfCameraModel = keyFile.get_string("LensProfile", "LFCameraModel"); + if (keyFile.has_key ("LensProfile", "LFCameraModel")) { + lensProf.lfCameraModel = keyFile.get_string ("LensProfile", "LFCameraModel"); + if (pedited) { pedited->lensProf.lfCameraModel = true; } } - if (keyFile.has_key("LensProfile", "LFLens")) { - lensProf.lfLens = keyFile.get_string("LensProfile", "LFLens"); + if (keyFile.has_key ("LensProfile", "LFLens")) { + lensProf.lfLens = keyFile.get_string ("LensProfile", "LFLens"); + if (pedited) { pedited->lensProf.lfLens = true; } @@ -9880,6 +9937,7 @@ bool ProcParams::operator== (const ProcParams& other) && locallab.enabled == other.locallab.enabled && locallab.avoid == other.locallab.avoid && locallab.invers == other.locallab.invers + && locallab.cutpast == other.locallab.cutpast && locallab.curvactiv == other.locallab.curvactiv && locallab.activlum == other.locallab.activlum && locallab.inversrad == other.locallab.inversrad @@ -9897,6 +9955,9 @@ bool ProcParams::operator== (const ProcParams& other) && locallab.centerX == other.locallab.centerX && locallab.centerY == other.locallab.centerY && locallab.circrad == other.locallab.circrad + && locallab.centerXbuf == other.locallab.centerXbuf + && locallab.centerYbuf == other.locallab.centerYbuf + && locallab.adjblur == other.locallab.adjblur && locallab.thres == other.locallab.thres && locallab.proxi == other.locallab.proxi && locallab.lightness == other.locallab.lightness @@ -9966,7 +10027,7 @@ bool ProcParams::operator== (const ProcParams& other) && locallab.cccurve == other.locallab.cccurve && locallab.LHcurve == other.locallab.LHcurve && locallab.HHcurve == other.locallab.HHcurve - + && pcvignette.enabled == other.pcvignette.enabled && pcvignette.strength == other.pcvignette.strength && pcvignette.feather == other.pcvignette.feather diff --git a/rtengine/procparams.h b/rtengine/procparams.h index fe00a9632..e70210c3f 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -841,7 +841,7 @@ public: LCP // Lens correction using lcp file }; - static const char *methodstring[static_cast(LcMode::LCP) + 1u]; + static const char *methodstring[static_cast (LcMode::LCP) + 1u]; LcMode lcMode; Glib::ustring lcpFile; bool useDist, useVign, useCA; @@ -875,18 +875,19 @@ public: return lcMode == LcMode::LENSFUNMANUAL; } - Glib::ustring getMethodString(LcMode mode) const + Glib::ustring getMethodString (LcMode mode) const { - return methodstring[static_cast(mode)]; + return methodstring[static_cast (mode)]; } - LcMode getMethodNumber(const Glib::ustring &mode) const + LcMode getMethodNumber (const Glib::ustring &mode) const { - for(size_t i = 0; i <= static_cast(LcMode::LCP); ++i) { - if(methodstring[i] == mode) { - return static_cast(i); + for (size_t i = 0; i <= static_cast (LcMode::LCP); ++i) { + if (methodstring[i] == mode) { + return static_cast (i); } } + return LcMode::NONE; } }; @@ -933,6 +934,9 @@ public: int centerX; int centerY; int circrad; + int centerXbuf; + int centerYbuf; + int adjblur; int thres; int proxi; Glib::ustring qualityMethod; @@ -995,6 +999,7 @@ public: Glib::ustring Smethod; Glib::ustring retinexMethod; bool invers; + bool cutpast; bool curvactiv; bool activlum; bool inversrad; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 4d833238c..004456c1f 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -601,7 +601,10 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, //Evlocallabblack LUMINANCECURVE, //Evlocallabshcompr LUMINANCECURVE, //Evlocallabsensiex - LUMINANCECURVE //Evlocallabshape + LUMINANCECURVE, //Evlocallabshape + LUMINANCECURVE, //Evlocallabcenterbuf + LUMINANCECURVE, //Evlocallabadjblur + LUMINANCECURVE //Evlocallabcutpast }; diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index cd30492c4..bad78c7d2 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -1102,7 +1102,7 @@ private: } ifstream fich (datalab, ios::in); - int maxdata = 73; + int maxdata = 77;//73 10011 if (fich && versionmip != 0) { std::string inser; @@ -1293,6 +1293,17 @@ private: dataspots[68][0] = params.locallab.shcompr; dataspots[69][0] = params.locallab.sensiex; + dataspots[70][0] = params.locallab.centerXbuf; + dataspots[71][0] = params.locallab.centerYbuf; + dataspots[72][0] = params.locallab.adjblur; + + if (!params.locallab.cutpast) { + dataspots[73][0] = 0; + } else { + dataspots[73][0] = 1; + } + + dataspots[maxdata - 3][0] = 100.f * params.locallab.hueref; dataspots[maxdata - 2][0] = params.locallab.chromaref; dataspots[maxdata - 1][0] = params.locallab.lumaref; @@ -1715,6 +1726,16 @@ private: params.locallab.shcompr = dataspots[68][sp]; params.locallab.sensiex = dataspots[69][sp]; + params.locallab.centerXbuf = dataspots[70][sp]; + params.locallab.centerYbuf = dataspots[71][sp]; + params.locallab.adjblur = dataspots[72][sp]; + + if (dataspots[73][sp] == 0) { + params.locallab.cutpast = false; + } else { + params.locallab.cutpast = true; + } + params.locallab.hueref = ((float) dataspots[maxdata - 3][sp]) / 100.f; params.locallab.chromaref = dataspots[maxdata - 2][sp]; params.locallab.lumaref = dataspots[maxdata - 1][sp]; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 128e6b0a3..f2c664670 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -107,6 +107,9 @@ Locallab::Locallab (): hueref (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_HUEREF"), -3.15, 3.15, 0.01, 0))), chromaref (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_CHROMAREF"), 0, 200, 0.01, 0))), lumaref (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_LUMAMAREF"), 0, 100, 0.01, 0))), + centerXbuf (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_CENTERBUF_X"), -1000, 1000, 1, 0))), + centerYbuf (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_CENTERBUF_Y"), -1000, 1000, 1, 0))), + adjblur (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_ADJBLUR"), 0, 100, 1, 0))), Smethod (Gtk::manage (new MyComboBoxText ())), retinexMethod (Gtk::manage (new MyComboBoxText ())), @@ -116,6 +119,7 @@ Locallab::Locallab (): artifFrame (Gtk::manage (new Gtk::Frame (M ("TP_LOCALLAB_ARTIF")))), shapeFrame (Gtk::manage (new Gtk::Frame (M ("TP_LOCALLAB_SHFR")))), superFrame (Gtk::manage (new Gtk::Frame ())), + dustFrame (Gtk::manage (new Gtk::Frame (M ("TP_LOCALLAB_DUST")))), // artifVBox (Gtk::manage (new Gtk::VBox ())), // shapeVBox (Gtk::manage (new Gtk::VBox ())), @@ -146,6 +150,7 @@ Locallab::Locallab (): inversrad (Gtk::manage (new Gtk::CheckButton (M ("TP_LOCALLAB_INVERS")))), inversret (Gtk::manage (new Gtk::CheckButton (M ("TP_LOCALLAB_INVERS")))), inverssha (Gtk::manage (new Gtk::CheckButton (M ("TP_LOCALLAB_INVERS")))), + cutpast (Gtk::manage (new Gtk::CheckButton (M ("TP_LOCALLAB_CUTPAST")))), draggedPointOldAngle (-1000.) { @@ -351,6 +356,10 @@ Locallab::Locallab (): sensi->set_tooltip_text (M ("TP_LOCALLAB_SENSI_TOOLTIP")); sensi->setAdjusterListener (this); + centerXbuf->setAdjusterListener (this);; + centerYbuf->setAdjusterListener (this);; + adjblur->setAdjusterListener (this);; + //exposure expcomp->setAdjusterListener (this); @@ -388,6 +397,9 @@ Locallab::Locallab (): inversret->set_active (false); inversretConn = inversret->signal_toggled().connect ( sigc::mem_fun (*this, &Locallab::inversretChanged) ); + cutpast->set_active (false); + cutpastConn = cutpast->signal_toggled().connect ( sigc::mem_fun (*this, &Locallab::cutpastChanged) ); + cutpast->set_tooltip_text (M ("TP_LOCALLAB_CUTPAST_TOOLTIP")); //tone mapping local stren->setAdjusterListener (this); @@ -603,6 +615,7 @@ Locallab::Locallab (): superFrame->set_label_widget (*curvactiv); ToolParamBlock* const colorBox = Gtk::manage (new ToolParamBlock()); + ToolParamBlock* const dustBox = Gtk::manage (new ToolParamBlock()); superBox->pack_start (*lightness); superBox->pack_start (*contrast); @@ -612,6 +625,17 @@ Locallab::Locallab (): colorBox->pack_start (*chroma); colorBox->pack_start (*sensi); + dustFrame->set_label_align (0.025, 0.5); + + dustBox->pack_start (*cutpast); + dustBox->pack_start (*centerXbuf); + dustBox->pack_start (*centerYbuf); + dustBox->pack_start (*adjblur); + dustFrame->add (*dustBox); +// colorBox->pack_start (*dustFrame); + centerXbuf->hide(); + centerYbuf->hide(); + qualcurvbox->pack_start (*labqualcurv, Gtk::PACK_SHRINK, 4); qualcurvbox->pack_start (*qualitycurveMethod); @@ -1145,6 +1169,10 @@ void Locallab::neutral_pressed () centerX->resetValue (false); centerY->resetValue (false); circrad->resetValue (false); + centerXbuf->resetValue (false); + centerYbuf->resetValue (false); + adjblur->resetValue (false); + qualityMethod->set_active (0); qualitycurveMethod->set_active (0); thres->resetValue (false); @@ -1158,6 +1186,7 @@ void Locallab::neutral_pressed () transit->resetValue (false); sensibn->resetValue (false); invers->set_active (false); + cutpast->set_active (false); curvactiv->set_active (false); inversrad->set_active (false); inversret->set_active (false); @@ -1653,11 +1682,21 @@ bool Locallab::localComputed_ () shcompr->setValue (nextdatasp[68]); sensiex->setValue (nextdatasp[69]); + centerXbuf->setValue (nextdatasp[70]); + centerYbuf->setValue (nextdatasp[71]); + adjblur->setValue (nextdatasp[72]); - double intermed = 0.01 * (double) nextdatasp[64]; + //protectskin + if (nextdatasp[73] == 0) { + cutpast->set_active (false); + } else { + cutpast->set_active (true); + } + + double intermed = 0.01 * (double) nextdatasp[74]; hueref->setValue (intermed); - chromaref->setValue (nextdatasp[65]); - lumaref->setValue (nextdatasp[66]); + chromaref->setValue (nextdatasp[75]); + lumaref->setValue (nextdatasp[76]); int *s_datc; s_datc = new int[70]; @@ -1839,6 +1878,10 @@ bool Locallab::localComputed_ () listener->panelChanged (Evlocallabinvers, M ("GENERAL_ENABLED")); } + if (listener) {//for cutpast + listener->panelChanged (Evlocallabcutpast, M ("GENERAL_ENABLED")); + } + if (listener) {//for curvactiv listener->panelChanged (Evlocallabcurvactiv, M ("GENERAL_ENABLED")); } @@ -1921,7 +1964,7 @@ bool Locallab::localComputed_ () void Locallab::localChanged (int **datasp, std::string datastr, std::string ll_str, std::string lh_str, std::string cc_str, std::string hh_str, std::string sk_str, std::string ps_str, std::string ex_str, int sp, int maxdat) { - for (int i = 2; i < 73; i++) { + for (int i = 2; i < 77; i++) { nextdatasp[i] = datasp[i][sp]; } @@ -1960,6 +2003,8 @@ void Locallab::read (const ProcParams* pp, const ParamsEdited* pedited) hueref->hide(); chromaref->hide(); lumaref->hide(); + centerXbuf->hide(); + centerYbuf->hide(); disableListener (); enablecolorConn.block (true); @@ -1981,6 +2026,9 @@ void Locallab::read (const ProcParams* pp, const ParamsEdited* pedited) centerX->setEditedState (pedited->locallab.centerX ? Edited : UnEdited); centerY->setEditedState (pedited->locallab.centerY ? Edited : UnEdited); circrad->setEditedState (pedited->locallab.circrad ? Edited : UnEdited); + centerXbuf->setEditedState (pedited->locallab.centerXbuf ? Edited : UnEdited); + centerYbuf->setEditedState (pedited->locallab.centerYbuf ? Edited : UnEdited); + adjblur->setEditedState (pedited->locallab.adjblur ? Edited : UnEdited); thres->setEditedState (pedited->locallab.thres ? Edited : UnEdited); proxi->setEditedState (pedited->locallab.proxi ? Edited : UnEdited); lightness->setEditedState (pedited->locallab.lightness ? Edited : UnEdited); @@ -2046,6 +2094,7 @@ void Locallab::read (const ProcParams* pp, const ParamsEdited* pedited) avoid->set_inconsistent (multiImage && !pedited->locallab.avoid); activlum->set_inconsistent (multiImage && !pedited->locallab.activlum); invers->set_inconsistent (multiImage && !pedited->locallab.invers); + cutpast->set_inconsistent (multiImage && !pedited->locallab.cutpast); curvactiv->set_inconsistent (multiImage && !pedited->locallab.curvactiv); inversrad->set_inconsistent (multiImage && !pedited->locallab.inversrad); inverssha->set_inconsistent (multiImage && !pedited->locallab.inverssha); @@ -2101,6 +2150,9 @@ void Locallab::read (const ProcParams* pp, const ParamsEdited* pedited) inversConn.block (true); invers->set_active (pp->locallab.invers); inversConn.block (false); + cutpastConn.block (true); + cutpast->set_active (pp->locallab.cutpast); + cutpastConn.block (false); curvactivConn.block (true); curvactiv->set_active (pp->locallab.curvactiv); curvactivConn.block (false); @@ -2122,6 +2174,9 @@ void Locallab::read (const ProcParams* pp, const ParamsEdited* pedited) centerX->setValue (pp->locallab.centerX); centerY->setValue (pp->locallab.centerY); circrad->setValue (pp->locallab.circrad); + centerXbuf->setValue (pp->locallab.centerXbuf); + centerYbuf->setValue (pp->locallab.centerYbuf); + adjblur->setValue (pp->locallab.adjblur); thres->setValue (pp->locallab.thres); proxi->setValue (pp->locallab.proxi); lightness->setValue (pp->locallab.lightness); @@ -2230,12 +2285,14 @@ void Locallab::read (const ProcParams* pp, const ParamsEdited* pedited) lastavoid = pp->locallab.avoid; lastinvers = pp->locallab.invers; + lastcutpast = pp->locallab.cutpast; lastcurvactiv = pp->locallab.curvactiv; lastinversrad = pp->locallab.inversrad; lastinversret = pp->locallab.inversret; lastinverssha = pp->locallab.inverssha; activlumChanged(); inversChanged(); + cutpastChanged(); curvactivChanged(); inversradChanged(); inversretChanged(); @@ -2293,6 +2350,8 @@ void Locallab::read (const ProcParams* pp, const ParamsEdited* pedited) hueref->hide(); chromaref->hide(); lumaref->hide(); + centerXbuf->hide(); + centerYbuf->hide(); if (pp->locallab.Smethod == "SYM" || pp->locallab.Smethod == "SYMSL") { locXL->setValue (locX->getValue()); @@ -2479,54 +2538,54 @@ void Locallab::updateGeometry (const int centerX_, const int centerY_, const int double decay45T = (1.414 * decayX * decayYT) / sqrt (SQR (decayX) + SQR (decayYT)); //printf("decayX=%f decayY=%f decay10=%f decay45=%f oriX=%i origY=%i\n", decayX, decayY, decay10, decay45, origin.x, origin.y); - updateBeziers (visibleGeometry.at (5), decayX, decay5 , decay15, 0., 5., 15.); - updateBeziers (mouseOverGeometry.at (5), decayX, decay5 , decay15, 0., 5., 15.); + updateBeziers (visibleGeometry.at (5), decayX, decay5, decay15, 0., 5., 15.); + updateBeziers (mouseOverGeometry.at (5), decayX, decay5, decay15, 0., 5., 15.); - updateBeziers (visibleGeometry.at (6), decay15, decay30 , decay45, 15., 30., 45.); - updateBeziers (mouseOverGeometry.at (6), decay15, decay30 , decay45, 15., 30., 45.); + updateBeziers (visibleGeometry.at (6), decay15, decay30, decay45, 15., 30., 45.); + updateBeziers (mouseOverGeometry.at (6), decay15, decay30, decay45, 15., 30., 45.); - updateBeziers (visibleGeometry.at (7), decay45, decay60 , decay75, 45., 60., 75.); - updateBeziers (mouseOverGeometry.at (7), decay45, decay60 , decay75, 45., 60., 75.); + updateBeziers (visibleGeometry.at (7), decay45, decay60, decay75, 45., 60., 75.); + updateBeziers (mouseOverGeometry.at (7), decay45, decay60, decay75, 45., 60., 75.); - updateBeziers (visibleGeometry.at (8), decay75, decay85 , decayY, 75., 85., 90.); - updateBeziers (mouseOverGeometry.at (8), decay75, decay85 , decayY, 75., 85., 90.); + updateBeziers (visibleGeometry.at (8), decay75, decay85, decayY, 75., 85., 90.); + updateBeziers (mouseOverGeometry.at (8), decay75, decay85, decayY, 75., 85., 90.); - updateBeziers (visibleGeometry.at (9), decayY, decay85L , decay75L, 90., 95., 105.); - updateBeziers (mouseOverGeometry.at (9), decayY, decay85L , decay75L, 90., 95., 105.); + updateBeziers (visibleGeometry.at (9), decayY, decay85L, decay75L, 90., 95., 105.); + updateBeziers (mouseOverGeometry.at (9), decayY, decay85L, decay75L, 90., 95., 105.); - updateBeziers (visibleGeometry.at (10), decay75L, decay60L , decay45L, 105., 120., 135.); - updateBeziers (mouseOverGeometry.at (10), decay75L, decay60L , decay45L, 105., 120., 135.); + updateBeziers (visibleGeometry.at (10), decay75L, decay60L, decay45L, 105., 120., 135.); + updateBeziers (mouseOverGeometry.at (10), decay75L, decay60L, decay45L, 105., 120., 135.); - updateBeziers (visibleGeometry.at (11), decay45L, decay30L , decay15L, 135., 150., 165.); - updateBeziers (mouseOverGeometry.at (11), decay45L, decay30L , decay15L, 135., 150., 165.); + updateBeziers (visibleGeometry.at (11), decay45L, decay30L, decay15L, 135., 150., 165.); + updateBeziers (mouseOverGeometry.at (11), decay45L, decay30L, decay15L, 135., 150., 165.); - updateBeziers (visibleGeometry.at (12), decay15L, decay5L , decayXL, 165., 175., 180.); - updateBeziers (mouseOverGeometry.at (12), decay15L, decay5L , decayXL, 165., 175., 180.); + updateBeziers (visibleGeometry.at (12), decay15L, decay5L, decayXL, 165., 175., 180.); + updateBeziers (mouseOverGeometry.at (12), decay15L, decay5L, decayXL, 165., 175., 180.); - updateBeziers (visibleGeometry.at (13), decayXL, decay5LT , decay15LT, 180., 185., 195.); - updateBeziers (mouseOverGeometry.at (13), decayXL, decay5LT , decay15LT, 180., 185., 195.); + updateBeziers (visibleGeometry.at (13), decayXL, decay5LT, decay15LT, 180., 185., 195.); + updateBeziers (mouseOverGeometry.at (13), decayXL, decay5LT, decay15LT, 180., 185., 195.); - updateBeziers (visibleGeometry.at (14), decay15LT, decay30LT , decay45LT, 195., 210., 225.); - updateBeziers (mouseOverGeometry.at (14), decay15LT, decay30LT , decay45LT, 195., 210., 225.); + updateBeziers (visibleGeometry.at (14), decay15LT, decay30LT, decay45LT, 195., 210., 225.); + updateBeziers (mouseOverGeometry.at (14), decay15LT, decay30LT, decay45LT, 195., 210., 225.); - updateBeziers (visibleGeometry.at (15), decay45LT, decay60LT , decay75LT, 225., 240., 255.); - updateBeziers (mouseOverGeometry.at (15), decay45LT, decay60LT , decay75LT, 225., 240., 255.); + updateBeziers (visibleGeometry.at (15), decay45LT, decay60LT, decay75LT, 225., 240., 255.); + updateBeziers (mouseOverGeometry.at (15), decay45LT, decay60LT, decay75LT, 225., 240., 255.); - updateBeziers (visibleGeometry.at (16), decay75LT, decay85LT , decayYT, 255., 265., 270.); - updateBeziers (mouseOverGeometry.at (16), decay75LT, decay85LT , decayYT, 255., 265., 270.); + updateBeziers (visibleGeometry.at (16), decay75LT, decay85LT, decayYT, 255., 265., 270.); + updateBeziers (mouseOverGeometry.at (16), decay75LT, decay85LT, decayYT, 255., 265., 270.); - updateBeziers (visibleGeometry.at (17), decayYT, decay85T , decay75T, 270., 275., 285.); - updateBeziers (mouseOverGeometry.at (17), decayYT, decay85T , decay75T, 270., 275., 285.); + updateBeziers (visibleGeometry.at (17), decayYT, decay85T, decay75T, 270., 275., 285.); + updateBeziers (mouseOverGeometry.at (17), decayYT, decay85T, decay75T, 270., 275., 285.); - updateBeziers (visibleGeometry.at (18), decay75T, decay60T , decay45T, 285., 300., 315.); - updateBeziers (mouseOverGeometry.at (18), decay75T, decay60T , decay45T, 285., 300., 315.); + updateBeziers (visibleGeometry.at (18), decay75T, decay60T, decay45T, 285., 300., 315.); + updateBeziers (mouseOverGeometry.at (18), decay75T, decay60T, decay45T, 285., 300., 315.); - updateBeziers (visibleGeometry.at (19), decay45T, decay30T , decay15T, 315., 330., 345.); - updateBeziers (mouseOverGeometry.at (19), decay45T, decay30T , decay15T, 315., 330., 345.); + updateBeziers (visibleGeometry.at (19), decay45T, decay30T, decay15T, 315., 330., 345.); + updateBeziers (mouseOverGeometry.at (19), decay45T, decay30T, decay15T, 315., 330., 345.); - updateBeziers (visibleGeometry.at (20), decay15T, decay5T , decayX, 345., 355., 360.); - updateBeziers (mouseOverGeometry.at (20), decay15T, decay5T , decayX, 345., 355., 360.); + updateBeziers (visibleGeometry.at (20), decay15T, decay5T, decayX, 345., 355., 360.); + updateBeziers (mouseOverGeometry.at (20), decay15T, decay5T, decayX, 345., 355., 360.); } @@ -2545,6 +2604,9 @@ void Locallab::write (ProcParams* pp, ParamsEdited* pedited) pp->locallab.centerX = centerX->getIntValue (); pp->locallab.centerY = centerY->getIntValue (); pp->locallab.circrad = circrad->getIntValue (); + pp->locallab.centerXbuf = centerXbuf->getIntValue (); + pp->locallab.centerYbuf = centerYbuf->getIntValue (); + pp->locallab.adjblur = adjblur->getIntValue (); pp->locallab.proxi = proxi->getIntValue (); pp->locallab.thres = thres->getIntValue (); pp->locallab.lightness = lightness->getIntValue (); @@ -2583,6 +2645,7 @@ void Locallab::write (ProcParams* pp, ParamsEdited* pedited) pp->locallab.avoid = avoid->get_active(); pp->locallab.activlum = activlum->get_active(); pp->locallab.invers = invers->get_active(); + pp->locallab.cutpast = cutpast->get_active(); pp->locallab.curvactiv = curvactiv->get_active(); pp->locallab.inversrad = inversrad->get_active(); pp->locallab.inversret = inversret->get_active(); @@ -2642,6 +2705,9 @@ void Locallab::write (ProcParams* pp, ParamsEdited* pedited) pedited->locallab.centerX = centerX->getEditedState (); pedited->locallab.centerY = centerY->getEditedState (); pedited->locallab.circrad = circrad->getEditedState (); + pedited->locallab.centerXbuf = centerXbuf->getEditedState (); + pedited->locallab.centerYbuf = centerYbuf->getEditedState (); + pedited->locallab.adjblur = adjblur->getEditedState (); pedited->locallab.proxi = proxi->getEditedState (); pedited->locallab.thres = thres->getEditedState (); pedited->locallab.lightness = lightness->getEditedState (); @@ -2680,6 +2746,7 @@ void Locallab::write (ProcParams* pp, ParamsEdited* pedited) pedited->locallab.enabled = !get_inconsistent(); pedited->locallab.avoid = !avoid->get_inconsistent(); pedited->locallab.invers = !invers->get_inconsistent(); + pedited->locallab.cutpast = !cutpast->get_inconsistent(); pedited->locallab.curvactiv = !curvactiv->get_inconsistent(); pedited->locallab.activlum = !activlum->get_inconsistent(); pedited->locallab.inversret = !inversret->get_inconsistent(); @@ -3119,6 +3186,32 @@ void Locallab::inversChanged () } } +void Locallab::cutpastChanged () +{ + + if (batchMode) { + if (cutpast->get_inconsistent()) { + cutpast->set_inconsistent (false); + cutpastConn.block (true); + cutpast->set_active (false); + cutpastConn.block (false); + } else if (lastcutpast) { + cutpast->set_inconsistent (true); + } + + lastcutpast = cutpast->get_active (); + } + + + if (listener) { + if (getEnabled()) { + listener->panelChanged (Evlocallabcutpast, M ("GENERAL_ENABLED")); + } else { + listener->panelChanged (Evlocallabcutpast, M ("GENERAL_DISABLED")); + } + } +} + void Locallab::curvactivChanged () { @@ -3279,6 +3372,9 @@ void Locallab::setDefaults (const ProcParams * defParams, const ParamsEdited * p centerX->setDefault (defParams->locallab.centerX); centerY->setDefault (defParams->locallab.centerY); circrad->setDefault (defParams->locallab.circrad); + centerXbuf->setDefault (defParams->locallab.centerXbuf); + centerYbuf->setDefault (defParams->locallab.centerYbuf); + adjblur->setDefault (defParams->locallab.adjblur); thres->setDefault (defParams->locallab.thres); proxi->setDefault (defParams->locallab.proxi); lightness->setDefault (defParams->locallab.lightness); @@ -3345,6 +3441,9 @@ void Locallab::setDefaults (const ProcParams * defParams, const ParamsEdited * p centerX->setDefaultEditedState (pedited->locallab.centerX ? Edited : UnEdited); centerY->setDefaultEditedState (pedited->locallab.centerY ? Edited : UnEdited); circrad->setDefaultEditedState (pedited->locallab.circrad ? Edited : UnEdited); + centerXbuf->setDefaultEditedState (pedited->locallab.centerXbuf ? Edited : UnEdited); + centerYbuf->setDefaultEditedState (pedited->locallab.centerYbuf ? Edited : UnEdited); + adjblur->setDefaultEditedState (pedited->locallab.adjblur ? Edited : UnEdited); thres->setDefaultEditedState (pedited->locallab.thres ? Edited : UnEdited); proxi->setDefaultEditedState (pedited->locallab.proxi ? Edited : UnEdited); lightness->setDefaultEditedState (pedited->locallab.lightness ? Edited : UnEdited); @@ -3410,6 +3509,9 @@ void Locallab::setDefaults (const ProcParams * defParams, const ParamsEdited * p centerX->setDefaultEditedState (Irrelevant); centerY->setDefaultEditedState (Irrelevant); circrad->setDefaultEditedState (Irrelevant); + centerXbuf->setDefaultEditedState (Irrelevant); + centerYbuf->setDefaultEditedState (Irrelevant); + adjblur->setDefaultEditedState (Irrelevant); thres->setDefaultEditedState (Irrelevant); proxi->setDefaultEditedState (Irrelevant); lightness->setDefaultEditedState (Irrelevant); @@ -3485,6 +3587,8 @@ void Locallab::adjusterChanged (Adjuster * a, double newval) hueref->hide(); chromaref->hide(); lumaref->hide(); + centerXbuf->hide(); + centerYbuf->hide(); if (a == pastels && pastSatTog->get_active()) { saturated->setValue (newval); @@ -3655,8 +3759,12 @@ void Locallab::adjusterChanged (Adjuster * a, double newval) listener->panelChanged (Evlocallabsensibn, sensibn->getTextValue()); } else if (a == proxi) { listener->panelChanged (Evlocallabproxi, proxi->getTextValue()); + } else if (a == adjblur) { + listener->panelChanged (Evlocallabadjblur, adjblur->getTextValue()); } else if (a == centerX || a == centerY) { listener->panelChanged (EvlocallabCenter, Glib::ustring::compose ("X=%1\nY=%2", centerX->getTextValue(), centerY->getTextValue())); + } else if (a == centerXbuf || a == centerYbuf) { + listener->panelChanged (EvlocallabCenterbuf, Glib::ustring::compose ("X=%1\nY=%2", centerXbuf->getTextValue(), centerYbuf->getTextValue())); } else { listener->panelChanged (EvlocallabEqualizer, Glib::ustring::compose ("%1, %2, %3, %4, %5", @@ -3743,6 +3851,9 @@ void Locallab::trimValues (rtengine::procparams::ProcParams * pp) centerX->trimValue (pp->locallab.centerX); centerY->trimValue (pp->locallab.centerY); circrad->trimValue (pp->locallab.circrad); + centerXbuf->trimValue (pp->locallab.centerXbuf); + centerYbuf->trimValue (pp->locallab.centerYbuf); + adjblur->trimValue (pp->locallab.adjblur); thres->trimValue (pp->locallab.thres); proxi->trimValue (pp->locallab.proxi); lightness->trimValue (pp->locallab.lightness); @@ -3817,6 +3928,9 @@ void Locallab::setBatchMode (bool batchMode) centerX->showEditedCB (); centerY->showEditedCB (); circrad->showEditedCB (); + centerXbuf->showEditedCB (); + centerYbuf->showEditedCB (); + adjblur->showEditedCB (); thres->showEditedCB (); proxi->showEditedCB (); lightness->showEditedCB (); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 4208bfde0..16a162c9b 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -116,6 +116,9 @@ private: Adjuster* const hueref; Adjuster* const chromaref; Adjuster* const lumaref; + Adjuster* const centerXbuf; + Adjuster* const centerYbuf; + Adjuster* const adjblur; MyComboBoxText* const Smethod; MyComboBoxText* const retinexMethod; @@ -126,6 +129,7 @@ private: Gtk::Frame* const artifFrame; Gtk::Frame* const shapeFrame; Gtk::Frame* const superFrame; + Gtk::Frame* const dustFrame; Gtk::Label* const labmdh; Gtk::Label* const labqual; @@ -156,6 +160,7 @@ private: Gtk::CheckButton* const inversrad; Gtk::CheckButton* const inversret; Gtk::CheckButton* const inverssha; + Gtk::CheckButton* const cutpast; Gtk::Button* neutral; Gtk::HBox* neutrHBox; @@ -201,7 +206,7 @@ private: sigc::connection enablecolorConn, enableexposeConn, enablevibranceConn, enableblurConn, enabletonemapConn; sigc::connection enableretiConn, enablesharpConn, enablecbdlConn; sigc::connection enabledenoiConn; - sigc::connection editConn, avoidConn, inversConn, curvactivConn, activlumConn, inversradConn, inversretConn, inversshaConn, neutralconn, neutralconn1; + sigc::connection editConn, avoidConn, inversConn, cutpastConn, curvactivConn, activlumConn, inversradConn, inversretConn, inversshaConn, neutralconn, neutralconn1; sigc::connection Smethodconn; sigc::connection retinexMethodConn; sigc::connection qualityMethodConn; @@ -209,7 +214,7 @@ private: - int nextdatasp[73]; + int nextdatasp[77]; int nextlength; std::string nextstr; std::string nextstr2; @@ -236,7 +241,7 @@ private: double draggedlocYTOffset; double draggedlocXLOffset; rtengine::Coord draggedCenter; - bool lastavoid, lastinvers, lastinversrad, lastinversret, lastactivlum, lastinverssha, lastcurvactiv; + bool lastavoid, lastinvers, lastcutpast, lastinversrad, lastinversret, lastactivlum, lastinverssha, lastcurvactiv; int lastanbspot; void editToggled (); @@ -270,6 +275,7 @@ public: void inversradChanged (); void inversretChanged (); void inversshaChanged (); + void cutpastChanged (); void curveChanged (CurveEditor* ce); void autoOpenCurve (); void localChanged (int **datasp, std::string datastr, std::string ll_str, std::string lh_str, std::string cc_str, std::string hh_str, std::string sk_str, std::string ps_str, std::string ex_str, int sp, int maxdat); diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index ccbd2148b..876cdba21 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -323,6 +323,9 @@ void ParamsEdited::set (bool v) locallab.centerX = v; locallab.centerY = v; locallab.circrad = v; + locallab.centerXbuf = v; + locallab.centerYbuf = v; + locallab.adjblur = v; locallab.thres = v; locallab.proxi = v; locallab.qualityMethod = v; @@ -365,6 +368,7 @@ void ParamsEdited::set (bool v) locallab.Smethod = v; locallab.retinexMethod = v; locallab.invers = v; + locallab.cutpast = v; locallab.curvactiv = v; locallab.activlum = v; locallab.inversrad = v; @@ -944,6 +948,7 @@ void ParamsEdited::initFrom (const std::vector locallab.enabled = locallab.enabled && p.locallab.enabled == other.locallab.enabled; locallab.avoid = locallab.avoid && p.locallab.avoid == other.locallab.avoid; locallab.invers = locallab.invers && p.locallab.invers == other.locallab.invers; + locallab.cutpast = locallab.cutpast && p.locallab.cutpast == other.locallab.cutpast; locallab.curvactiv = locallab.curvactiv && p.locallab.curvactiv == other.locallab.curvactiv; locallab.activlum = locallab.activlum && p.locallab.activlum == other.locallab.activlum; locallab.inversrad = locallab.inversrad && p.locallab.inversrad == other.locallab.inversrad; @@ -959,6 +964,9 @@ void ParamsEdited::initFrom (const std::vector locallab.centerX = locallab.centerX && p.locallab.centerX == other.locallab.centerX; locallab.centerY = locallab.centerY && p.locallab.centerY == other.locallab.centerY; locallab.circrad = locallab.circrad && p.locallab.circrad == other.locallab.circrad; + locallab.centerXbuf = locallab.centerXbuf && p.locallab.centerXbuf == other.locallab.centerXbuf; + locallab.centerYbuf = locallab.centerYbuf && p.locallab.centerYbuf == other.locallab.centerYbuf; + locallab.adjblur = locallab.adjblur && p.locallab.adjblur == other.locallab.adjblur; locallab.thres = locallab.thres && p.locallab.thres == other.locallab.thres; locallab.proxi = locallab.proxi && p.locallab.proxi == other.locallab.proxi; locallab.qualityMethod = locallab.qualityMethod && p.locallab.qualityMethod == other.locallab.qualityMethod; @@ -1721,7 +1729,7 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten } if (sharpening.edges_radius) { - toEdit.sharpening.edges_radius = dontforceSet && options.baBehav[ADDSET_SHARP_RADIUS] ? toEdit.sharpening.edges_radius + mods.sharpening.edges_radius: mods.sharpening.edges_radius; + toEdit.sharpening.edges_radius = dontforceSet && options.baBehav[ADDSET_SHARP_RADIUS] ? toEdit.sharpening.edges_radius + mods.sharpening.edges_radius : mods.sharpening.edges_radius; } if (sharpening.edges_tolerance) { @@ -2367,6 +2375,10 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten toEdit.locallab.invers = mods.locallab.invers; } + if (locallab.cutpast) { + toEdit.locallab.cutpast = mods.locallab.cutpast; + } + if (locallab.curvactiv) { toEdit.locallab.curvactiv = mods.locallab.curvactiv; } @@ -2435,6 +2447,18 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten toEdit.locallab.circrad = mods.locallab.circrad; } + if (locallab.centerXbuf) { + toEdit.locallab.centerXbuf = mods.locallab.centerXbuf; + } + + if (locallab.centerYbuf) { + toEdit.locallab.centerYbuf = mods.locallab.centerYbuf; + } + + if (locallab.adjblur) { + toEdit.locallab.adjblur = mods.locallab.adjblur; + } + if (locallab.thres) { toEdit.locallab.thres = mods.locallab.thres; } diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 8557d4288..4627c7fca 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -436,6 +436,9 @@ public: bool centerX; bool centerY; bool circrad; + bool centerXbuf; + bool centerYbuf; + bool adjblur; bool thres; bool proxi; bool qualityMethod; @@ -486,6 +489,7 @@ public: bool vart; bool activlum; bool invers; + bool cutpast; bool curvactiv; bool inversrad; bool inversret;