diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 499ee7812..651884e34 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -3093,10 +3093,13 @@ void ImProcFunctions::ContAllL(float *koeLi[12], float maxkoeLi, bool lipschitz, float atten01234 = 0.80f; value *= (atten01234 * scaleskip[1]); //for zoom < 100% reduce strength...I choose level 1...but!! } - + float edghig = settings->edghi;//increase or reduce "reinforce" + float edglow = settings->edglo;//increase or reduce "reduce" + float limrad = settings->limrad;//threshold action in function radius (rad) + printf("edghi=%f edglo=%f limrad=%f\n", edghig, edglow, limrad); // value *= beta; float edge = 1.f; - float lim0 = 20.f; //arbitrary limit for low radius and level between 2 or 3 to 30 maxi + float lim0 = limrad; //arbitrary limit for low radius and level between 2 or 3 to 30 maxi float lev = float (level); float repart = (float)cp.til; @@ -3104,15 +3107,14 @@ void ImProcFunctions::ContAllL(float *koeLi[12], float maxkoeLi, bool lipschitz, if (cp.reinforce != 2) { const float brepart = cp.reinforce == 1 - ? 3.f - : 0.5f; + ? edghig + : edglow; const float arepart = -(brepart - 1.f) / (lim0 / 60.f); - if (rad < lim0 / 60.f) { + if (rad < (lim0 / 60.f)) { repart *= (arepart * rad + brepart); //linear repartition of repart } } - float al0 = 1.f + (repart) / 50.f; float al10 = 1.0f; //arbitrary value ==> less = take into account high levels // float ak =-(al0-al10)/10.f;//10 = maximum levels @@ -3120,15 +3122,16 @@ void ImProcFunctions::ContAllL(float *koeLi[12], float maxkoeLi, bool lipschitz, float bk = al0; float koef = ak * level + bk; //modulate for levels : more levels high, more koef low ==> concentrated action on low levels, without or near for high levels float expkoef = -std::pow(std::fabs(rad - lev), koef); //reduce effect for high levels + printf("repart=%f\n", repart); if (cp.reinforce == 3) { - if (rad < lim0 / 60.f && level == 0) { + if (rad < (lim0 / 60.f) && level == 0) { expkoef *= abs(repart); //reduce effect for low values of rad and level=0==> quasi only level 1 is effective } } if (cp.reinforce == 1) { - if (rad < lim0 / 60.f && level == 1) { + if (rad < (lim0 / 60.f) && level == 1) { expkoef /= repart; //increase effect for low values of rad and level=1==> quasi only level 0 is effective } } diff --git a/rtengine/settings.h b/rtengine/settings.h index fde6fa132..0fb4996df 100644 --- a/rtengine/settings.h +++ b/rtengine/settings.h @@ -99,6 +99,10 @@ public: int itcwb_delta; bool itcwb_stdobserver10; int itcwb_precis; +//wavelet levels + double edghi; + double edglo; + double limrad; enum class ThumbnailInspectorMode { diff --git a/rtgui/options.cc b/rtgui/options.cc index cc49f1fcd..04914e748 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -617,6 +617,12 @@ void Options::setDefaults() rtSettings.itcwb_precis = 5;//3 or 5 or 9 // end locallab +//wavelet + rtSettings.edghi = 3.0;//1.1 and 5. + rtSettings.edglo = 0.5;//0.1 and 0.95 + rtSettings.limrad = 20.;//1 and 60 + + rtSettings.protectred = 60; rtSettings.protectredh = 0.3; rtSettings.CRI_color = 0; @@ -1704,6 +1710,22 @@ void Options::readFromFile(Glib::ustring fname) } + if (keyFile.has_group("Wavelet")) { + if (keyFile.has_key("Wavelet", "Edghi")) { + rtSettings.edghi = keyFile.get_double("Wavelet", "Edghi"); + } + + if (keyFile.has_key("Wavelet", "Edglo")) { + rtSettings.edglo = keyFile.get_double("Wavelet", "Edglo"); + } + + if (keyFile.has_key("Wavelet", "Limrad")) { + rtSettings.limrad = keyFile.get_double("Wavelet", "Limrad"); + } + + } + + if (keyFile.has_group("ICC Profile Creator")) { if (keyFile.has_key("ICC Profile Creator", "PimariesPreset")) { ICCPC_primariesPreset = keyFile.get_string("ICC Profile Creator", "PimariesPreset"); @@ -2302,6 +2324,11 @@ void Options::saveToFile(Glib::ustring fname) keyFile.set_integer("Color Management", "Previewselection", rtSettings.previewselection); keyFile.set_double("Color Management", "Cbdlsensi", rtSettings.cbdlsensi); + keyFile.set_double("Wavelet", "Edghi", rtSettings.edghi); + keyFile.set_double("Wavelet", "Edglo", rtSettings.edglo); + keyFile.set_double("Wavelet", "Limrad", rtSettings.limrad); + + keyFile.set_string("ICC Profile Creator", "PimariesPreset", ICCPC_primariesPreset); keyFile.set_double("ICC Profile Creator", "RedPrimaryX", ICCPC_redPrimaryX); keyFile.set_double("ICC Profile Creator", "RedPrimaryY", ICCPC_redPrimaryY);