diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index a22603921..fc2529a13 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -933,25 +933,25 @@ void Crop::update(int todo) int maxspot = 1; if (needslocal) { - for (int sp = 0; sp < params.locallab.nbspot; sp++) { - locRETgainCurve.Set(params.locallab.localTgaincurve.at(sp)); - loclhCurve.Set(params.locallab.LHcurve.at(sp), LHutili); - lochhCurve.Set(params.locallab.HHcurve.at(sp), HHutili); + for (int sp = 0; sp < params.locallab.nbspot && sp < (int)params.locallab.spots.size(); sp++) { + locRETgainCurve.Set(params.locallab.spots.at(sp).localTgaincurve); + loclhCurve.Set(params.locallab.spots.at(sp).LHcurve, LHutili); + lochhCurve.Set(params.locallab.spots.at(sp).HHcurve, HHutili); locallutili = false; - CurveFactory::curveLocal(locallutili, params.locallab.llcurve.at(sp), lllocalcurve2, sca); + CurveFactory::curveLocal(locallutili, params.locallab.spots.at(sp).llcurve, lllocalcurve2, sca); localcutili = false; - CurveFactory::curveCCLocal(localcutili, params.locallab.cccurve.at(sp), cclocalcurve2, sca); + CurveFactory::curveCCLocal(localcutili, params.locallab.spots.at(sp).cccurve, cclocalcurve2, sca); //localskutili = false; - CurveFactory::curveskLocal(localskutili, params.locallab.skintonescurve.at(sp), sklocalcurve2, sca); - CurveFactory::curveexLocal(localexutili, params.locallab.excurve.at(sp), exlocalcurve2, sca); + CurveFactory::curveskLocal(localskutili, params.locallab.spots.at(sp).skintonescurve, sklocalcurve2, sca); + CurveFactory::curveexLocal(localexutili, params.locallab.spots.at(sp).excurve, exlocalcurve2, sca); - double ecomp = params.locallab.expcomp.at(sp); - double black = params.locallab.black.at(sp); - double hlcompr = params.locallab.hlcompr.at(sp); - double hlcomprthresh = params.locallab.hlcomprthresh.at(sp); - double shcompr = params.locallab.shcompr.at(sp); - double br = params.locallab.lightness.at(sp); + double ecomp = params.locallab.spots.at(sp).expcomp; + double black = params.locallab.spots.at(sp).black; + double hlcompr = params.locallab.spots.at(sp).hlcompr; + double hlcomprthresh = params.locallab.spots.at(sp).hlcomprthresh; + double shcompr = params.locallab.spots.at(sp).shcompr; + double br = params.locallab.spots.at(sp).lightness; CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 6d49dfab5..610ec2de4 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -767,7 +767,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) float **shbuffer = nullptr; int sca = 1; - for (int sp = 0; sp < params.locallab.nbspot; sp++) { + for (int sp = 0; sp < params.locallab.nbspot && sp < (int)params.locallab.spots.size(); sp++) { // Set local curves of current spot to LUT LHutili = false; HHutili = false; @@ -775,19 +775,19 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) localexutili = false; localcutili = false; localskutili = false; - locRETgainCurve.Set(params.locallab.localTgaincurve.at(sp)); - loclhCurve.Set(params.locallab.LHcurve.at(sp), LHutili); - lochhCurve.Set(params.locallab.HHcurve.at(sp), HHutili); - CurveFactory::curveLocal(locallutili, params.locallab.llcurve.at(sp), lllocalcurve, sca); - CurveFactory::curveCCLocal(localcutili, params.locallab.cccurve.at(sp), cclocalcurve, sca); - CurveFactory::curveskLocal(localskutili, params.locallab.skintonescurve.at(sp), sklocalcurve, sca); - CurveFactory::curveexLocal(localexutili, params.locallab.excurve.at(sp), exlocalcurve, sca); - double ecomp = params.locallab.expcomp.at(sp); - double black = params.locallab.black.at(sp); - double hlcompr = params.locallab.hlcompr.at(sp); - double hlcomprthresh = params.locallab.hlcomprthresh.at(sp); - double shcompr = params.locallab.shcompr.at(sp); - double br = params.locallab.lightness.at(sp); + locRETgainCurve.Set(params.locallab.spots.at(sp).localTgaincurve); + loclhCurve.Set(params.locallab.spots.at(sp).LHcurve, LHutili); + lochhCurve.Set(params.locallab.spots.at(sp).HHcurve, HHutili); + CurveFactory::curveLocal(locallutili, params.locallab.spots.at(sp).llcurve, lllocalcurve, sca); + CurveFactory::curveCCLocal(localcutili, params.locallab.spots.at(sp).cccurve, cclocalcurve, sca); + CurveFactory::curveskLocal(localskutili, params.locallab.spots.at(sp).skintonescurve, sklocalcurve, sca); + CurveFactory::curveexLocal(localexutili, params.locallab.spots.at(sp).excurve, exlocalcurve, sca); + double ecomp = params.locallab.spots.at(sp).expcomp; + double black = params.locallab.spots.at(sp).black; + double hlcompr = params.locallab.spots.at(sp).hlcompr; + double hlcomprthresh = params.locallab.spots.at(sp).hlcomprthresh; + double shcompr = params.locallab.spots.at(sp).shcompr; + double br = params.locallab.spots.at(sp).lightness; CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, sca); @@ -795,7 +795,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) // Reference parameters computation double huere, chromare, lumare, huerefblu, sobelre; - if (params.locallab.spotMethod.at(sp) == "exc") { + if (params.locallab.spots.at(sp).spotMethod == "exc") { ipf.calc_ref(sp, reserv, reserv, 0, 0, pW, pH, scale, huerefblu, huere, chromare, lumare, sobelre); } else { ipf.calc_ref(sp, nprevl, nprevl, 0, 0, pW, pH, scale, huerefblu, huere, chromare, lumare, sobelre); diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 53c10f2e6..db0dcbd00 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -5230,11 +5230,11 @@ void ImProcFunctions::EPDToneMapCIE(CieImage *ncie, float a_w, float c_, int Wid void ImProcFunctions::EPDToneMaplocal(int sp, LabImage *lab, LabImage *tmp1, unsigned int Iterates, int skip) { - float stren = ((float)params->locallab.stren.at(sp)) / 100.f; - float edgest = ((float)params->locallab.estop.at(sp)) / 100.f; - float sca = ((float)params->locallab.scaltm.at(sp)) / 10.f; - float gamm = ((float)params->locallab.gamma.at(sp)) / 100.f; - float rew = ((float)params->locallab.rewei.at(sp)); + float stren = ((float)params->locallab.spots.at(sp).stren) / 100.f; + float edgest = ((float)params->locallab.spots.at(sp).estop) / 100.f; + float sca = ((float)params->locallab.spots.at(sp).scaltm) / 10.f; + float gamm = ((float)params->locallab.spots.at(sp).gamma) / 100.f; + float rew = ((float)params->locallab.spots.at(sp).rewei); //Pointers to whole data and size of it. float *L = lab->L[0]; float *a = lab->a[0]; diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 8ded508b4..8639c4579 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -331,114 +331,114 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall { int w = oW; int h = oH; - int circr = locallab.circrad.at(sp); - float streng = ((float)locallab.stren.at(sp)) / 100.f; - float gam = ((float)locallab.gamma.at(sp)) / 100.f; - float est = ((float)locallab.estop.at(sp)) / 100.f; - float scal_tm = ((float)locallab.scaltm.at(sp)) / 10.f; - float rewe = ((float)locallab.rewei.at(sp)); + int circr = locallab.spots.at(sp).circrad; + float streng = ((float)locallab.spots.at(sp).stren) / 100.f; + float gam = ((float)locallab.spots.at(sp).gamma) / 100.f; + float est = ((float)locallab.spots.at(sp).estop) / 100.f; + float scal_tm = ((float)locallab.spots.at(sp).scaltm) / 10.f; + float rewe = ((float)locallab.spots.at(sp).rewei); - float thre = locallab.thresh.at(sp) / 100.f; - double local_x = locallab.locX.at(sp) / 2000.0; - double local_y = locallab.locY.at(sp) / 2000.0; - double local_xL = locallab.locXL.at(sp) / 2000.0; - double local_yT = locallab.locYT.at(sp) / 2000.0; - double local_center_x = locallab.centerX.at(sp) / 2000.0 + 0.5; - double local_center_y = locallab.centerY.at(sp) / 2000.0 + 0.5; + float thre = locallab.spots.at(sp).thresh / 100.f; + double local_x = locallab.spots.at(sp).locX / 2000.0; + double local_y = locallab.spots.at(sp).locY / 2000.0; + double local_xL = locallab.spots.at(sp).locXL / 2000.0; + double local_yT = locallab.spots.at(sp).locYT / 2000.0; + double local_center_x = locallab.spots.at(sp).centerX / 2000.0 + 0.5; + double local_center_y = locallab.spots.at(sp).centerY / 2000.0 + 0.5; double local_center_xbuf = 0.0; // Provision double local_center_ybuf = 0.0; // Provision - double local_dxx = locallab.iter.at(sp) / 8000.0; //for proxi = 2==> # 1 pixel - double local_dyy = locallab.iter.at(sp) / 8000.0; - float iterati = (float) locallab.iter.at(sp); + double local_dxx = locallab.spots.at(sp).iter / 8000.0; //for proxi = 2==> # 1 pixel + double local_dyy = locallab.spots.at(sp).iter / 8000.0; + float iterati = (float) locallab.spots.at(sp).iter; // double local_dyy = locallab.proxi; - float chromaPastel = float (locallab.pastels.at(sp)) / 100.0f; - float chromaSatur = float (locallab.saturated.at(sp)) / 100.0f; - int local_sensiv = locallab.sensiv.at(sp); - int local_sensiex = locallab.sensiex.at(sp); + float chromaPastel = float (locallab.spots.at(sp).pastels) / 100.0f; + float chromaSatur = float (locallab.spots.at(sp).saturated) / 100.0f; + int local_sensiv = locallab.spots.at(sp).sensiv; + int local_sensiex = locallab.spots.at(sp).sensiex; - if (locallab.qualityMethod.at(sp) == "std") { + if (locallab.spots.at(sp).qualityMethod == "std") { lp.qualmet = 0; - } else if (locallab.qualityMethod.at(sp) == "enh") { + } else if (locallab.spots.at(sp).qualityMethod == "enh") { lp.qualmet = 1; - } else if (locallab.qualityMethod.at(sp) == "enhden") { + } else if (locallab.spots.at(sp).qualityMethod == "enhden") { lp.qualmet = 2; } - if (locallab.qualitycurveMethod.at(sp) == "none") { + if (locallab.spots.at(sp).qualitycurveMethod == "none") { lp.qualcurvemet = 0; - } else if (locallab.qualitycurveMethod.at(sp) == "std") { + } else if (locallab.spots.at(sp).qualitycurveMethod == "std") { lp.qualcurvemet = 1; - } else if (locallab.qualitycurveMethod.at(sp) == "enh") { + } else if (locallab.spots.at(sp).qualitycurveMethod == "enh") { lp.qualcurvemet = 2; } - if (locallab.blurMethod.at(sp) == "norm") { + if (locallab.spots.at(sp).blurMethod == "norm") { lp.blurmet = 0; - } else if (locallab.blurMethod.at(sp) == "inv") { + } else if (locallab.spots.at(sp).blurMethod == "inv") { lp.blurmet = 1; - } else if (locallab.blurMethod.at(sp) == "sym") { + } else if (locallab.spots.at(sp).blurMethod == "sym") { lp.blurmet = 2; } - if (locallab.spotMethod.at(sp) == "norm") { + if (locallab.spots.at(sp).spotMethod == "norm") { lp.excmet = 0; - } else if (locallab.spotMethod.at(sp) == "exc") { + } else if (locallab.spots.at(sp).spotMethod == "exc") { lp.excmet = 1; } - if (locallab.shape.at(sp) == "ELI") { + if (locallab.spots.at(sp).shape == "ELI") { lp.shapmet = 0; - } else if (locallab.shape.at(sp) == "RECT") { + } else if (locallab.spots.at(sp).shape == "RECT") { lp.shapmet = 1; } - float local_noiself = (float)locallab.noiselumf.at(sp); - float local_noiselc = (float)locallab.noiselumc.at(sp); - float local_noiseldetail = (float)locallab.noiselumdetail.at(sp); - int local_noiselequal = locallab.noiselequal.at(sp); - float local_noisechrodetail = (float)locallab.noisechrodetail.at(sp); - int local_sensiden = locallab.sensiden.at(sp); + float local_noiself = (float)locallab.spots.at(sp).noiselumf; + float local_noiselc = (float)locallab.spots.at(sp).noiselumc; + float local_noiseldetail = (float)locallab.spots.at(sp).noiselumdetail; + int local_noiselequal = locallab.spots.at(sp).noiselequal; + float local_noisechrodetail = (float)locallab.spots.at(sp).noisechrodetail; + int local_sensiden = locallab.spots.at(sp).sensiden; - float local_noisecf = ((float)locallab.noisechrof.at(sp)) / 10.f; - float local_noisecc = ((float)locallab.noisechroc.at(sp)) / 10.f; + float local_noisecf = ((float)locallab.spots.at(sp).noisechrof) / 10.f; + float local_noisecc = ((float)locallab.spots.at(sp).noisechroc) / 10.f; float multi[5]; for (int y = 0; y < 5; y++) { - multi[y] = ((float) locallab.mult[y].at(sp)) / 100.f; + multi[y] = ((float) locallab.spots.at(sp).mult[y]) / 100.f; } - float thresho = ((float)locallab.threshold.at(sp)) / 100.f; - float chromcbdl = (float)locallab.chromacbdl.at(sp); + float thresho = ((float)locallab.spots.at(sp).threshold) / 100.f; + float chromcbdl = (float)locallab.spots.at(sp).chromacbdl; - int local_chroma = locallab.chroma.at(sp); - int local_sensi = locallab.sensi.at(sp); - int local_sensibn = locallab.sensibn.at(sp); - int local_sensitm = locallab.sensitm.at(sp); - int local_sensiexclu = locallab.sensiexclu.at(sp); - int local_struc = locallab.struc.at(sp); - int local_warm = locallab.warm.at(sp); - int local_sensih = locallab.sensih.at(sp); - int local_sensicb = locallab.sensicb.at(sp); - int local_contrast = locallab.contrast.at(sp); - float local_lightness = (float) locallab.lightness.at(sp); - int local_transit = locallab.transit.at(sp); - double radius = (double) locallab.radius.at(sp); - double sharradius = ((double) locallab.sharradius.at(sp)) / 100. ; - int local_sensisha = locallab.sensisha.at(sp); - int local_sharamount = locallab.sharamount.at(sp); - int local_shardamping = locallab.shardamping.at(sp); - int local_shariter = locallab.shariter.at(sp); - bool inverse = locallab.invers.at(sp); - bool curvacti = locallab.curvactiv.at(sp); - bool acti = locallab.activlum.at(sp); + int local_chroma = locallab.spots.at(sp).chroma; + int local_sensi = locallab.spots.at(sp).sensi; + int local_sensibn = locallab.spots.at(sp).sensibn; + int local_sensitm = locallab.spots.at(sp).sensitm; + int local_sensiexclu = locallab.spots.at(sp).sensiexclu; + int local_struc = locallab.spots.at(sp).struc; + int local_warm = locallab.spots.at(sp).warm; + int local_sensih = locallab.spots.at(sp).sensih; + int local_sensicb = locallab.spots.at(sp).sensicb; + int local_contrast = locallab.spots.at(sp).contrast; + float local_lightness = (float) locallab.spots.at(sp).lightness; + int local_transit = locallab.spots.at(sp).transit; + double radius = (double) locallab.spots.at(sp).radius; + double sharradius = ((double) locallab.spots.at(sp).sharradius) / 100. ; + int local_sensisha = locallab.spots.at(sp).sensisha; + int local_sharamount = locallab.spots.at(sp).sharamount; + int local_shardamping = locallab.spots.at(sp).shardamping; + int local_shariter = locallab.spots.at(sp).shariter; + bool inverse = locallab.spots.at(sp).invers; + bool curvacti = locallab.spots.at(sp).curvactiv; + bool acti = locallab.spots.at(sp).activlum; bool cupas = false; // Provision bool inverserad = false; // Provision - bool inverseret = locallab.inversret.at(sp); - bool inversesha = locallab.inverssha.at(sp); - double strength = (double) locallab.strength.at(sp); - float str = (float)locallab.str.at(sp); + bool inverseret = locallab.spots.at(sp).inversret; + bool inversesha = locallab.spots.at(sp).inverssha; + double strength = (double) locallab.spots.at(sp).strength; + float str = (float)locallab.spots.at(sp).str; lp.cir = circr; lp.actsp = acti; @@ -490,8 +490,8 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.noisecf = local_noisecf; lp.noisecc = local_noisecc; lp.sensden = local_sensiden; - lp.bilat = locallab.bilateral.at(sp); - lp.adjch = (float) locallab.adjblur.at(sp); + lp.bilat = locallab.spots.at(sp).bilateral; + lp.adjch = (float) locallab.spots.at(sp).adjblur; lp.strengt = streng; lp.gamm = gam; lp.esto = est; @@ -505,25 +505,25 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.threshol = thresho; lp.chromacb = chromcbdl; - lp.colorena = locallab.expcolor.at(sp); - lp.blurena = locallab.expblur.at(sp); - lp.tonemapena = locallab.exptonemap.at(sp); - lp.retiena = locallab.expreti.at(sp); - lp.sharpena = locallab.expsharp.at(sp); - lp.cbdlena = locallab.expcbdl.at(sp); - lp.denoiena = locallab.expdenoi.at(sp); - lp.expvib = locallab.expvibrance.at(sp); + lp.colorena = locallab.spots.at(sp).expcolor; + lp.blurena = locallab.spots.at(sp).expblur; + lp.tonemapena = locallab.spots.at(sp).exptonemap; + lp.retiena = locallab.spots.at(sp).expreti; + lp.sharpena = locallab.spots.at(sp).expsharp; + lp.cbdlena = locallab.spots.at(sp).expcbdl; + lp.denoiena = locallab.spots.at(sp).expdenoi; + lp.expvib = locallab.spots.at(sp).expvibrance; lp.sensv = local_sensiv; lp.past = chromaPastel; lp.satur = chromaSatur; - lp.exposena = locallab.expexpose.at(sp); + lp.exposena = locallab.spots.at(sp).expexpose; lp.cut_past = cupas; - lp.blac = locallab.black.at(sp); - lp.shcomp = locallab.shcompr.at(sp); - lp.hlcomp = locallab.hlcompr.at(sp); - lp.hlcompthr = locallab.hlcomprthresh.at(sp); - lp.expcomp = locallab.expcomp.at(sp) / 100.; + lp.blac = locallab.spots.at(sp).black; + lp.shcomp = locallab.spots.at(sp).shcompr; + lp.hlcomp = locallab.spots.at(sp).hlcompr; + lp.hlcompthr = locallab.spots.at(sp).hlcomprthresh; + lp.expcomp = locallab.spots.at(sp).expcomp / 100.; lp.sensex = local_sensiex; lp.strucc = local_struc; lp.war = local_warm; @@ -761,10 +761,10 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, LabImage* dest) int tempo; - if (params->locallab.warm.at(sp) > 0) { - tempo = 5000 - 30 * params->locallab.warm.at(sp); + if (params->locallab.spots.at(sp).warm > 0) { + tempo = 5000 - 30 * params->locallab.spots.at(sp).warm; } else { - tempo = 5000 - 49 * params->locallab.warm.at(sp); + tempo = 5000 - 49 * params->locallab.spots.at(sp).warm; } ColorTemp::temp2mulxyz(params->wb.temperature, params->wb.method, Xw, Zw); //compute white Xw Yw Zw : white current WB @@ -1027,7 +1027,7 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, LabImage* dest) void ImProcFunctions::vibrancelocal(int sp, int bfw, int bfh, LabImage* lab, LabImage* dest, bool & localskutili, LUTf & sklocalcurve) { - if (!((bool)params->locallab.expvibrance.at(sp))) { + if (!((bool)params->locallab.spots.at(sp).expvibrance)) { return; } @@ -1040,10 +1040,10 @@ void ImProcFunctions::vibrancelocal(int sp, int bfw, int bfh, LabImage* lab, La int negat = 0, moreRGB = 0, negsat = 0, moresat = 0; #endif - const float chromaPastel = float (params->locallab.pastels.at(sp)) / 100.0f; - const float chromaSatur = float (params->locallab.saturated.at(sp)) / 100.0f; + const float chromaPastel = float (params->locallab.spots.at(sp).pastels) / 100.0f; + const float chromaSatur = float (params->locallab.spots.at(sp).saturated) / 100.0f; const float p00 = 0.07f; - const float limitpastelsatur = (static_cast(params->locallab.psthreshold.at(sp).getTopLeft()) / 100.0f) * (1.0f - p00) + p00; + const float limitpastelsatur = (static_cast(params->locallab.spots.at(sp).psthreshold.getTopLeft()) / 100.0f) * (1.0f - p00) + p00; const float maxdp = (limitpastelsatur - p00) / 4.0f; const float maxds = (1.0 - limitpastelsatur) / 4.0f; const float p0 = p00 + maxdp; @@ -1052,7 +1052,7 @@ void ImProcFunctions::vibrancelocal(int sp, int bfw, int bfh, LabImage* lab, La const float s0 = limitpastelsatur + maxds; const float s1 = limitpastelsatur + 2.0f * maxds; const float s2 = limitpastelsatur + 3.0f * maxds; - const float transitionweighting = static_cast(params->locallab.psthreshold.at(sp).getBottomLeft()) / 100.0f; + const float transitionweighting = static_cast(params->locallab.spots.at(sp).psthreshold.getBottomLeft()) / 100.0f; float chromamean = 0.0f; if (chromaPastel != chromaSatur) { @@ -1084,8 +1084,8 @@ void ImProcFunctions::vibrancelocal(int sp, int bfw, int bfh, LabImage* lab, La const bool highlight = params->toneCurve.hrenabled;//Get the value if "highlight reconstruction" is activated - const bool protectskins = params->locallab.protectskins.at(sp); - const bool avoidcolorshift = params->locallab.avoidcolorshift.at(sp); + const bool protectskins = params->locallab.spots.at(sp).protectskins; + const bool avoidcolorshift = params->locallab.spots.at(sp).avoidcolorshift; TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix(params->icm.workingProfile); //inverse matrix user select @@ -11441,10 +11441,10 @@ void ImProcFunctions::Lab_Local(int call, int maxspot, int sp, LUTf & huerefs, L // } //sharpen only square area instaed of all image - ImProcFunctions::deconvsharpeningloc(bufsh, hbuffer, bfw, bfh, loctemp, params->locallab.shardamping.at(sp), (double)params->locallab.sharradius.at(sp) / 100., params->locallab.shariter.at(sp), params->locallab.sharamount.at(sp)); + ImProcFunctions::deconvsharpeningloc(bufsh, hbuffer, bfw, bfh, loctemp, params->locallab.spots.at(sp).shardamping, (double)params->locallab.spots.at(sp).sharradius / 100., params->locallab.spots.at(sp).shariter, params->locallab.spots.at(sp).sharamount); } else { //call from dcrop.cc - ImProcFunctions::deconvsharpeningloc(original->L, shbuffer, bfw, bfh, loctemp, params->locallab.shardamping.at(sp), (double)params->locallab.sharradius.at(sp) / 100., params->locallab.shariter.at(sp), params->locallab.sharamount.at(sp)); + ImProcFunctions::deconvsharpeningloc(original->L, shbuffer, bfw, bfh, loctemp, params->locallab.spots.at(sp).shardamping, (double)params->locallab.spots.at(sp).sharradius / 100., params->locallab.spots.at(sp).shariter, params->locallab.spots.at(sp).sharamount); } @@ -11467,7 +11467,7 @@ void ImProcFunctions::Lab_Local(int call, int maxspot, int sp, LUTf & huerefs, L int GH = original->H; JaggedArray loctemp(GW, GH); - ImProcFunctions::deconvsharpeningloc(original->L, shbuffer, GW, GH, loctemp, params->locallab.shardamping.at(sp), (double)params->locallab.sharradius.at(sp) / 100., params->locallab.shariter.at(sp), params->locallab.sharamount.at(sp)); + ImProcFunctions::deconvsharpeningloc(original->L, shbuffer, GW, GH, loctemp, params->locallab.spots.at(sp).shardamping, (double)params->locallab.spots.at(sp).sharradius / 100., params->locallab.spots.at(sp).shariter, params->locallab.spots.at(sp).sharamount); float hueplus = hueref + dhuesha; float huemoins = hueref - dhuesha; @@ -11631,7 +11631,7 @@ void ImProcFunctions::Lab_Local(int call, int maxspot, int sp, LUTf & huerefs, L InverseReti_Local(lp, original, transformed, tmpl, cx, cy, 0); } - if (params->locallab.chrrt.at(sp) > 0) { + if (params->locallab.spots.at(sp).chrrt > 0) { if (!lp.invret && call <= 3) { @@ -11731,7 +11731,7 @@ void ImProcFunctions::Lab_Local(int call, int maxspot, int sp, LUTf & huerefs, L // Gamut and Munsell control - very important do not desactivated to avoid crash - if (params->locallab.avoid.at(sp)) { + if (params->locallab.spots.at(sp).avoid) { TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix(params->icm.workingProfile); float wip[3][3] = { {static_cast(wiprof[0][0]), static_cast(wiprof[0][1]), static_cast(wiprof[0][2])}, diff --git a/rtengine/ipretinex.cc b/rtengine/ipretinex.cc index bf36ab885..cb8397222 100644 --- a/rtengine/ipretinex.cc +++ b/rtengine/ipretinex.cc @@ -814,10 +814,10 @@ void ImProcFunctions::MSRLocal(int sp, float** luminance, float** templ, const f // constexpr bool useHsl = false; //never used constexpr bool useHslLin = false;//never used const float offse = 0.f; //loc.offs; - const float chrT = (float)(loc.chrrt.at(sp)) / 100.f; + const float chrT = (float)(loc.spots.at(sp).chrrt) / 100.f; const int scal = scall;//3;//loc.scale;; - const float vart = loc.vart.at(sp) / 100.f;//variance - const float strength = loc.str.at(sp) / 100.f; // Blend with original L channel data + const float vart = loc.spots.at(sp).vart / 100.f;//variance + const float strength = loc.spots.at(sp).str / 100.f; // Blend with original L channel data float limD = 10.f;//(float) loc.limd; limD = pow(limD, 1.7f); //about 2500 enough //limD *= useHslLin ? 10.f : 1.f; @@ -826,7 +826,7 @@ void ImProcFunctions::MSRLocal(int sp, float** luminance, float** templ, const f //empirical skip evaluation : very difficult because quasi all parameters interfere //to test on several images - int nei = (int)(krad * loc.neigh.at(sp)); + int nei = (int)(krad * loc.spots.at(sp).neigh); if (skip >= 4) { nei = (int)(0.1f * nei + 2.f); //not too bad @@ -836,12 +836,12 @@ void ImProcFunctions::MSRLocal(int sp, float** luminance, float** templ, const f int moderetinex = 0; - if (loc.retinexMethod.at(sp) == "uni") { + if (loc.spots.at(sp).retinexMethod == "uni") { moderetinex = 0; - } else if (loc.retinexMethod.at(sp) == "low") { + } else if (loc.spots.at(sp).retinexMethod == "low") { moderetinex = 1; } else { - if (loc.retinexMethod.at(sp) == "high") { // default to 2 ( deh.retinexMethod == "high" ) + if (loc.spots.at(sp).retinexMethod == "high") { // default to 2 ( deh.retinexMethod == "high" ) moderetinex = 2; } } diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 54c608ad9..e72f58dd9 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2265,128 +2265,121 @@ void WaveletParams::getCurves( } -LocallabParams::LocallabParams() : - enabled(false), - nbspot(0), - selspot(0), +LocallabParams::LocallabSpot::LocallabSpot() : // Control spot settings - id(), - name(), - isvisible(), - shape(), - spotMethod(), - sensiexclu(), - struc(), - shapeMethod(), - locX(), - locXL(), - locY(), - locYT(), - centerX(), - centerY(), - circrad(), - qualityMethod(), - transit(), - thresh(), - iter(), + id(1), + name(""), + isvisible(true), + shape("ELI"), + spotMethod("norm"), + sensiexclu(19), + struc(0), + shapeMethod("IND"), + locX(250), + locXL(250), + locY(250), + locYT(250), + centerX(0), + centerY(0), + circrad(18), + qualityMethod("enh"), + transit(60), + thresh(18), + iter(0), // Color & Light - expcolor(), - curvactiv(), - lightness(), - contrast(), - chroma(), - sensi(), - qualitycurveMethod(), - llcurve(), - cccurve(), - LHcurve(), - HHcurve(), - invers(), + expcolor(false), + curvactiv(false), + lightness(0), + contrast(0), + chroma(0), + sensi(19), + qualitycurveMethod("none"), + llcurve{(double)DCT_NURBS, 0.0, 0.0, 1.0, 1.0}, + cccurve{(double)DCT_NURBS, 0.0, 0.0, 1.0, 1.0}, + LHcurve{(double)FCT_MinMaxCPoints, 0.0, 0.50, 0.35, 0.35, 0.166, 0.50, 0.35, 0.35, 0.333, 0.50, 0.35, 0.35, 0.50, 0.50, 0.35, 0.35, 0.666, 0.50, 0.35, 0.35, 0.833, 0.50, 0.35, 0.35}, + HHcurve{(double)FCT_MinMaxCPoints, 0.0, 0.50, 0.35, 0.35, 0.166, 0.50, 0.35, 0.35, 0.333, 0.50, 0.35, 0.35, 0.50, 0.50, 0.35, 0.35, 0.666, 0.50, 0.35, 0.35, 0.833, 0.50, 0.35, 0.35}, + invers(false), // Exposure - expexpose(), - expcomp(), - hlcompr(), - hlcomprthresh(), - black(), - shcompr(), - warm(), - sensiex(), - excurve(), + expexpose(false), + expcomp(0), + hlcompr(20), + hlcomprthresh(33), + black(0), + shcompr(50), + warm(0), + sensiex(19), + excurve{(double)DCT_NURBS, 0.0, 0.0, 1.0, 1.0}, // Vibrance - expvibrance(), - saturated(), - pastels(), - psthreshold(), - protectskins(), - avoidcolorshift(), - pastsattog(), - sensiv(), - skintonescurve(), + expvibrance(false), + saturated(0), + pastels(0), + psthreshold({0, 75, false}), + protectskins(false), + avoidcolorshift(true), + pastsattog(true), + sensiv(19), + skintonescurve{(double)DCT_Linear}, // Blur & Noise - expblur(), - radius(), - strength(), - sensibn(), - blurMethod(), - activlum(), + expblur(false), + radius(1), + strength(0), + sensibn(40), + blurMethod("norm"), + activlum(false), // Tone Mapping - exptonemap(), - stren(), - gamma(), - estop(), - scaltm(), - rewei(), - sensitm(), + exptonemap(false), + stren(1), + gamma(100), + estop(140), + scaltm(10), + rewei(0), + sensitm(19), // Retinex - expreti(), - retinexMethod(), - str(), - chrrt(), - neigh(), - vart(), - sensih(), - localTgaincurve(), - inversret(), + expreti(false), + retinexMethod("high"), + str(0), + chrrt(0), + neigh(50), + vart(200), + sensih(19), + localTgaincurve{(double)FCT_MinMaxCPoints, 0.0, 0.12, 0.35, 0.35, 0.70, 0.50, 0.35, 0.35, 1.00, 0.12, 0.35, 0.35}, + inversret(false), // Sharpening - expsharp(), - sharradius(), - sharamount(), - shardamping(), - shariter(), - sensisha(), - inverssha(), + expsharp(false), + sharradius(40), + sharamount(75), + shardamping(75), + shariter(30), + sensisha(19), + inverssha(false), // Contrast by detail levels - expcbdl(), - mult(), - chromacbdl(), - threshold(), - sensicb(), + expcbdl(false), + mult{100.0, 100.0, 100.0, 100.0, 100.0}, + chromacbdl(0), + threshold(20.0), + sensicb(19), // Denoise - expdenoi(), - noiselumf(), - noiselumc(), - noiselumdetail(), - noiselequal(), - noisechrof(), - noisechroc(), - noisechrodetail(), - adjblur(), - bilateral(), - sensiden(), + expdenoi(false), + noiselumf(0), + noiselumc(0), + noiselumdetail(0), + noiselequal(7), + noisechrof(0), + noisechroc(0), + noisechrodetail(0), + adjblur(0), + bilateral(0), + sensiden(30), // Others - avoid() + avoid(false) { } -bool LocallabParams::operator ==(const LocallabParams& other) const +bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const { - return - enabled == other.enabled - && nbspot == other.nbspot - && selspot == other.selspot // Control spot settings - && id == other.id + id == other.id && name == other.name && isvisible == other.isvisible && shape == other.shape @@ -2502,11 +2495,32 @@ bool LocallabParams::operator ==(const LocallabParams& other) const && avoid == other.avoid; } -bool LocallabParams::operator !=(const LocallabParams& other) const +bool LocallabParams::LocallabSpot::operator !=(const LocallabSpot& other) const { return !(*this == other); } +LocallabParams::LocallabParams() : + enabled(false), + nbspot(0), + selspot(0), + spots() +{ +} + +bool LocallabParams::operator ==(const LocallabParams& other) const +{ + return + enabled == other.enabled + && nbspot == other.nbspot + && selspot == other.selspot + && spots == other.spots; +} + +bool LocallabParams::operator !=(const LocallabParams& other) const +{ + return !(*this == other); +} DirPyrEqualizerParams::DirPyrEqualizerParams() : enabled(false), @@ -3390,117 +3404,118 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.nbspot, "Locallab", "Nbspot", locallab.nbspot, keyFile); saveToKeyfile(!pedited || pedited->locallab.selspot, "Locallab", "Selspot", locallab.selspot, keyFile); - for (int i = 0; i < locallab.nbspot; i++) { + for (int i = 0; i < locallab.nbspot && i < (int)locallab.spots.size(); i++) { + LocallabParams::LocallabSpot spot = locallab.spots.at(i); // Control spot settings - saveToKeyfile(!pedited || pedited->locallab.id, "Locallab", "Id_" + std::to_string(i), locallab.id.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.name, "Locallab", "Name_" + std::to_string(i), locallab.name.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.isvisible, "Locallab", "Isvisible_" + std::to_string(i), locallab.isvisible.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.shape, "Locallab", "Shape_" + std::to_string(i), locallab.shape.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.spotMethod, "Locallab", "SpotMethod_" + std::to_string(i), locallab.spotMethod.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.sensiexclu, "Locallab", "SensiExclu_" + std::to_string(i), locallab.sensiexclu.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.struc, "Locallab", "Struc_" + std::to_string(i), locallab.struc.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.shapeMethod, "Locallab", "ShapeMethod_" + std::to_string(i), locallab.shapeMethod.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.locX, "Locallab", "LocX_" + std::to_string(i), locallab.locX.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.locXL, "Locallab", "LocXL_" + std::to_string(i), locallab.locXL.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.locY, "Locallab", "LocY_" + std::to_string(i), locallab.locY.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.locYT, "Locallab", "LocYT_" + std::to_string(i), locallab.locYT.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.centerX, "Locallab", "CenterX_" + std::to_string(i), locallab.centerX.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.centerY, "Locallab", "CenterY_" + std::to_string(i), locallab.centerY.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.circrad, "Locallab", "Circrad_" + std::to_string(i), locallab.circrad.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.qualityMethod, "Locallab", "QualityMethod_" + std::to_string(i), locallab.qualityMethod.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.transit, "Locallab", "Transit_" + std::to_string(i), locallab.transit.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.thresh, "Locallab", "Thresh_" + std::to_string(i), locallab.thresh.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.iter, "Locallab", "Iter_" + std::to_string(i), locallab.iter.at(i), keyFile); + saveToKeyfile(!pedited || pedited->locallab.id, "Locallab", "Id_" + std::to_string(i), spot.id, keyFile); + saveToKeyfile(!pedited || pedited->locallab.name, "Locallab", "Name_" + std::to_string(i), spot.name, keyFile); + saveToKeyfile(!pedited || pedited->locallab.isvisible, "Locallab", "Isvisible_" + std::to_string(i), spot.isvisible, keyFile); + saveToKeyfile(!pedited || pedited->locallab.shape, "Locallab", "Shape_" + std::to_string(i), spot.shape, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spotMethod, "Locallab", "SpotMethod_" + std::to_string(i), spot.spotMethod, keyFile); + saveToKeyfile(!pedited || pedited->locallab.sensiexclu, "Locallab", "SensiExclu_" + std::to_string(i), spot.sensiexclu, keyFile); + saveToKeyfile(!pedited || pedited->locallab.struc, "Locallab", "Struc_" + std::to_string(i), spot.struc, keyFile); + saveToKeyfile(!pedited || pedited->locallab.shapeMethod, "Locallab", "ShapeMethod_" + std::to_string(i), spot.shapeMethod, keyFile); + saveToKeyfile(!pedited || pedited->locallab.locX, "Locallab", "LocX_" + std::to_string(i), spot.locX, keyFile); + saveToKeyfile(!pedited || pedited->locallab.locXL, "Locallab", "LocXL_" + std::to_string(i), spot.locXL, keyFile); + saveToKeyfile(!pedited || pedited->locallab.locY, "Locallab", "LocY_" + std::to_string(i), spot.locY, keyFile); + saveToKeyfile(!pedited || pedited->locallab.locYT, "Locallab", "LocYT_" + std::to_string(i), spot.locYT, keyFile); + saveToKeyfile(!pedited || pedited->locallab.centerX, "Locallab", "CenterX_" + std::to_string(i), spot.centerX, keyFile); + saveToKeyfile(!pedited || pedited->locallab.centerY, "Locallab", "CenterY_" + std::to_string(i), spot.centerY, keyFile); + saveToKeyfile(!pedited || pedited->locallab.circrad, "Locallab", "Circrad_" + std::to_string(i), spot.circrad, keyFile); + saveToKeyfile(!pedited || pedited->locallab.qualityMethod, "Locallab", "QualityMethod_" + std::to_string(i), spot.qualityMethod, keyFile); + saveToKeyfile(!pedited || pedited->locallab.transit, "Locallab", "Transit_" + std::to_string(i), spot.transit, keyFile); + saveToKeyfile(!pedited || pedited->locallab.thresh, "Locallab", "Thresh_" + std::to_string(i), spot.thresh, keyFile); + saveToKeyfile(!pedited || pedited->locallab.iter, "Locallab", "Iter_" + std::to_string(i), spot.iter, keyFile); // Color & Light - saveToKeyfile(!pedited || pedited->locallab.expcolor, "Locallab", "Expcolor_" + std::to_string(i), locallab.expcolor.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.curvactiv, "Locallab", "Curvactiv_" + std::to_string(i), locallab.curvactiv.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.lightness, "Locallab", "Lightness_" + std::to_string(i), locallab.lightness.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.contrast, "Locallab", "Contrast_" + std::to_string(i), locallab.contrast.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.chroma, "Locallab", "Chroma_" + std::to_string(i), locallab.chroma.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.sensi, "Locallab", "Sensi_" + std::to_string(i), locallab.sensi.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.qualitycurveMethod, "Locallab", "QualityCurveMethod_" + std::to_string(i), locallab.qualitycurveMethod.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.llcurve, "Locallab", "LLCurve_" + std::to_string(i), locallab.llcurve.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.cccurve, "Locallab", "CCCurve_" + std::to_string(i), locallab.cccurve.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.LHcurve, "Locallab", "LHCurve_" + std::to_string(i), locallab.LHcurve.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.HHcurve, "Locallab", "HHCurve_" + std::to_string(i), locallab.HHcurve.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.invers, "Locallab", "Invers_" + std::to_string(i), locallab.invers.at(i), keyFile); + saveToKeyfile(!pedited || pedited->locallab.expcolor, "Locallab", "Expcolor_" + std::to_string(i), spot.expcolor, keyFile); + saveToKeyfile(!pedited || pedited->locallab.curvactiv, "Locallab", "Curvactiv_" + std::to_string(i), spot.curvactiv, keyFile); + saveToKeyfile(!pedited || pedited->locallab.lightness, "Locallab", "Lightness_" + std::to_string(i), spot.lightness, keyFile); + saveToKeyfile(!pedited || pedited->locallab.contrast, "Locallab", "Contrast_" + std::to_string(i), spot.contrast, keyFile); + saveToKeyfile(!pedited || pedited->locallab.chroma, "Locallab", "Chroma_" + std::to_string(i), spot.chroma, keyFile); + saveToKeyfile(!pedited || pedited->locallab.sensi, "Locallab", "Sensi_" + std::to_string(i), spot.sensi, keyFile); + saveToKeyfile(!pedited || pedited->locallab.qualitycurveMethod, "Locallab", "QualityCurveMethod_" + std::to_string(i), spot.qualitycurveMethod, keyFile); + saveToKeyfile(!pedited || pedited->locallab.llcurve, "Locallab", "LLCurve_" + std::to_string(i), spot.llcurve, keyFile); + saveToKeyfile(!pedited || pedited->locallab.cccurve, "Locallab", "CCCurve_" + std::to_string(i), spot.cccurve, keyFile); + saveToKeyfile(!pedited || pedited->locallab.LHcurve, "Locallab", "LHCurve_" + std::to_string(i), spot.LHcurve, keyFile); + saveToKeyfile(!pedited || pedited->locallab.HHcurve, "Locallab", "HHCurve_" + std::to_string(i), spot.HHcurve, keyFile); + saveToKeyfile(!pedited || pedited->locallab.invers, "Locallab", "Invers_" + std::to_string(i), spot.invers, keyFile); // Exposure - saveToKeyfile(!pedited || pedited->locallab.expexpose, "Locallab", "Expexpose_" + std::to_string(i), locallab.expexpose.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.expcomp, "Locallab", "Expcomp_" + std::to_string(i), locallab.expcomp.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.hlcompr, "Locallab", "Hlcompr_" + std::to_string(i), locallab.hlcompr.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.hlcomprthresh, "Locallab", "Hlcomprthresh_" + std::to_string(i), locallab.hlcomprthresh.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.black, "Locallab", "Black_" + std::to_string(i), locallab.black.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.shcompr, "Locallab", "Shcompr_" + std::to_string(i), locallab.shcompr.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.warm, "Locallab", "Warm_" + std::to_string(i), locallab.warm.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.sensiex, "Locallab", "Sensiex_" + std::to_string(i), locallab.sensiex.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.excurve, "Locallab", "ExCurve_" + std::to_string(i), locallab.excurve.at(i), keyFile); + saveToKeyfile(!pedited || pedited->locallab.expexpose, "Locallab", "Expexpose_" + std::to_string(i), spot.expexpose, keyFile); + saveToKeyfile(!pedited || pedited->locallab.expcomp, "Locallab", "Expcomp_" + std::to_string(i), spot.expcomp, keyFile); + saveToKeyfile(!pedited || pedited->locallab.hlcompr, "Locallab", "Hlcompr_" + std::to_string(i), spot.hlcompr, keyFile); + saveToKeyfile(!pedited || pedited->locallab.hlcomprthresh, "Locallab", "Hlcomprthresh_" + std::to_string(i), spot.hlcomprthresh, keyFile); + saveToKeyfile(!pedited || pedited->locallab.black, "Locallab", "Black_" + std::to_string(i), spot.black, keyFile); + saveToKeyfile(!pedited || pedited->locallab.shcompr, "Locallab", "Shcompr_" + std::to_string(i), spot.shcompr, keyFile); + saveToKeyfile(!pedited || pedited->locallab.warm, "Locallab", "Warm_" + std::to_string(i), spot.warm, keyFile); + saveToKeyfile(!pedited || pedited->locallab.sensiex, "Locallab", "Sensiex_" + std::to_string(i), spot.sensiex, keyFile); + saveToKeyfile(!pedited || pedited->locallab.excurve, "Locallab", "ExCurve_" + std::to_string(i), spot.excurve, keyFile); // Vibrance - saveToKeyfile(!pedited || pedited->locallab.expvibrance, "Locallab", "Expvibrance_" + std::to_string(i), locallab.expvibrance.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.saturated, "Locallab", "Saturated_" + std::to_string(i), locallab.saturated.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.pastels, "Locallab", "Pastels_" + std::to_string(i), locallab.pastels.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.psthreshold, "Locallab", "PSThreshold_" + std::to_string(i), locallab.psthreshold.at(i).toVector(), keyFile); - saveToKeyfile(!pedited || pedited->locallab.protectskins, "Locallab", "ProtectSkins_" + std::to_string(i), locallab.protectskins.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.avoidcolorshift, "Locallab", "AvoidColorShift_" + std::to_string(i), locallab.avoidcolorshift.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.pastsattog, "Locallab", "PastSatTog_" + std::to_string(i), locallab.pastsattog.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.sensiv, "Locallab", "Sensiv_" + std::to_string(i), locallab.sensiv.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.skintonescurve, "Locallab", "SkinTonesCurve_" + std::to_string(i), locallab.skintonescurve.at(i), keyFile); + saveToKeyfile(!pedited || pedited->locallab.expvibrance, "Locallab", "Expvibrance_" + std::to_string(i), spot.expvibrance, keyFile); + saveToKeyfile(!pedited || pedited->locallab.saturated, "Locallab", "Saturated_" + std::to_string(i), spot.saturated, keyFile); + saveToKeyfile(!pedited || pedited->locallab.pastels, "Locallab", "Pastels_" + std::to_string(i), spot.pastels, keyFile); + saveToKeyfile(!pedited || pedited->locallab.psthreshold, "Locallab", "PSThreshold_" + std::to_string(i), spot.psthreshold.toVector(), keyFile); + saveToKeyfile(!pedited || pedited->locallab.protectskins, "Locallab", "ProtectSkins_" + std::to_string(i), spot.protectskins, keyFile); + saveToKeyfile(!pedited || pedited->locallab.avoidcolorshift, "Locallab", "AvoidColorShift_" + std::to_string(i), spot.avoidcolorshift, keyFile); + saveToKeyfile(!pedited || pedited->locallab.pastsattog, "Locallab", "PastSatTog_" + std::to_string(i), spot.pastsattog, keyFile); + saveToKeyfile(!pedited || pedited->locallab.sensiv, "Locallab", "Sensiv_" + std::to_string(i), spot.sensiv, keyFile); + saveToKeyfile(!pedited || pedited->locallab.skintonescurve, "Locallab", "SkinTonesCurve_" + std::to_string(i), spot.skintonescurve, keyFile); // Blur & Noise - saveToKeyfile(!pedited || pedited->locallab.expblur, "Locallab", "Expblur_" + std::to_string(i), locallab.expblur.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.radius, "Locallab", "Radius_" + std::to_string(i), locallab.radius.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.strength, "Locallab", "Strength_" + std::to_string(i), locallab.strength.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.sensibn, "Locallab", "Sensibn_" + std::to_string(i), locallab.sensibn.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.blurMethod, "Locallab", "BlurMethod_" + std::to_string(i), locallab.blurMethod.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.activlum, "Locallab", "activlum_" + std::to_string(i), locallab.activlum.at(i), keyFile); + saveToKeyfile(!pedited || pedited->locallab.expblur, "Locallab", "Expblur_" + std::to_string(i), spot.expblur, keyFile); + saveToKeyfile(!pedited || pedited->locallab.radius, "Locallab", "Radius_" + std::to_string(i), spot.radius, keyFile); + saveToKeyfile(!pedited || pedited->locallab.strength, "Locallab", "Strength_" + std::to_string(i), spot.strength, keyFile); + saveToKeyfile(!pedited || pedited->locallab.sensibn, "Locallab", "Sensibn_" + std::to_string(i), spot.sensibn, keyFile); + saveToKeyfile(!pedited || pedited->locallab.blurMethod, "Locallab", "BlurMethod_" + std::to_string(i), spot.blurMethod, keyFile); + saveToKeyfile(!pedited || pedited->locallab.activlum, "Locallab", "activlum_" + std::to_string(i), spot.activlum, keyFile); // Tone Mapping - saveToKeyfile(!pedited || pedited->locallab.exptonemap, "Locallab", "Exptonemap_" + std::to_string(i), locallab.exptonemap.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.stren, "Locallab", "Stren_" + std::to_string(i), locallab.stren.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.gamma, "Locallab", "Gamma_" + std::to_string(i), locallab.gamma.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.estop, "Locallab", "Estop_" + std::to_string(i), locallab.estop.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.scaltm, "Locallab", "Scaltm_" + std::to_string(i), locallab.scaltm.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.rewei, "Locallab", "Rewei_" + std::to_string(i), locallab.rewei.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.sensitm, "Locallab", "Sensitm_" + std::to_string(i), locallab.sensitm.at(i), keyFile); + saveToKeyfile(!pedited || pedited->locallab.exptonemap, "Locallab", "Exptonemap_" + std::to_string(i), spot.exptonemap, keyFile); + saveToKeyfile(!pedited || pedited->locallab.stren, "Locallab", "Stren_" + std::to_string(i), spot.stren, keyFile); + saveToKeyfile(!pedited || pedited->locallab.gamma, "Locallab", "Gamma_" + std::to_string(i), spot.gamma, keyFile); + saveToKeyfile(!pedited || pedited->locallab.estop, "Locallab", "Estop_" + std::to_string(i), spot.estop, keyFile); + saveToKeyfile(!pedited || pedited->locallab.scaltm, "Locallab", "Scaltm_" + std::to_string(i), spot.scaltm, keyFile); + saveToKeyfile(!pedited || pedited->locallab.rewei, "Locallab", "Rewei_" + std::to_string(i), spot.rewei, keyFile); + saveToKeyfile(!pedited || pedited->locallab.sensitm, "Locallab", "Sensitm_" + std::to_string(i), spot.sensitm, keyFile); // Retinex - saveToKeyfile(!pedited || pedited->locallab.expreti, "Locallab", "Expreti_" + std::to_string(i), locallab.expreti.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.retinexMethod, "Locallab", "retinexMethod_" + std::to_string(i), locallab.retinexMethod.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.str, "Locallab", "Str_" + std::to_string(i), locallab.str.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.chrrt, "Locallab", "Chrrt_" + std::to_string(i), locallab.chrrt.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.neigh, "Locallab", "Neigh_" + std::to_string(i), locallab.neigh.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.vart, "Locallab", "Vart_" + std::to_string(i), locallab.vart.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.sensih, "Locallab", "Sensih_" + std::to_string(i), locallab.sensih.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.localTgaincurve, "Locallab", "TgainCurve_" + std::to_string(i), locallab.localTgaincurve.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.inversret, "Locallab", "Inversret_" + std::to_string(i), locallab.inversret.at(i), keyFile); + saveToKeyfile(!pedited || pedited->locallab.expreti, "Locallab", "Expreti_" + std::to_string(i), spot.expreti, keyFile); + saveToKeyfile(!pedited || pedited->locallab.retinexMethod, "Locallab", "retinexMethod_" + std::to_string(i), spot.retinexMethod, keyFile); + saveToKeyfile(!pedited || pedited->locallab.str, "Locallab", "Str_" + std::to_string(i), spot.str, keyFile); + saveToKeyfile(!pedited || pedited->locallab.chrrt, "Locallab", "Chrrt_" + std::to_string(i), spot.chrrt, keyFile); + saveToKeyfile(!pedited || pedited->locallab.neigh, "Locallab", "Neigh_" + std::to_string(i), spot.neigh, keyFile); + saveToKeyfile(!pedited || pedited->locallab.vart, "Locallab", "Vart_" + std::to_string(i), spot.vart, keyFile); + saveToKeyfile(!pedited || pedited->locallab.sensih, "Locallab", "Sensih_" + std::to_string(i), spot.sensih, keyFile); + saveToKeyfile(!pedited || pedited->locallab.localTgaincurve, "Locallab", "TgainCurve_" + std::to_string(i), spot.localTgaincurve, keyFile); + saveToKeyfile(!pedited || pedited->locallab.inversret, "Locallab", "Inversret_" + std::to_string(i), spot.inversret, keyFile); // Sharpening - saveToKeyfile(!pedited || pedited->locallab.expsharp, "Locallab", "Expsharp_" + std::to_string(i), locallab.expsharp.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.sharradius, "Locallab", "Sharradius_" + std::to_string(i), locallab.sharradius.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.sharamount, "Locallab", "Sharamount_" + std::to_string(i), locallab.sharamount.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.shardamping, "Locallab", "Shardamping_" + std::to_string(i), locallab.shardamping.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.shariter, "Locallab", "Shariter_" + std::to_string(i), locallab.shariter.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.sensisha, "Locallab", "Sensisha_" + std::to_string(i), locallab.sensisha.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.inverssha, "Locallab", "Inverssha_" + std::to_string(i), locallab.inverssha.at(i), keyFile); + saveToKeyfile(!pedited || pedited->locallab.expsharp, "Locallab", "Expsharp_" + std::to_string(i), spot.expsharp, keyFile); + saveToKeyfile(!pedited || pedited->locallab.sharradius, "Locallab", "Sharradius_" + std::to_string(i), spot.sharradius, keyFile); + saveToKeyfile(!pedited || pedited->locallab.sharamount, "Locallab", "Sharamount_" + std::to_string(i), spot.sharamount, keyFile); + saveToKeyfile(!pedited || pedited->locallab.shardamping, "Locallab", "Shardamping_" + std::to_string(i), spot.shardamping, keyFile); + saveToKeyfile(!pedited || pedited->locallab.shariter, "Locallab", "Shariter_" + std::to_string(i), spot.shariter, keyFile); + saveToKeyfile(!pedited || pedited->locallab.sensisha, "Locallab", "Sensisha_" + std::to_string(i), spot.sensisha, keyFile); + saveToKeyfile(!pedited || pedited->locallab.inverssha, "Locallab", "Inverssha_" + std::to_string(i), spot.inverssha, keyFile); // Contrast by detail levels - saveToKeyfile(!pedited || pedited->locallab.expcbdl, "Locallab", "Expcbdl_" + std::to_string(i), locallab.expcbdl.at(i), keyFile); + saveToKeyfile(!pedited || pedited->locallab.expcbdl, "Locallab", "Expcbdl_" + std::to_string(i), spot.expcbdl, keyFile); for (int j = 0; j < 5; j++) { - saveToKeyfile(!pedited || pedited->locallab.mult[j], "Locallab", "Mult" + std::to_string(j) + "_" + std::to_string(i), locallab.mult[j].at(i), keyFile); + saveToKeyfile(!pedited || pedited->locallab.mult[j], "Locallab", "Mult" + std::to_string(j) + "_" + std::to_string(i), spot.mult[j], keyFile); } - saveToKeyfile(!pedited || pedited->locallab.chromacbdl, "Locallab", "Chromacbdl_" + std::to_string(i), locallab.chromacbdl.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.threshold, "Locallab", "Threshold_" + std::to_string(i), locallab.threshold.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.sensicb, "Locallab", "Sensicb_" + std::to_string(i), locallab.sensicb.at(i), keyFile); + saveToKeyfile(!pedited || pedited->locallab.chromacbdl, "Locallab", "Chromacbdl_" + std::to_string(i), spot.chromacbdl, keyFile); + saveToKeyfile(!pedited || pedited->locallab.threshold, "Locallab", "Threshold_" + std::to_string(i), spot.threshold, keyFile); + saveToKeyfile(!pedited || pedited->locallab.sensicb, "Locallab", "Sensicb_" + std::to_string(i), spot.sensicb, keyFile); // Denoise - saveToKeyfile(!pedited || pedited->locallab.expdenoi, "Locallab", "Expdenoi_" + std::to_string(i), locallab.expdenoi.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.noiselumf, "Locallab", "noiselumf_" + std::to_string(i), locallab.noiselumf.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.noiselumc, "Locallab", "noiselumc_" + std::to_string(i), locallab.noiselumc.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.noiselumdetail, "Locallab", "noiselumdetail_" + std::to_string(i), locallab.noiselumdetail.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.noiselequal, "Locallab", "noiselequal_" + std::to_string(i), locallab.noiselequal.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.noisechrof, "Locallab", "noisechrof_" + std::to_string(i), locallab.noisechrof.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.noisechroc, "Locallab", "noisechroc_" + std::to_string(i), locallab.noisechroc.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.noisechrodetail, "Locallab", "noisechrodetail_" + std::to_string(i), locallab.noisechrodetail.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.adjblur, "Locallab", "Adjblur_" + std::to_string(i), locallab.adjblur.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.bilateral, "Locallab", "Bilateral_" + std::to_string(i), locallab.bilateral.at(i), keyFile); - saveToKeyfile(!pedited || pedited->locallab.sensiden, "Locallab", "Sensiden_" + std::to_string(i), locallab.sensiden.at(i), keyFile); + saveToKeyfile(!pedited || pedited->locallab.expdenoi, "Locallab", "Expdenoi_" + std::to_string(i), spot.expdenoi, keyFile); + saveToKeyfile(!pedited || pedited->locallab.noiselumf, "Locallab", "noiselumf_" + std::to_string(i), spot.noiselumf, keyFile); + saveToKeyfile(!pedited || pedited->locallab.noiselumc, "Locallab", "noiselumc_" + std::to_string(i), spot.noiselumc, keyFile); + saveToKeyfile(!pedited || pedited->locallab.noiselumdetail, "Locallab", "noiselumdetail_" + std::to_string(i), spot.noiselumdetail, keyFile); + saveToKeyfile(!pedited || pedited->locallab.noiselequal, "Locallab", "noiselequal_" + std::to_string(i), spot.noiselequal, keyFile); + saveToKeyfile(!pedited || pedited->locallab.noisechrof, "Locallab", "noisechrof_" + std::to_string(i), spot.noisechrof, keyFile); + saveToKeyfile(!pedited || pedited->locallab.noisechroc, "Locallab", "noisechroc_" + std::to_string(i), spot.noisechroc, keyFile); + saveToKeyfile(!pedited || pedited->locallab.noisechrodetail, "Locallab", "noisechrodetail_" + std::to_string(i), spot.noisechrodetail, keyFile); + saveToKeyfile(!pedited || pedited->locallab.adjblur, "Locallab", "Adjblur_" + std::to_string(i), spot.adjblur, keyFile); + saveToKeyfile(!pedited || pedited->locallab.bilateral, "Locallab", "Bilateral_" + std::to_string(i), spot.bilateral, keyFile); + saveToKeyfile(!pedited || pedited->locallab.sensiden, "Locallab", "Sensiden_" + std::to_string(i), spot.sensiden, keyFile); // Others - saveToKeyfile(!pedited || pedited->locallab.avoid, "Locallab", "Avoid_" + std::to_string(i), locallab.avoid.at(i), keyFile); + saveToKeyfile(!pedited || pedited->locallab.avoid, "Locallab", "Avoid_" + std::to_string(i), spot.avoid, keyFile); } // Post-crop vignette @@ -4542,174 +4557,66 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Selspot", pedited, locallab.selspot, pedited->locallab.selspot); // Resize locallab settings if required - if (locallab.nbspot > (int)locallab.id.size()) { - // Control spot settings - locallab.id.resize(locallab.nbspot); - locallab.name.resize(locallab.nbspot); - locallab.isvisible.resize(locallab.nbspot); - locallab.shape.resize(locallab.nbspot); - locallab.spotMethod.resize(locallab.nbspot); - locallab.sensiexclu.resize(locallab.nbspot); - locallab.struc.resize(locallab.nbspot); - locallab.shapeMethod.resize(locallab.nbspot); - locallab.locX.resize(locallab.nbspot); - locallab.locXL.resize(locallab.nbspot); - locallab.locY.resize(locallab.nbspot); - locallab.locYT.resize(locallab.nbspot); - locallab.centerX.resize(locallab.nbspot); - locallab.centerY.resize(locallab.nbspot); - locallab.circrad.resize(locallab.nbspot); - locallab.qualityMethod.resize(locallab.nbspot); - locallab.transit.resize(locallab.nbspot); - locallab.thresh.resize(locallab.nbspot); - locallab.iter.resize(locallab.nbspot); - // Color & Light - locallab.expcolor.resize(locallab.nbspot); - locallab.curvactiv.resize(locallab.nbspot); - locallab.lightness.resize(locallab.nbspot); - locallab.contrast.resize(locallab.nbspot); - locallab.chroma.resize(locallab.nbspot); - locallab.sensi.resize(locallab.nbspot); - locallab.qualitycurveMethod.resize(locallab.nbspot); - locallab.llcurve.resize(locallab.nbspot); - locallab.cccurve.resize(locallab.nbspot); - locallab.LHcurve.resize(locallab.nbspot); - locallab.HHcurve.resize(locallab.nbspot); - locallab.invers.resize(locallab.nbspot); - // Exposure - locallab.expexpose.resize(locallab.nbspot); - locallab.expcomp.resize(locallab.nbspot); - locallab.hlcompr.resize(locallab.nbspot); - locallab.hlcomprthresh.resize(locallab.nbspot); - locallab.black.resize(locallab.nbspot); - locallab.shcompr.resize(locallab.nbspot); - locallab.warm.resize(locallab.nbspot); - locallab.sensiex.resize(locallab.nbspot); - locallab.excurve.resize(locallab.nbspot); - // Vibrance - locallab.expvibrance.resize(locallab.nbspot); - locallab.saturated.resize(locallab.nbspot); - locallab.pastels.resize(locallab.nbspot); - Threshold val(0, 0, false); // Default value (initialization values not important) for resize function as Threshold does not have constructor Threshold() - locallab.psthreshold.resize(locallab.nbspot, val); - locallab.protectskins.resize(locallab.nbspot); - locallab.avoidcolorshift.resize(locallab.nbspot); - locallab.pastsattog.resize(locallab.nbspot); - locallab.sensiv.resize(locallab.nbspot); - locallab.skintonescurve.resize(locallab.nbspot); - // Blur & Noise - locallab.expblur.resize(locallab.nbspot); - locallab.radius.resize(locallab.nbspot); - locallab.strength.resize(locallab.nbspot); - locallab.sensibn.resize(locallab.nbspot); - locallab.blurMethod.resize(locallab.nbspot); - locallab.activlum.resize(locallab.nbspot); - // Tone Mapping - locallab.exptonemap.resize(locallab.nbspot); - locallab.stren.resize(locallab.nbspot); - locallab.gamma.resize(locallab.nbspot); - locallab.estop.resize(locallab.nbspot); - locallab.scaltm.resize(locallab.nbspot); - locallab.rewei.resize(locallab.nbspot); - locallab.sensitm.resize(locallab.nbspot); - // Retinex - locallab.expreti.resize(locallab.nbspot); - locallab.retinexMethod.resize(locallab.nbspot); - locallab.str.resize(locallab.nbspot); - locallab.chrrt.resize(locallab.nbspot); - locallab.neigh.resize(locallab.nbspot); - locallab.vart.resize(locallab.nbspot); - locallab.sensih.resize(locallab.nbspot); - locallab.localTgaincurve.resize(locallab.nbspot); - locallab.inversret.resize(locallab.nbspot); - // Sharpening - locallab.expsharp.resize(locallab.nbspot); - locallab.sharradius.resize(locallab.nbspot); - locallab.sharamount.resize(locallab.nbspot); - locallab.shardamping.resize(locallab.nbspot); - locallab.shariter.resize(locallab.nbspot); - locallab.sensisha.resize(locallab.nbspot); - locallab.inverssha.resize(locallab.nbspot); - // Contrast by detail levels - locallab.expcbdl.resize(locallab.nbspot); - - for (int i = 0; i < 5; i++) { - locallab.mult[i].resize(locallab.nbspot); - } - - locallab.chromacbdl.resize(locallab.nbspot); - locallab.threshold.resize(locallab.nbspot); - locallab.sensicb.resize(locallab.nbspot); - // Denoise - locallab.expdenoi.resize(locallab.nbspot); - locallab.noiselumf.resize(locallab.nbspot); - locallab.noiselumc.resize(locallab.nbspot); - locallab.noiselumdetail.resize(locallab.nbspot); - locallab.noiselequal.resize(locallab.nbspot); - locallab.noisechrof.resize(locallab.nbspot); - locallab.noisechroc.resize(locallab.nbspot); - locallab.noisechrodetail.resize(locallab.nbspot); - locallab.adjblur.resize(locallab.nbspot); - locallab.bilateral.resize(locallab.nbspot); - locallab.sensiden.resize(locallab.nbspot); - // Others - locallab.avoid.resize(locallab.nbspot); + if (locallab.nbspot > (int)locallab.spots.size()) { + locallab.spots.resize(locallab.nbspot); } for (int i = 0; i < locallab.nbspot; i++) { + LocallabParams::LocallabSpot spot; + // Control spot settings - assignFromKeyfile(keyFile, "Locallab", "Id_" + std::to_string(i), pedited, locallab.id.at(i), pedited->locallab.id); - assignFromKeyfile(keyFile, "Locallab", "Name_" + std::to_string(i), pedited, locallab.name.at(i), pedited->locallab.name); - assignFromKeyfile(keyFile, "Locallab", "Isvisible_" + std::to_string(i), pedited, locallab.isvisible.at(i), pedited->locallab.isvisible); - assignFromKeyfile(keyFile, "Locallab", "Shape_" + std::to_string(i), pedited, locallab.shape.at(i), pedited->locallab.shape); - assignFromKeyfile(keyFile, "Locallab", "SpotMethod_" + std::to_string(i), pedited, locallab.spotMethod.at(i), pedited->locallab.spotMethod); - assignFromKeyfile(keyFile, "Locallab", "ShapeMethod_" + std::to_string(i), pedited, locallab.shapeMethod.at(i), pedited->locallab.shapeMethod); - assignFromKeyfile(keyFile, "Locallab", "SensiExclu_" + std::to_string(i), pedited, locallab.sensiexclu.at(i), pedited->locallab.sensiexclu); - assignFromKeyfile(keyFile, "Locallab", "Struc_" + std::to_string(i), pedited, locallab.struc.at(i), pedited->locallab.struc); - assignFromKeyfile(keyFile, "Locallab", "LocX_" + std::to_string(i), pedited, locallab.locX.at(i), pedited->locallab.locX); - assignFromKeyfile(keyFile, "Locallab", "LocXL_" + std::to_string(i), pedited, locallab.locXL.at(i), pedited->locallab.locXL); - assignFromKeyfile(keyFile, "Locallab", "LocY_" + std::to_string(i), pedited, locallab.locY.at(i), pedited->locallab.locY); - assignFromKeyfile(keyFile, "Locallab", "LocYT_" + std::to_string(i), pedited, locallab.locYT.at(i), pedited->locallab.locYT); - assignFromKeyfile(keyFile, "Locallab", "CenterX_" + std::to_string(i), pedited, locallab.centerX.at(i), pedited->locallab.centerX); - assignFromKeyfile(keyFile, "Locallab", "CenterY_" + std::to_string(i), pedited, locallab.centerY.at(i), pedited->locallab.centerY); - assignFromKeyfile(keyFile, "Locallab", "Circrad_" + std::to_string(i), pedited, locallab.circrad.at(i), pedited->locallab.circrad); - assignFromKeyfile(keyFile, "Locallab", "QualityMethod_" + std::to_string(i), pedited, locallab.qualityMethod.at(i), pedited->locallab.qualityMethod); - assignFromKeyfile(keyFile, "Locallab", "Transit_" + std::to_string(i), pedited, locallab.transit.at(i), pedited->locallab.transit); - assignFromKeyfile(keyFile, "Locallab", "Thresh_" + std::to_string(i), pedited, locallab.thresh.at(i), pedited->locallab.thresh); - assignFromKeyfile(keyFile, "Locallab", "Iter_" + std::to_string(i), pedited, locallab.iter.at(i), pedited->locallab.iter); + assignFromKeyfile(keyFile, "Locallab", "Id_" + std::to_string(i), pedited, spot.id, pedited->locallab.id); + assignFromKeyfile(keyFile, "Locallab", "Name_" + std::to_string(i), pedited, spot.name, pedited->locallab.name); + assignFromKeyfile(keyFile, "Locallab", "Isvisible_" + std::to_string(i), pedited, spot.isvisible, pedited->locallab.isvisible); + assignFromKeyfile(keyFile, "Locallab", "Shape_" + std::to_string(i), pedited, spot.shape, pedited->locallab.shape); + assignFromKeyfile(keyFile, "Locallab", "SpotMethod_" + std::to_string(i), pedited, spot.spotMethod, pedited->locallab.spotMethod); + assignFromKeyfile(keyFile, "Locallab", "ShapeMethod_" + std::to_string(i), pedited, spot.shapeMethod, pedited->locallab.shapeMethod); + assignFromKeyfile(keyFile, "Locallab", "SensiExclu_" + std::to_string(i), pedited, spot.sensiexclu, pedited->locallab.sensiexclu); + assignFromKeyfile(keyFile, "Locallab", "Struc_" + std::to_string(i), pedited, spot.struc, pedited->locallab.struc); + assignFromKeyfile(keyFile, "Locallab", "LocX_" + std::to_string(i), pedited, spot.locX, pedited->locallab.locX); + assignFromKeyfile(keyFile, "Locallab", "LocXL_" + std::to_string(i), pedited, spot.locXL, pedited->locallab.locXL); + assignFromKeyfile(keyFile, "Locallab", "LocY_" + std::to_string(i), pedited, spot.locY, pedited->locallab.locY); + assignFromKeyfile(keyFile, "Locallab", "LocYT_" + std::to_string(i), pedited, spot.locYT, pedited->locallab.locYT); + assignFromKeyfile(keyFile, "Locallab", "CenterX_" + std::to_string(i), pedited, spot.centerX, pedited->locallab.centerX); + assignFromKeyfile(keyFile, "Locallab", "CenterY_" + std::to_string(i), pedited, spot.centerY, pedited->locallab.centerY); + assignFromKeyfile(keyFile, "Locallab", "Circrad_" + std::to_string(i), pedited, spot.circrad, pedited->locallab.circrad); + assignFromKeyfile(keyFile, "Locallab", "QualityMethod_" + std::to_string(i), pedited, spot.qualityMethod, pedited->locallab.qualityMethod); + assignFromKeyfile(keyFile, "Locallab", "Transit_" + std::to_string(i), pedited, spot.transit, pedited->locallab.transit); + assignFromKeyfile(keyFile, "Locallab", "Thresh_" + std::to_string(i), pedited, spot.thresh, pedited->locallab.thresh); + assignFromKeyfile(keyFile, "Locallab", "Iter_" + std::to_string(i), pedited, spot.iter, pedited->locallab.iter); // Color & Light - assignFromKeyfile(keyFile, "Locallab", "Expcolor_" + std::to_string(i), pedited, locallab.expcolor.at(i), pedited->locallab.expcolor); - assignFromKeyfile(keyFile, "Locallab", "Curvactiv_" + std::to_string(i), pedited, locallab.curvactiv.at(i), pedited->locallab.curvactiv); - assignFromKeyfile(keyFile, "Locallab", "Lightness_" + std::to_string(i), pedited, locallab.lightness.at(i), pedited->locallab.lightness); - assignFromKeyfile(keyFile, "Locallab", "Contrast_" + std::to_string(i), pedited, locallab.contrast.at(i), pedited->locallab.contrast); - assignFromKeyfile(keyFile, "Locallab", "Chroma_" + std::to_string(i), pedited, locallab.chroma.at(i), pedited->locallab.chroma); - assignFromKeyfile(keyFile, "Locallab", "Sensi_" + std::to_string(i), pedited, locallab.sensi.at(i), pedited->locallab.sensi); - assignFromKeyfile(keyFile, "Locallab", "QualityCurveMethod_" + std::to_string(i), pedited, locallab.qualitycurveMethod.at(i), pedited->locallab.qualitycurveMethod); - assignFromKeyfile(keyFile, "Locallab", "LLCurve_" + std::to_string(i), pedited, locallab.llcurve.at(i), pedited->locallab.llcurve); - assignFromKeyfile(keyFile, "Locallab", "CCCurve_" + std::to_string(i), pedited, locallab.cccurve.at(i), pedited->locallab.cccurve); - assignFromKeyfile(keyFile, "Locallab", "LHCurve_" + std::to_string(i), pedited, locallab.LHcurve.at(i), pedited->locallab.LHcurve); - assignFromKeyfile(keyFile, "Locallab", "HHCurve_" + std::to_string(i), pedited, locallab.HHcurve.at(i), pedited->locallab.HHcurve); - assignFromKeyfile(keyFile, "Locallab", "Invers_" + std::to_string(i), pedited, locallab.invers.at(i), pedited->locallab.invers); + assignFromKeyfile(keyFile, "Locallab", "Expcolor_" + std::to_string(i), pedited, spot.expcolor, pedited->locallab.expcolor); + assignFromKeyfile(keyFile, "Locallab", "Curvactiv_" + std::to_string(i), pedited, spot.curvactiv, pedited->locallab.curvactiv); + assignFromKeyfile(keyFile, "Locallab", "Lightness_" + std::to_string(i), pedited, spot.lightness, pedited->locallab.lightness); + assignFromKeyfile(keyFile, "Locallab", "Contrast_" + std::to_string(i), pedited, spot.contrast, pedited->locallab.contrast); + assignFromKeyfile(keyFile, "Locallab", "Chroma_" + std::to_string(i), pedited, spot.chroma, pedited->locallab.chroma); + assignFromKeyfile(keyFile, "Locallab", "Sensi_" + std::to_string(i), pedited, spot.sensi, pedited->locallab.sensi); + assignFromKeyfile(keyFile, "Locallab", "QualityCurveMethod_" + std::to_string(i), pedited, spot.qualitycurveMethod, pedited->locallab.qualitycurveMethod); + assignFromKeyfile(keyFile, "Locallab", "LLCurve_" + std::to_string(i), pedited, spot.llcurve, pedited->locallab.llcurve); + assignFromKeyfile(keyFile, "Locallab", "CCCurve_" + std::to_string(i), pedited, spot.cccurve, pedited->locallab.cccurve); + assignFromKeyfile(keyFile, "Locallab", "LHCurve_" + std::to_string(i), pedited, spot.LHcurve, pedited->locallab.LHcurve); + assignFromKeyfile(keyFile, "Locallab", "HHCurve_" + std::to_string(i), pedited, spot.HHcurve, pedited->locallab.HHcurve); + assignFromKeyfile(keyFile, "Locallab", "Invers_" + std::to_string(i), pedited, spot.invers, pedited->locallab.invers); // Exposure - assignFromKeyfile(keyFile, "Locallab", "Expexpose_" + std::to_string(i), pedited, locallab.expexpose.at(i), pedited->locallab.expexpose); - assignFromKeyfile(keyFile, "Locallab", "Expcomp_" + std::to_string(i), pedited, locallab.expcomp.at(i), pedited->locallab.expcomp); - assignFromKeyfile(keyFile, "Locallab", "Hlcompr_" + std::to_string(i), pedited, locallab.hlcompr.at(i), pedited->locallab.hlcompr); - assignFromKeyfile(keyFile, "Locallab", "Hlcomprthresh_" + std::to_string(i), pedited, locallab.hlcomprthresh.at(i), pedited->locallab.hlcomprthresh); - assignFromKeyfile(keyFile, "Locallab", "Black_" + std::to_string(i), pedited, locallab.black.at(i), pedited->locallab.black); - assignFromKeyfile(keyFile, "Locallab", "Shcompr_" + std::to_string(i), pedited, locallab.shcompr.at(i), pedited->locallab.shcompr); - assignFromKeyfile(keyFile, "Locallab", "Warm_" + std::to_string(i), pedited, locallab.warm.at(i), pedited->locallab.warm); - assignFromKeyfile(keyFile, "Locallab", "Sensiex_" + std::to_string(i), pedited, locallab.sensiex.at(i), pedited->locallab.sensiex); - assignFromKeyfile(keyFile, "Locallab", "ExCurve_" + std::to_string(i), pedited, locallab.excurve.at(i), pedited->locallab.excurve); + assignFromKeyfile(keyFile, "Locallab", "Expexpose_" + std::to_string(i), pedited, spot.expexpose, pedited->locallab.expexpose); + assignFromKeyfile(keyFile, "Locallab", "Expcomp_" + std::to_string(i), pedited, spot.expcomp, pedited->locallab.expcomp); + assignFromKeyfile(keyFile, "Locallab", "Hlcompr_" + std::to_string(i), pedited, spot.hlcompr, pedited->locallab.hlcompr); + assignFromKeyfile(keyFile, "Locallab", "Hlcomprthresh_" + std::to_string(i), pedited, spot.hlcomprthresh, pedited->locallab.hlcomprthresh); + assignFromKeyfile(keyFile, "Locallab", "Black_" + std::to_string(i), pedited, spot.black, pedited->locallab.black); + assignFromKeyfile(keyFile, "Locallab", "Shcompr_" + std::to_string(i), pedited, spot.shcompr, pedited->locallab.shcompr); + assignFromKeyfile(keyFile, "Locallab", "Warm_" + std::to_string(i), pedited, spot.warm, pedited->locallab.warm); + assignFromKeyfile(keyFile, "Locallab", "Sensiex_" + std::to_string(i), pedited, spot.sensiex, pedited->locallab.sensiex); + assignFromKeyfile(keyFile, "Locallab", "ExCurve_" + std::to_string(i), pedited, spot.excurve, pedited->locallab.excurve); // Vibrance - assignFromKeyfile(keyFile, "Locallab", "Expvibrance_" + std::to_string(i), pedited, locallab.expvibrance.at(i), pedited->locallab.expvibrance); - assignFromKeyfile(keyFile, "Locallab", "Saturated_" + std::to_string(i), pedited, locallab.saturated.at(i), pedited->locallab.saturated); - assignFromKeyfile(keyFile, "Locallab", "Pastels_" + std::to_string(i), pedited, locallab.pastels.at(i), pedited->locallab.pastels); + assignFromKeyfile(keyFile, "Locallab", "Expvibrance_" + std::to_string(i), pedited, spot.expvibrance, pedited->locallab.expvibrance); + assignFromKeyfile(keyFile, "Locallab", "Saturated_" + std::to_string(i), pedited, spot.saturated, pedited->locallab.saturated); + assignFromKeyfile(keyFile, "Locallab", "Pastels_" + std::to_string(i), pedited, spot.pastels, pedited->locallab.pastels); if (keyFile.has_key("Locallab", "PSThreshold_" + std::to_string(i))) { const std::vector thresh = keyFile.get_integer_list("Locallab", "PSThreshold_" + std::to_string(i)); if (thresh.size() >= 2) { - locallab.psthreshold.at(i).setValues(thresh[0], thresh[1]); + spot.psthreshold.setValues(thresh[0], thresh[1]); } if (pedited) { @@ -4717,68 +4624,70 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } } - assignFromKeyfile(keyFile, "Locallab", "ProtectSkins_" + std::to_string(i), pedited, locallab.protectskins.at(i), pedited->locallab.protectskins); - assignFromKeyfile(keyFile, "Locallab", "AvoidColorShift_" + std::to_string(i), pedited, locallab.avoidcolorshift.at(i), pedited->locallab.avoidcolorshift); - assignFromKeyfile(keyFile, "Locallab", "PastSatTog_" + std::to_string(i), pedited, locallab.pastsattog.at(i), pedited->locallab.pastsattog); - assignFromKeyfile(keyFile, "Locallab", "Sensiv_" + std::to_string(i), pedited, locallab.sensiv.at(i), pedited->locallab.sensiv); - assignFromKeyfile(keyFile, "Locallab", "SkinTonesCurve_" + std::to_string(i), pedited, locallab.skintonescurve.at(i), pedited->locallab.skintonescurve); + assignFromKeyfile(keyFile, "Locallab", "ProtectSkins_" + std::to_string(i), pedited, spot.protectskins, pedited->locallab.protectskins); + assignFromKeyfile(keyFile, "Locallab", "AvoidColorShift_" + std::to_string(i), pedited, spot.avoidcolorshift, pedited->locallab.avoidcolorshift); + assignFromKeyfile(keyFile, "Locallab", "PastSatTog_" + std::to_string(i), pedited, spot.pastsattog, pedited->locallab.pastsattog); + assignFromKeyfile(keyFile, "Locallab", "Sensiv_" + std::to_string(i), pedited, spot.sensiv, pedited->locallab.sensiv); + assignFromKeyfile(keyFile, "Locallab", "SkinTonesCurve_" + std::to_string(i), pedited, spot.skintonescurve, pedited->locallab.skintonescurve); // Blur & Noise - assignFromKeyfile(keyFile, "Locallab", "Expblur_" + std::to_string(i), pedited, locallab.expblur.at(i), pedited->locallab.expblur); - assignFromKeyfile(keyFile, "Locallab", "Radius_" + std::to_string(i), pedited, locallab.radius.at(i), pedited->locallab.radius); - assignFromKeyfile(keyFile, "Locallab", "Strength_" + std::to_string(i), pedited, locallab.strength.at(i), pedited->locallab.strength); - assignFromKeyfile(keyFile, "Locallab", "Sensibn_" + std::to_string(i), pedited, locallab.sensibn.at(i), pedited->locallab.sensibn); - assignFromKeyfile(keyFile, "Locallab", "BlurMethod_" + std::to_string(i), pedited, locallab.blurMethod.at(i), pedited->locallab.blurMethod); - assignFromKeyfile(keyFile, "Locallab", "activlum_" + std::to_string(i), pedited, locallab.activlum.at(i), pedited->locallab.activlum); + assignFromKeyfile(keyFile, "Locallab", "Expblur_" + std::to_string(i), pedited, spot.expblur, pedited->locallab.expblur); + assignFromKeyfile(keyFile, "Locallab", "Radius_" + std::to_string(i), pedited, spot.radius, pedited->locallab.radius); + assignFromKeyfile(keyFile, "Locallab", "Strength_" + std::to_string(i), pedited, spot.strength, pedited->locallab.strength); + assignFromKeyfile(keyFile, "Locallab", "Sensibn_" + std::to_string(i), pedited, spot.sensibn, pedited->locallab.sensibn); + assignFromKeyfile(keyFile, "Locallab", "BlurMethod_" + std::to_string(i), pedited, spot.blurMethod, pedited->locallab.blurMethod); + assignFromKeyfile(keyFile, "Locallab", "activlum_" + std::to_string(i), pedited, spot.activlum, pedited->locallab.activlum); // Tone Mapping - assignFromKeyfile(keyFile, "Locallab", "Exptonemap_" + std::to_string(i), pedited, locallab.exptonemap.at(i), pedited->locallab.exptonemap); - assignFromKeyfile(keyFile, "Locallab", "Stren_" + std::to_string(i), pedited, locallab.stren.at(i), pedited->locallab.stren); - assignFromKeyfile(keyFile, "Locallab", "Gamma_" + std::to_string(i), pedited, locallab.gamma.at(i), pedited->locallab.gamma); - assignFromKeyfile(keyFile, "Locallab", "Estop_" + std::to_string(i), pedited, locallab.estop.at(i), pedited->locallab.estop); - assignFromKeyfile(keyFile, "Locallab", "Scaltm_" + std::to_string(i), pedited, locallab.scaltm.at(i), pedited->locallab.scaltm); - assignFromKeyfile(keyFile, "Locallab", "Rewei_" + std::to_string(i), pedited, locallab.rewei.at(i), pedited->locallab.rewei); - assignFromKeyfile(keyFile, "Locallab", "Sensitm_" + std::to_string(i), pedited, locallab.sensitm.at(i), pedited->locallab.sensitm); + assignFromKeyfile(keyFile, "Locallab", "Exptonemap_" + std::to_string(i), pedited, spot.exptonemap, pedited->locallab.exptonemap); + assignFromKeyfile(keyFile, "Locallab", "Stren_" + std::to_string(i), pedited, spot.stren, pedited->locallab.stren); + assignFromKeyfile(keyFile, "Locallab", "Gamma_" + std::to_string(i), pedited, spot.gamma, pedited->locallab.gamma); + assignFromKeyfile(keyFile, "Locallab", "Estop_" + std::to_string(i), pedited, spot.estop, pedited->locallab.estop); + assignFromKeyfile(keyFile, "Locallab", "Scaltm_" + std::to_string(i), pedited, spot.scaltm, pedited->locallab.scaltm); + assignFromKeyfile(keyFile, "Locallab", "Rewei_" + std::to_string(i), pedited, spot.rewei, pedited->locallab.rewei); + assignFromKeyfile(keyFile, "Locallab", "Sensitm_" + std::to_string(i), pedited, spot.sensitm, pedited->locallab.sensitm); // Retinex - assignFromKeyfile(keyFile, "Locallab", "Expreti_" + std::to_string(i), pedited, locallab.expreti.at(i), pedited->locallab.expreti); - assignFromKeyfile(keyFile, "Locallab", "retinexMethod_" + std::to_string(i), pedited, locallab.retinexMethod.at(i), pedited->locallab.retinexMethod); - assignFromKeyfile(keyFile, "Locallab", "Str_" + std::to_string(i), pedited, locallab.str.at(i), pedited->locallab.str); - assignFromKeyfile(keyFile, "Locallab", "Chrrt_" + std::to_string(i), pedited, locallab.chrrt.at(i), pedited->locallab.chrrt); - assignFromKeyfile(keyFile, "Locallab", "Neigh_" + std::to_string(i), pedited, locallab.neigh.at(i), pedited->locallab.neigh); - assignFromKeyfile(keyFile, "Locallab", "Vart_" + std::to_string(i), pedited, locallab.vart.at(i), pedited->locallab.vart); - assignFromKeyfile(keyFile, "Locallab", "Sensih_" + std::to_string(i), pedited, locallab.sensih.at(i), pedited->locallab.sensih); - assignFromKeyfile(keyFile, "Locallab", "TgainCurve_" + std::to_string(i), pedited, locallab.localTgaincurve.at(i), pedited->locallab.localTgaincurve); - assignFromKeyfile(keyFile, "Locallab", "Inversret_" + std::to_string(i), pedited, locallab.inversret.at(i), pedited->locallab.inversret); + assignFromKeyfile(keyFile, "Locallab", "Expreti_" + std::to_string(i), pedited, spot.expreti, pedited->locallab.expreti); + assignFromKeyfile(keyFile, "Locallab", "retinexMethod_" + std::to_string(i), pedited, spot.retinexMethod, pedited->locallab.retinexMethod); + assignFromKeyfile(keyFile, "Locallab", "Str_" + std::to_string(i), pedited, spot.str, pedited->locallab.str); + assignFromKeyfile(keyFile, "Locallab", "Chrrt_" + std::to_string(i), pedited, spot.chrrt, pedited->locallab.chrrt); + assignFromKeyfile(keyFile, "Locallab", "Neigh_" + std::to_string(i), pedited, spot.neigh, pedited->locallab.neigh); + assignFromKeyfile(keyFile, "Locallab", "Vart_" + std::to_string(i), pedited, spot.vart, pedited->locallab.vart); + assignFromKeyfile(keyFile, "Locallab", "Sensih_" + std::to_string(i), pedited, spot.sensih, pedited->locallab.sensih); + assignFromKeyfile(keyFile, "Locallab", "TgainCurve_" + std::to_string(i), pedited, spot.localTgaincurve, pedited->locallab.localTgaincurve); + assignFromKeyfile(keyFile, "Locallab", "Inversret_" + std::to_string(i), pedited, spot.inversret, pedited->locallab.inversret); // Sharpening - assignFromKeyfile(keyFile, "Locallab", "Expsharp_" + std::to_string(i), pedited, locallab.expsharp.at(i), pedited->locallab.expsharp); - assignFromKeyfile(keyFile, "Locallab", "Sharradius_" + std::to_string(i), pedited, locallab.sharradius.at(i), pedited->locallab.sharradius); - assignFromKeyfile(keyFile, "Locallab", "Sharamount_" + std::to_string(i), pedited, locallab.sharamount.at(i), pedited->locallab.sharamount); - assignFromKeyfile(keyFile, "Locallab", "Shardamping_" + std::to_string(i), pedited, locallab.shardamping.at(i), pedited->locallab.shardamping); - assignFromKeyfile(keyFile, "Locallab", "Shariter_" + std::to_string(i), pedited, locallab.shariter.at(i), pedited->locallab.shariter); - assignFromKeyfile(keyFile, "Locallab", "Sensisha_" + std::to_string(i), pedited, locallab.sensisha.at(i), pedited->locallab.sensisha); - assignFromKeyfile(keyFile, "Locallab", "Inverssha_" + std::to_string(i), pedited, locallab.inverssha.at(i), pedited->locallab.inverssha); + assignFromKeyfile(keyFile, "Locallab", "Expsharp_" + std::to_string(i), pedited, spot.expsharp, pedited->locallab.expsharp); + assignFromKeyfile(keyFile, "Locallab", "Sharradius_" + std::to_string(i), pedited, spot.sharradius, pedited->locallab.sharradius); + assignFromKeyfile(keyFile, "Locallab", "Sharamount_" + std::to_string(i), pedited, spot.sharamount, pedited->locallab.sharamount); + assignFromKeyfile(keyFile, "Locallab", "Shardamping_" + std::to_string(i), pedited, spot.shardamping, pedited->locallab.shardamping); + assignFromKeyfile(keyFile, "Locallab", "Shariter_" + std::to_string(i), pedited, spot.shariter, pedited->locallab.shariter); + assignFromKeyfile(keyFile, "Locallab", "Sensisha_" + std::to_string(i), pedited, spot.sensisha, pedited->locallab.sensisha); + assignFromKeyfile(keyFile, "Locallab", "Inverssha_" + std::to_string(i), pedited, spot.inverssha, pedited->locallab.inverssha); // Contrast by detail levels - assignFromKeyfile(keyFile, "Locallab", "Expcbdl_" + std::to_string(i), pedited, locallab.expcbdl.at(i), pedited->locallab.expcbdl); + assignFromKeyfile(keyFile, "Locallab", "Expcbdl_" + std::to_string(i), pedited, spot.expcbdl, pedited->locallab.expcbdl); for (int j = 0; j < 5; j ++) { - assignFromKeyfile(keyFile, "Locallab", "Mult" + std::to_string(j) + "_" + std::to_string(i), pedited, locallab.mult[j].at(i), pedited->locallab.mult[j]); + assignFromKeyfile(keyFile, "Locallab", "Mult" + std::to_string(j) + "_" + std::to_string(i), pedited, spot.mult[j], pedited->locallab.mult[j]); } - assignFromKeyfile(keyFile, "Locallab", "Chromacbdl_" + std::to_string(i), pedited, locallab.chromacbdl.at(i), pedited->locallab.chromacbdl); - assignFromKeyfile(keyFile, "Locallab", "Threshold_" + std::to_string(i), pedited, locallab.threshold.at(i), pedited->locallab.threshold); - assignFromKeyfile(keyFile, "Locallab", "Sensicb_" + std::to_string(i), pedited, locallab.sensicb.at(i), pedited->locallab.sensicb); + assignFromKeyfile(keyFile, "Locallab", "Chromacbdl_" + std::to_string(i), pedited, spot.chromacbdl, pedited->locallab.chromacbdl); + assignFromKeyfile(keyFile, "Locallab", "Threshold_" + std::to_string(i), pedited, spot.threshold, pedited->locallab.threshold); + assignFromKeyfile(keyFile, "Locallab", "Sensicb_" + std::to_string(i), pedited, spot.sensicb, pedited->locallab.sensicb); // Denoise - assignFromKeyfile(keyFile, "Locallab", "Expdenoi_" + std::to_string(i), pedited, locallab.expdenoi.at(i), pedited->locallab.expdenoi); - assignFromKeyfile(keyFile, "Locallab", "noiselumf_" + std::to_string(i), pedited, locallab.noiselumf.at(i), pedited->locallab.noiselumf); - assignFromKeyfile(keyFile, "Locallab", "noiselumc_" + std::to_string(i), pedited, locallab.noiselumc.at(i), pedited->locallab.noiselumc); - assignFromKeyfile(keyFile, "Locallab", "noiselumdetail_" + std::to_string(i), pedited, locallab.noiselumdetail.at(i), pedited->locallab.noiselumdetail); - assignFromKeyfile(keyFile, "Locallab", "noiselequal_" + std::to_string(i), pedited, locallab.noiselequal.at(i), pedited->locallab.noiselequal); - assignFromKeyfile(keyFile, "Locallab", "noisechrof_" + std::to_string(i), pedited, locallab.noisechrof.at(i), pedited->locallab.noisechrof); - assignFromKeyfile(keyFile, "Locallab", "noisechroc_" + std::to_string(i), pedited, locallab.noisechroc.at(i), pedited->locallab.noisechroc); - assignFromKeyfile(keyFile, "Locallab", "noisechrodetail_" + std::to_string(i), pedited, locallab.noisechrodetail.at(i), pedited->locallab.noisechrodetail); - assignFromKeyfile(keyFile, "Locallab", "Adjblur_" + std::to_string(i), pedited, locallab.adjblur.at(i), pedited->locallab.adjblur); - assignFromKeyfile(keyFile, "Locallab", "Bilateral_" + std::to_string(i), pedited, locallab.bilateral.at(i), pedited->locallab.bilateral); - assignFromKeyfile(keyFile, "Locallab", "Sensiden_" + std::to_string(i), pedited, locallab.sensiden.at(i), pedited->locallab.sensiden); + assignFromKeyfile(keyFile, "Locallab", "Expdenoi_" + std::to_string(i), pedited, spot.expdenoi, pedited->locallab.expdenoi); + assignFromKeyfile(keyFile, "Locallab", "noiselumf_" + std::to_string(i), pedited, spot.noiselumf, pedited->locallab.noiselumf); + assignFromKeyfile(keyFile, "Locallab", "noiselumc_" + std::to_string(i), pedited, spot.noiselumc, pedited->locallab.noiselumc); + assignFromKeyfile(keyFile, "Locallab", "noiselumdetail_" + std::to_string(i), pedited, spot.noiselumdetail, pedited->locallab.noiselumdetail); + assignFromKeyfile(keyFile, "Locallab", "noiselequal_" + std::to_string(i), pedited, spot.noiselequal, pedited->locallab.noiselequal); + assignFromKeyfile(keyFile, "Locallab", "noisechrof_" + std::to_string(i), pedited, spot.noisechrof, pedited->locallab.noisechrof); + assignFromKeyfile(keyFile, "Locallab", "noisechroc_" + std::to_string(i), pedited, spot.noisechroc, pedited->locallab.noisechroc); + assignFromKeyfile(keyFile, "Locallab", "noisechrodetail_" + std::to_string(i), pedited, spot.noisechrodetail, pedited->locallab.noisechrodetail); + assignFromKeyfile(keyFile, "Locallab", "Adjblur_" + std::to_string(i), pedited, spot.adjblur, pedited->locallab.adjblur); + assignFromKeyfile(keyFile, "Locallab", "Bilateral_" + std::to_string(i), pedited, spot.bilateral, pedited->locallab.bilateral); + assignFromKeyfile(keyFile, "Locallab", "Sensiden_" + std::to_string(i), pedited, spot.sensiden, pedited->locallab.sensiden); // Others - assignFromKeyfile(keyFile, "Locallab", "Avoid_" + std::to_string(i), pedited, locallab.avoid.at(i), pedited->locallab.avoid); + assignFromKeyfile(keyFile, "Locallab", "Avoid_" + std::to_string(i), pedited, spot.avoid, pedited->locallab.avoid); + + locallab.spots.at(i) = spot; } } diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 987e37e56..916668f38 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -107,6 +107,12 @@ public: } } + template + typename std::enable_if::value, bool>::type operator !=(const Threshold& rhs) const + { + return !(*this == rhs); + } + T getBottom() const { return bottom_left; @@ -901,125 +907,179 @@ struct GradientParams { * Parameters of the Local Lab */ struct LocallabParams { + struct LocallabSpot { + // Control spot settings + int id; + Glib::ustring name; + bool isvisible; + Glib::ustring shape; // ELI, RECT + Glib::ustring spotMethod; // norm, exc + int sensiexclu; + int struc; + Glib::ustring shapeMethod; // IND, SYM, INDSL, SYMSL + int locX; + int locXL; + int locY; + int locYT; + int centerX; + int centerY; + int circrad; + Glib::ustring qualityMethod; // std, enh, enhden + int transit; + int thresh; + int iter; + // Color & Light + bool expcolor; + bool curvactiv; + int lightness; + int contrast; + int chroma; + int sensi; + Glib::ustring qualitycurveMethod; + std::vector llcurve; + std::vector cccurve; + std::vector LHcurve; + std::vector HHcurve; + bool invers; + // Exposure + bool expexpose; + int expcomp; + int hlcompr; + int hlcomprthresh; + int black; + int shcompr; + int warm; + int sensiex; + std::vector excurve; + // Vibrance + bool expvibrance; + int saturated; + int pastels; + Threshold psthreshold; + bool protectskins; + bool avoidcolorshift; + bool pastsattog; + int sensiv; + std::vector skintonescurve; + // Blur & Noise + bool expblur; + int radius; + int strength; + int sensibn; + Glib::ustring blurMethod; + bool activlum; + // Tone Mapping + bool exptonemap; + int stren; + int gamma; + int estop; + int scaltm; + int rewei; + int sensitm; + // Retinex + bool expreti; + Glib::ustring retinexMethod; + int str; + int chrrt; + int neigh; + int vart; + int sensih; + std::vector localTgaincurve; + bool inversret; + // Sharpening + bool expsharp; + int sharradius; + int sharamount; + int shardamping; + int shariter; + int sensisha; + bool inverssha; + // Contrast by detail levels + bool expcbdl; + double mult[5]; + int chromacbdl; + double threshold; + int sensicb; + // Denoise + bool expdenoi; + int noiselumf; + int noiselumc; + int noiselumdetail; + int noiselequal; + int noisechrof; + int noisechroc; + int noisechrodetail; + int adjblur; + int bilateral; + int sensiden; + // Others + bool avoid; + + LocallabSpot(); + + bool operator ==(const LocallabSpot& other) const; + bool operator !=(const LocallabSpot& other) const; + }; + bool enabled; int nbspot; int selspot; - // Control spot settings - std::vector id; - std::vector name; - std::vector isvisible; - std::vector shape; // ELI, RECT - std::vector spotMethod; // norm, exc - std::vector sensiexclu; - std::vector struc; - std::vector shapeMethod; // IND, SYM, INDSL, SYMSL - std::vector locX; - std::vector locXL; - std::vector locY; - std::vector locYT; - std::vector centerX; - std::vector centerY; - std::vector circrad; - std::vector qualityMethod; // std, enh, enhden - std::vector transit; - std::vector thresh; - std::vector iter; - // Color & Light - std::vector expcolor; - std::vector curvactiv; - std::vector lightness; - std::vector contrast; - std::vector chroma; - std::vector sensi; - std::vector qualitycurveMethod; - std::vector> llcurve; - std::vector> cccurve; - std::vector> LHcurve; - std::vector> HHcurve; - std::vector invers; - // Exposure - std::vector expexpose; - std::vector expcomp; - std::vector hlcompr; - std::vector hlcomprthresh; - std::vector black; - std::vector shcompr; - std::vector warm; - std::vector sensiex; - std::vector> excurve; - // Vibrance - std::vector expvibrance; - std::vector saturated; - std::vector pastels; - std::vector> psthreshold; - std::vector protectskins; - std::vector avoidcolorshift; - std::vector pastsattog; - std::vector sensiv; - std::vector> skintonescurve; - // Blur & Noise - std::vector expblur; - std::vector radius; - std::vector strength; - std::vector sensibn; - std::vector blurMethod; - std::vector activlum; - // Tone Mapping - std::vector exptonemap; - std::vector stren; - std::vector gamma; - std::vector estop; - std::vector scaltm; - std::vector rewei; - std::vector sensitm; - // Retinex - std::vector expreti; - std::vector retinexMethod; - std::vector str; - std::vector chrrt; - std::vector neigh; - std::vector vart; - std::vector sensih; - std::vector> localTgaincurve; - std::vector inversret; - // Sharpening - std::vector expsharp; - std::vector sharradius; - std::vector sharamount; - std::vector shardamping; - std::vector shariter; - std::vector sensisha; - std::vector inverssha; - // Contrast by detail levels - std::vector expcbdl; - std::vector mult[5]; - std::vector chromacbdl; - std::vector threshold; - std::vector sensicb; - // Denoise - std::vector expdenoi; - std::vector noiselumf; - std::vector noiselumc; - std::vector noiselumdetail; - std::vector noiselequal; - std::vector noisechrof; - std::vector noisechroc; - std::vector noisechrodetail; - std::vector adjblur; - std::vector bilateral; - std::vector sensiden; - // Others - std::vector avoid; + std::vector spots; LocallabParams(); bool operator ==(const LocallabParams& other) const; bool operator !=(const LocallabParams& other) const; + + template + bool compareSpotsByElem(const std::vector& other, T LocallabSpot::*elem) const + { + if (spots.size() != other.size()) { + return false; + } + + for (int i = 0; i < (int)spots.size(); i++) { + if (spots.at(i).*elem != other.at(i).*elem) { + return false; + } + } + + return true; + } + + template + bool compareSpotsByElemArray(const std::vector& other, T LocallabSpot::*elem, int index) const + { + if (spots.size() != other.size()) { + return false; + } + + for (int i = 0; i < (int)spots.size(); i++) { + if ((spots.at(i).*elem)[index] != (other.at(i).*elem)[index]) { + return false; + } + } + + return true; + } + + template + void setSpotsByElem(const std::vector& other, T LocallabSpot::*elem) + { + for (int i = 0; i < (int)spots.size() && i < (int)other.size(); i++) { + spots.at(i).*elem = other.at(i).*elem; + } + } + + template + void setSpotsByElemArray(const std::vector& other, T LocallabSpot::*elem, int index) + { + for (int i = 0; i < (int)spots.size() && i < (int)other.size(); i++) { + (spots.at(i).*elem)[index] = (other.at(i).*elem)[index]; + } + } }; - - - /** * Parameters of the post-crop vignette filter */ diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index a5b84e186..a85ddb2fc 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -1110,8 +1110,8 @@ private: int maxspot = 1; float** shbuffer = nullptr; - for (int sp = 0; sp < params.locallab.nbspot; sp++) { - if (params.locallab.inverssha.at(sp)) { + for (int sp = 0; sp < params.locallab.nbspot && sp < (int)params.locallab.spots.size(); sp++) { + if (params.locallab.spots.at(sp).inverssha) { shbuffer = new float*[fh]; for (int i = 0; i < fh; i++) { @@ -1126,20 +1126,20 @@ private: bool localcutili = false; bool localskutili = false; bool localexutili = false; - locRETgainCurve.Set(params.locallab.localTgaincurve.at(sp)); - loclhCurve.Set(params.locallab.LHcurve.at(sp), LHutili); - lochhCurve.Set(params.locallab.HHcurve.at(sp), HHutili); - CurveFactory::curveLocal(locallutili, params.locallab.llcurve.at(sp), lllocalcurve, 1); - CurveFactory::curveCCLocal(localcutili, params.locallab.cccurve.at(sp), cclocalcurve, 1); - CurveFactory::curveskLocal(localskutili, params.locallab.skintonescurve.at(sp), sklocalcurve, 1); - CurveFactory::curveexLocal(localexutili, params.locallab.excurve.at(sp), exlocalcurve, 1); + locRETgainCurve.Set(params.locallab.spots.at(sp).localTgaincurve); + loclhCurve.Set(params.locallab.spots.at(sp).LHcurve, LHutili); + lochhCurve.Set(params.locallab.spots.at(sp).HHcurve, HHutili); + CurveFactory::curveLocal(locallutili, params.locallab.spots.at(sp).llcurve, lllocalcurve, 1); + CurveFactory::curveCCLocal(localcutili, params.locallab.spots.at(sp).cccurve, cclocalcurve, 1); + CurveFactory::curveskLocal(localskutili, params.locallab.spots.at(sp).skintonescurve, sklocalcurve, 1); + CurveFactory::curveexLocal(localexutili, params.locallab.spots.at(sp).excurve, exlocalcurve, 1); //provisory - double ecomp = params.locallab.expcomp.at(sp); - double black = params.locallab.black.at(sp); - double hlcompr = params.locallab.hlcompr.at(sp); - double hlcomprthresh = params.locallab.hlcomprthresh.at(sp); - double shcompr = params.locallab.shcompr.at(sp); - double br = params.locallab.lightness.at(sp); + double ecomp = params.locallab.spots.at(sp).expcomp; + double black = params.locallab.spots.at(sp).black; + double hlcompr = params.locallab.spots.at(sp).hlcompr; + double hlcomprthresh = params.locallab.spots.at(sp).hlcomprthresh; + double shcompr = params.locallab.spots.at(sp).shcompr; + double br = params.locallab.spots.at(sp).lightness; CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, 1); @@ -1147,7 +1147,7 @@ private: // Reference parameters computation double huere, chromare, lumare, huerefblu, sobelre; - if (params.locallab.spotMethod.at(sp) == "exc") { + if (params.locallab.spots.at(sp).spotMethod == "exc") { ipf.calc_ref(sp, reservView, reservView, 0, 0, fw, fh, 1, huerefblu, huere, chromare, lumare, sobelre); } else { ipf.calc_ref(sp, labView, labView, 0, 0, fw, fh, 1, huerefblu, huere, chromare, lumare, sobelre); @@ -1163,7 +1163,7 @@ private: sklocalcurve.clear(); exlocalcurve.clear(); - if (params.locallab.inverssha.at(sp)) { + if (params.locallab.spots.at(sp).inverssha) { for (int i = 0; i < fh; i++) { delete [] shbuffer[i]; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index b5a7c2d41..9e0af5a1e 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -162,6 +162,8 @@ Locallab::Locallab(): CurveListener::setMulti(true); float R, G, B; + LocallabParams::LocallabSpot defSpot; + // Settings expsettings->getExpander()->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expsettings->getExpander())); expsettings->setLevel(2); @@ -193,7 +195,7 @@ Locallab::Locallab(): llCurveEditorG->setCurveListener(this); llshape = static_cast(llCurveEditorG->addCurve(CT_Diagonal, "L(L)")); - llshape->setResetCurve(DCT_NURBS, {(double)DCT_NURBS, 0.0, 0.0, 1.0, 1.0}); + llshape->setResetCurve(DiagonalCurveType(defSpot.llcurve.at(0)), defSpot.llcurve); llshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); std::vector mllshape; mllshape.push_back(GradientMilestone(0., 0., 0., 0.)); @@ -202,7 +204,7 @@ Locallab::Locallab(): llshape->setLeftBarBgGradient(mllshape); ccshape = static_cast(llCurveEditorG->addCurve(CT_Diagonal, "C(C)")); - ccshape->setResetCurve(DCT_NURBS, {(double)DCT_NURBS, 0.0, 0.0, 1.0, 1.0}); + ccshape->setResetCurve(DiagonalCurveType(defSpot.cccurve.at(0)), defSpot.cccurve); ccshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); std::vector mccshape; mccshape.push_back(GradientMilestone(0., 0., 0., 0.)); @@ -214,7 +216,7 @@ Locallab::Locallab(): LHshape = static_cast(llCurveEditorG->addCurve(CT_Flat, "L(H)", nullptr, false, true)); LHshape->setIdentityValue(0.); - LHshape->setResetCurve(FCT_MinMaxCPoints, {(double)FCT_MinMaxCPoints, 0.0, 0.50, 0.35, 0.35, 0.166, 0.50, 0.35, 0.35, 0.333, 0.50, 0.35, 0.35, 0.50, 0.50, 0.35, 0.35, 0.666, 0.50, 0.35, 0.35, 0.833, 0.50, 0.35, 0.35}); + LHshape->setResetCurve(FlatCurveType(defSpot.LHcurve.at(0)), defSpot.LHcurve); LHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); LHshape->setCurveColorProvider(this, 1); std::vector mLHshape; @@ -229,7 +231,7 @@ Locallab::Locallab(): HHshape = static_cast(llCurveEditorG->addCurve(CT_Flat, "H(H)", nullptr, false, true)); HHshape->setIdentityValue(0.); - HHshape->setResetCurve(FCT_MinMaxCPoints, {(double)FCT_MinMaxCPoints, 0.0, 0.50, 0.35, 0.35, 0.166, 0.50, 0.35, 0.35, 0.333, 0.50, 0.35, 0.35, 0.50, 0.50, 0.35, 0.35, 0.666, 0.50, 0.35, 0.35, 0.833, 0.50, 0.35, 0.35}); + HHshape->setResetCurve(FlatCurveType(defSpot.HHcurve.at(0)), defSpot.HHcurve); HHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); HHshape->setCurveColorProvider(this, 1); std::vector mHHshape; @@ -292,7 +294,7 @@ Locallab::Locallab(): curveEditorG->setCurveListener(this); shapeexpos = static_cast(curveEditorG->addCurve(CT_Diagonal, "")); - shapeexpos->setResetCurve(DCT_NURBS, {(double)DCT_NURBS, 0.0, 0.0, 1.0, 1.0}); + shapeexpos->setResetCurve(DiagonalCurveType(defSpot.excurve.at(0)), defSpot.excurve); shapeexpos->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_TONES_TOOLTIP")); std::vector mshapeexpos; mshapeexpos.push_back(GradientMilestone(0., 0., 0., 0.)); @@ -455,7 +457,7 @@ Locallab::Locallab(): cTgainshape = static_cast(LocalcurveEditorgainT->addCurve(CT_Flat, "", nullptr, false, false)); cTgainshape->setIdentityValue(0.); - cTgainshape->setResetCurve(FCT_MinMaxCPoints, {(double)FCT_MinMaxCPoints, 0.0, 0.12, 0.35, 0.35, 0.70, 0.50, 0.35, 0.35, 1.00, 0.12, 0.35, 0.35}); + cTgainshape->setResetCurve(FlatCurveType(defSpot.localTgaincurve.at(0)), defSpot.localTgaincurve); cTgainshape->setTooltip(M("TP_RETINEX_GAINTRANSMISSION_TOOLTIP")); LocalcurveEditorgainT->curveListComplete(); @@ -906,55 +908,55 @@ void Locallab::read(const ProcParams* pp, const ParamsEdited* pedited) // Add non existent spots and update existent ones ControlSpotPanel::SpotRow* const r = new ControlSpotPanel::SpotRow(); - for (int i = 0; i < pp->locallab.nbspot; i++) { - r->id = pp->locallab.id.at(i); - r->name = pp->locallab.name.at(i); - r->isvisible = pp->locallab.isvisible.at(i); + for (int i = 0; i < pp->locallab.nbspot && i < (int)pp->locallab.spots.size(); i++) { + r->id = pp->locallab.spots.at(i).id; + r->name = pp->locallab.spots.at(i).name; + r->isvisible = pp->locallab.spots.at(i).isvisible; - if (pp->locallab.shape.at(i) == "ELI") { + if (pp->locallab.spots.at(i).shape == "ELI") { r->shape = 0; } else { r->shape = 1; } - if (pp->locallab.spotMethod.at(i) == "norm") { + if (pp->locallab.spots.at(i).spotMethod == "norm") { r->spotMethod = 0; } else { r->spotMethod = 1; } - r->sensiexclu = pp->locallab.sensiexclu.at(i); - r->struc = pp->locallab.struc.at(i); + r->sensiexclu = pp->locallab.spots.at(i).sensiexclu; + r->struc = pp->locallab.spots.at(i).struc; - if (pp->locallab.shapeMethod.at(i) == "IND") { + if (pp->locallab.spots.at(i).shapeMethod == "IND") { r->shapeMethod = 0; - } else if (pp->locallab.shapeMethod.at(i) == "SYM") { + } else if (pp->locallab.spots.at(i).shapeMethod == "SYM") { r->shapeMethod = 1; - } else if (pp->locallab.shapeMethod.at(i) == "INDSL") { + } else if (pp->locallab.spots.at(i).shapeMethod == "INDSL") { r->shapeMethod = 2; } else { r->shapeMethod = 3; } - r->locX = pp->locallab.locX.at(i); - r->locXL = pp->locallab.locXL.at(i); - r->locY = pp->locallab.locY.at(i); - r->locYT = pp->locallab.locYT.at(i); - r->centerX = pp->locallab.centerX.at(i); - r->centerY = pp->locallab.centerY.at(i); - r->circrad = pp->locallab.circrad.at(i); + r->locX = pp->locallab.spots.at(i).locX; + r->locXL = pp->locallab.spots.at(i).locXL; + r->locY = pp->locallab.spots.at(i).locY; + r->locYT = pp->locallab.spots.at(i).locYT; + r->centerX = pp->locallab.spots.at(i).centerX; + r->centerY = pp->locallab.spots.at(i).centerY; + r->circrad = pp->locallab.spots.at(i).circrad; - if (pp->locallab.qualityMethod.at(i) == "std") { + if (pp->locallab.spots.at(i).qualityMethod == "std") { r->qualityMethod = 0; - } else if (pp->locallab.qualityMethod.at(i) == "enh") { + } else if (pp->locallab.spots.at(i).qualityMethod == "enh") { r->qualityMethod = 1; } else { r->qualityMethod = 2; } - r->transit = pp->locallab.transit.at(i); - r->thresh = pp->locallab.thresh.at(i); - r->iter = pp->locallab.iter.at(i); + r->transit = pp->locallab.spots.at(i).transit; + r->thresh = pp->locallab.spots.at(i).thresh; + r->iter = pp->locallab.spots.at(i).iter; if (!expsettings->updateControlSpot(r)) { expsettings->addControlSpot(r); @@ -968,8 +970,8 @@ void Locallab::read(const ProcParams* pp, const ParamsEdited* pedited) for (int i = 0; i < (int)list->size(); i++) { ispresent = false; - for (int j = 0; j < pp->locallab.nbspot; j++) { - if (list->at(i) == pp->locallab.id.at(j)) { + for (int j = 0; j < pp->locallab.nbspot && j < (int)pp->locallab.spots.size(); j++) { + if (list->at(i) == pp->locallab.spots.at(j).id) { ispresent = true; break; } @@ -982,7 +984,7 @@ void Locallab::read(const ProcParams* pp, const ParamsEdited* pedited) // Select active spot if (pp->locallab.nbspot > 0) { - expsettings->setSelectedSpot(pp->locallab.id.at(pp->locallab.selspot)); + expsettings->setSelectedSpot(pp->locallab.spots.at(pp->locallab.selspot).id); } // Update Locallab tools GUI @@ -1001,146 +1003,68 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) const int spotPanelEvent = expsettings->getEventType(); int spotId; ControlSpotPanel::SpotRow* r; + LocallabParams::LocallabSpot* newSpot; switch (spotPanelEvent) { case (1): // 1 = Spot creation event // Spot creation (default initialization) + newSpot = new LocallabParams::LocallabSpot(); spotId = expsettings->getNewId(); r = new ControlSpotPanel::SpotRow(); - r->id = spotId; - r->name = "Control Spot #" + std::to_string(spotId); - r->isvisible = true; - r->shape = 0; - r->spotMethod = 0; - r->sensiexclu = 19; - r->struc = 0; - r->shapeMethod = 2; - r->locX = 250; - r->locXL = 250; - r->locY = 250; - r->locYT = 250; - r->centerX = 0; - r->centerY = 0; - r->circrad = 18; - r->qualityMethod = 0; - r->transit = 60; - r->thresh = 18; - r->iter = 0; + r->id = newSpot->id = spotId; + r->name = newSpot->name = "Control Spot #" + std::to_string(spotId); + r->isvisible = newSpot->isvisible; + + if (newSpot->shape == "ELI") { + r->shape = 0; + } else { + r->shape = 1; + } + + if (newSpot->spotMethod == "norm") { + r->spotMethod = 0; + } else { + r->spotMethod = 1; + } + + r->sensiexclu = newSpot->sensiexclu; + r->struc = newSpot->struc; + + if (newSpot->shapeMethod == "IND") { + r->shapeMethod = 0; + } else if (newSpot->shapeMethod == "SYM") { + r->shapeMethod = 1; + } else if (newSpot->shapeMethod == "INDSL") { + r->shapeMethod = 2; + } else { + r->shapeMethod = 3; + } + + r->locX = newSpot->locX; + r->locXL = newSpot->locXL; + r->locY = newSpot->locY; + r->locYT = newSpot->locYT; + r->centerX = newSpot->centerX; + r->centerY = newSpot->centerY; + r->circrad = newSpot->circrad; + + if (newSpot->qualityMethod == "std") { + r->qualityMethod = 0; + } else if (newSpot->qualityMethod == "enh") { + r->qualityMethod = 1; + } else { + r->qualityMethod = 2; + } + + r->transit = newSpot->transit; + r->thresh = newSpot->thresh; + r->iter = newSpot->iter; expsettings->addControlSpot(r); // ProcParams update pp->locallab.nbspot++; pp->locallab.selspot = pp->locallab.nbspot - 1; - // Control spot settings - pp->locallab.id.push_back(r->id); - pp->locallab.name.push_back(r->name); - pp->locallab.isvisible.push_back(r->isvisible); - pp->locallab.shape.push_back("ELI"); - pp->locallab.spotMethod.push_back("norm"); - pp->locallab.sensiexclu.push_back(r->sensiexclu); - pp->locallab.struc.push_back(r->struc); - pp->locallab.shapeMethod.push_back("INDSL"); - pp->locallab.locX.push_back(r->locX); - pp->locallab.locXL.push_back(r->locXL); - pp->locallab.locY.push_back(r->locY); - pp->locallab.locYT.push_back(r->locYT); - pp->locallab.centerX.push_back(r->centerX); - pp->locallab.centerY.push_back(r->centerY); - pp->locallab.circrad.push_back(r->circrad); - pp->locallab.qualityMethod.push_back("std"); - pp->locallab.transit.push_back(r->transit); - pp->locallab.thresh.push_back(r->thresh); - pp->locallab.iter.push_back(r->iter); - // Color & Light - pp->locallab.expcolor.push_back(0); - pp->locallab.curvactiv.push_back(0); - pp->locallab.lightness.push_back(0); - pp->locallab.contrast.push_back(0); - pp->locallab.chroma.push_back(0); - pp->locallab.sensi.push_back(19); - pp->locallab.qualitycurveMethod.push_back("none"); - pp->locallab.llcurve.push_back({(double)DCT_NURBS, 0.0, 0.0, 1.0, 1.0}); - pp->locallab.cccurve.push_back({(double)DCT_NURBS, 0.0, 0.0, 1.0, 1.0}); - pp->locallab.LHcurve.push_back({(double)FCT_MinMaxCPoints, 0.0, 0.50, 0.35, 0.35, 0.166, 0.50, 0.35, 0.35, 0.333, 0.50, 0.35, 0.35, 0.50, 0.50, 0.35, 0.35, 0.666, 0.50, 0.35, 0.35, 0.833, 0.50, 0.35, 0.35}); - pp->locallab.HHcurve.push_back({(double)FCT_MinMaxCPoints, 0.0, 0.50, 0.35, 0.35, 0.166, 0.50, 0.35, 0.35, 0.333, 0.50, 0.35, 0.35, 0.50, 0.50, 0.35, 0.35, 0.666, 0.50, 0.35, 0.35, 0.833, 0.50, 0.35, 0.35}); - pp->locallab.invers.push_back(0); - // Exposure - pp->locallab.expexpose.push_back(0); - pp->locallab.expcomp.push_back(0); - pp->locallab.hlcompr.push_back(20); - pp->locallab.hlcomprthresh.push_back(33); - pp->locallab.black.push_back(0); - pp->locallab.shcompr.push_back(50); - pp->locallab.warm.push_back(0); - pp->locallab.sensiex.push_back(19); - pp->locallab.excurve.push_back({(double)DCT_NURBS, 0.0, 0.0, 1.0, 1.0}); - // Vibrance - pp->locallab.expvibrance.push_back(0); - pp->locallab.saturated.push_back(0); - pp->locallab.pastels.push_back(0); - pp->locallab.psthreshold.push_back({0, 75, false}); - pp->locallab.protectskins.push_back(0); - pp->locallab.avoidcolorshift.push_back(1); - pp->locallab.pastsattog.push_back(1); - pp->locallab.sensiv.push_back(19); - pp->locallab.skintonescurve.push_back({(double)DCT_Linear}); - // Blur & Noise - pp->locallab.expblur.push_back(0); - pp->locallab.radius.push_back(1); - pp->locallab.strength.push_back(0); - pp->locallab.sensibn.push_back(40); - pp->locallab.blurMethod.push_back("norm"); - pp->locallab.activlum.push_back(0); - // Tone Mapping - pp->locallab.exptonemap.push_back(0); - pp->locallab.stren.push_back(1); - pp->locallab.gamma.push_back(100); - pp->locallab.estop.push_back(140); - pp->locallab.scaltm.push_back(10); - pp->locallab.rewei.push_back(0); - pp->locallab.sensitm.push_back(19); - // Retinex - pp->locallab.expreti.push_back(0); - pp->locallab.retinexMethod.push_back("high"); - pp->locallab.str.push_back(0); - pp->locallab.chrrt.push_back(0); - pp->locallab.neigh.push_back(50); - pp->locallab.vart.push_back(200); - pp->locallab.sensih.push_back(19); - pp->locallab.localTgaincurve.push_back({(double)FCT_MinMaxCPoints, 0.0, 0.12, 0.35, 0.35, 0.70, 0.50, 0.35, 0.35, 1.00, 0.12, 0.35, 0.35}); - pp->locallab.inversret.push_back(0); - // Sharpening - pp->locallab.expsharp.push_back(0); - pp->locallab.sharradius.push_back(40); - pp->locallab.sharamount.push_back(75); - pp->locallab.shardamping.push_back(75); - pp->locallab.shariter.push_back(30); - pp->locallab.sensisha.push_back(19); - pp->locallab.inverssha.push_back(0); - // Contrast by detail levels - pp->locallab.expcbdl.push_back(0); - - for (int i = 0; i < 5; i++) { - pp->locallab.mult[i].push_back(100.0); - } - - pp->locallab.chromacbdl.push_back(0); - pp->locallab.threshold.push_back(20.0); - pp->locallab.sensicb.push_back(19); - // Denoise - pp->locallab.expdenoi.push_back(0); - pp->locallab.noiselumf.push_back(0); - pp->locallab.noiselumc.push_back(0); - pp->locallab.noiselumdetail.push_back(0); - pp->locallab.noiselequal.push_back(7); - pp->locallab.noisechrof.push_back(0); - pp->locallab.noisechroc.push_back(0); - pp->locallab.noisechrodetail.push_back(0); - pp->locallab.adjblur.push_back(0); - pp->locallab.bilateral.push_back(0); - pp->locallab.sensiden.push_back(30); - // Others - pp->locallab.avoid.push_back(0); + pp->locallab.spots.push_back(*newSpot); // New created spot selection expsettings->setSelectedSpot(spotId); @@ -1156,126 +1080,17 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) // Get deleted spot index in ProcParams and update it spotId = expsettings->getSelectedSpot(); - for (int i = 0; i < pp->locallab.nbspot; i++) { - if (pp->locallab.id.at(i) == spotId) { + for (int i = 0; i < pp->locallab.nbspot && i < (int)pp->locallab.spots.size(); i++) { + if (pp->locallab.spots.at(i).id == spotId) { // ProcParams update pp->locallab.nbspot--; pp->locallab.selspot = 0; - // Control spot settings - pp->locallab.id.erase(pp->locallab.id.begin() + i); - pp->locallab.name.erase(pp->locallab.name.begin() + i); - pp->locallab.isvisible.erase(pp->locallab.isvisible.begin() + i); - pp->locallab.shape.erase(pp->locallab.shape.begin() + i); - pp->locallab.spotMethod.erase(pp->locallab.spotMethod.begin() + i); - pp->locallab.sensiexclu.erase(pp->locallab.sensiexclu.begin() + i); - pp->locallab.struc.erase(pp->locallab.struc.begin() + i); - pp->locallab.shapeMethod.erase(pp->locallab.shapeMethod.begin() + i); - pp->locallab.locX.erase(pp->locallab.locX.begin() + i); - pp->locallab.locXL.erase(pp->locallab.locXL.begin() + i); - pp->locallab.locY.erase(pp->locallab.locY.begin() + i); - pp->locallab.locYT.erase(pp->locallab.locYT.begin() + i); - pp->locallab.centerX.erase(pp->locallab.centerX.begin() + i); - pp->locallab.centerY.erase(pp->locallab.centerY.begin() + i); - pp->locallab.circrad.erase(pp->locallab.circrad.begin() + i); - pp->locallab.qualityMethod.erase(pp->locallab.qualityMethod.begin() + i); - pp->locallab.transit.erase(pp->locallab.transit.begin() + i); - pp->locallab.thresh.erase(pp->locallab.thresh.begin() + i); - pp->locallab.iter.erase(pp->locallab.iter.begin() + i); + pp->locallab.spots.erase(pp->locallab.spots.begin() + i); expsettings->deleteControlSpot(spotId); - // Color & Light - pp->locallab.expcolor.erase(pp->locallab.expcolor.begin() + i); - pp->locallab.curvactiv.erase(pp->locallab.curvactiv.begin() + i); - pp->locallab.lightness.erase(pp->locallab.lightness.begin() + i); - pp->locallab.contrast.erase(pp->locallab.contrast.begin() + i); - pp->locallab.chroma.erase(pp->locallab.chroma.begin() + i); - pp->locallab.sensi.erase(pp->locallab.sensi.begin() + i); - pp->locallab.qualitycurveMethod.erase(pp->locallab.qualitycurveMethod.begin() + i); - pp->locallab.llcurve.erase(pp->locallab.llcurve.begin() + i); - pp->locallab.cccurve.erase(pp->locallab.cccurve.begin() + i); - pp->locallab.LHcurve.erase(pp->locallab.LHcurve.begin() + i); - pp->locallab.HHcurve.erase(pp->locallab.HHcurve.begin() + i); - pp->locallab.invers.erase(pp->locallab.invers.begin() + i); - // Exposure - pp->locallab.expexpose.erase(pp->locallab.expexpose.begin() + i); - pp->locallab.expcomp.erase(pp->locallab.expcomp.begin() + i); - pp->locallab.hlcompr.erase(pp->locallab.hlcompr.begin() + i); - pp->locallab.hlcomprthresh.erase(pp->locallab.hlcomprthresh.begin() + i); - pp->locallab.black.erase(pp->locallab.black.begin() + i); - pp->locallab.shcompr.erase(pp->locallab.shcompr.begin() + i); - pp->locallab.warm.erase(pp->locallab.warm.begin() + i); - pp->locallab.sensiex.erase(pp->locallab.sensiex.begin() + i); - pp->locallab.excurve.erase(pp->locallab.excurve.begin() + i); - // Vibrance - pp->locallab.expvibrance.erase(pp->locallab.expvibrance.begin() + i); - pp->locallab.saturated.erase(pp->locallab.saturated.begin() + i); - pp->locallab.pastels.erase(pp->locallab.pastels.begin() + i); - pp->locallab.psthreshold.erase(pp->locallab.psthreshold.begin() + i); - pp->locallab.protectskins.erase(pp->locallab.protectskins.begin() + i); - pp->locallab.avoidcolorshift.erase(pp->locallab.avoidcolorshift.begin() + i); - pp->locallab.pastsattog.erase(pp->locallab.pastsattog.begin() + i); - pp->locallab.sensiv.erase(pp->locallab.sensiv.begin() + i); - pp->locallab.skintonescurve.erase(pp->locallab.skintonescurve.begin() + i); - // Blur & Noise - pp->locallab.expblur.erase(pp->locallab.expblur.begin() + i); - pp->locallab.radius.erase(pp->locallab.radius.begin() + i); - pp->locallab.strength.erase(pp->locallab.strength.begin() + i); - pp->locallab.sensibn.erase(pp->locallab.sensibn.begin() + i); - pp->locallab.blurMethod.erase(pp->locallab.blurMethod.begin() + i); - pp->locallab.activlum.erase(pp->locallab.activlum.begin() + i); - // Tone Mapping - pp->locallab.exptonemap.erase(pp->locallab.exptonemap.begin() + i); - pp->locallab.stren.erase(pp->locallab.stren.begin() + i); - pp->locallab.gamma.erase(pp->locallab.gamma.begin() + i); - pp->locallab.estop.erase(pp->locallab.estop.begin() + i); - pp->locallab.scaltm.erase(pp->locallab.scaltm.begin() + i); - pp->locallab.rewei.erase(pp->locallab.rewei.begin() + i); - pp->locallab.sensitm.erase(pp->locallab.sensitm.begin() + i); - // Retinex - pp->locallab.expreti.erase(pp->locallab.expreti.begin() + i); - pp->locallab.retinexMethod.erase(pp->locallab.retinexMethod.begin() + i); - pp->locallab.str.erase(pp->locallab.str.begin() + i); - pp->locallab.chrrt.erase(pp->locallab.chrrt.begin() + i); - pp->locallab.neigh.erase(pp->locallab.neigh.begin() + i); - pp->locallab.vart.erase(pp->locallab.vart.begin() + i); - pp->locallab.sensih.erase(pp->locallab.sensih.begin() + i); - pp->locallab.localTgaincurve.erase(pp->locallab.localTgaincurve.begin() + i); - pp->locallab.inversret.erase(pp->locallab.inversret.begin() + i); - // Sharpening - pp->locallab.expsharp.erase(pp->locallab.expsharp.begin() + i); - pp->locallab.sharradius.erase(pp->locallab.sharradius.begin() + i); - pp->locallab.sharamount.erase(pp->locallab.sharamount.begin() + i); - pp->locallab.shardamping.erase(pp->locallab.shardamping.begin() + i); - pp->locallab.shariter.erase(pp->locallab.shariter.begin() + i); - pp->locallab.sensisha.erase(pp->locallab.sensisha.begin() + i); - pp->locallab.inverssha.erase(pp->locallab.inverssha.begin() + i); - // Contrast by detail levels - pp->locallab.expcbdl.erase(pp->locallab.expcbdl.begin() + i); - - for (int j = 0; j < 5; j++) { - pp->locallab.mult[j].erase(pp->locallab.mult[j].begin() + i); - } - - pp->locallab.chromacbdl.erase(pp->locallab.chromacbdl.begin() + i); - pp->locallab.threshold.erase(pp->locallab.threshold.begin() + i); - pp->locallab.sensicb.erase(pp->locallab.sensicb.begin() + i); - // Denoise - pp->locallab.expdenoi.erase(pp->locallab.expdenoi.begin() + i); - pp->locallab.noiselumf.erase(pp->locallab.noiselumf.begin() + i); - pp->locallab.noiselumc.erase(pp->locallab.noiselumc.begin() + i); - pp->locallab.noiselumdetail.erase(pp->locallab.noiselumdetail.begin() + i); - pp->locallab.noiselequal.erase(pp->locallab.noiselequal.begin() + i); - pp->locallab.noisechrof.erase(pp->locallab.noisechrof.begin() + i); - pp->locallab.noisechroc.erase(pp->locallab.noisechroc.begin() + i); - pp->locallab.noisechrodetail.erase(pp->locallab.noisechrodetail.begin() + i); - pp->locallab.adjblur.erase(pp->locallab.adjblur.begin() + i); - pp->locallab.bilateral.erase(pp->locallab.bilateral.begin() + i); - pp->locallab.sensiden.erase(pp->locallab.sensiden.begin() + i); - // Others - pp->locallab.avoid.erase(pp->locallab.avoid.begin() + i); // Select one remaining spot if (pp->locallab.nbspot > 0) { - expsettings->setSelectedSpot(pp->locallab.id.at(pp->locallab.selspot)); + expsettings->setSelectedSpot(pp->locallab.spots.at(pp->locallab.selspot).id); } // Update Locallab tools GUI with new created spot @@ -1292,8 +1107,8 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) case (3): // 3 = Spot selection event spotId = expsettings->getSelectedSpot(); - for (int i = 0; i < pp->locallab.nbspot; i++) { - if (pp->locallab.id.at(i) == spotId) { + for (int i = 0; i < pp->locallab.nbspot && i < (int)pp->locallab.spots.size(); i++) { + if (pp->locallab.spots.at(i).id == spotId) { pp->locallab.selspot = i; break; } @@ -1312,168 +1127,170 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) r = expsettings->getSpot(expsettings->getSelectedSpot()); // ProcParams update - // Control spot settings - pp->locallab.name.at(pp->locallab.selspot) = r->name; - pp->locallab.isvisible.at(pp->locallab.selspot) = r->isvisible; + if (pp->locallab.selspot < (int)pp->locallab.spots.size()) { + // Control spot settings + pp->locallab.spots.at(pp->locallab.selspot).name = r->name; + pp->locallab.spots.at(pp->locallab.selspot).isvisible = r->isvisible; - if (r->shape == 0) { - pp->locallab.shape.at(pp->locallab.selspot) = "ELI"; - } else { - pp->locallab.shape.at(pp->locallab.selspot) = "RECT"; + if (r->shape == 0) { + pp->locallab.spots.at(pp->locallab.selspot).shape = "ELI"; + } else { + pp->locallab.spots.at(pp->locallab.selspot).shape = "RECT"; + } + + if (r->spotMethod == 0) { + pp->locallab.spots.at(pp->locallab.selspot).spotMethod = "norm"; + } else { + pp->locallab.spots.at(pp->locallab.selspot).spotMethod = "exc"; + } + + pp->locallab.spots.at(pp->locallab.selspot).sensiexclu = r->sensiexclu; + pp->locallab.spots.at(pp->locallab.selspot).struc = r->struc; + + if (r->shapeMethod == 0) { + pp->locallab.spots.at(pp->locallab.selspot).shapeMethod = "IND"; + } else if (r->shapeMethod == 1) { + pp->locallab.spots.at(pp->locallab.selspot).shapeMethod = "SYM"; + } else if (r->shapeMethod == 2) { + pp->locallab.spots.at(pp->locallab.selspot).shapeMethod = "INDSL"; + } else { + pp->locallab.spots.at(pp->locallab.selspot).shapeMethod = "SYMSL"; + } + + pp->locallab.spots.at(pp->locallab.selspot).locX = r->locX; + pp->locallab.spots.at(pp->locallab.selspot).locXL = r->locXL; + pp->locallab.spots.at(pp->locallab.selspot).locY = r->locY; + pp->locallab.spots.at(pp->locallab.selspot).locYT = r->locYT; + pp->locallab.spots.at(pp->locallab.selspot).centerX = r->centerX; + pp->locallab.spots.at(pp->locallab.selspot).centerY = r->centerY; + pp->locallab.spots.at(pp->locallab.selspot).circrad = r->circrad; + + if (r->qualityMethod == 0) { + pp->locallab.spots.at(pp->locallab.selspot).qualityMethod = "std"; + } else if (r->qualityMethod == 1) { + pp->locallab.spots.at(pp->locallab.selspot).qualityMethod = "enh"; + } else { + pp->locallab.spots.at(pp->locallab.selspot).qualityMethod = "enhden"; + } + + pp->locallab.spots.at(pp->locallab.selspot).transit = r->transit; + pp->locallab.spots.at(pp->locallab.selspot).thresh = r->thresh; + pp->locallab.spots.at(pp->locallab.selspot).iter = r->iter; + // Color & Light + pp->locallab.spots.at(pp->locallab.selspot).expcolor = expcolor->getEnabled(); + pp->locallab.spots.at(pp->locallab.selspot).curvactiv = curvactiv->get_active(); + pp->locallab.spots.at(pp->locallab.selspot).lightness = lightness->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).contrast = contrast->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).chroma = chroma->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).sensi = sensi->getIntValue(); + + if (qualitycurveMethod->get_active_row_number() == 0) { + pp->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod = "none"; + } else if (qualitycurveMethod->get_active_row_number() == 1) { + pp->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod = "std"; + } else if (qualitycurveMethod->get_active_row_number() == 2) { + pp->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod = "enh"; + } + + pp->locallab.spots.at(pp->locallab.selspot).llcurve = llshape->getCurve(); + pp->locallab.spots.at(pp->locallab.selspot).cccurve = ccshape->getCurve(); + pp->locallab.spots.at(pp->locallab.selspot).LHcurve = LHshape->getCurve(); + pp->locallab.spots.at(pp->locallab.selspot).HHcurve = HHshape->getCurve(); + pp->locallab.spots.at(pp->locallab.selspot).invers = invers->get_active(); + // Exposure + pp->locallab.spots.at(pp->locallab.selspot).expexpose = expexpose->getEnabled(); + pp->locallab.spots.at(pp->locallab.selspot).expcomp = expcomp->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).hlcompr = hlcompr->getIntValue(); + 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).warm = warm->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).sensiex = sensiex->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).excurve = shapeexpos->getCurve(); + // Vibrance + pp->locallab.spots.at(pp->locallab.selspot).expvibrance = expvibrance->getEnabled(); + pp->locallab.spots.at(pp->locallab.selspot).saturated = saturated->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).pastels = pastels->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).psthreshold = psThreshold->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).protectskins = protectSkins->get_active(); + pp->locallab.spots.at(pp->locallab.selspot).avoidcolorshift = avoidColorShift->get_active(); + pp->locallab.spots.at(pp->locallab.selspot).pastsattog = pastSatTog->get_active(); + pp->locallab.spots.at(pp->locallab.selspot).sensiv = sensiv->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).skintonescurve = skinTonesCurve->getCurve(); + // Blur & Noise + pp->locallab.spots.at(pp->locallab.selspot).expblur = expblur->getEnabled(); + pp->locallab.spots.at(pp->locallab.selspot).radius = radius->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).strength = strength->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).sensibn = sensibn->getIntValue(); + + if (blurMethod->get_active_row_number() == 0) { + pp->locallab.spots.at(pp->locallab.selspot).blurMethod = "norm"; + } else if (blurMethod->get_active_row_number() == 1) { + pp->locallab.spots.at(pp->locallab.selspot).blurMethod = "inv"; + } else if (blurMethod->get_active_row_number() == 2) { + pp->locallab.spots.at(pp->locallab.selspot).blurMethod = "sym"; + } + + pp->locallab.spots.at(pp->locallab.selspot).activlum = activlum->get_active(); + // Tone Mapping + pp->locallab.spots.at(pp->locallab.selspot).exptonemap = exptonemap->getEnabled(); + pp->locallab.spots.at(pp->locallab.selspot).stren = stren->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).gamma = gamma->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).estop = estop->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).scaltm = scaltm->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).rewei = rewei->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).sensitm = sensitm->getIntValue(); + // Retinex + pp->locallab.spots.at(pp->locallab.selspot).expreti = expreti->getEnabled(); + + if (retinexMethod->get_active_row_number() == 0) { + pp->locallab.spots.at(pp->locallab.selspot).retinexMethod = "low"; + } else if (retinexMethod->get_active_row_number() == 1) { + pp->locallab.spots.at(pp->locallab.selspot).retinexMethod = "uni"; + } else if (retinexMethod->get_active_row_number() == 2) { + pp->locallab.spots.at(pp->locallab.selspot).retinexMethod = "high"; + } + + pp->locallab.spots.at(pp->locallab.selspot).str = str->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).chrrt = chrrt->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).neigh = neigh->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).vart = vart->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).sensih = sensih->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).localTgaincurve = cTgainshape->getCurve(); + pp->locallab.spots.at(pp->locallab.selspot).inversret = inversret->get_active(); + // Sharpening + pp->locallab.spots.at(pp->locallab.selspot).expsharp = expsharp->getEnabled(); + pp->locallab.spots.at(pp->locallab.selspot).sharradius = sharradius->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).sharamount = sharamount->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).shardamping = shardamping->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).shariter = shariter->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).sensisha = sensisha->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).inverssha = inverssha->get_active(); + // Contrast by detail levels + pp->locallab.spots.at(pp->locallab.selspot).expcbdl = expcbdl->getEnabled(); + + for (int i = 0; i < 5; i++) { + pp->locallab.spots.at(pp->locallab.selspot).mult[i] = multiplier[i]->getIntValue(); + } + + pp->locallab.spots.at(pp->locallab.selspot).chromacbdl = chromacbdl->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).threshold = threshold->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).sensicb = sensicb->getIntValue(); + // Denoise + pp->locallab.spots.at(pp->locallab.selspot).expdenoi = expdenoi->getEnabled(); + pp->locallab.spots.at(pp->locallab.selspot).noiselumf = noiselumf->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).noiselumc = noiselumc->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).noiselumdetail = noiselumdetail->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).noiselequal = noiselequal->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).noisechrof = noisechrof->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).noisechroc = noisechroc->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).noisechrodetail = noisechrodetail->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).adjblur = adjblur->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).bilateral = bilateral->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).sensiden = sensiden->getIntValue(); + // Others + pp->locallab.spots.at(pp->locallab.selspot).avoid = avoid->get_active(); } - - if (r->spotMethod == 0) { - pp->locallab.spotMethod.at(pp->locallab.selspot) = "norm"; - } else { - pp->locallab.spotMethod.at(pp->locallab.selspot) = "exc"; - } - - pp->locallab.sensiexclu.at(pp->locallab.selspot) = r->sensiexclu; - pp->locallab.struc.at(pp->locallab.selspot) = r->struc; - - if (r->shapeMethod == 0) { - pp->locallab.shapeMethod.at(pp->locallab.selspot) = "IND"; - } else if (r->shapeMethod == 1) { - pp->locallab.shapeMethod.at(pp->locallab.selspot) = "SYM"; - } else if (r->shapeMethod == 2) { - pp->locallab.shapeMethod.at(pp->locallab.selspot) = "INDSL"; - } else { - pp->locallab.shapeMethod.at(pp->locallab.selspot) = "SYMSL"; - } - - pp->locallab.locX.at(pp->locallab.selspot) = r->locX; - pp->locallab.locXL.at(pp->locallab.selspot) = r->locXL; - pp->locallab.locY.at(pp->locallab.selspot) = r->locY; - pp->locallab.locYT.at(pp->locallab.selspot) = r->locYT; - pp->locallab.centerX.at(pp->locallab.selspot) = r->centerX; - pp->locallab.centerY.at(pp->locallab.selspot) = r->centerY; - pp->locallab.circrad.at(pp->locallab.selspot) = r->circrad; - - if (r->qualityMethod == 0) { - pp->locallab.qualityMethod.at(pp->locallab.selspot) = "std"; - } else if (r->qualityMethod == 1) { - pp->locallab.qualityMethod.at(pp->locallab.selspot) = "enh"; - } else { - pp->locallab.qualityMethod.at(pp->locallab.selspot) = "enhden"; - } - - pp->locallab.transit.at(pp->locallab.selspot) = r->transit; - pp->locallab.thresh.at(pp->locallab.selspot) = r->thresh; - pp->locallab.iter.at(pp->locallab.selspot) = r->iter; - // Color & Light - pp->locallab.expcolor.at(pp->locallab.selspot) = (int)expcolor->getEnabled(); - pp->locallab.curvactiv.at(pp->locallab.selspot) = (int)curvactiv->get_active(); - pp->locallab.lightness.at(pp->locallab.selspot) = lightness->getIntValue(); - pp->locallab.contrast.at(pp->locallab.selspot) = contrast->getIntValue(); - pp->locallab.chroma.at(pp->locallab.selspot) = chroma->getIntValue(); - pp->locallab.sensi.at(pp->locallab.selspot) = sensi->getIntValue(); - - if (qualitycurveMethod->get_active_row_number() == 0) { - pp->locallab.qualitycurveMethod.at(pp->locallab.selspot) = "none"; - } else if (qualitycurveMethod->get_active_row_number() == 1) { - pp->locallab.qualitycurveMethod.at(pp->locallab.selspot) = "std"; - } else if (qualitycurveMethod->get_active_row_number() == 2) { - pp->locallab.qualitycurveMethod.at(pp->locallab.selspot) = "enh"; - } - - pp->locallab.llcurve.at(pp->locallab.selspot) = llshape->getCurve(); - pp->locallab.cccurve.at(pp->locallab.selspot) = ccshape->getCurve(); - pp->locallab.LHcurve.at(pp->locallab.selspot) = LHshape->getCurve(); - pp->locallab.HHcurve.at(pp->locallab.selspot) = HHshape->getCurve(); - pp->locallab.invers.at(pp->locallab.selspot) = invers->get_active(); - // Exposure - pp->locallab.expexpose.at(pp->locallab.selspot) = (int)expexpose->getEnabled(); - pp->locallab.expcomp.at(pp->locallab.selspot) = expcomp->getIntValue(); - pp->locallab.hlcompr.at(pp->locallab.selspot) = hlcompr->getIntValue(); - pp->locallab.hlcomprthresh.at(pp->locallab.selspot) = hlcomprthresh->getIntValue(); - pp->locallab.black.at(pp->locallab.selspot) = black->getIntValue(); - pp->locallab.shcompr.at(pp->locallab.selspot) = shcompr->getIntValue(); - pp->locallab.warm.at(pp->locallab.selspot) = warm->getIntValue(); - pp->locallab.sensiex.at(pp->locallab.selspot) = sensiex->getIntValue(); - pp->locallab.excurve.at(pp->locallab.selspot) = shapeexpos->getCurve(); - // Vibrance - pp->locallab.expvibrance.at(pp->locallab.selspot) = (int)expvibrance->getEnabled(); - pp->locallab.saturated.at(pp->locallab.selspot) = saturated->getIntValue(); - pp->locallab.pastels.at(pp->locallab.selspot) = pastels->getIntValue(); - pp->locallab.psthreshold.at(pp->locallab.selspot) = psThreshold->getValue(); - pp->locallab.protectskins.at(pp->locallab.selspot) = (int)protectSkins->get_active(); - pp->locallab.avoidcolorshift.at(pp->locallab.selspot) = (int)avoidColorShift->get_active(); - pp->locallab.pastsattog.at(pp->locallab.selspot) = (int)pastSatTog->get_active(); - pp->locallab.sensiv.at(pp->locallab.selspot) = sensiv->getIntValue(); - pp->locallab.skintonescurve.at(pp->locallab.selspot) = skinTonesCurve->getCurve(); - // Blur & Noise - pp->locallab.expblur.at(pp->locallab.selspot) = (int)expblur->getEnabled(); - pp->locallab.radius.at(pp->locallab.selspot) = radius->getIntValue(); - pp->locallab.strength.at(pp->locallab.selspot) = strength->getIntValue(); - pp->locallab.sensibn.at(pp->locallab.selspot) = sensibn->getIntValue(); - - if (blurMethod->get_active_row_number() == 0) { - pp->locallab.blurMethod.at(pp->locallab.selspot) = "norm"; - } else if (blurMethod->get_active_row_number() == 1) { - pp->locallab.blurMethod.at(pp->locallab.selspot) = "inv"; - } else if (blurMethod->get_active_row_number() == 2) { - pp->locallab.blurMethod.at(pp->locallab.selspot) = "sym"; - } - - pp->locallab.activlum.at(pp->locallab.selspot) = (int)activlum->get_active(); - // Tone Mapping - pp->locallab.exptonemap.at(pp->locallab.selspot) = (int)exptonemap->getEnabled(); - pp->locallab.stren.at(pp->locallab.selspot) = stren->getIntValue(); - pp->locallab.gamma.at(pp->locallab.selspot) = gamma->getIntValue(); - pp->locallab.estop.at(pp->locallab.selspot) = estop->getIntValue(); - pp->locallab.scaltm.at(pp->locallab.selspot) = scaltm->getIntValue(); - pp->locallab.rewei.at(pp->locallab.selspot) = rewei->getIntValue(); - pp->locallab.sensitm.at(pp->locallab.selspot) = sensitm->getIntValue(); - // Retinex - pp->locallab.expreti.at(pp->locallab.selspot) = (int)expreti->getEnabled(); - - if (retinexMethod->get_active_row_number() == 0) { - pp->locallab.retinexMethod.at(pp->locallab.selspot) = "low"; - } else if (retinexMethod->get_active_row_number() == 1) { - pp->locallab.retinexMethod.at(pp->locallab.selspot) = "uni"; - } else if (retinexMethod->get_active_row_number() == 2) { - pp->locallab.retinexMethod.at(pp->locallab.selspot) = "high"; - } - - pp->locallab.str.at(pp->locallab.selspot) = str->getIntValue(); - pp->locallab.chrrt.at(pp->locallab.selspot) = chrrt->getIntValue(); - pp->locallab.neigh.at(pp->locallab.selspot) = neigh->getIntValue(); - pp->locallab.vart.at(pp->locallab.selspot) = vart->getIntValue(); - pp->locallab.sensih.at(pp->locallab.selspot) = sensih->getIntValue(); - pp->locallab.localTgaincurve.at(pp->locallab.selspot) = cTgainshape->getCurve(); - pp->locallab.inversret.at(pp->locallab.selspot) = (int)inversret->get_active(); - // Sharpening - pp->locallab.expsharp.at(pp->locallab.selspot) = (int)expsharp->getEnabled(); - pp->locallab.sharradius.at(pp->locallab.selspot) = sharradius->getIntValue(); - pp->locallab.sharamount.at(pp->locallab.selspot) = sharamount->getIntValue(); - pp->locallab.shardamping.at(pp->locallab.selspot) = shardamping->getIntValue(); - pp->locallab.shariter.at(pp->locallab.selspot) = shariter->getIntValue(); - pp->locallab.sensisha.at(pp->locallab.selspot) = sensisha->getIntValue(); - pp->locallab.inverssha.at(pp->locallab.selspot) = (int)inverssha->get_active(); - // Contrast by detail levels - pp->locallab.expcbdl.at(pp->locallab.selspot) = (int)expcbdl->getEnabled(); - - for (int i = 0; i < 5; i++) { - pp->locallab.mult[i].at(pp->locallab.selspot) = multiplier[i]->getIntValue(); - } - - pp->locallab.chromacbdl.at(pp->locallab.selspot) = chromacbdl->getIntValue(); - pp->locallab.threshold.at(pp->locallab.selspot) = threshold->getValue(); - pp->locallab.sensicb.at(pp->locallab.selspot) = sensicb->getIntValue(); - // Denoise - pp->locallab.expdenoi.at(pp->locallab.selspot) = (int)expdenoi->getEnabled(); - pp->locallab.noiselumf.at(pp->locallab.selspot) = noiselumf->getIntValue(); - pp->locallab.noiselumc.at(pp->locallab.selspot) = noiselumc->getIntValue(); - pp->locallab.noiselumdetail.at(pp->locallab.selspot) = noiselumdetail->getIntValue(); - pp->locallab.noiselequal.at(pp->locallab.selspot) = noiselequal->getIntValue(); - pp->locallab.noisechrof.at(pp->locallab.selspot) = noisechrof->getIntValue(); - pp->locallab.noisechroc.at(pp->locallab.selspot) = noisechroc->getIntValue(); - pp->locallab.noisechrodetail.at(pp->locallab.selspot) = noisechrodetail->getIntValue(); - pp->locallab.adjblur.at(pp->locallab.selspot) = adjblur->getIntValue(); - pp->locallab.bilateral.at(pp->locallab.selspot) = bilateral->getIntValue(); - pp->locallab.sensiden.at(pp->locallab.selspot) = sensiden->getIntValue(); - // Others - pp->locallab.avoid.at(pp->locallab.selspot) = (int)avoid->get_active(); } // Update Locallab tools GUI @@ -2916,130 +2733,130 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, int printf("updateLocallabGUI\n"); // Update GUI values - if (index < pp->locallab.nbspot) { + if (index < pp->locallab.nbspot && index < (int)pp->locallab.spots.size()) { // Color & Light - expcolor->setEnabled((bool)pp->locallab.expcolor.at(index)); - curvactiv->set_active((bool)pp->locallab.curvactiv.at(index)); - lightness->setValue(pp->locallab.lightness.at(index)); - contrast->setValue(pp->locallab.contrast.at(index)); - chroma->setValue(pp->locallab.chroma.at(index)); - sensi->setValue(pp->locallab.sensi.at(index)); + expcolor->setEnabled(pp->locallab.spots.at(index).expcolor); + curvactiv->set_active(pp->locallab.spots.at(index).curvactiv); + lightness->setValue(pp->locallab.spots.at(index).lightness); + contrast->setValue(pp->locallab.spots.at(index).contrast); + chroma->setValue(pp->locallab.spots.at(index).chroma); + sensi->setValue(pp->locallab.spots.at(index).sensi); - if (pp->locallab.qualitycurveMethod.at(index) == "none") { + if (pp->locallab.spots.at(index).qualitycurveMethod == "none") { qualitycurveMethod->set_active(0); - } else if (pp->locallab.qualitycurveMethod.at(index) == "std") { + } else if (pp->locallab.spots.at(index).qualitycurveMethod == "std") { qualitycurveMethod->set_active(1); } else { qualitycurveMethod->set_active(2); } - llshape->setCurve(pp->locallab.llcurve.at(index)); - ccshape->setCurve(pp->locallab.cccurve.at(index)); - LHshape->setCurve(pp->locallab.LHcurve.at(index)); - HHshape->setCurve(pp->locallab.HHcurve.at(index)); - invers->set_active((bool)pp->locallab.invers.at(index)); + llshape->setCurve(pp->locallab.spots.at(index).llcurve); + ccshape->setCurve(pp->locallab.spots.at(index).cccurve); + LHshape->setCurve(pp->locallab.spots.at(index).LHcurve); + HHshape->setCurve(pp->locallab.spots.at(index).HHcurve); + invers->set_active(pp->locallab.spots.at(index).invers); // Exposure - expexpose->setEnabled((bool)pp->locallab.expexpose.at(index)); - expcomp->setValue(pp->locallab.expcomp.at(index)); - hlcompr->setValue(pp->locallab.hlcompr.at(index)); - hlcomprthresh->setValue(pp->locallab.hlcomprthresh.at(index)); - black->setValue(pp->locallab.black.at(index)); - shcompr->setValue(pp->locallab.shcompr.at(index)); - warm->setValue(pp->locallab.warm.at(index)); - sensiex->setValue(pp->locallab.sensiex.at(index)); - shapeexpos->setCurve(pp->locallab.excurve.at(index)); + expexpose->setEnabled(pp->locallab.spots.at(index).expexpose); + expcomp->setValue(pp->locallab.spots.at(index).expcomp); + hlcompr->setValue(pp->locallab.spots.at(index).hlcompr); + hlcomprthresh->setValue(pp->locallab.spots.at(index).hlcomprthresh); + black->setValue(pp->locallab.spots.at(index).black); + shcompr->setValue(pp->locallab.spots.at(index).shcompr); + warm->setValue(pp->locallab.spots.at(index).warm); + sensiex->setValue(pp->locallab.spots.at(index).sensiex); + shapeexpos->setCurve(pp->locallab.spots.at(index).excurve); // Vibrance - expvibrance->setEnabled((bool)pp->locallab.expvibrance.at(index)); - saturated->setValue(pp->locallab.saturated.at(index)); - pastels->setValue(pp->locallab.pastels.at(index)); - psThreshold->setValue(pp->locallab.psthreshold.at(index)); - protectSkins->set_active((bool)pp->locallab.protectskins.at(index)); - avoidColorShift->set_active((bool)pp->locallab.avoidcolorshift.at(index)); - pastSatTog->set_active((bool)pp->locallab.pastsattog.at(index)); - sensiv->setValue(pp->locallab.sensiv.at(index)); - skinTonesCurve->setCurve(pp->locallab.skintonescurve.at(index)); + expvibrance->setEnabled(pp->locallab.spots.at(index).expvibrance); + saturated->setValue(pp->locallab.spots.at(index).saturated); + pastels->setValue(pp->locallab.spots.at(index).pastels); + psThreshold->setValue(pp->locallab.spots.at(index).psthreshold); + protectSkins->set_active(pp->locallab.spots.at(index).protectskins); + avoidColorShift->set_active(pp->locallab.spots.at(index).avoidcolorshift); + pastSatTog->set_active(pp->locallab.spots.at(index).pastsattog); + sensiv->setValue(pp->locallab.spots.at(index).sensiv); + skinTonesCurve->setCurve(pp->locallab.spots.at(index).skintonescurve); // Blur & Noise - expblur->setEnabled((bool)pp->locallab.expblur.at(index)); - radius->setValue(pp->locallab.radius.at(index)); - strength->setValue(pp->locallab.strength.at(index)); - sensibn->setValue(pp->locallab.sensibn.at(index)); + expblur->setEnabled(pp->locallab.spots.at(index).expblur); + radius->setValue(pp->locallab.spots.at(index).radius); + strength->setValue(pp->locallab.spots.at(index).strength); + sensibn->setValue(pp->locallab.spots.at(index).sensibn); - if (pp->locallab.blurMethod.at(index) == "norm") { + if (pp->locallab.spots.at(index).blurMethod == "norm") { blurMethod->set_active(0); - } else if (pp->locallab.blurMethod.at(index) == "inv") { + } else if (pp->locallab.spots.at(index).blurMethod == "inv") { blurMethod->set_active(1); } else { blurMethod->set_active(2); } - activlum->set_active((bool)pp->locallab.activlum.at(index)); + activlum->set_active(pp->locallab.spots.at(index).activlum); // Tone Mapping - exptonemap->setEnabled((bool)pp->locallab.exptonemap.at(index)); - stren->setValue(pp->locallab.stren.at(index)); - gamma->setValue(pp->locallab.gamma.at(index)); - estop->setValue(pp->locallab.estop.at(index)); - scaltm->setValue(pp->locallab.scaltm.at(index)); - rewei->setValue(pp->locallab.rewei.at(index)); - sensitm->setValue(pp->locallab.sensitm.at(index)); + exptonemap->setEnabled(pp->locallab.spots.at(index).exptonemap); + stren->setValue(pp->locallab.spots.at(index).stren); + gamma->setValue(pp->locallab.spots.at(index).gamma); + estop->setValue(pp->locallab.spots.at(index).estop); + scaltm->setValue(pp->locallab.spots.at(index).scaltm); + rewei->setValue(pp->locallab.spots.at(index).rewei); + sensitm->setValue(pp->locallab.spots.at(index).sensitm); // Retinex - expreti->setEnabled((bool)pp->locallab.expreti.at(index)); + expreti->setEnabled(pp->locallab.spots.at(index).expreti); - if (pp->locallab.retinexMethod.at(index) == "low") { + if (pp->locallab.spots.at(index).retinexMethod == "low") { retinexMethod->set_active(0); - } else if (pp->locallab.retinexMethod.at(index) == "uni") { + } else if (pp->locallab.spots.at(index).retinexMethod == "uni") { retinexMethod->set_active(1); } else { retinexMethod->set_active(2); } - str->setValue(pp->locallab.str.at(index)); - chrrt->setValue(pp->locallab.chrrt.at(index)); - neigh->setValue(pp->locallab.neigh.at(index)); - vart->setValue(pp->locallab.vart.at(index)); - sensih->setValue(pp->locallab.sensih.at(index)); - cTgainshape->setCurve(pp->locallab.localTgaincurve.at(index)); - inversret->set_active((bool)pp->locallab.inversret.at(index)); + str->setValue(pp->locallab.spots.at(index).str); + chrrt->setValue(pp->locallab.spots.at(index).chrrt); + neigh->setValue(pp->locallab.spots.at(index).neigh); + vart->setValue(pp->locallab.spots.at(index).vart); + sensih->setValue(pp->locallab.spots.at(index).sensih); + cTgainshape->setCurve(pp->locallab.spots.at(index).localTgaincurve); + inversret->set_active(pp->locallab.spots.at(index).inversret); // Sharpening - expsharp->setEnabled((bool)pp->locallab.expsharp.at(index)); - sharradius->setValue(pp->locallab.sharradius.at(index)); - sharamount->setValue(pp->locallab.sharamount.at(index)); - shardamping->setValue(pp->locallab.shardamping.at(index)); - shariter->setValue(pp->locallab.shariter.at(index)); - sensisha->setValue(pp->locallab.sensisha.at(index)); - inverssha->set_active((bool)pp->locallab.inverssha.at(index)); + expsharp->setEnabled(pp->locallab.spots.at(index).expsharp); + sharradius->setValue(pp->locallab.spots.at(index).sharradius); + sharamount->setValue(pp->locallab.spots.at(index).sharamount); + shardamping->setValue(pp->locallab.spots.at(index).shardamping); + shariter->setValue(pp->locallab.spots.at(index).shariter); + sensisha->setValue(pp->locallab.spots.at(index).sensisha); + inverssha->set_active(pp->locallab.spots.at(index).inverssha); // Contrast by detail levels - expcbdl->setEnabled((bool)pp->locallab.expcbdl.at(index)); + expcbdl->setEnabled(pp->locallab.spots.at(index).expcbdl); for (int i = 0; i < 5; i++) { - multiplier[i]->setValue(pp->locallab.mult[i].at(index)); + multiplier[i]->setValue(pp->locallab.spots.at(index).mult[i]); } - chromacbdl->setValue(pp->locallab.chromacbdl.at(index)); - threshold->setValue(pp->locallab.threshold.at(index)); - sensicb->setValue(pp->locallab.sensicb.at(index)); + chromacbdl->setValue(pp->locallab.spots.at(index).chromacbdl); + threshold->setValue(pp->locallab.spots.at(index).threshold); + sensicb->setValue(pp->locallab.spots.at(index).sensicb); // Denoise - expdenoi->setEnabled((bool)pp->locallab.expdenoi.at(index)); - noiselumf->setValue(pp->locallab.noiselumf.at(index)); - noiselumc->setValue(pp->locallab.noiselumc.at(index)); - noiselumdetail->setValue(pp->locallab.noiselumdetail.at(index)); - noiselequal->setValue(pp->locallab.noiselequal.at(index)); - noisechrof->setValue(pp->locallab.noisechrof.at(index)); - noisechroc->setValue(pp->locallab.noisechroc.at(index)); - noisechrodetail->setValue(pp->locallab.noisechrodetail.at(index)); - adjblur->setValue(pp->locallab.adjblur.at(index)); - bilateral->setValue(pp->locallab.bilateral.at(index)); - sensiden->setValue(pp->locallab.sensiden.at(index)); + expdenoi->setEnabled(pp->locallab.spots.at(index).expdenoi); + noiselumf->setValue(pp->locallab.spots.at(index).noiselumf); + noiselumc->setValue(pp->locallab.spots.at(index).noiselumc); + noiselumdetail->setValue(pp->locallab.spots.at(index).noiselumdetail); + noiselequal->setValue(pp->locallab.spots.at(index).noiselequal); + noisechrof->setValue(pp->locallab.spots.at(index).noisechrof); + noisechroc->setValue(pp->locallab.spots.at(index).noisechroc); + noisechrodetail->setValue(pp->locallab.spots.at(index).noisechrodetail); + adjblur->setValue(pp->locallab.spots.at(index).adjblur); + bilateral->setValue(pp->locallab.spots.at(index).bilateral); + sensiden->setValue(pp->locallab.spots.at(index).sensiden); // Others - avoid->set_active((bool)pp->locallab.avoid.at(index)); + avoid->set_active(pp->locallab.spots.at(index).avoid); } } diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index a9e743e52..869725f14 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1003,116 +1003,118 @@ void ParamsEdited::initFrom(const std::vector& locallab.enabled = locallab.enabled && p.locallab.enabled == other.locallab.enabled; locallab.nbspot = locallab.nbspot && p.locallab.nbspot == other.locallab.nbspot; locallab.selspot = locallab.selspot && p.locallab.selspot == other.locallab.selspot; + + const std::vector& otherSpots = other.locallab.spots; // Control spot settings - locallab.id = locallab.id && p.locallab.id == other.locallab.id; - locallab.name = locallab.name && p.locallab.name == other.locallab.name; - locallab.isvisible = locallab.isvisible && p.locallab.isvisible == other.locallab.isvisible; - locallab.shape = locallab.shape && p.locallab.shape == other.locallab.shape; - locallab.spotMethod = locallab.spotMethod && p.locallab.spotMethod == other.locallab.spotMethod; - locallab.sensiexclu = locallab.sensiexclu && p.locallab.sensiexclu == other.locallab.sensiexclu; - locallab.struc = locallab.struc && p.locallab.struc == other.locallab.struc; - locallab.shapeMethod = locallab.shapeMethod && p.locallab.shapeMethod == other.locallab.shapeMethod; - locallab.locX = locallab.locX && p.locallab.locX == other.locallab.locX; - locallab.locXL = locallab.locXL && p.locallab.locXL == other.locallab.locXL; - locallab.locY = locallab.locY && p.locallab.locY == other.locallab.locY; - locallab.locYT = locallab.locYT && p.locallab.locYT == other.locallab.locYT; - 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.qualityMethod = locallab.qualityMethod && p.locallab.qualityMethod == other.locallab.qualityMethod; - locallab.transit = locallab.transit && p.locallab.transit == other.locallab.transit; - locallab.thresh = locallab.thresh && p.locallab.thresh == other.locallab.thresh; - locallab.iter = locallab.iter && p.locallab.iter == other.locallab.iter; + locallab.id = locallab.id && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::id); + locallab.name = locallab.name && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::name); + locallab.isvisible = locallab.isvisible && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::isvisible); + locallab.shape = locallab.shape && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::shape); + locallab.spotMethod = locallab.spotMethod && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::spotMethod); + locallab.sensiexclu = locallab.sensiexclu && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::sensiexclu); + locallab.struc = locallab.struc && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::struc); + locallab.shapeMethod = locallab.shapeMethod && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::shapeMethod); + locallab.locX = locallab.locX && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::locX); + locallab.locXL = locallab.locXL && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::locXL); + locallab.locY = locallab.locY && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::locY); + locallab.locYT = locallab.locYT && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::locYT); + locallab.centerX = locallab.centerX && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::centerX); + locallab.centerY = locallab.centerY && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::centerY); + locallab.circrad = locallab.circrad && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::circrad); + locallab.qualityMethod = locallab.qualityMethod && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::qualityMethod); + locallab.transit = locallab.transit && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::transit); + locallab.thresh = locallab.thresh && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::thresh); + locallab.iter = locallab.iter && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::iter); // Color & Light - locallab.expcolor = locallab.expcolor && p.locallab.expcolor == other.locallab.expcolor; - locallab.curvactiv = locallab.curvactiv && p.locallab.curvactiv == other.locallab.curvactiv; - locallab.lightness = locallab.lightness && p.locallab.lightness == other.locallab.lightness; - locallab.contrast = locallab.contrast && p.locallab.contrast == other.locallab.contrast; - locallab.chroma = locallab.chroma && p.locallab.chroma == other.locallab.chroma; - locallab.sensi = locallab.sensi && p.locallab.sensi == other.locallab.sensi; - locallab.qualitycurveMethod = locallab.qualitycurveMethod && p.locallab.qualitycurveMethod == other.locallab.qualitycurveMethod; - locallab.llcurve = locallab.llcurve && p.locallab.llcurve == other.locallab.llcurve; - locallab.cccurve = locallab.cccurve && p.locallab.cccurve == other.locallab.cccurve; - locallab.LHcurve = locallab.LHcurve && p.locallab.LHcurve == other.locallab.LHcurve; - locallab.HHcurve = locallab.HHcurve && p.locallab.HHcurve == other.locallab.HHcurve; - locallab.invers = locallab.invers && p.locallab.invers == other.locallab.invers; + locallab.expcolor = locallab.expcolor && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::expcolor); + locallab.curvactiv = locallab.curvactiv && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::curvactiv); + locallab.lightness = locallab.lightness && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::lightness); + locallab.contrast = locallab.contrast && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::contrast); + locallab.chroma = locallab.chroma && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::chroma); + locallab.sensi = locallab.sensi && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::sensi); + locallab.qualitycurveMethod = locallab.qualitycurveMethod && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::qualitycurveMethod); + locallab.llcurve = locallab.llcurve && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::llcurve); + locallab.cccurve = locallab.cccurve && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::cccurve); + locallab.LHcurve = locallab.LHcurve && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::LHcurve); + locallab.HHcurve = locallab.HHcurve && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::HHcurve); + locallab.invers = locallab.invers && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::invers); // Exposure - locallab.expexpose = locallab.expexpose && p.locallab.expexpose == other.locallab.expexpose; - locallab.expcomp = locallab.expcomp && p.locallab.expcomp == other.locallab.expcomp; - locallab.hlcompr = locallab.hlcompr && p.locallab.hlcompr == other.locallab.hlcompr; - locallab.hlcomprthresh = locallab.hlcomprthresh && p.locallab.hlcomprthresh == other.locallab.hlcomprthresh; - locallab.black = locallab.black && p.locallab.black == other.locallab.black; - locallab.shcompr = locallab.shcompr && p.locallab.shcompr == other.locallab.shcompr; - locallab.warm = locallab.warm && p.locallab.warm == other.locallab.warm; - locallab.sensiex = locallab.sensiex && p.locallab.sensiex == other.locallab.sensiex; - locallab.excurve = locallab.excurve && p.locallab.excurve == other.locallab.excurve; + locallab.expexpose = locallab.expexpose && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::expexpose); + locallab.expcomp = locallab.expcomp && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::expcomp); + locallab.hlcompr = locallab.hlcompr && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::hlcompr); + locallab.hlcomprthresh = locallab.hlcomprthresh && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::hlcomprthresh); + locallab.black = locallab.black && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::black); + locallab.shcompr = locallab.shcompr && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::shcompr); + locallab.warm = locallab.warm && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::warm); + locallab.sensiex = locallab.sensiex && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::sensiex); + locallab.excurve = locallab.excurve && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::excurve); // Vibrance - locallab.expvibrance = locallab.expvibrance && p.locallab.expvibrance == other.locallab.expvibrance; - locallab.saturated = locallab.saturated && p.locallab.saturated == other.locallab.saturated; - locallab.pastels = locallab.pastels && p.locallab.pastels == other.locallab.pastels; - locallab.psthreshold = locallab.psthreshold && p.locallab.psthreshold == other.locallab.psthreshold; - locallab.protectskins = locallab.protectskins && p.locallab.protectskins == other.locallab.protectskins; - locallab.avoidcolorshift = locallab.avoidcolorshift && p.locallab.avoidcolorshift == other.locallab.avoidcolorshift; - locallab.pastsattog = locallab.pastsattog && p.locallab.pastsattog == other.locallab.pastsattog; - locallab.sensiv = locallab.sensiv && p.locallab.sensiv == other.locallab.sensiv; - locallab.skintonescurve = locallab.skintonescurve && p.locallab.skintonescurve == other.locallab.skintonescurve; + locallab.expvibrance = locallab.expvibrance && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::expvibrance); + locallab.saturated = locallab.saturated && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::saturated); + locallab.pastels = locallab.pastels && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::pastels); + locallab.psthreshold = locallab.psthreshold && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::psthreshold); + locallab.protectskins = locallab.protectskins && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::protectskins); + locallab.avoidcolorshift = locallab.avoidcolorshift && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::avoidcolorshift); + locallab.pastsattog = locallab.pastsattog && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::pastsattog); + locallab.sensiv = locallab.sensiv && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::sensiv); + locallab.skintonescurve = locallab.skintonescurve && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::skintonescurve); // Blur & Noise - locallab.expblur = locallab.expblur && p.locallab.expblur == other.locallab.expblur; - locallab.radius = locallab.radius && p.locallab.radius == other.locallab.radius; - locallab.strength = locallab.strength && p.locallab.strength == other.locallab.strength; - locallab.sensibn = locallab.sensibn && p.locallab.sensibn == other.locallab.sensibn; - locallab.blurMethod = locallab.blurMethod && p.locallab.blurMethod == other.locallab.blurMethod; - locallab.activlum = locallab.activlum && p.locallab.activlum == other.locallab.activlum; + locallab.expblur = locallab.expblur && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::expblur); + locallab.radius = locallab.radius && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::radius); + locallab.strength = locallab.strength && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::strength); + locallab.sensibn = locallab.sensibn && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::sensibn); + locallab.blurMethod = locallab.blurMethod && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::blurMethod); + locallab.activlum = locallab.activlum && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::activlum); // Tone Mapping - locallab.exptonemap = locallab.exptonemap && p.locallab.exptonemap == other.locallab.exptonemap; - locallab.stren = locallab.stren && p.locallab.stren == other.locallab.stren; - locallab.gamma = locallab.gamma && p.locallab.gamma == other.locallab.gamma; - locallab.estop = locallab.estop && p.locallab.estop == other.locallab.estop; - locallab.scaltm = locallab.scaltm && p.locallab.scaltm == other.locallab.scaltm; - locallab.rewei = locallab.rewei && p.locallab.rewei == other.locallab.rewei; - locallab.sensitm = locallab.sensitm && p.locallab.sensitm == other.locallab.sensitm; + locallab.exptonemap = locallab.exptonemap && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::exptonemap); + locallab.stren = locallab.stren && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::stren); + locallab.gamma = locallab.gamma && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::gamma); + locallab.estop = locallab.estop && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::estop); + locallab.scaltm = locallab.scaltm && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::scaltm); + locallab.rewei = locallab.rewei && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::rewei); + locallab.sensitm = locallab.sensitm && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::sensitm); // Retinex - locallab.expreti = locallab.expreti && p.locallab.expreti == other.locallab.expreti; - locallab.retinexMethod = locallab.retinexMethod && p.locallab.retinexMethod == other.locallab.retinexMethod; - locallab.str = locallab.str && p.locallab.str == other.locallab.str; - locallab.chrrt = locallab.chrrt && p.locallab.chrrt == other.locallab.chrrt; - locallab.neigh = locallab.neigh && p.locallab.neigh == other.locallab.neigh; - locallab.vart = locallab.vart && p.locallab.vart == other.locallab.vart; - locallab.sensih = locallab.sensih && p.locallab.sensih == other.locallab.sensih; - locallab.localTgaincurve = locallab.localTgaincurve && p.locallab.localTgaincurve == other.locallab.localTgaincurve; - locallab.inversret = locallab.inversret && p.locallab.inversret == other.locallab.inversret; + locallab.expreti = locallab.expreti && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::expreti); + locallab.retinexMethod = locallab.retinexMethod && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::retinexMethod); + locallab.str = locallab.str && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::str); + locallab.chrrt = locallab.chrrt && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::chrrt); + locallab.neigh = locallab.neigh && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::neigh); + locallab.vart = locallab.vart && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::vart); + locallab.sensih = locallab.sensih && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::sensih); + locallab.localTgaincurve = locallab.localTgaincurve && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::localTgaincurve); + locallab.inversret = locallab.inversret && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::inversret); // Sharpening - locallab.expsharp = locallab.expsharp && p.locallab.expsharp == other.locallab.expsharp; - locallab.sharradius = locallab.sharradius && p.locallab.sharradius == other.locallab.sharradius; - locallab.sharamount = locallab.sharamount && p.locallab.sharamount == other.locallab.sharamount; - locallab.shardamping = locallab.shardamping && p.locallab.shardamping == other.locallab.shardamping; - locallab.shariter = locallab.shariter && p.locallab.shariter == other.locallab.shariter; - locallab.sensisha = locallab.sensisha && p.locallab.sensisha == other.locallab.sensisha; - locallab.inverssha = locallab.inverssha && p.locallab.inverssha == other.locallab.inverssha; + locallab.expsharp = locallab.expsharp && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::expsharp); + locallab.sharradius = locallab.sharradius && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::sharradius); + locallab.sharamount = locallab.sharamount && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::sharamount); + locallab.shardamping = locallab.shardamping && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::shardamping); + locallab.shariter = locallab.shariter && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::shariter); + locallab.sensisha = locallab.sensisha && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::sensisha); + locallab.inverssha = locallab.inverssha && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::inverssha); // Contrast by detail levels - locallab.expcbdl = locallab.expcbdl && p.locallab.expcbdl == other.locallab.expcbdl; + locallab.expcbdl = locallab.expcbdl && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::expcbdl); for (int i = 0; i < 5; i++) { - locallab.mult[i] = locallab.mult[i] && p.locallab.mult[i] == other.locallab.mult[i]; + locallab.mult[i] = locallab.mult[i] && p.locallab.compareSpotsByElemArray(otherSpots, &LocallabParams::LocallabSpot::mult, i); } - locallab.chromacbdl = locallab.chromacbdl && p.locallab.chromacbdl == other.locallab.chromacbdl; - locallab.threshold = locallab.threshold && p.locallab.threshold == other.locallab.threshold; - locallab.sensicb = locallab.sensicb && p.locallab.sensicb == other.locallab.sensicb; + locallab.chromacbdl = locallab.chromacbdl && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::chromacbdl); + locallab.threshold = locallab.threshold && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::threshold); + locallab.sensicb = locallab.sensicb && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::sensicb); // Denoise - locallab.expdenoi = locallab.expdenoi && p.locallab.expdenoi == other.locallab.expdenoi; - locallab.noiselumf = locallab.noiselumf && p.locallab.noiselumf == other.locallab.noiselumf; - locallab.noiselumc = locallab.noiselumc && p.locallab.noiselumc == other.locallab.noiselumc; - locallab.noiselumdetail = locallab.noiselumdetail && p.locallab.noiselumdetail == other.locallab.noiselumdetail; - locallab.noiselequal = locallab.noiselequal && p.locallab.noiselequal == other.locallab.noiselequal; - locallab.noisechrof = locallab.noisechrof && p.locallab.noisechrof == other.locallab.noisechrof; - locallab.noisechroc = locallab.noisechroc && p.locallab.noisechroc == other.locallab.noisechroc; - locallab.noisechrodetail = locallab.noisechrodetail && p.locallab.noisechrodetail == other.locallab.noisechrodetail; - locallab.adjblur = locallab.adjblur && p.locallab.adjblur == other.locallab.adjblur; - locallab.bilateral = locallab.bilateral && p.locallab.bilateral == other.locallab.bilateral; - locallab.sensiden = locallab.sensiden && p.locallab.sensiden == other.locallab.sensiden; + locallab.expdenoi = locallab.expdenoi && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::expdenoi); + locallab.noiselumf = locallab.noiselumf && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::noiselumf); + locallab.noiselumc = locallab.noiselumc && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::noiselumc); + locallab.noiselumdetail = locallab.noiselumdetail && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::noiselumdetail); + locallab.noiselequal = locallab.noiselequal && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::noiselequal); + locallab.noisechrof = locallab.noisechrof && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::noisechrof); + locallab.noisechroc = locallab.noisechroc && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::noisechroc); + locallab.noisechrodetail = locallab.noisechrodetail && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::noisechrodetail); + locallab.adjblur = locallab.adjblur && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::adjblur); + locallab.bilateral = locallab.bilateral && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::bilateral); + locallab.sensiden = locallab.sensiden && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::sensiden); // Others - locallab.avoid = locallab.avoid && p.locallab.avoid == other.locallab.avoid; + locallab.avoid = locallab.avoid && p.locallab.compareSpotsByElem(otherSpots, &LocallabParams::LocallabSpot::avoid); pcvignette.enabled = pcvignette.enabled && p.pcvignette.enabled == other.pcvignette.enabled; pcvignette.strength = pcvignette.strength && p.pcvignette.strength == other.pcvignette.strength; @@ -2477,403 +2479,406 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng if (locallab.nbspot) { toEdit.locallab.nbspot = mods.locallab.nbspot; + toEdit.locallab.spots.resize(toEdit.locallab.nbspot); } if (locallab.selspot) { toEdit.locallab.selspot = mods.locallab.selspot; } + const std::vector& modsSpots = mods.locallab.spots; + // Control spot settings if (locallab.id) { - toEdit.locallab.id = mods.locallab.id; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::id); } if (locallab.name) { - toEdit.locallab.name = mods.locallab.name; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::name); } if (locallab.isvisible) { - toEdit.locallab.isvisible = mods.locallab.isvisible; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::isvisible); } if (locallab.shape) { - toEdit.locallab.shape = mods.locallab.shape; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::shape); } if (locallab.spotMethod) { - toEdit.locallab.spotMethod = mods.locallab.spotMethod; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::spotMethod); } if (locallab.sensiexclu) { - toEdit.locallab.sensiexclu = mods.locallab.sensiexclu; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::sensiexclu); } if (locallab.struc) { - toEdit.locallab.struc = mods.locallab.struc; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::struc); } if (locallab.shapeMethod) { - toEdit.locallab.shapeMethod = mods.locallab.shapeMethod; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::shapeMethod); } if (locallab.locX) { - toEdit.locallab.locX = mods.locallab.locX; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::locX); } if (locallab.locXL) { - toEdit.locallab.locXL = mods.locallab.locXL; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::locXL); } if (locallab.locY) { - toEdit.locallab.locY = mods.locallab.locY; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::locY); } if (locallab.locYT) { - toEdit.locallab.locYT = mods.locallab.locYT; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::locYT); } if (locallab.centerX) { - toEdit.locallab.centerX = mods.locallab.centerX; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::centerX); } if (locallab.centerY) { - toEdit.locallab.centerY = mods.locallab.centerY; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::centerY); } if (locallab.circrad) { - toEdit.locallab.circrad = mods.locallab.circrad; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::circrad); } if (locallab.qualityMethod) { - toEdit.locallab.qualityMethod = mods.locallab.qualityMethod; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::qualityMethod); } if (locallab.transit) { - toEdit.locallab.transit = mods.locallab.transit; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::transit); } if (locallab.thresh) { - toEdit.locallab.thresh = mods.locallab.thresh; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::thresh); } if (locallab.iter) { - toEdit.locallab.iter = mods.locallab.iter; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::iter); } // Color & Light if (locallab.expcolor) { - toEdit.locallab.expcolor = mods.locallab.expcolor; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::expcolor); } if (locallab.curvactiv) { - toEdit.locallab.curvactiv = mods.locallab.curvactiv; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::curvactiv); } if (locallab.lightness) { - toEdit.locallab.lightness = mods.locallab.lightness; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::lightness); } if (locallab.contrast) { - toEdit.locallab.contrast = mods.locallab.contrast; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::contrast); } if (locallab.chroma) { - toEdit.locallab.chroma = mods.locallab.chroma; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::chroma); } if (locallab.sensi) { - toEdit.locallab.sensi = mods.locallab.sensi; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::sensi); } if (locallab.qualitycurveMethod) { - toEdit.locallab.qualitycurveMethod = mods.locallab.qualitycurveMethod; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::qualitycurveMethod); } if (locallab.llcurve) { - toEdit.locallab.llcurve = mods.locallab.llcurve; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::llcurve); } if (locallab.cccurve) { - toEdit.locallab.cccurve = mods.locallab.cccurve; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::cccurve); } if (locallab.LHcurve) { - toEdit.locallab.LHcurve = mods.locallab.LHcurve; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::LHcurve); } if (locallab.HHcurve) { - toEdit.locallab.HHcurve = mods.locallab.HHcurve; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::HHcurve); } if (locallab.invers) { - toEdit.locallab.invers = mods.locallab.invers; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::invers); } // Exposure if (locallab.expexpose) { - toEdit.locallab.expexpose = mods.locallab.expexpose; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::expexpose); } if (locallab.expcomp) { - toEdit.locallab.expcomp = mods.locallab.expcomp; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::expcomp); } if (locallab.hlcompr) { - toEdit.locallab.hlcompr = mods.locallab.hlcompr; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::hlcompr); } if (locallab.hlcomprthresh) { - toEdit.locallab.hlcomprthresh = mods.locallab.hlcomprthresh; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::hlcomprthresh); } if (locallab.black) { - toEdit.locallab.black = mods.locallab.black; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::black); } if (locallab.shcompr) { - toEdit.locallab.shcompr = mods.locallab.shcompr; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::shcompr); } if (locallab.warm) { - toEdit.locallab.warm = mods.locallab.warm; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::warm); } if (locallab.sensiex) { - toEdit.locallab.sensiex = mods.locallab.sensiex; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::sensiex); } if (locallab.excurve) { - toEdit.locallab.excurve = mods.locallab.excurve; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::excurve); } // Vibrance if (locallab.expvibrance) { - toEdit.locallab.expvibrance = mods.locallab.expvibrance; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::expvibrance); } if (locallab.saturated) { - toEdit.locallab.saturated = mods.locallab.saturated; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::saturated); } if (locallab.pastels) { - toEdit.locallab.pastels = mods.locallab.pastels; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::pastels); } if (locallab.psthreshold) { - toEdit.locallab.psthreshold = mods.locallab.psthreshold; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::psthreshold); } if (locallab.protectskins) { - toEdit.locallab.protectskins = mods.locallab.protectskins; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::protectskins); } if (locallab.avoidcolorshift) { - toEdit.locallab.avoidcolorshift = mods.locallab.avoidcolorshift; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::avoidcolorshift); } if (locallab.pastsattog) { - toEdit.locallab.pastsattog = mods.locallab.pastsattog; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::pastsattog); } if (locallab.sensiv) { - toEdit.locallab.sensiv = mods.locallab.sensiv; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::sensiv); } if (locallab.skintonescurve) { - toEdit.locallab.skintonescurve = mods.locallab.skintonescurve; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::skintonescurve); } // Blur & Noise if (locallab.expblur) { - toEdit.locallab.expblur = mods.locallab.expblur; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::expblur); } if (locallab.radius) { - toEdit.locallab.radius = mods.locallab.radius; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::radius); } if (locallab.strength) { - toEdit.locallab.strength = mods.locallab.strength; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::strength); } if (locallab.sensibn) { - toEdit.locallab.sensibn = mods.locallab.sensibn; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::sensibn); } if (locallab.blurMethod) { - toEdit.locallab.blurMethod = mods.locallab.blurMethod; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::blurMethod); } if (locallab.activlum) { - toEdit.locallab.activlum = mods.locallab.activlum; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::activlum); } // Tone Mapping if (locallab.exptonemap) { - toEdit.locallab.exptonemap = mods.locallab.exptonemap; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::exptonemap); } if (locallab.stren) { - toEdit.locallab.stren = mods.locallab.stren; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::stren); } if (locallab.gamma) { - toEdit.locallab.gamma = mods.locallab.gamma; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::gamma); } if (locallab.estop) { - toEdit.locallab.estop = mods.locallab.estop; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::estop); } if (locallab.scaltm) { - toEdit.locallab.scaltm = mods.locallab.scaltm; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::scaltm); } if (locallab.rewei) { - toEdit.locallab.rewei = mods.locallab.rewei; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::rewei); } if (locallab.sensitm) { - toEdit.locallab.sensitm = mods.locallab.sensitm; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::sensitm); } // Retinex if (locallab.expreti) { - toEdit.locallab.expreti = mods.locallab.expreti; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::expreti); } if (locallab.retinexMethod) { - toEdit.locallab.retinexMethod = mods.locallab.retinexMethod; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::retinexMethod); } if (locallab.str) { - toEdit.locallab.str = mods.locallab.str; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::str); } if (locallab.chrrt) { - toEdit.locallab.chrrt = mods.locallab.chrrt; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::chrrt); } if (locallab.neigh) { - toEdit.locallab.neigh = mods.locallab.neigh; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::neigh); } if (locallab.vart) { - toEdit.locallab.vart = mods.locallab.vart; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::vart); } if (locallab.sensih) { - toEdit.locallab.sensih = mods.locallab.sensih; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::sensih); } if (locallab.localTgaincurve) { - toEdit.locallab.localTgaincurve = mods.locallab.localTgaincurve; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::localTgaincurve); } if (locallab.inversret) { - toEdit.locallab.inversret = mods.locallab.inversret; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::inversret); } // Sharpening if (locallab.expsharp) { - toEdit.locallab.expsharp = mods.locallab.expsharp; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::expsharp); } if (locallab.sharradius) { - toEdit.locallab.sharradius = mods.locallab.sharradius; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::sharradius); } if (locallab.sharamount) { - toEdit.locallab.sharamount = mods.locallab.sharamount; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::sharamount); } if (locallab.shardamping) { - toEdit.locallab.shardamping = mods.locallab.shardamping; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::shardamping); } if (locallab.shariter) { - toEdit.locallab.shariter = mods.locallab.shariter; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::shariter); } if (locallab.sensisha) { - toEdit.locallab.sensisha = mods.locallab.sensisha; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::sensisha); } if (locallab.inverssha) { - toEdit.locallab.inverssha = mods.locallab.inverssha; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::inverssha); } // Contrast by detail levels if (locallab.expcbdl) { - toEdit.locallab.expcbdl = mods.locallab.expcbdl; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::expcbdl); } for (int i = 0; i < 5; i++) { if (locallab.mult[i]) { - toEdit.locallab.mult[i] = mods.locallab.mult[i]; + toEdit.locallab.setSpotsByElemArray(modsSpots, &LocallabParams::LocallabSpot::mult, i); } } if (locallab.chromacbdl) { - toEdit.locallab.chromacbdl = mods.locallab.chromacbdl; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::chromacbdl); } if (locallab.threshold) { - toEdit.locallab.threshold = mods.locallab.threshold; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::threshold); } if (locallab.sensicb) { - toEdit.locallab.sensicb = mods.locallab.sensicb; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::sensicb); } // Denoise if (locallab.expdenoi) { - toEdit.locallab.expdenoi = mods.locallab.expdenoi; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::expdenoi); } if (locallab.noiselumf) { - toEdit.locallab.noiselumf = mods.locallab.noiselumf; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::noiselumf); } if (locallab.noiselumc) { - toEdit.locallab.noiselumc = mods.locallab.noiselumc; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::noiselumc); } if (locallab.noiselumdetail) { - toEdit.locallab.noiselumdetail = mods.locallab.noiselumdetail; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::noiselumdetail); } if (locallab.noiselequal) { - toEdit.locallab.noiselequal = mods.locallab.noiselequal; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::noiselequal); } if (locallab.noisechrof) { - toEdit.locallab.noisechrof = mods.locallab.noisechrof; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::noisechrof); } if (locallab.noisechroc) { - toEdit.locallab.noisechroc = mods.locallab.noisechroc; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::noisechroc); } if (locallab.noisechrodetail) { - toEdit.locallab.noisechrodetail = mods.locallab.noisechrodetail; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::noisechrodetail); } if (locallab.adjblur) { - toEdit.locallab.adjblur = mods.locallab.adjblur; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::adjblur); } if (locallab.bilateral) { - toEdit.locallab.bilateral = mods.locallab.bilateral; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::bilateral); } if (locallab.sensiden) { - toEdit.locallab.sensiden = mods.locallab.sensiden; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::sensiden); } // Others if (locallab.avoid) { - toEdit.locallab.avoid = mods.locallab.avoid; + toEdit.locallab.setSpotsByElem(modsSpots, &LocallabParams::LocallabSpot::avoid); } @@ -3743,7 +3748,7 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng if (softlight.strength) { toEdit.softlight.strength = dontforceSet && options.baBehav[ADDSET_SOFTLIGHT_STRENGTH] ? toEdit.softlight.strength + mods.softlight.strength : mods.softlight.strength; } - + if (metadata.mode) { toEdit.metadata.mode = mods.metadata.mode; }