diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index ba65c20f6..ad2723c8b 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -1033,23 +1033,12 @@ void Crop::update (int todo) CurveFactory::curveLocal (locallutili, params.locallab.llcurve, lllocalcurve2, sca); localcutili = false; CurveFactory::curveCCLocal (localcutili, params.locallab.cccurve, cclocalcurve2, sca); - /* - params.locallab.hueref = (parent->huerefs[sp]) / 100.f; - params.locallab.chromaref = parent->chromarefs[sp]; - params.locallab.lumaref = parent->lumarefs[sp]; - */ - double huere, chromare, lumare; - // params.locallab.hueref = parent->huer; - // params.locallab.chromaref = parent->chromar; - // params.locallab.lumaref = parent->lumar; - // printf("dcr1 sp=%i huer=%f \n", sp,parent->huerefs[sp] / 100.f ); - parent->ipf.calc_ref (1, sp, (float**)shbuffer, labnCrop, labnCrop, trafx / skip, trafy / skip, cropx / skip, cropy / skip, skips (parent->fw, skip), skips (parent->fh, skip), parent->fw, parent->fh, locutili, skip, locRETgainCurve, locallutili, lllocalcurve2, loclhCurve, cclocalcurve2, huere, chromare, lumare); + params.locallab.hueref = (parent->huerefs[sp]) / 100.f; + params.locallab.chromaref = parent->chromarefs[sp]; + params.locallab.lumaref = parent->lumarefs[sp]; - - params.locallab.hueref = huere ; //parent->huer; - params.locallab.chromaref = chromare; //parent->chromar; - params.locallab.lumaref = lumare; //parent->lumar; + //printf ("dcr1 sp=%i huer=%f \n", sp, parent->huerefs[sp] / 100.f ); parent->ipf.Lab_Local (1, sp, (float**)shbuffer, labnCrop, labnCrop, trafx / skip, trafy / skip, cropx / skip, cropy / skip, skips (parent->fw, skip), skips (parent->fh, skip), parent->fw, parent->fh, locutili, skip, locRETgainCurve, locallutili, lllocalcurve2, loclhCurve, cclocalcurve2, params.locallab.hueref, params.locallab.chromaref, params.locallab.lumaref); lllocalcurve2.clear(); @@ -1283,19 +1272,10 @@ void Crop::update (int todo) CurveFactory::curveCCLocal (localcutili, params.locallab.cccurve, cclocalcurve2, sca); // skip == 1 ? 1 : 16); - // params.locallab.hueref = (parent->huerefs[sp]) / 100.f; - // params.locallab.chromaref = parent->chromarefs[sp]; - // params.locallab.lumaref = parent->lumarefs[sp]; - // printf("dcr2 sp=%i huer=%f \n", sp, parent->huerefs[sp] / 100.f); - - double huere, chromare, lumare; - parent->ipf.calc_ref (1, sp, (float**)shbuffer, labnCrop, labnCrop, trafx / skip, trafy / skip, cropx / skip, cropy / skip, skips (parent->fw, skip), skips (parent->fh, skip), parent->fw, parent->fh, locutili, skip, locRETgainCurve, locallutili, lllocalcurve2, loclhCurve, cclocalcurve2, huere, chromare, lumare); - - - params.locallab.hueref = huere; //parent->huer; - params.locallab.chromaref = chromare;//parent->chromar; - params.locallab.lumaref = lumare;//parent->lumar; - + params.locallab.hueref = (parent->huerefs[sp]) / 100.f; + params.locallab.chromaref = parent->chromarefs[sp]; + params.locallab.lumaref = parent->lumarefs[sp]; + // printf ("dcr2 sp=%i huer=%f \n", sp, parent->huerefs[sp] / 100.f); parent->ipf.Lab_Local (1, sp, (float**)shbuffer, labnCrop, labnCrop, trafx / skip, trafy / skip, cropx / skip, cropy / skip, skips (parent->fw, skip), skips (parent->fh, skip), parent->fw, parent->fh, locutili, skip, locRETgainCurve, locallutili, lllocalcurve2, loclhCurve, cclocalcurve2, params.locallab.hueref, params.locallab.chromaref, params.locallab.lumaref); lllocalcurve2.clear(); diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index b07de5171..f63b2967b 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -44,15 +44,6 @@ ImProcCoordinator::ImProcCoordinator () softProof (false), gamutCheck (false), scale (10), highDetailPreprocessComputed (false), highDetailRawComputed (false), allocated (false), bwAutoR (-9000.f), bwAutoG (-9000.f), bwAutoB (-9000.f), CAMMean (NAN), coordX (0), coordY (0), localX (0), localY (0), dataspot (nullptr), retistr (nullptr), retistrsav (nullptr), llstr (nullptr), lhstr (nullptr), ccstr (nullptr), - /* - ======= - : orig_prev(nullptr), oprevi(nullptr), oprevl(nullptr), nprevl(nullptr), previmg(nullptr), workimg(nullptr), - ncie(nullptr), imgsrc(nullptr), shmap(nullptr), lastAwbEqual(0.), lastAwbTempBias(0.0), ipf(¶ms, true), monitorIntent(RI_RELATIVE), - softProof(false), gamutCheck(false), scale(10), highDetailPreprocessComputed(false), highDetailRawComputed(false), - allocated(false), bwAutoR(-9000.f), bwAutoG(-9000.f), bwAutoB(-9000.f), CAMMean(NAN), - - >>>>>>> dev - */ ctColorCurve(), // localcurve(65536, 0), hltonecurve (65536), @@ -1238,7 +1229,10 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) lhstr[0] = lh_str + "@"; //end local L = f(H) - + //spot references + dataspot[58][0] = huerefs[0] = 100.f * params.locallab.hueref; + dataspot[59][0] = chromarefs[0] = params.locallab.chromaref; + dataspot[60][0] = lumarefs[0] = params.locallab.lumaref; @@ -1765,10 +1759,10 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) for (int sp = 1; sp < maxspot; sp++) { //spots default - params.locallab.hueref = INFINITY; - params.locallab.chromaref = INFINITY; + params.locallab.hueref = dataspot[58][sp] / 100.; + params.locallab.chromaref = dataspot[59][sp]; bool locutili = locutili; - params.locallab.lumaref = INFINITY; + params.locallab.lumaref = dataspot[60][sp]; params.locallab.circrad = circrads[sp] = dataspot[2][sp]; params.locallab.locX = locx[sp] = dataspot[3][sp]; params.locallab.locY = locy[sp] = dataspot[4][sp]; @@ -2018,13 +2012,11 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) params.locallab.hueref = huer; params.locallab.chromaref = chromar; params.locallab.lumaref = lumar; - ipf.Lab_Local (3, sp, (float**)shbuffer, nprevl, nprevl, 0, 0, 0, 0, pW, pH, fw, fh, locutili, scale, locRETgainCurve, locallutili, lllocalcurve, loclhCurve, cclocalcurve, params.locallab.hueref, params.locallab.chromaref, params.locallab.lumaref); dataspot[58][sp] = huerefs[sp] = 100.f * params.locallab.hueref; dataspot[59][sp] = chromarefs[sp] = params.locallab.chromaref; dataspot[60][sp] = lumarefs[sp] = params.locallab.lumaref; - nextParams.locallab.hueref = params.locallab.hueref; - nextParams.locallab.chromaref = params.locallab.chromaref; - nextParams.locallab.lumaref = params.locallab.lumaref; + + ipf.Lab_Local (3, sp, (float**)shbuffer, nprevl, nprevl, 0, 0, 0, 0, pW, pH, fw, fh, locutili, scale, locRETgainCurve, locallutili, lllocalcurve, loclhCurve, cclocalcurve, params.locallab.hueref, params.locallab.chromaref, params.locallab.lumaref); lllocalcurve.clear(); cclocalcurve.clear(); @@ -2322,28 +2314,16 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) CurveFactory::curveLocal (locallutili, params.locallab.llcurve, lllocalcurve, sca); //scale == 1 ? 1 : 16); CurveFactory::curveCCLocal (localcutili, params.locallab.cccurve, cclocalcurve, sca); //scale == 1 ? 1 : 16); - double huere, chromare, lumare; - ipf.calc_ref (3, sp, (float**)shbuffer, nprevl, nprevl, 0, 0, 0, 0, pW, pH, fw, fh, locutili, scale, locRETgainCurve, locallutili, lllocalcurve, loclhCurve, cclocalcurve, huere, chromare, lumare); - huer = huere; - chromar = chromare; - lumar = lumare ; - params.locallab.hueref = huer; - params.locallab.chromaref = chromar; - params.locallab.lumaref = lumar; - - ipf.Lab_Local (3, sp, (float**)shbuffer, nprevl, nprevl, 0, 0, 0, 0, pW, pH, fw, fh, locutili, scale, locRETgainCurve, locallutili, lllocalcurve, loclhCurve, cclocalcurve, params.locallab.hueref, params.locallab.chromaref, params.locallab.lumaref ); + params.locallab.hueref = huerefs[0] / 100.; dataspot[58][sp] = huerefs[sp] = 100.f * params.locallab.hueref; - dataspot[59][sp] = chromarefs[sp] = params.locallab.chromaref; - dataspot[60][sp] = lumarefs[sp] = params.locallab.lumaref; + dataspot[59][sp] = chromarefs[sp] = params.locallab.chromaref = chromarefs[0]; + dataspot[60][sp] = lumarefs[sp] = params.locallab.lumaref = lumarefs[0]; + + ipf.Lab_Local (3, sp, (float**)shbuffer, nprevl, nprevl, 0, 0, 0, 0, pW, pH, fw, fh, locutili, scale, locRETgainCurve, locallutili, lllocalcurve, loclhCurve, cclocalcurve, params.locallab.hueref, params.locallab.chromaref, params.locallab.lumaref ); lllocalcurve.clear(); cclocalcurve.clear(); - nextParams.locallab.hueref = params.locallab.hueref; - nextParams.locallab.chromaref = params.locallab.chromaref; - nextParams.locallab.lumaref = params.locallab.lumaref; - - ofstream fou (datal, ios::out | ios::trunc); if (fou) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 283730a58..0ec2e035a 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -3594,13 +3594,12 @@ void ImProcFunctions::InverseColorLight_Local (const struct local_params & lp, L void ImProcFunctions::calc_ref (int call, int sp, float** shbuffer, LabImage * original, LabImage * transformed, int sx, int sy, int cx, int cy, int oW, int oH, int fw, int fh, bool locutili, int sk, const LocretigainCurve & locRETgainCcurve, bool locallutili, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, LUTf & cclocalcurve, double & hueref, double & chromaref, double & lumaref) { if (params->locallab.enabled) { - //always calculate hueref, chromaref, lumaref before others operations + //always calculate hueref, chromaref, lumaref before others operations use in normal mode for all modules exceprt denoise int GW = transformed->W; int GH = transformed->H; struct local_params lp; calcLocalParams (oW, oH, params->locallab, lp); -//begin contrast and evalue hue // double precision for large summations double ave = 0.; double aveA = 0.; @@ -3685,22 +3684,6 @@ void ImProcFunctions::Lab_Local (int call, int sp, float** shbuffer, LabImage * double ave = 0.; int n = 0; float av; - /* - //begin contrast and evalue hue - // double precision for large summations - double ave = 0.; - /* double aveA = 0.; - double aveB = 0.; - double aveL = 0.; - double aveChro = 0.; - // int precision for the counters - int n = 0; - int nab = 0; - // single precision for the result - float av, avA, avB, avL; - */ -//evauate mean luminance for contrast : actually one area -// evaluate also hue int levred; bool noiscfactiv = false; @@ -3712,42 +3695,6 @@ void ImProcFunctions::Lab_Local (int call, int sp, float** shbuffer, LabImage * noiscfactiv = false; } - /* - int spotSize = 0.88623f * max (1, lp.cir / sk); //18 - //O.88623 = sqrt(PI / 4) ==> sqare equal to circle - - // very small region, don't use omp here - for (int y = max (cy, (int) (lp.yc - spotSize)); y < min (transformed->H + cy, (int) (lp.yc + spotSize + 1)); y++) { - for (int x = max (cx, (int) (lp.xc - spotSize)); x < min (transformed->W + cx, (int) (lp.xc + spotSize + 1)); x++) { - aveL += original->L[y - cy][x - cx]; - aveA += original->a[y - cy][x - cx]; - aveB += original->b[y - cy][x - cx]; - aveChro += sqrtf (SQR (original->b[y - cy][x - cx]) + SQR (original->a[y - cy][x - cx])); - - nab++; - } - } - */ - /* - if ((!lp.inv && !lp.invret) && hueref == INFINITY && chromaref == INFINITY && lumaref == INFINITY) { - //evaluate hue, chroma, luma in center spot - int spotSize = 0.88623f * max (1, lp.cir / sk); //18 - //O.88623 = sqrt(PI / 4) ==> sqare equal to circle - - // very small region, don't use omp here - for (int y = max (cy, (int) (lp.yc - spotSize)); y < min (transformed->H + cy, (int) (lp.yc + spotSize + 1)); y++) { - for (int x = max (cx, (int) (lp.xc - spotSize)); x < min (transformed->W + cx, (int) (lp.xc + spotSize + 1)); x++) { - aveL += original->L[y - cy][x - cx]; - aveA += original->a[y - cy][x - cx]; - aveB += original->b[y - cy][x - cx]; - aveChro += sqrtf (SQR (original->b[y - cy][x - cx]) + SQR (original->a[y - cy][x - cx])); - - nab++; - } - } - - } else - */ if (lp.inv || lp.invret) { //exterior || lp.curvact ave = 0.f; n = 0; @@ -3778,33 +3725,6 @@ void ImProcFunctions::Lab_Local (int call, int sp, float** shbuffer, LabImage * av = ave / 327.68f; } - /* - aveL = aveL / nab; - aveA = aveA / nab; - aveB = aveB / nab; - aveChro = aveChro / nab; - aveChro /= 327.68f; - avA = aveA / 327.68f; - avB = aveB / 327.68f; - avL = aveL / 327.68f; - hueref = xatan2f (avB, avA); //mean hue - chromaref = aveChro; - lumaref = avL; - */ -//INFINITY to solve crop problem when Ref is outside preview - /* - if (hueref == INFINITY) { - hueref = xatan2f (avB, avA); //mean hue - } - - if (chromaref == INFINITY) { - chromaref = aveChro; - } - - if (lumaref == INFINITY) { - lumaref = avL; - } - */ // printf ("call= %i sp=%i hueref=%f chromaref=%f lumaref=%f\n", call, sp, hueref, chromaref, lumaref); struct local_contra lco; diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 58bfb7f2a..7a1c6e749 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -538,6 +538,10 @@ enum ProcEvent { Evlocallabccshape = 508, EvlocallabqualitycurveMethod = 509, EvWBtempBias = 510, + Evlocallabhueref = 511, + Evlocallabchromaref = 512, + Evlocallablumaref = 513, + NUMOFEVENTS diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 4dcef6f2e..bd3a97964 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -58,40 +58,40 @@ bool ToneCurveParams::HLReconstructionNecessary (LUTu &histRedRaw, LUTu &histGre void WBParams::init() { // Creation of the different methods and its associated temperature value - wbEntries.push_back(new WBEntry("Camera" , WBT_CAMERA, M("TP_WBALANCE_CAMERA"), 0, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Auto" , WBT_AUTO, M("TP_WBALANCE_AUTO"), 0, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Daylight" , WBT_DAYLIGHT, M("TP_WBALANCE_DAYLIGHT"), 5300, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Cloudy" , WBT_CLOUDY, M("TP_WBALANCE_CLOUDY"), 6200, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Shade" , WBT_SHADE, M("TP_WBALANCE_SHADE"), 7600, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Water 1" , WBT_WATER, M("TP_WBALANCE_WATER1"), 35000, 0.3f, 1.1f, 0.f)); - wbEntries.push_back(new WBEntry("Water 2" , WBT_WATER, M("TP_WBALANCE_WATER2"), 48000, 0.63f, 1.38f, 0.f)); - wbEntries.push_back(new WBEntry("Tungsten" , WBT_TUNGSTEN, M("TP_WBALANCE_TUNGSTEN"), 2856, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Fluo F1" , WBT_FLUORESCENT, M("TP_WBALANCE_FLUO1"), 6430, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Fluo F2" , WBT_FLUORESCENT, M("TP_WBALANCE_FLUO2"), 4230, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Fluo F3" , WBT_FLUORESCENT, M("TP_WBALANCE_FLUO3"), 3450, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Fluo F4" , WBT_FLUORESCENT, M("TP_WBALANCE_FLUO4"), 2940, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Fluo F5" , WBT_FLUORESCENT, M("TP_WBALANCE_FLUO5"), 6350, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Fluo F6" , WBT_FLUORESCENT, M("TP_WBALANCE_FLUO6"), 4150, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Fluo F7" , WBT_FLUORESCENT, M("TP_WBALANCE_FLUO7"), 6500, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Fluo F8" , WBT_FLUORESCENT, M("TP_WBALANCE_FLUO8"), 5020, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Fluo F9" , WBT_FLUORESCENT, M("TP_WBALANCE_FLUO9"), 4330, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Fluo F10" , WBT_FLUORESCENT, M("TP_WBALANCE_FLUO10"), 5300, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Fluo F11" , WBT_FLUORESCENT, M("TP_WBALANCE_FLUO11"), 4000, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Fluo F12" , WBT_FLUORESCENT, M("TP_WBALANCE_FLUO12"), 3000, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("HMI Lamp" , WBT_LAMP, M("TP_WBALANCE_HMI"), 4800, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("GTI Lamp" , WBT_LAMP, M("TP_WBALANCE_GTI"), 5000, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("JudgeIII Lamp" , WBT_LAMP, M("TP_WBALANCE_JUDGEIII"), 5100, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Solux Lamp 3500K" , WBT_LAMP, M("TP_WBALANCE_SOLUX35"), 3480, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Solux Lamp 4100K" , WBT_LAMP, M("TP_WBALANCE_SOLUX41"), 3930, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Solux Lamp 4700K" , WBT_LAMP, M("TP_WBALANCE_SOLUX47"), 4700, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("NG Solux Lamp 4700K" , WBT_LAMP, M("TP_WBALANCE_SOLUX47_NG"), 4480, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("LED LSI Lumelex 2040", WBT_LED, M("TP_WBALANCE_LED_LSI"), 2970, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("LED CRS SP12 WWMR16" , WBT_LED, M("TP_WBALANCE_LED_CRS"), 3050, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Flash 5500K" , WBT_FLASH, M("TP_WBALANCE_FLASH55"), 5500, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Flash 6000K" , WBT_FLASH, M("TP_WBALANCE_FLASH60"), 6000, 1.f, 1.f, 0.f)); - wbEntries.push_back(new WBEntry("Flash 6500K" , WBT_FLASH, M("TP_WBALANCE_FLASH65"), 6500, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Camera" , WBT_CAMERA, M ("TP_WBALANCE_CAMERA"), 0, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Auto" , WBT_AUTO, M ("TP_WBALANCE_AUTO"), 0, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Daylight" , WBT_DAYLIGHT, M ("TP_WBALANCE_DAYLIGHT"), 5300, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Cloudy" , WBT_CLOUDY, M ("TP_WBALANCE_CLOUDY"), 6200, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Shade" , WBT_SHADE, M ("TP_WBALANCE_SHADE"), 7600, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Water 1" , WBT_WATER, M ("TP_WBALANCE_WATER1"), 35000, 0.3f, 1.1f, 0.f)); + wbEntries.push_back (new WBEntry ("Water 2" , WBT_WATER, M ("TP_WBALANCE_WATER2"), 48000, 0.63f, 1.38f, 0.f)); + wbEntries.push_back (new WBEntry ("Tungsten" , WBT_TUNGSTEN, M ("TP_WBALANCE_TUNGSTEN"), 2856, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Fluo F1" , WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO1"), 6430, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Fluo F2" , WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO2"), 4230, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Fluo F3" , WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO3"), 3450, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Fluo F4" , WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO4"), 2940, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Fluo F5" , WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO5"), 6350, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Fluo F6" , WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO6"), 4150, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Fluo F7" , WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO7"), 6500, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Fluo F8" , WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO8"), 5020, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Fluo F9" , WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO9"), 4330, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Fluo F10" , WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO10"), 5300, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Fluo F11" , WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO11"), 4000, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Fluo F12" , WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO12"), 3000, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("HMI Lamp" , WBT_LAMP, M ("TP_WBALANCE_HMI"), 4800, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("GTI Lamp" , WBT_LAMP, M ("TP_WBALANCE_GTI"), 5000, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("JudgeIII Lamp" , WBT_LAMP, M ("TP_WBALANCE_JUDGEIII"), 5100, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Solux Lamp 3500K" , WBT_LAMP, M ("TP_WBALANCE_SOLUX35"), 3480, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Solux Lamp 4100K" , WBT_LAMP, M ("TP_WBALANCE_SOLUX41"), 3930, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Solux Lamp 4700K" , WBT_LAMP, M ("TP_WBALANCE_SOLUX47"), 4700, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("NG Solux Lamp 4700K" , WBT_LAMP, M ("TP_WBALANCE_SOLUX47_NG"), 4480, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("LED LSI Lumelex 2040", WBT_LED, M ("TP_WBALANCE_LED_LSI"), 2970, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("LED CRS SP12 WWMR16" , WBT_LED, M ("TP_WBALANCE_LED_CRS"), 3050, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Flash 5500K" , WBT_FLASH, M ("TP_WBALANCE_FLASH55"), 5500, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Flash 6000K" , WBT_FLASH, M ("TP_WBALANCE_FLASH60"), 6000, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Flash 6500K" , WBT_FLASH, M ("TP_WBALANCE_FLASH65"), 6500, 1.f, 1.f, 0.f)); // Should remain the last one - wbEntries.push_back(new WBEntry("Custom" , WBT_CUSTOM, M("TP_WBALANCE_CUSTOM"), 0, 1.f, 1.f, 0.f)); + wbEntries.push_back (new WBEntry ("Custom" , WBT_CUSTOM, M ("TP_WBALANCE_CUSTOM"), 0, 1.f, 1.f, 0.f)); } void WBParams::cleanup() @@ -926,9 +926,9 @@ void LocallabParams::setDefaults() estop = 140; scaltm = 3; rewei = 0; - hueref = INFINITY; - chromaref = INFINITY; - lumaref = INFINITY; + hueref = 1.; + chromaref = 50.; + lumaref = 50.; str = 0; neigh = 50; vart = 200; @@ -2896,6 +2896,18 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b keyFile.set_integer ("Locallab", "ANbspot", locallab.anbspot); } + if (!pedited || pedited->locallab.hueref) { + keyFile.set_double ("Locallab", "Hueref", locallab.hueref); + } + + if (!pedited || pedited->locallab.chromaref) { + keyFile.set_double ("Locallab", "Chromaref", locallab.chromaref); + } + + if (!pedited || pedited->locallab.lumaref) { + keyFile.set_double ("Locallab", "Lumaref", locallab.lumaref); + } + if (!pedited || pedited->locallab.vart) { keyFile.set_integer ("Locallab", "Vart", locallab.vart); } @@ -4628,6 +4640,30 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } + if (keyFile.has_key ("Locallab", "Hueref")) { + locallab.hueref = keyFile.get_double ("Locallab", "Hueref"); + + if (pedited) { + pedited->locallab.hueref = true; + } + } + + if (keyFile.has_key ("Locallab", "Chromaref")) { + locallab.chromaref = keyFile.get_double ("Locallab", "Chromaref"); + + if (pedited) { + pedited->locallab.chromaref = true; + } + } + + if (keyFile.has_key ("Locallab", "Lumaref")) { + locallab.lumaref = keyFile.get_double ("Locallab", "Lumaref"); + + if (pedited) { + pedited->locallab.lumaref = true; + } + } + if (keyFile.has_key ("Locallab", "Vart")) { locallab.vart = keyFile.get_integer ("Locallab", "Vart"); @@ -6378,7 +6414,7 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } if (keyFile.has_key ("Crop", "W")) { - crop.w = std::max(keyFile.get_integer("Crop", "W"), 1); + crop.w = std::max (keyFile.get_integer ("Crop", "W"), 1); if (pedited) { pedited->crop.w = true; @@ -6386,7 +6422,7 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } if (keyFile.has_key ("Crop", "H")) { - crop.h = std::max(keyFile.get_integer("Crop", "H"), 1); + crop.h = std::max (keyFile.get_integer ("Crop", "H"), 1); if (pedited) { pedited->crop.h = true; @@ -8912,6 +8948,9 @@ bool ProcParams::operator== (const ProcParams& other) && locallab.neigh == other.locallab.neigh && locallab.nbspot == other.locallab.nbspot && locallab.anbspot == other.locallab.anbspot + && locallab.hueref == other.locallab.hueref + && locallab.chromaref == other.locallab.chromaref + && locallab.lumaref == other.locallab.lumaref && locallab.vart == other.locallab.vart && locallab.threshold == other.locallab.threshold && locallab.expcolor == other.locallab.expcolor diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 210093299..750d91a65 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -552,7 +552,7 @@ public: double equal; double tempBias; - WBEntry(const Glib::ustring &p, enum WBTypes t, const Glib::ustring &l, int temp, double green, double equal, double bias) : ppLabel(p), type(t), GUILabel(l), temperature(temp), green(green), equal(equal), tempBias(bias) {}; + WBEntry (const Glib::ustring &p, enum WBTypes t, const Glib::ustring &l, int temp, double green, double equal, double bias) : ppLabel (p), type (t), GUILabel (l), temperature (temp), green (green), equal (equal), tempBias (bias) {}; }; class WBParams diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 1d37b7fd9..8675d9bd5 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -537,7 +537,11 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, //Evlocallabcurvactiv LUMINANCECURVE, //Evlocallabccshape LUMINANCECURVE, //EvlocallabqualitycurveMethod - ALLNORAW // EvWBtempBias + ALLNORAW, // EvWBtempBias + LUMINANCECURVE, //Evlocallabhueref + LUMINANCECURVE, //Evlocallabchromaref + LUMINANCECURVE //Evlocallablumaref + }; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 07ec3449e..25c309e88 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -96,6 +96,9 @@ Locallab::Locallab (): noiselumc (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_NOISELUMCOARSE"), 0, 100, 1, 0))), noisechrof (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_NOISECHROFINE"), 0, 100, 1, 0))), noisechroc (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_NOISECHROCOARSE"), 0, 100, 1, 0))), + hueref (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_HUEREF"), -3.15, 3.15, 0.01, 0))), + chromaref (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_CHROMAREF"), 0, 200, 0.01, 0))), + lumaref (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_LUMAMAREF"), 0, 100, 0.01, 0))), Smethod (Gtk::manage (new MyComboBoxText ())), qualityMethod (Gtk::manage (new MyComboBoxText ())), @@ -420,7 +423,19 @@ Locallab::Locallab (): avoidConn = avoid->signal_toggled().connect ( sigc::mem_fun (*this, &Locallab::avoidChanged) ); shapeVBox->pack_start (*nbspot); pack_start (*anbspot); + + hueref->setAdjusterListener (this); + chromaref->setAdjusterListener (this); + lumaref->setAdjusterListener (this); + + pack_start (*hueref); + pack_start (*chromaref); + pack_start (*lumaref); + anbspot->hide();//keep anbspot - i used it to test diffrent algo... + hueref->hide(); + chromaref->hide(); + lumaref->hide(); ctboxS->pack_start (*Smethod); shapeVBox->pack_start (*ctboxS); @@ -542,6 +557,7 @@ Locallab::Locallab (): noisechroc->setAdjusterListener (this); + denoisVBox->pack_start (*noiselumf); denoisVBox->pack_start (*noiselumc); denoisVBox->pack_start (*noisechrof); @@ -1355,6 +1371,11 @@ bool Locallab::localComputed_ () qualitycurveMethod->set_active (2); } + double intermed = 0.01 * (double) nextdatasp[58]; + hueref->setValue (intermed); + chromaref->setValue (nextdatasp[59]); + lumaref->setValue (nextdatasp[60]); + int *s_datc; s_datc = new int[70]; int siz; @@ -1622,6 +1643,9 @@ void Locallab::read (const ProcParams* pp, const ParamsEdited* pedited) nbspot->setEditedState (pedited->locallab.nbspot ? Edited : UnEdited); anbspot->setEditedState (pedited->locallab.anbspot ? Edited : UnEdited); + hueref->setEditedState (pedited->locallab.hueref ? Edited : UnEdited); + chromaref->setEditedState (pedited->locallab.chromaref ? Edited : UnEdited); + lumaref->setEditedState (pedited->locallab.lumaref ? Edited : UnEdited); transit->setEditedState (pedited->locallab.transit ? Edited : UnEdited); str->setEditedState (pedited->locallab.str ? Edited : UnEdited); neigh->setEditedState (pedited->locallab.neigh ? Edited : UnEdited); @@ -1731,6 +1755,9 @@ void Locallab::read (const ProcParams* pp, const ParamsEdited* pedited) neigh->setValue (pp->locallab.neigh); nbspot->setValue (pp->locallab.nbspot); anbspot->setValue (pp->locallab.anbspot); + hueref->setValue (pp->locallab.hueref); + chromaref->setValue (pp->locallab.chromaref); + lumaref->setValue (pp->locallab.lumaref); vart->setValue (pp->locallab.vart); chrrt->setValue (pp->locallab.chrrt); cTgainshape->setCurve (pp->locallab.localTgaincurve); @@ -1820,6 +1847,9 @@ void Locallab::read (const ProcParams* pp, const ParamsEdited* pedited) qualitycurveMethodConn.block (false); anbspot->hide(); + hueref->hide(); + chromaref->hide(); + lumaref->hide(); if (pp->locallab.Smethod == "SYM" || pp->locallab.Smethod == "SYMSL") { locXL->setValue (locX->getValue()); @@ -2088,6 +2118,9 @@ void Locallab::write (ProcParams* pp, ParamsEdited* pedited) pp->locallab.neigh = neigh->getIntValue (); pp->locallab.nbspot = nbspot->getIntValue (); pp->locallab.anbspot = anbspot->getIntValue (); + pp->locallab.hueref = hueref->getValue (); + pp->locallab.chromaref = chromaref->getValue (); + pp->locallab.lumaref = lumaref->getValue (); pp->locallab.vart = vart->getIntValue (); pp->locallab.chrrt = chrrt->getIntValue (); pp->locallab.localTgaincurve = cTgainshape->getCurve (); @@ -2162,6 +2195,10 @@ void Locallab::write (ProcParams* pp, ParamsEdited* pedited) pedited->locallab.neigh = neigh->getEditedState (); pedited->locallab.nbspot = nbspot->getEditedState (); pedited->locallab.anbspot = anbspot->getEditedState (); + pedited->locallab.hueref = hueref->getEditedState (); + pedited->locallab.chromaref = chromaref->getEditedState (); + pedited->locallab.lumaref = lumaref->getEditedState (); + pedited->locallab.vart = vart->getEditedState (); pedited->locallab.chrrt = chrrt->getEditedState (); pedited->locallab.localTgaincurve = !cTgainshape->isUnChanged (); @@ -2649,6 +2686,10 @@ void Locallab::setDefaults (const ProcParams * defParams, const ParamsEdited * p neigh->setDefault (defParams->locallab.neigh); nbspot->setDefault (defParams->locallab.nbspot); anbspot->setDefault (defParams->locallab.anbspot); + hueref->setDefault (defParams->locallab.hueref); + chromaref->setDefault (defParams->locallab.chromaref); + lumaref->setDefault (defParams->locallab.lumaref); + vart->setDefault (defParams->locallab.vart); chrrt->setDefault (defParams->locallab.chrrt); @@ -2700,6 +2741,9 @@ void Locallab::setDefaults (const ProcParams * defParams, const ParamsEdited * p neigh->setDefaultEditedState (pedited->locallab.neigh ? Edited : UnEdited); nbspot->setDefaultEditedState (pedited->locallab.nbspot ? Edited : UnEdited); anbspot->setDefaultEditedState (pedited->locallab.anbspot ? Edited : UnEdited); + hueref->setDefaultEditedState (pedited->locallab.hueref ? Edited : UnEdited); + chromaref->setDefaultEditedState (pedited->locallab.chromaref ? Edited : UnEdited); + lumaref->setDefaultEditedState (pedited->locallab.lumaref ? Edited : UnEdited); vart->setDefaultEditedState (pedited->locallab.vart ? Edited : UnEdited); chrrt->setDefaultEditedState (pedited->locallab.chrrt ? Edited : UnEdited); @@ -2750,6 +2794,9 @@ void Locallab::setDefaults (const ProcParams * defParams, const ParamsEdited * p neigh->setDefaultEditedState (Irrelevant); nbspot->setDefaultEditedState (Irrelevant); anbspot->setDefaultEditedState (Irrelevant); + hueref->setDefaultEditedState (Irrelevant); + chromaref->setDefaultEditedState (Irrelevant); + lumaref->setDefaultEditedState (Irrelevant); vart->setDefaultEditedState (Irrelevant); chrrt->setDefaultEditedState (Irrelevant); @@ -2768,6 +2815,9 @@ void Locallab::adjusterChanged (Adjuster * a, double newval) updateGeometry (int (centerX->getValue()), int (centerY->getValue()), int (circrad->getValue()), (int)locY->getValue(), degree->getValue(), (int)locX->getValue(), (int)locYT->getValue(), (int)locXL->getValue()); anbspot->hide(); + hueref->hide(); + chromaref->hide(); + lumaref->hide(); if (listener && getEnabled()) { if (a == degree) { @@ -2886,6 +2936,12 @@ void Locallab::adjusterChanged (Adjuster * a, double newval) listener->panelChanged (Evlocallabnbspot, nbspot->getTextValue()); } else if (a == anbspot) { listener->panelChanged (Evlocallabanbspot, "");//anbspot->getTextValue()); + } else if (a == hueref) { + listener->panelChanged (Evlocallabhueref, "");//anbspot->getTextValue()); + } else if (a == chromaref) { + listener->panelChanged (Evlocallabchromaref, "");//anbspot->getTextValue()); + } else if (a == lumaref) { + listener->panelChanged (Evlocallablumaref, "");//anbspot->getTextValue()); } else if (a == vart) { listener->panelChanged (Evlocallabvart, vart->getTextValue()); } else if (a == chrrt) { @@ -3018,6 +3074,10 @@ void Locallab::trimValues (rtengine::procparams::ProcParams * pp) neigh->trimValue (pp->locallab.neigh); nbspot->trimValue (pp->locallab.nbspot); anbspot->trimValue (pp->locallab.anbspot); + hueref->trimValue (pp->locallab.hueref); + chromaref->trimValue (pp->locallab.chromaref); + lumaref->trimValue (pp->locallab.lumaref); + vart->trimValue (pp->locallab.vart); chrrt->trimValue (pp->locallab.chrrt); @@ -3074,6 +3134,9 @@ void Locallab::setBatchMode (bool batchMode) neigh->showEditedCB (); nbspot->showEditedCB (); anbspot->showEditedCB (); + hueref->showEditedCB (); + chromaref->showEditedCB (); + lumaref->showEditedCB (); vart->showEditedCB (); LocalcurveEditorgainT->setBatchMode (batchMode); LocalcurveEditorgainTrab->setBatchMode (batchMode); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 2ff9bd02a..9ad0dba57 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -81,6 +81,9 @@ private: Adjuster* const rewei; Adjuster* const sensitm; Adjuster* const retrab; + Adjuster* const hueref; + Adjuster* const chromaref; + Adjuster* const lumaref; MyExpander* const expcolor; MyExpander* const expblur; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 95171ce00..b0294316f 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -352,6 +352,9 @@ void ParamsEdited::set (bool v) locallab.neigh = v; locallab.nbspot = v; locallab.anbspot = v; + locallab.hueref = v; + locallab.chromaref = v; + locallab.lumaref = v; locallab.vart = v; locallab.localTgaincurve = v; locallab.localTgaincurverab = v; @@ -915,6 +918,9 @@ void ParamsEdited::initFrom (const std::vector locallab.neigh = locallab.neigh && p.locallab.neigh == other.locallab.neigh; locallab.nbspot = locallab.nbspot && p.locallab.nbspot == other.locallab.nbspot; locallab.anbspot = locallab.anbspot && p.locallab.anbspot == other.locallab.anbspot; + locallab.hueref = locallab.hueref && p.locallab.hueref == other.locallab.hueref; + locallab.chromaref = locallab.chromaref && p.locallab.chromaref == other.locallab.chromaref; + locallab.lumaref = locallab.lumaref && p.locallab.lumaref == other.locallab.lumaref; locallab.vart = locallab.vart && p.locallab.vart == other.locallab.vart; locallab.localTgaincurve = locallab.localTgaincurve && p.locallab.localTgaincurve == other.locallab.localTgaincurve; locallab.localTgaincurverab = locallab.localTgaincurverab && p.locallab.localTgaincurverab == other.locallab.localTgaincurverab; @@ -2386,6 +2392,18 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten toEdit.locallab.anbspot = mods.locallab.anbspot; } + if (locallab.hueref) { + toEdit.locallab.hueref = mods.locallab.hueref; + } + + if (locallab.chromaref) { + toEdit.locallab.chromaref = mods.locallab.chromaref; + } + + if (locallab.lumaref) { + toEdit.locallab.lumaref = mods.locallab.lumaref; + } + if (locallab.vart) { toEdit.locallab.vart = mods.locallab.vart; } diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 0491f688e..f36037461 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -464,6 +464,9 @@ public: bool neigh; bool nbspot; bool anbspot; + bool hueref; + bool chromaref; + bool lumaref; bool vart; bool activlum; bool invers;