diff --git a/rtdata/languages/default b/rtdata/languages/default index 2ed021e39..50bab5ad8 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1095,6 +1095,7 @@ HISTORY_MSG_855;Local - Entire image HISTORY_MSG_856;Local - Base log HISTORY_MSG_857;Local - Contrast Blur Residual HISTORY_MSG_858;Local - Contrast Luminance only +HISTORY_MSG_859;Local - Contrast Blur levels HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -2189,6 +2190,7 @@ TP_LOCALLAB_BLURCBDL;Blur levels 0-1-2-3-4 TP_LOCALLAB_BLURCOL;Radius Mask Blur TP_LOCALLAB_BLURDE;Blur Shape detection TP_LOCALLAB_BLURLC;Luminance only +TP_LOCALLAB_BLURLEVELFRA;Blur Levels TP_LOCALLAB_BLURRESIDFRA;Blur Residual TP_LOCALLAB_BUTTON_ADD;Add TP_LOCALLAB_BUTTON_DEL;Delete @@ -2335,6 +2337,7 @@ TP_LOCALLAB_LAPLACEXP;Laplacian threshold TP_LOCALLAB_LAPMASKCOL;Laplacian threshold mask TP_LOCALLAB_LAPRAD_TOOLTIP;Avoid using Radius and Laplace Threshold simultaneously TP_LOCALLAB_LC_FFTW_TOOLTIP;FFT improve quality and allow big radius, but increases the treatment time.\nThe treatment time depends on the surface to be treated.\nTo be used preferably for large radius.\n\nDimensions can be reduced by a few pixels to optimize FFTW.\nThis optimization can reduce the treatment time by a factor of 1.5 to 10.\n +TP_LOCALLAB_LEVELBLUR;Blur levels TP_LOCALLAB_LEVELWAV;Wavelets Levels TP_LOCALLAB_LEVELWAV_TOOLTIP;The Level is automatically adapted to the size of the spot and the preview.\nFrom level 9 size max 512 to level 1 size max = 4 TP_LOCALLAB_LIGHTNESS;Lightness diff --git a/rtengine/CMakeLists.txt b/rtengine/CMakeLists.txt index 92ed0c635..43efafeeb 100644 --- a/rtengine/CMakeLists.txt +++ b/rtengine/CMakeLists.txt @@ -117,7 +117,6 @@ set(RTENGINESOURCEFILES processingjob.cc procparams.cc profilestore.cc - pyramid_1.cc rawflatfield.cc rawimage.cc rawimagesource.cc diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index a4d0f6c7d..f5fb006c7 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -311,7 +311,7 @@ public: static void strcurv_data(std::string retistr, int *s_datc, int &siz); void blendstruc(int bfw, int bfh, LabImage* bufcolorig, float radius, float stru, array2D & blend2, int sk, bool multiThread); - void wavcontrast4(float ** tmp, float contrast, float radblur, int bfw, int bfh, int level_bl, int level_hl, int level_br, int level_hr, int sk, bool numThreads, const LocwavCurve & locwavCurve, bool & locwavutili, int & maxlvl); + void wavcontrast4(float ** tmp, float contrast, float radblur, float radlevblur, int bfw, int bfh, int level_bl, int level_hl, int level_br, int level_hr, int sk, bool numThreads, const LocwavCurve & locwavCurve, bool & locwavutili, int & maxlvl); void transit_shapedetect2(int call, 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, 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); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index c086e8410..552ac68dc 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -3992,7 +3992,7 @@ void ImProcFunctions::maskcalccol(int call, bool invmask, bool pde, int bfw, int const int numThreads = 1; #endif - wavcontrast4(bufmaskblurcol->L, contrast, 0.f, bfw, bfh, level_bl, level_hl, level_br, level_hr, sk, numThreads, loclmasCurvecolwav, lmasutilicolwav, maxlvl); + wavcontrast4(bufmaskblurcol->L, contrast, 0.f, 0.f, bfw, bfh, level_bl, level_hl, level_br, level_hr, sk, numThreads, loclmasCurvecolwav, lmasutilicolwav, maxlvl); } @@ -6729,8 +6729,7 @@ void ImProcFunctions::fftw_tile_blur(int GW, int GH, int tilssize, int max_numbl fftwf_destroy_plan(plan_backward_blox[1]); fftwf_cleanup(); } - -void ImProcFunctions::wavcontrast4(float ** tmp, float contrast, float radblur, int bfw, int bfh, int level_bl, int level_hl, int level_br, int level_hr, int sk, bool numThreads, const LocwavCurve & locwavCurve, bool & locwavutili, int & maxlvl) +void ImProcFunctions::wavcontrast4(float ** tmp, float contrast, float radblur, float radlevblur, int bfw, int bfh, int level_bl, int level_hl, int level_br, int level_hr, int sk, bool numThreads, const LocwavCurve & locwavCurve, bool & locwavutili, int & maxlvl) { wavelet_decomposition *wdspot = new wavelet_decomposition(tmp[0], bfw, bfh, level_br, 1, sk, numThreads, 6); @@ -6840,6 +6839,91 @@ void ImProcFunctions::wavcontrast4(float ** tmp, float contrast, float radblur, bhigh = -ahigh * level_br; } + int dir = 3; + int leve = maxlvl; + + float ****templevel = nullptr; + templevel = new float***[dir]; + + //allocate memory for 3 DIR n levels, H_L, W_L + for (int d = 0; d < dir; d++) { + templevel[d] = new float**[leve]; + + for (int k = 0; k < leve; k++) { + templevel[d][k] = new float*[H_L]; + + for (int i = 0; i < H_L; i++) { + templevel[d][k][i] = new float[W_L]; + } + } + } + + //fill array templevel with wavelet value level dir + for (int dir = 1; dir < 4; dir++) { + for (int level = level_bl; level < maxlvl; ++level) { + int W_L = wdspot->level_W(level); + int H_L = wdspot->level_H(level); + float **wav_L = wdspot->level_coeffs(level); + + for (int y = 0; y < H_L; y++) { + for (int x = 0; x < W_L; x++) { + float val = wav_L[dir][y * W_L + x]; + templevel[dir - 1][level][y][x] = val; + } + } + } + } + + //blur level and dir + for (int dir = 1; dir < 4; dir++) { + for (int level = level_bl; level < maxlvl; ++level) { + int W_L = wdspot->level_W(level); + int H_L = wdspot->level_H(level); + #pragma omp parallel + { + gaussianBlur(templevel[dir - 1][level], templevel[dir - 1][level], W_L, H_L, radlevblur); + } + } + } + + //put blur values in wavelet level and dir + for (int dir = 1; dir < 4; dir++) { + for (int level = level_bl; level < maxlvl; ++level) { + int W_L = wdspot->level_W(level); + int H_L = wdspot->level_H(level); + float **wav_L = wdspot->level_coeffs(level); + + for (int y = 0; y < H_L; y++) { + for (int x = 0; x < W_L; x++) { + wav_L[dir][y * W_L + x] = templevel[dir - 1][level][y][x]; + } + } + } + } + + + //free memory + for (int i = 0; i < dir; i++) { + for (int j = 0; j < leve; j++) { + for (int l = 0; l < H_L; l++) { + delete [] templevel[i][j][l]; + } + } + } + + for (int i = 0; i < dir; i++) { + for (int j = 0; j < leve; j++) { + delete [] templevel[i][j]; + } + } + + for (int i = 0; i < dir; i++) { + delete [] templevel[i]; + } + + delete [] templevel; + + if (locwavCurve && locwavutili) { for (int dir = 1; dir < 4; dir++) { for (int level = level_bl; level < maxlvl; ++level) { @@ -7174,7 +7258,7 @@ void ImProcFunctions::fftw_denoise(int GW, int GH, int max_numblox_W, int min_nu } -void ImProcFunctions::DeNoise(int call, int del, float * slidL, float * slida, float * slidb, int aut, bool noiscfactiv, const struct local_params& lp, LabImage* originalmaskbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage* original, LabImage* transformed, int cx, int cy, int sk) +void ImProcFunctions::DeNoise(int call, int del, float * slidL, float * slida, float * slidb, int aut, bool noiscfactiv, const struct local_params & lp, LabImage * originalmaskbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage * original, LabImage * transformed, int cx, int cy, int sk) { //local denoise @@ -8349,7 +8433,7 @@ float triangle(float a, float a1, float b) return a1; } -void rgbtone(float& maxval, float& medval, float& minval, LUTf & lutToneCurve) +void rgbtone(float & maxval, float & medval, float & minval, LUTf & lutToneCurve) { float minvalold = minval, medvalold = medval, maxvalold = maxval; @@ -8387,7 +8471,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o bool & LHutili, bool & HHutili, LUTf & cclocalcurve, bool & localcutili, LUTf & rgblocalcurve, bool & localrgbutili, bool & localexutili, LUTf & exlocalcurve, LUTf & hltonecurveloc, LUTf & shtonecurveloc, LUTf & tonecurveloc, LUTf & lightCurveloc, double & huerefblur, double & chromarefblur, double & lumarefblur, double & hueref, double & chromaref, double & lumaref, double & sobelref, int &lastsav, int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llvibMask, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask, - float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax) + float & minCD, float & maxCD, float & mini, float & maxi, float & Tmean, float & Tsigma, float & Tmin, float & Tmax) { //general call of others functions : important return hueref, chromaref, lumaref if (params->locallab.enabled) { @@ -8779,7 +8863,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o int level_hr = params->locallab.spots.at(sp).csthresholdblur.getTopRight(); - wavcontrast4(bufmaskblurbl->L, contrast, 0.f, GW, GH, level_bl, level_hl, level_br, level_hr, sk, numThreads, loclmasCurveblwav, lmasutiliblwav, maxlvl); + wavcontrast4(bufmaskblurbl->L, contrast, 0.f, 0.f, GW, GH, level_bl, level_hl, level_br, level_hr, sk, numThreads, loclmasCurveblwav, lmasutiliblwav, maxlvl); } int shado = params->locallab.spots.at(sp).shadmaskbl; @@ -10691,8 +10775,9 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o int level_hr = params->locallab.spots.at(sp).csthreshold.getTopRight(); const float radblur = (params->locallab.spots.at(sp).residblur) / sk; const bool blurlc = params->locallab.spots.at(sp).blurlc; + const float radlevblur = (params->locallab.spots.at(sp).levelblur) / sk; - wavcontrast4(tmp1->L, contrast, radblur, tmp1->W, tmp1->H, level_bl, level_hl, level_br, level_hr, sk, numThreads, locwavCurve, locwavutili, maxlvl); + wavcontrast4(tmp1->L, contrast, radblur, radlevblur, tmp1->W, tmp1->H, level_bl, level_hl, level_br, level_hr, sk, numThreads, locwavCurve, locwavutili, maxlvl); const float satur = params->locallab.spots.at(sp).residchro; diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 213cdc5dd..7e0da95cc 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -884,6 +884,7 @@ enum ProcEventCode { Evlocallabbaselog = 855, Evlocallabresidblur = 856, Evlocallabblurlc = 857, + Evlocallablevelblur = 858, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 4e797193c..581090d88 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2723,6 +2723,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : levelwav(4), residcont(0.0), residblur(0.0), + levelblur(0.0), residchro(0.0), clarilres(0.0), claricres(0.0), @@ -3108,6 +3109,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && levelwav == other.levelwav && residcont == other.residcont && residblur == other.residblur + && levelblur == other.levelblur && residchro == other.residchro && clarilres == other.clarilres && claricres == other.claricres @@ -4473,6 +4475,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).levelwav, "Locallab", "Levelwav_" + std::to_string(i), spot.levelwav, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).residcont, "Locallab", "Residcont_" + std::to_string(i), spot.residcont, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).residblur, "Locallab", "Residblur_" + std::to_string(i), spot.residblur, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).levelblur, "Locallab", "Levelblur_" + std::to_string(i), spot.levelblur, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).residchro, "Locallab", "Residchro_" + std::to_string(i), spot.residchro, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).clarilres, "Locallab", "ClariLres_" + std::to_string(i), spot.clarilres, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).claricres, "Locallab", "ClariCres_" + std::to_string(i), spot.claricres, keyFile); @@ -5987,6 +5990,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Levelwav_" + std::to_string(i), pedited, spot.levelwav, spotEdited.levelwav); assignFromKeyfile(keyFile, "Locallab", "Residcont_" + std::to_string(i), pedited, spot.residcont, spotEdited.residcont); assignFromKeyfile(keyFile, "Locallab", "Residblur_" + std::to_string(i), pedited, spot.residblur, spotEdited.residblur); + assignFromKeyfile(keyFile, "Locallab", "Levelblur_" + std::to_string(i), pedited, spot.levelblur, spotEdited.levelblur); assignFromKeyfile(keyFile, "Locallab", "Residchro_" + std::to_string(i), pedited, spot.residchro, spotEdited.residchro); assignFromKeyfile(keyFile, "Locallab", "ClariLres_" + std::to_string(i), pedited, spot.clarilres, spotEdited.clarilres); assignFromKeyfile(keyFile, "Locallab", "ClariCres_" + std::to_string(i), pedited, spot.claricres, spotEdited.claricres); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index eb86c0145..72139464c 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1266,6 +1266,7 @@ struct LocallabParams { int levelwav; double residcont; double residblur; + double levelblur; double residchro; double clarilres; double claricres; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index e3c77cffe..68f3ce4b8 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -887,7 +887,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { AUTOEXP, //Evlocallabfullimage LUMINANCECURVE, //Evlocallabbaselog LUMINANCECURVE, //Evlocallabresidblur - LUMINANCECURVE // Evlocallabblurlc + LUMINANCECURVE, // Evlocallabblurlc + LUMINANCECURVE //Evlocallablevelblur }; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index b5dcf1cc5..70ec6d9fc 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -546,6 +546,7 @@ lclightness(Gtk::manage(new Adjuster(M("TP_LOCALCONTRAST_LIGHTNESS"), 0, 3.0, 0. levelwav(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LEVELWAV"), 1, 9, 1, 4))), residcont(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDCONT"), -100, 100, 1, 0))), residblur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDBLUR"), 0., 100., 0.5, 0.))), +levelblur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LEVELBLUR"), 0., 100., 0.5, 0.))), clarilres(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CLARILRES"), -20., 100., 0.5, 0.))), clarisoft(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CLARISOFT"), 0., 100., 0.5, 0.))), claricres(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CLARICRES"), -20., 100., 0.5, 0.))), @@ -727,6 +728,7 @@ retiFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_RETIFRA")))), retitoolFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_RETITOOLFRA")))), residFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_RESID")))), clariFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_CLARIFRA")))), +blurlevelFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_BLURLEVELFRA")))), blurresidFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_BLURRESIDFRA")))), grainFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRAINFRA")))), logFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LOGFRA")))), @@ -2811,6 +2813,7 @@ pe(nullptr) residcont->setAdjusterListener(this); residblur->setAdjusterListener(this); + levelblur->setAdjusterListener(this); residchro->setAdjusterListener(this); clarilres->setAdjusterListener(this); clarisoft->setAdjusterListener(this); @@ -2840,12 +2843,18 @@ pe(nullptr) blurcontraBox->pack_start(*blurlc); blurresidFrame->add(*blurcontraBox); + blurlevelFrame->set_label_align(0.025, 0.5); + ToolParamBlock* const blurlevcontBox = Gtk::manage(new ToolParamBlock()); + blurlevcontBox->pack_start(*levelblur); + blurlevelFrame->add(*blurlevcontBox); + setExpandAlignProperties(expcontrastpyr, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); expcontrastpyr->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expcontrastpyr)); expcontrastpyr->setLevel(2); ToolParamBlock* const blurcontBox = Gtk::manage(new ToolParamBlock()); blurcontBox->pack_start(*clariFrame); blurcontBox->pack_start(*blurresidFrame); + blurcontBox->pack_start(*blurlevelFrame); expcontrastpyr->add(*blurcontBox, false); @@ -5005,6 +5014,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pp->locallab.spots.at(pp->locallab.selspot).levelwav = levelwav->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).residcont = residcont->getValue(); pp->locallab.spots.at(pp->locallab.selspot).residblur = residblur->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).levelblur = levelblur->getValue(); pp->locallab.spots.at(pp->locallab.selspot).residchro = residchro->getValue(); pp->locallab.spots.at(pp->locallab.selspot).clarilres = clarilres->getValue(); pp->locallab.spots.at(pp->locallab.selspot).claricres = claricres->getValue(); @@ -5393,6 +5403,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pe->locallab.spots.at(pp->locallab.selspot).levelwav = pe->locallab.spots.at(pp->locallab.selspot).levelwav || levelwav->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).residcont = pe->locallab.spots.at(pp->locallab.selspot).residcont || residcont->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).residblur = pe->locallab.spots.at(pp->locallab.selspot).residblur || residblur->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).levelblur = pe->locallab.spots.at(pp->locallab.selspot).levelblur || levelblur->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).residchro = pe->locallab.spots.at(pp->locallab.selspot).residchro || residchro->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).clarilres = pe->locallab.spots.at(pp->locallab.selspot).clarilres || clarilres->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).claricres = pe->locallab.spots.at(pp->locallab.selspot).claricres || claricres->getEditedState(); @@ -5778,6 +5789,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pedited->locallab.spots.at(pp->locallab.selspot).levelwav = pedited->locallab.spots.at(pp->locallab.selspot).levelwav || levelwav->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).residcont = pedited->locallab.spots.at(pp->locallab.selspot).residcont || residcont->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).residblur = pedited->locallab.spots.at(pp->locallab.selspot).residblur || residblur->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).levelblur = pedited->locallab.spots.at(pp->locallab.selspot).levelblur || levelblur->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).residchro = pedited->locallab.spots.at(pp->locallab.selspot).residchro || residchro->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).clarilres = pedited->locallab.spots.at(pp->locallab.selspot).clarilres || clarilres->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).claricres = pedited->locallab.spots.at(pp->locallab.selspot).claricres || claricres->getEditedState(); @@ -6275,6 +6287,7 @@ void Locallab::localcontMethodChanged() levelwav->hide(); residcont->hide(); residblur->hide(); + levelblur->hide(); residchro->hide(); clarilres->hide(); claricres->hide(); @@ -6292,6 +6305,7 @@ void Locallab::localcontMethodChanged() levelwav->show(); residcont->show(); residblur->show(); + levelblur->show(); residchro->show(); clarilres->show(); claricres->show(); @@ -8269,6 +8283,7 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c levelwav->setDefault(defSpot->levelwav); residcont->setDefault(defSpot->residcont); residblur->setDefault(defSpot->residblur); + levelblur->setDefault(defSpot->levelblur); residchro->setDefault(defSpot->residchro); clarilres->setDefault(defSpot->clarilres); claricres->setDefault(defSpot->claricres); @@ -8500,6 +8515,7 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c levelwav->setDefaultEditedState(Irrelevant); residcont->setDefaultEditedState(Irrelevant); residblur->setDefaultEditedState(Irrelevant); + levelblur->setDefaultEditedState(Irrelevant); residchro->setDefaultEditedState(Irrelevant); clarilres->setDefaultEditedState(Irrelevant); claricres->setDefaultEditedState(Irrelevant); @@ -8736,6 +8752,7 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c levelwav->setDefaultEditedState(defSpotState->levelwav ? Edited : UnEdited); residcont->setDefaultEditedState(defSpotState->residcont ? Edited : UnEdited); residblur->setDefaultEditedState(defSpotState->residblur ? Edited : UnEdited); + levelblur->setDefaultEditedState(defSpotState->levelblur ? Edited : UnEdited); residchro->setDefaultEditedState(defSpotState->residchro ? Edited : UnEdited); clarilres->setDefaultEditedState(defSpotState->clarilres ? Edited : UnEdited); claricres->setDefaultEditedState(defSpotState->claricres ? Edited : UnEdited); @@ -9890,6 +9907,12 @@ void Locallab::adjusterChanged(Adjuster * a, double newval) } } + if (a == levelblur) { + if (listener) { + listener->panelChanged(Evlocallablevelblur, levelblur->getTextValue()); + } + } + if (a == residchro) { if (listener) { listener->panelChanged(Evlocallabresidchro, residchro->getTextValue()); @@ -10365,6 +10388,7 @@ void Locallab::setBatchMode(bool batchMode) levelwav->showEditedCB(); residcont->showEditedCB(); residblur->showEditedCB(); + levelblur->showEditedCB(); residchro->showEditedCB(); clarilres->showEditedCB(); claricres->showEditedCB(); @@ -11412,6 +11436,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con levelwav->setValue(pp->locallab.spots.at(index).levelwav); residcont->setValue(pp->locallab.spots.at(index).residcont); residblur->setValue(pp->locallab.spots.at(index).residblur); + levelblur->setValue(pp->locallab.spots.at(index).levelblur); residchro->setValue(pp->locallab.spots.at(index).residchro); clarilres->setValue(pp->locallab.spots.at(index).clarilres); claricres->setValue(pp->locallab.spots.at(index).claricres); @@ -11904,6 +11929,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con levelwav->setEditedState(spotState->levelwav ? Edited : UnEdited); residcont->setEditedState(spotState->residcont ? Edited : UnEdited); residblur->setEditedState(spotState->residblur ? Edited : UnEdited); + levelblur->setEditedState(spotState->levelblur ? Edited : UnEdited); residchro->setEditedState(spotState->residchro ? Edited : UnEdited); clarilres->setEditedState(spotState->clarilres ? Edited : UnEdited); claricres->setEditedState(spotState->claricres ? Edited : UnEdited); @@ -12408,6 +12434,7 @@ void Locallab::updateSpecificGUIState() levelwav->hide(); residcont->hide(); residblur->hide(); + levelblur->hide(); residchro->hide(); clarilres->hide(); claricres->hide(); @@ -12425,6 +12452,7 @@ void Locallab::updateSpecificGUIState() levelwav->show(); residcont->show(); residblur->show(); + levelblur->show(); residchro->show(); clarilres->show(); claricres->show(); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 2bb2018a1..d464b7686 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -347,6 +347,7 @@ private: Adjuster* const levelwav; Adjuster* const residcont; Adjuster* const residblur; + Adjuster* const levelblur; Adjuster* const clarilres; Adjuster* const clarisoft; Adjuster* const claricres; @@ -568,6 +569,7 @@ private: Gtk::Frame* const retitoolFrame; Gtk::Frame* const residFrame; Gtk::Frame* const clariFrame; + Gtk::Frame* const blurlevelFrame; Gtk::Frame* const blurresidFrame; Gtk::Frame* const grainFrame; Gtk::Frame* const logFrame; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 8babda616..b5bd5d9b9 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1259,6 +1259,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).levelwav = locallab.spots.at(j).levelwav && pSpot.levelwav == otherSpot.levelwav; locallab.spots.at(j).residcont = locallab.spots.at(j).residcont && pSpot.residcont == otherSpot.residcont; locallab.spots.at(j).residblur = locallab.spots.at(j).residblur && pSpot.residblur == otherSpot.residblur; + locallab.spots.at(j).levelblur = locallab.spots.at(j).levelblur && pSpot.levelblur == otherSpot.levelblur; locallab.spots.at(j).residchro = locallab.spots.at(j).residchro && pSpot.residchro == otherSpot.residchro; locallab.spots.at(j).clarilres = locallab.spots.at(j).clarilres && pSpot.clarilres == otherSpot.clarilres; locallab.spots.at(j).claricres = locallab.spots.at(j).claricres && pSpot.claricres == otherSpot.claricres; @@ -3989,6 +3990,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).residblur = mods.locallab.spots.at(i).residblur; } + if (locallab.spots.at(i).levelblur) { + toEdit.locallab.spots.at(i).levelblur = mods.locallab.spots.at(i).levelblur; + } + if (locallab.spots.at(i).residchro) { toEdit.locallab.spots.at(i).residchro = mods.locallab.spots.at(i).residchro; } @@ -5495,6 +5500,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : levelwav(v), residcont(v), residblur(v), + levelblur(v), residchro(v), clarilres(v), claricres(v), @@ -5870,6 +5876,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) levelwav = v; residcont = v; residblur = v; + levelblur = v; residchro = v; clarilres = v; claricres = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 76d9bbbdd..8edf5df83 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -692,6 +692,7 @@ public: bool levelwav; bool residcont; bool residblur; + bool levelblur; bool residchro; bool clarilres; bool claricres;