From 02d6187cd880cd3b1a3804610e0e33ec181e9db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=B6ssie?= Date: Tue, 14 Nov 2017 21:20:07 +0100 Subject: [PATCH] `procparams.h` cleanup - Part 1 TODO: - Part 2 (obviously :wink:) - Remove `setDefaults()` in favour of c'tor --- rtengine/curves.cc | 4 +- rtengine/curves.h | 2 +- rtengine/improcfun.cc | 114 +++++------ rtengine/procparams.cc | 287 ++++++++++++++++----------- rtengine/procparams.h | 406 +++++++++++---------------------------- rtengine/utils.h | 2 +- rtgui/colorappearance.cc | 20 +- rtgui/dirpyrdenoise.cc | 4 +- rtgui/tonecurve.cc | 28 +-- rtgui/whitebalance.cc | 196 ++++++++++--------- rtgui/whitebalance.h | 8 +- 11 files changed, 486 insertions(+), 585 deletions(-) diff --git a/rtengine/curves.cc b/rtengine/curves.cc index 3096f19f4..8ece458e7 100644 --- a/rtengine/curves.cc +++ b/rtengine/curves.cc @@ -482,8 +482,8 @@ void CurveFactory::complexsgnCurve (bool & autili, bool & butili, bool & ccutil SSEFUNCTION void CurveFactory::complexCurve (double ecomp, double black, double hlcompr, double hlcomprthresh, double shcompr, double br, double contr, - procparams::ToneCurveParams::eTCModeId curveMode, const std::vector& curvePoints, - procparams::ToneCurveParams::eTCModeId curveMode2, const std::vector& curvePoints2, + procparams::ToneCurveParams::Mode curveMode, const std::vector& curvePoints, + procparams::ToneCurveParams::Mode curveMode2, const std::vector& curvePoints2, LUTu & histogram, LUTf & hlCurve, LUTf & shCurve, LUTf & outCurve, LUTu & outBeforeCCurveHistogram, diff --git a/rtengine/curves.h b/rtengine/curves.h index c20b78772..413531471 100644 --- a/rtengine/curves.h +++ b/rtengine/curves.h @@ -281,7 +281,7 @@ public: public: static void complexCurve (double ecomp, double black, double hlcompr, double hlcomprthresh, double shcompr, double br, double contr, - procparams::ToneCurveParams::eTCModeId curveMode, const std::vector& curvePoints, procparams::ToneCurveParams::eTCModeId curveMode2, const std::vector& curvePoints2, + procparams::ToneCurveParams::Mode curveMode, const std::vector& curvePoints, procparams::ToneCurveParams::Mode curveMode2, const std::vector& curvePoints2, LUTu & histogram, LUTf & hlCurve, LUTf & shCurve, LUTf & outCurve, LUTu & outBeforeCCurveHistogram, ToneCurve & outToneCurve, ToneCurve & outToneCurve2, int skip = 1); diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 829384cc6..bc5bafca0 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -440,11 +440,11 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh } // extracting datas from 'params' to avoid cache flush (to be confirmed) - ColorAppearanceParams::eTCModeId curveMode = params->colorappearance.curveMode; - ColorAppearanceParams::eTCModeId curveMode2 = params->colorappearance.curveMode2; + ColorAppearanceParams::TCMode curveMode = params->colorappearance.curveMode; + ColorAppearanceParams::TCMode curveMode2 = params->colorappearance.curveMode2; bool hasColCurve1 = bool (customColCurve1); bool hasColCurve2 = bool (customColCurve2); - ColorAppearanceParams::eCTCModeId curveMode3 = params->colorappearance.curveMode3; + ColorAppearanceParams::CTCMode curveMode3 = params->colorappearance.curveMode3; bool hasColCurve3 = bool (customColCurve3); @@ -805,7 +805,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh } if (hasColCurve1) {//curve 1 with Lightness and Brightness - if (curveMode == ColorAppearanceParams::TC_MODE_LIGHT) { + if (curveMode == ColorAppearanceParams::TCMode::LIGHT) { /* float Jj=(float) Jpro*327.68; float Jold=Jj; const Lightcurve& userColCurve = static_cast(customColCurve1); @@ -843,7 +843,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh } t1L = true; - } else if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { + } else if (curveMode == ColorAppearanceParams::TCMode::BRIGHT) { //attention! Brightness curves are open - unlike Lightness or Lab or RGB==> rendering and algoritms will be different float coef = ((aw + 4.f) * (4.f / c)) / 100.f; float Qanc = Qpro; @@ -891,7 +891,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh } if (hasColCurve2) {//curve 2 with Lightness and Brightness - if (curveMode2 == ColorAppearanceParams::TC_MODE_LIGHT) { + if (curveMode2 == ColorAppearanceParams::TCMode::LIGHT) { float Jj = (float) Jpro * 327.68; float Jold = Jj; /* @@ -934,7 +934,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh Jpro = 1.; } - } else if (curveMode2 == ColorAppearanceParams::TC_MODE_BRIGHT) { // + } else if (curveMode2 == ColorAppearanceParams::TCMode::BRIGHT) { // float Qanc = Qpro; float coef = ((aw + 4.f) * (4.f / c)) / 100.f; float Qq = (float) Qpro * 327.68f * (1.f / coef); @@ -992,7 +992,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh } if (hasColCurve3) {//curve 3 with chroma saturation colorfullness - if (curveMode3 == ColorAppearanceParams::TC_MODE_CHROMA) { + if (curveMode3 == ColorAppearanceParams::CTCMode::CHROMA) { double parsat = 0.8; //0.68; double coef = 327.68 / parsat; float Cc = (float) Cpro * coef; @@ -1016,7 +1016,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh } // Cpro=Cc/coef; - } else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { // + } else if (curveMode3 == ColorAppearanceParams::CTCMode::SATUR) { // double parsat = 0.8; //0.6 double coef = 327.68 / parsat; float Ss = (float) spro * coef; @@ -1036,7 +1036,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh Cpro = (spro * spro * Qpro) / (10000.0); c1s = 1; - } else if (curveMode3 == ColorAppearanceParams::TC_MODE_COLORF) { // + } else if (curveMode3 == ColorAppearanceParams::CTCMode::COLORF) { // double parsat = 0.8; //0.68; double coef = 327.68 / parsat; float Mm = (float) Mpro * coef; @@ -1121,21 +1121,21 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh int libr = 0; int colch = 0; - if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { + if (curveMode == ColorAppearanceParams::TCMode::BRIGHT) { brli = 70.0; libr = 1; - } else if (curveMode == ColorAppearanceParams::TC_MODE_LIGHT) { + } else if (curveMode == ColorAppearanceParams::TCMode::LIGHT) { brli = 327.; libr = 0; } - if (curveMode3 == ColorAppearanceParams::TC_MODE_CHROMA) { + if (curveMode3 == ColorAppearanceParams::CTCMode::CHROMA) { chsacol = 400.;//327.; colch = 0; - } else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { + } else if (curveMode3 == ColorAppearanceParams::CTCMode::SATUR) { chsacol = 450.0; colch = 1; - } else if (curveMode3 == ColorAppearanceParams::TC_MODE_COLORF) { + } else if (curveMode3 == ColorAppearanceParams::CTCMode::COLORF) { chsacol = 400.;//327.0; colch = 2; } @@ -1390,21 +1390,21 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh int libr = 0; int colch = 0; - if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { + if (curveMode == ColorAppearanceParams::TCMode::BRIGHT) { brli = 70.0; libr = 1; - } else if (curveMode == ColorAppearanceParams::TC_MODE_LIGHT) { + } else if (curveMode == ColorAppearanceParams::TCMode::LIGHT) { brli = 327.; libr = 0; } - if (curveMode3 == ColorAppearanceParams::TC_MODE_CHROMA) { + if (curveMode3 == ColorAppearanceParams::CTCMode::CHROMA) { chsacol = 400.;//327.; colch = 0; - } else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { + } else if (curveMode3 == ColorAppearanceParams::CTCMode::SATUR) { chsacol = 450.0; colch = 1; - } else if (curveMode3 == ColorAppearanceParams::TC_MODE_COLORF) { + } else if (curveMode3 == ColorAppearanceParams::CTCMode::COLORF) { chsacol = 400.;//327.0; colch = 2; } @@ -1765,14 +1765,14 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int const float rstprotection = 100. - params->colorappearance.rstprotection; // extracting datas from 'params' to avoid cache flush (to be confirmed) - const ColorAppearanceParams::eTCModeId curveMode = params->colorappearance.curveMode; + const ColorAppearanceParams::TCMode curveMode = params->colorappearance.curveMode; const bool hasColCurve1 = bool (customColCurve1); - const bool t1L = hasColCurve1 && curveMode == ColorAppearanceParams::TC_MODE_LIGHT; + const bool t1L = hasColCurve1 && curveMode == ColorAppearanceParams::TCMode::LIGHT; - const ColorAppearanceParams::eTCModeId curveMode2 = params->colorappearance.curveMode2; + const ColorAppearanceParams::TCMode curveMode2 = params->colorappearance.curveMode2; const bool hasColCurve2 = bool (customColCurve2); - const ColorAppearanceParams::eCTCModeId curveMode3 = params->colorappearance.curveMode3; + const ColorAppearanceParams::CTCMode curveMode3 = params->colorappearance.curveMode3; const bool hasColCurve3 = bool (customColCurve3); bool needJ = (alg == 0 || alg == 1 || alg == 3); @@ -2226,7 +2226,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int } if (hasColCurve1) {//curve 1 with Lightness and Brightness - if (curveMode == ColorAppearanceParams::TC_MODE_LIGHT) { + if (curveMode == ColorAppearanceParams::TCMode::LIGHT) { float Jj = (float) Jpro * 327.68f; float Jold = Jj; float Jold100 = (float) Jpro; @@ -2255,7 +2255,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int if (Jpro < 1.f) { Jpro = 1.f; } - } else if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { + } else if (curveMode == ColorAppearanceParams::TCMode::BRIGHT) { //attention! Brightness curves are open - unlike Lightness or Lab or RGB==> rendering and algoritms will be different float coef = ((aw + 4.f) * (4.f / c)) / 100.f; float Qanc = Qpro; @@ -2299,7 +2299,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int } if (hasColCurve2) {//curve 2 with Lightness and Brightness - if (curveMode2 == ColorAppearanceParams::TC_MODE_LIGHT) { + if (curveMode2 == ColorAppearanceParams::TCMode::LIGHT) { float Jj = (float) Jpro * 327.68f; float Jold = Jj; float Jold100 = (float) Jpro; @@ -2337,7 +2337,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int Jpro = 1.f; } - } else if (curveMode2 == ColorAppearanceParams::TC_MODE_BRIGHT) { // + } else if (curveMode2 == ColorAppearanceParams::TCMode::BRIGHT) { // float Qanc = Qpro; float coef = ((aw + 4.f) * (4.f / c)) / 100.f; @@ -2394,7 +2394,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int } if (hasColCurve3) {//curve 3 with chroma saturation colorfullness - if (curveMode3 == ColorAppearanceParams::TC_MODE_CHROMA) { + if (curveMode3 == ColorAppearanceParams::CTCMode::CHROMA) { float parsat = 0.8f; //0.68; float coef = 327.68f / parsat; float Cc = (float) Cpro * coef; @@ -2417,7 +2417,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int Cpro = 50.f; } */ - } else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { // + } else if (curveMode3 == ColorAppearanceParams::CTCMode::SATUR) { // float parsat = 0.8f; //0.6 float coef = 327.68f / parsat; float Ss = (float) spro * coef; @@ -2434,7 +2434,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int Color::skinredfloat (Jpro, hpro, Ss, Sold, dred, protect_red, sk, rstprotection, ko, spro); Qpro = ( 4.0f / c ) * sqrtf ( Jpro / 100.0f ) * ( aw + 4.0f ) ; Cpro = (spro * spro * Qpro) / (10000.0f); - } else if (curveMode3 == ColorAppearanceParams::TC_MODE_COLORF) { // + } else if (curveMode3 == ColorAppearanceParams::CTCMode::COLORF) { // float parsat = 0.8f; //0.68; float coef = 327.68f / parsat; float Mm = (float) Mpro * coef; @@ -2504,10 +2504,10 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int float colch; //update histogram - if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { + if (curveMode == ColorAppearanceParams::TCMode::BRIGHT) { brli = 70.0f; libr = Q; //40.0 to 100.0 approximative factor for Q - 327 for J - } else { /*if(curveMode == ColorAppearanceParams::TC_MODE_LIGHT)*/ + } else { /*if(curveMode == ColorAppearanceParams::TCMode::LIGHT)*/ brli = 327.f; libr = J; //327 for J } @@ -2515,13 +2515,13 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int posl = (int) (libr * brli); hist16JCAM[posl]++; - if (curveMode3 == ColorAppearanceParams::TC_MODE_CHROMA) { + if (curveMode3 == ColorAppearanceParams::CTCMode::CHROMA) { chsacol = 400.f;//327 colch = C; //450.0 approximative factor for s 320 for M - } else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { + } else if (curveMode3 == ColorAppearanceParams::CTCMode::SATUR) { chsacol = 450.0f; colch = s; - } else { /*if(curveMode3 == ColorAppearanceParams::TC_MODE_COLORF)*/ + } else { /*if(curveMode3 == ColorAppearanceParams::CTCMode::COLORF)*/ chsacol = 400.0f;//327 colch = M; } @@ -2857,10 +2857,10 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int float libr; float colch; - if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { + if (curveMode == ColorAppearanceParams::TCMode::BRIGHT) { brli = 70.0f; libr = ncie->Q_p[i][j]; //40.0 to 100.0 approximative factor for Q - 327 for J - } else { /*if(curveMode == ColorAppearanceParams::TC_MODE_LIGHT)*/ + } else { /*if(curveMode == ColorAppearanceParams::TCMode::LIGHT)*/ brli = 327.f; libr = ncie->J_p[i][j]; //327 for J } @@ -2868,13 +2868,13 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int posl = (int) (libr * brli); hist16JCAM[posl]++; - if (curveMode3 == ColorAppearanceParams::TC_MODE_CHROMA) { + if (curveMode3 == ColorAppearanceParams::CTCMode::CHROMA) { chsacol = 400.f;//327.f; colch = ncie_C_p; - } else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { + } else if (curveMode3 == ColorAppearanceParams::CTCMode::SATUR) { chsacol = 450.0f; colch = 100.f * sqrtf (ncie_C_p / ncie->Q_p[i][j]); - } else { /*if(curveMode3 == ColorAppearanceParams::TC_MODE_COLORF)*/ + } else { /*if(curveMode3 == ColorAppearanceParams::CTCMode::COLORF)*/ chsacol = 400.f;//327.0f; colch = ncie->M_p[i][j]; } @@ -3270,8 +3270,8 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer const float hlrange = 65536.0 - shoulder; const bool isProPhoto = (params->icm.working == "ProPhoto"); // extracting datas from 'params' to avoid cache flush (to be confirmed) - ToneCurveParams::eTCModeId curveMode = params->toneCurve.curveMode; - ToneCurveParams::eTCModeId curveMode2 = params->toneCurve.curveMode2; + ToneCurveParams::Mode curveMode = params->toneCurve.curveMode; + ToneCurveParams::Mode curveMode2 = params->toneCurve.curveMode2; bool highlight = params->toneCurve.hrenabled;//Get the value if "highlight reconstruction" is activated bool hasToneCurve1 = bool (customToneCurve1); bool hasToneCurve2 = bool (customToneCurve2); @@ -3283,12 +3283,12 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer PerceptualToneCurveState ptc1ApplyState, ptc2ApplyState; - if (hasToneCurve1 && curveMode == ToneCurveParams::TC_MODE_PERCEPTUAL) { + if (hasToneCurve1 && curveMode == ToneCurveParams::Mode::PERCEPTUAL) { const PerceptualToneCurve& userToneCurve = static_cast (customToneCurve1); userToneCurve.initApplyState (ptc1ApplyState, params->icm.working); } - if (hasToneCurve2 && curveMode2 == ToneCurveParams::TC_MODE_PERCEPTUAL) { + if (hasToneCurve2 && curveMode2 == ToneCurveParams::Mode::PERCEPTUAL) { const PerceptualToneCurve& userToneCurve = static_cast (customToneCurve2); userToneCurve.initApplyState (ptc2ApplyState, params->icm.working); } @@ -3641,21 +3641,21 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } if (hasToneCurve1) { - if (curveMode == ToneCurveParams::TC_MODE_STD) { // Standard + if (curveMode == ToneCurveParams::Mode::STD) { // Standard for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { const StandardToneCurve& userToneCurve = static_cast (customToneCurve1); userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (curveMode == ToneCurveParams::TC_MODE_FILMLIKE) { // Adobe like + } else if (curveMode == ToneCurveParams::Mode::FILMLIKE) { // Adobe like for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { const AdobeToneCurve& userToneCurve = static_cast (customToneCurve1); userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (curveMode == ToneCurveParams::TC_MODE_SATANDVALBLENDING) { // apply the curve on the saturation and value channels + } else if (curveMode == ToneCurveParams::Mode::SATANDVALBLENDING) { // apply the curve on the saturation and value channels for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { const SatAndValueBlendingToneCurve& userToneCurve = static_cast (customToneCurve1); @@ -3665,7 +3665,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (curveMode == ToneCurveParams::TC_MODE_WEIGHTEDSTD) { // apply the curve to the rgb channels, weighted + } else if (curveMode == ToneCurveParams::Mode::WEIGHTEDSTD) { // apply the curve to the rgb channels, weighted const WeightedStdToneCurve& userToneCurve = static_cast (customToneCurve1); for (int i = istart, ti = 0; i < tH; i++, ti++) { @@ -3676,7 +3676,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (curveMode == ToneCurveParams::TC_MODE_LUMINANCE) { // apply the curve to the luminance channel + } else if (curveMode == ToneCurveParams::Mode::LUMINANCE) { // apply the curve to the luminance channel const LuminanceToneCurve& userToneCurve = static_cast (customToneCurve1); for (int i = istart, ti = 0; i < tH; i++, ti++) { @@ -3687,7 +3687,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (curveMode == ToneCurveParams::TC_MODE_PERCEPTUAL) { // apply curve while keeping color appearance constant + } else if (curveMode == ToneCurveParams::Mode::PERCEPTUAL) { // apply curve while keeping color appearance constant const PerceptualToneCurve& userToneCurve = static_cast (customToneCurve1); for (int i = istart, ti = 0; i < tH; i++, ti++) { @@ -3712,28 +3712,28 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } if (hasToneCurve2) { - if (curveMode2 == ToneCurveParams::TC_MODE_STD) { // Standard + if (curveMode2 == ToneCurveParams::Mode::STD) { // Standard for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { const StandardToneCurve& userToneCurve = static_cast (customToneCurve2); userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (curveMode2 == ToneCurveParams::TC_MODE_FILMLIKE) { // Adobe like + } else if (curveMode2 == ToneCurveParams::Mode::FILMLIKE) { // Adobe like for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { const AdobeToneCurve& userToneCurve = static_cast (customToneCurve2); userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (curveMode2 == ToneCurveParams::TC_MODE_SATANDVALBLENDING) { // apply the curve on the saturation and value channels + } else if (curveMode2 == ToneCurveParams::Mode::SATANDVALBLENDING) { // apply the curve on the saturation and value channels for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { const SatAndValueBlendingToneCurve& userToneCurve = static_cast (customToneCurve2); userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (curveMode2 == ToneCurveParams::TC_MODE_WEIGHTEDSTD) { // apply the curve to the rgb channels, weighted + } else if (curveMode2 == ToneCurveParams::Mode::WEIGHTEDSTD) { // apply the curve to the rgb channels, weighted const WeightedStdToneCurve& userToneCurve = static_cast (customToneCurve2); for (int i = istart, ti = 0; i < tH; i++, ti++) { @@ -3741,7 +3741,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (curveMode2 == ToneCurveParams::TC_MODE_LUMINANCE) { // apply the curve to the luminance channel + } else if (curveMode2 == ToneCurveParams::Mode::LUMINANCE) { // apply the curve to the luminance channel const LuminanceToneCurve& userToneCurve = static_cast (customToneCurve2); for (int i = istart, ti = 0; i < tH; i++, ti++) { @@ -3749,7 +3749,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (curveMode2 == ToneCurveParams::TC_MODE_PERCEPTUAL) { // apply curve while keeping color appearance constant + } else if (curveMode2 == ToneCurveParams::Mode::PERCEPTUAL) { // apply curve while keeping color appearance constant const PerceptualToneCurve& userToneCurve = static_cast (customToneCurve2); for (int i = istart, ti = 0; i < tH; i++, ti++) { diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 365cbc32a..c064f5366 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -265,12 +265,47 @@ const int br = (int) options.rtSettings.bot_right; const int tl = (int) options.rtSettings.top_left; const int bl = (int) options.rtSettings.bot_left; -const char *LensProfParams::methodstring[static_cast(LensProfParams::LcMode::LCP) + 1u] = {"none", "lfauto", "lfmanual", "lcp"}; const char *RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::numMethods] = {"amaze", "igv", "lmmse", "eahd", "hphd", "vng4", "dcb", "ahd", "fast", "mono", "none", "pixelshift" }; const char *RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::numMethods] = {"3-pass (best)", "1-pass (medium)", "fast", "mono", "none" }; const char *RAWParams::ff_BlurTypestring[RAWParams::numFlatFileBlurTypes] = {/*"Parametric",*/ "Area Flatfield", "Vertical Flatfield", "Horizontal Flatfield", "V+H Flatfield"}; -std::vector WBParams::wbEntries; + +const std::vector WBParams::wbEntries = { + {"Camera", WBEntry::Type::CAMERA, M ("TP_WBALANCE_CAMERA"), 0, 1.f, 1.f, 0.f}, + {"Auto", WBEntry::Type::AUTO, M ("TP_WBALANCE_AUTO"), 0, 1.f, 1.f, 0.f}, + {"Daylight", WBEntry::Type::DAYLIGHT, M ("TP_WBALANCE_DAYLIGHT"), 5300, 1.f, 1.f, 0.f}, + {"Cloudy", WBEntry::Type::CLOUDY, M ("TP_WBALANCE_CLOUDY"), 6200, 1.f, 1.f, 0.f}, + {"Shade", WBEntry::Type::SHADE, M ("TP_WBALANCE_SHADE"), 7600, 1.f, 1.f, 0.f}, + {"Water 1", WBEntry::Type::WATER, M ("TP_WBALANCE_WATER1"), 35000, 0.3f, 1.1f, 0.f}, + {"Water 2", WBEntry::Type::WATER, M ("TP_WBALANCE_WATER2"), 48000, 0.63f, 1.38f, 0.f}, + {"Tungsten", WBEntry::Type::TUNGSTEN, M ("TP_WBALANCE_TUNGSTEN"), 2856, 1.f, 1.f, 0.f}, + {"Fluo F1", WBEntry::Type::FLUORESCENT, M ("TP_WBALANCE_FLUO1"), 6430, 1.f, 1.f, 0.f}, + {"Fluo F2", WBEntry::Type::FLUORESCENT, M ("TP_WBALANCE_FLUO2"), 4230, 1.f, 1.f, 0.f}, + {"Fluo F3", WBEntry::Type::FLUORESCENT, M ("TP_WBALANCE_FLUO3"), 3450, 1.f, 1.f, 0.f}, + {"Fluo F4", WBEntry::Type::FLUORESCENT, M ("TP_WBALANCE_FLUO4"), 2940, 1.f, 1.f, 0.f}, + {"Fluo F5", WBEntry::Type::FLUORESCENT, M ("TP_WBALANCE_FLUO5"), 6350, 1.f, 1.f, 0.f}, + {"Fluo F6", WBEntry::Type::FLUORESCENT, M ("TP_WBALANCE_FLUO6"), 4150, 1.f, 1.f, 0.f}, + {"Fluo F7", WBEntry::Type::FLUORESCENT, M ("TP_WBALANCE_FLUO7"), 6500, 1.f, 1.f, 0.f}, + {"Fluo F8", WBEntry::Type::FLUORESCENT, M ("TP_WBALANCE_FLUO8"), 5020, 1.f, 1.f, 0.f}, + {"Fluo F9", WBEntry::Type::FLUORESCENT, M ("TP_WBALANCE_FLUO9"), 4330, 1.f, 1.f, 0.f}, + {"Fluo F10", WBEntry::Type::FLUORESCENT, M ("TP_WBALANCE_FLUO10"), 5300, 1.f, 1.f, 0.f}, + {"Fluo F11", WBEntry::Type::FLUORESCENT, M ("TP_WBALANCE_FLUO11"), 4000, 1.f, 1.f, 0.f}, + {"Fluo F12", WBEntry::Type::FLUORESCENT, M ("TP_WBALANCE_FLUO12"), 3000, 1.f, 1.f, 0.f}, + {"HMI Lamp", WBEntry::Type::LAMP, M ("TP_WBALANCE_HMI"), 4800, 1.f, 1.f, 0.f}, + {"GTI Lamp", WBEntry::Type::LAMP, M ("TP_WBALANCE_GTI"), 5000, 1.f, 1.f, 0.f}, + {"JudgeIII Lamp", WBEntry::Type::LAMP, M ("TP_WBALANCE_JUDGEIII"), 5100, 1.f, 1.f, 0.f}, + {"Solux Lamp 3500K", WBEntry::Type::LAMP, M ("TP_WBALANCE_SOLUX35"), 3480, 1.f, 1.f, 0.f}, + {"Solux Lamp 4100K", WBEntry::Type::LAMP, M ("TP_WBALANCE_SOLUX41"), 3930, 1.f, 1.f, 0.f}, + {"Solux Lamp 4700K", WBEntry::Type::LAMP, M ("TP_WBALANCE_SOLUX47"), 4700, 1.f, 1.f, 0.f}, + {"NG Solux Lamp 4700K", WBEntry::Type::LAMP, M ("TP_WBALANCE_SOLUX47_NG"), 4480, 1.f, 1.f, 0.f}, + {"LED LSI Lumelex 2040", WBEntry::Type::LED, M ("TP_WBALANCE_LED_LSI"), 2970, 1.f, 1.f, 0.f}, + {"LED CRS SP12 WWMR16", WBEntry::Type::LED, M ("TP_WBALANCE_LED_CRS"), 3050, 1.f, 1.f, 0.f}, + {"Flash 5500K", WBEntry::Type::FLASH, M ("TP_WBALANCE_FLASH55"), 5500, 1.f, 1.f, 0.f}, + {"Flash 6000K", WBEntry::Type::FLASH, M ("TP_WBALANCE_FLASH60"), 6000, 1.f, 1.f, 0.f}, + {"Flash 6500K", WBEntry::Type::FLASH, M ("TP_WBALANCE_FLASH65"), 6500, 1.f, 1.f, 0.f}, + // Should remain the last one + {"Custom", WBEntry::Type::CUSTOM, M ("TP_WBALANCE_CUSTOM"), 0, 1.f, 1.f, 0.f} +}; bool ToneCurveParams::HLReconstructionNecessary (LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw) { @@ -281,50 +316,14 @@ bool ToneCurveParams::HLReconstructionNecessary (LUTu &histRedRaw, LUTu &histGre return histRedRaw[255] > 50 || histGreenRaw[255] > 50 || histBlueRaw[255] > 50 || histRedRaw[0] > 50 || histGreenRaw[0] > 50 || histBlueRaw[0] > 50; } -void WBParams::init() +CropParams::CropParams() : + enabled(false), + x(0), + y(0), + w(0), + h(0), + fixratio(false) { - // 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)); - // Should remain the last one - wbEntries.push_back (new WBEntry ("Custom", WBT_CUSTOM, M ("TP_WBALANCE_CUSTOM"), 0, 1.f, 1.f, 0.f)); -} - -void WBParams::cleanup() -{ - for (unsigned int i = 0; i < wbEntries.size(); i++) { - delete wbEntries[i]; - } } // Maps crop to resized width (e.g. smaller previews) @@ -360,6 +359,7 @@ void RetinexParams::getDefaulttransmissionCurve (std::vector &curve) curve.at (i) = v[i - 1]; } } + void RetinexParams::getDefaultgaintransmissionCurve (std::vector &curve) { double v[16] = { 0.00, 0.1, 0.35, 0.00, @@ -1045,41 +1045,32 @@ DirPyrDenoiseParams::DirPyrDenoiseParams () setDefaults (); } -void DirPyrDenoiseParams::getDefaultNoisCurve (std::vector &curve) -{ - double v[8] = { 0.05, 0.15, 0.35, 0.35, - 0.55, 0.04, 0.35, 0.35 - }; - curve.resize (9); - curve.at (0 ) = double (FCT_MinMaxCPoints); - - for (size_t i = 1; i < curve.size(); ++i) { - curve.at (i) = v[i - 1]; - } -} - -void DirPyrDenoiseParams::getDefaultCCCurve (std::vector &curve) -{ - // double v[8]= { 0.15, 0.00,0.35,0.35, - // 0.60, 0.05,0.35,0.35}; - double v[8] = { 0.05, 0.50, 0.35, 0.35, - 0.35, 0.05, 0.35, 0.35 - }; - - curve.resize (9); - curve.at (0 ) = double (FCT_MinMaxCPoints); - - for (size_t i = 1; i < curve.size(); ++i) { - curve.at (i) = v[i - 1]; - } -} - - void DirPyrDenoiseParams::setDefaults() { - getDefaultNoisCurve (lcurve); - getDefaultCCCurve (cccurve); + lcurve = { + static_cast(FCT_MinMaxCPoints), + 0.05, + 0.15, + 0.35, + 0.35, + 0.55, + 0.04, + 0.35, + 0.35 + }; + + cccurve = { + static_cast(FCT_MinMaxCPoints), + 0.05, + 0.50, + 0.35, + 0.35, + 0.35, + 0.05, + 0.35, + 0.35 + }; enabled = false; enhance = false; @@ -1109,6 +1100,23 @@ void DirPyrDenoiseParams::getCurves (NoiseCurve &lCurve, NoiseCurve &cCurve) con cCurve.Set (this->cccurve); } +FattalToneMappingParams::FattalToneMappingParams() +{ + setDefaults(); +} + +void FattalToneMappingParams::setDefaults() +{ + enabled = false; + threshold = 0; + amount = 0; +} + +ToneCurveParams::ToneCurveParams() +{ + setDefaults(); +} + void ToneCurveParams::setDefaults() { autoexp = false; @@ -1125,12 +1133,17 @@ void ToneCurveParams::setDefaults() curve.push_back (DCT_Linear); curve2.clear (); curve2.push_back (DCT_Linear); - curveMode = ToneCurveParams::TC_MODE_STD; - curveMode2 = ToneCurveParams::TC_MODE_STD; + curveMode = ToneCurveParams::Mode::STD; + curveMode2 = ToneCurveParams::Mode::STD; hrenabled = false; method = "Blend"; } +LensProfParams::LensProfParams() +{ + setDefaults(); +} + void LensProfParams::setDefaults() { lcMode = LcMode::NONE; @@ -1142,12 +1155,64 @@ void LensProfParams::setDefaults() lfLens = ""; } +bool LensProfParams::useLensfun() const +{ + return lcMode == LcMode::LENSFUNAUTOMATCH || lcMode == LcMode::LENSFUNMANUAL; +} + +bool LensProfParams::lfAutoMatch() const +{ + return lcMode == LcMode::LENSFUNAUTOMATCH; +} + +bool LensProfParams::useLcp() const +{ + return lcMode == LcMode::LCP && lcpFile.length() > 0; +} + +bool LensProfParams::lfManual() const +{ + return lcMode == LcMode::LENSFUNMANUAL; +} + +const std::vector& LensProfParams::getMethodStrings() const +{ + static const std::vector method_strings = { + "none", + "lfauto", + "lfmanual", + "lcp" + }; + return method_strings; +} + +Glib::ustring LensProfParams::getMethodString(LcMode mode) const +{ + return getMethodStrings()[toUnderlying(mode)]; +} + +LensProfParams::LcMode LensProfParams::getMethodNumber(const Glib::ustring& mode) const +{ + for (std::vector::size_type i = 0; i < getMethodStrings().size(); ++i) { + if (getMethodStrings()[i] == mode) { + return static_cast(i); + } + } + return LcMode::NONE; +} + +CoarseTransformParams::CoarseTransformParams() +{ + setDefaults(); +} + void CoarseTransformParams::setDefaults() { rotate = 0; hflip = false; vflip = false; } + void RAWParams::BayerSensor::setPixelShiftDefaults() { pixelShiftMotion = 0; @@ -1249,14 +1314,10 @@ ProcParams::ProcParams () void ProcParams::init () { - - WBParams::init(); } void ProcParams::cleanup () { - - WBParams::cleanup(); } ProcParams* ProcParams::create () @@ -1401,11 +1462,11 @@ void ProcParams::setDefaults () colorappearance.curve.push_back (DCT_Linear); colorappearance.curve2.clear (); colorappearance.curve2.push_back (DCT_Linear); - colorappearance.curveMode = ColorAppearanceParams::TC_MODE_LIGHT; - colorappearance.curveMode2 = ColorAppearanceParams::TC_MODE_LIGHT; + colorappearance.curveMode = ColorAppearanceParams::TCMode::LIGHT; + colorappearance.curveMode2 = ColorAppearanceParams::TCMode::LIGHT; colorappearance.curve3.clear (); colorappearance.curve3.push_back (DCT_Linear); - colorappearance.curveMode3 = ColorAppearanceParams::TC_MODE_CHROMA; + colorappearance.curveMode3 = ColorAppearanceParams::CTCMode::CHROMA; colorappearance.tempout = 5000; colorappearance.greenout = 1.0; colorappearance.ybout = 18; @@ -1677,13 +1738,13 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b saveToKeyfile(!pedited || pedited->toneCurve.hrenabled, "HLRecovery", "Enabled", toneCurve.hrenabled, keyFile); saveToKeyfile(!pedited || pedited->toneCurve.method, "HLRecovery", "Method", toneCurve.method, keyFile); - const std::map tc_mapping = { - {ToneCurveParams::TC_MODE_STD, "Standard"}, - {ToneCurveParams::TC_MODE_FILMLIKE, "FilmLike"}, - {ToneCurveParams::TC_MODE_SATANDVALBLENDING, "SatAndValueBlending"}, - {ToneCurveParams::TC_MODE_WEIGHTEDSTD,"WeightedStd"}, - {ToneCurveParams::TC_MODE_LUMINANCE, "Luminance"}, - {ToneCurveParams::TC_MODE_PERCEPTUAL, "Perceptual"} + const std::map tc_mapping = { + {ToneCurveParams::Mode::STD, "Standard"}, + {ToneCurveParams::Mode::FILMLIKE, "FilmLike"}, + {ToneCurveParams::Mode::SATANDVALBLENDING, "SatAndValueBlending"}, + {ToneCurveParams::Mode::WEIGHTEDSTD,"WeightedStd"}, + {ToneCurveParams::Mode::LUMINANCE, "Luminance"}, + {ToneCurveParams::Mode::PERCEPTUAL, "Perceptual"} }; saveToKeyfile(!pedited || pedited->toneCurve.curveMode, "Exposure", "CurveMode", tc_mapping, toneCurve.curveMode, keyFile); @@ -1904,21 +1965,21 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b saveToKeyfile(!pedited || pedited->colorappearance.tonecie, "Color appearance", "Tonecie", colorappearance.tonecie, keyFile); // if (!pedited || pedited->colorappearance.sharpcie) keyFile.set_boolean ("Color appearance", "Sharpcie", colorappearance.sharpcie); - const std::map ca_mapping = { - {ColorAppearanceParams::TC_MODE_LIGHT, "Lightness"}, - {ColorAppearanceParams::TC_MODE_BRIGHT, "Brightness"} + const std::map ca_mapping = { + {ColorAppearanceParams::TCMode::LIGHT, "Lightness"}, + {ColorAppearanceParams::TCMode::BRIGHT, "Brightness"} }; saveToKeyfile(!pedited || pedited->colorappearance.curveMode, "Color appearance", "CurveMode", ca_mapping, colorappearance.curveMode, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.curveMode2, "Color appearance", "CurveMode2", ca_mapping, colorappearance.curveMode2, keyFile); saveToKeyfile( - !pedited || colorappearance.curveMode3, + !pedited || pedited->colorappearance.curveMode3, "Color appearance", "CurveMode3", { - {ColorAppearanceParams::TC_MODE_CHROMA, "Chroma"}, - {ColorAppearanceParams::TC_MODE_SATUR, "Saturation"}, - {ColorAppearanceParams::TC_MODE_COLORF, "Colorfullness"} + {ColorAppearanceParams::CTCMode::CHROMA, "Chroma"}, + {ColorAppearanceParams::CTCMode::SATUR, "Saturation"}, + {ColorAppearanceParams::CTCMode::COLORF, "Colorfullness"} }, colorappearance.curveMode3, @@ -2479,13 +2540,13 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) toneCurve.shcompr = 100; // older pp3 files can have values above 100. } - const std::map tc_mapping = { - {"Standard", ToneCurveParams::TC_MODE_STD}, - {"FilmLike", ToneCurveParams::TC_MODE_FILMLIKE}, - {"SatAndValueBlending", ToneCurveParams::TC_MODE_SATANDVALBLENDING}, - {"WeightedStd", ToneCurveParams::TC_MODE_WEIGHTEDSTD}, - {"Luminance", ToneCurveParams::TC_MODE_LUMINANCE}, - {"Perceptual", ToneCurveParams::TC_MODE_PERCEPTUAL} + const std::map tc_mapping = { + {"Standard", ToneCurveParams::Mode::STD}, + {"FilmLike", ToneCurveParams::Mode::FILMLIKE}, + {"SatAndValueBlending", ToneCurveParams::Mode::SATANDVALBLENDING}, + {"WeightedStd", ToneCurveParams::Mode::WEIGHTEDSTD}, + {"Luminance", ToneCurveParams::Mode::LUMINANCE}, + {"Perceptual", ToneCurveParams::Mode::PERCEPTUAL} }; assignFromKeyfile(keyFile, "Exposure", "CurveMode", pedited, tc_mapping, toneCurve.curveMode, pedited->toneCurve.curveMode); @@ -2835,9 +2896,9 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Color appearance", "Tonecie", pedited, colorappearance.tonecie, pedited->colorappearance.tonecie); // if (keyFile.has_key ("Color appearance", "Sharpcie")) {colorappearance.sharpcie = keyFile.get_boolean ("Color appearance", "Sharpcie"); if (pedited) pedited->colorappearance.sharpcie = true; } - const std::map tc_mapping = { - {"Lightness", ColorAppearanceParams::TC_MODE_LIGHT}, - {"Brightness", ColorAppearanceParams::TC_MODE_BRIGHT} + const std::map tc_mapping = { + {"Lightness", ColorAppearanceParams::TCMode::LIGHT}, + {"Brightness", ColorAppearanceParams::TCMode::BRIGHT} }; assignFromKeyfile(keyFile, "Color appearance", "CurveMode", pedited, tc_mapping, colorappearance.curveMode, pedited->colorappearance.curveMode); assignFromKeyfile(keyFile, "Color appearance", "CurveMode2", pedited, tc_mapping, colorappearance.curveMode2, pedited->colorappearance.curveMode2); @@ -2848,9 +2909,9 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) "CurveMode3", pedited, { - {"Chroma", ColorAppearanceParams::TC_MODE_CHROMA}, - {"Saturation", ColorAppearanceParams::TC_MODE_SATUR}, - {"Colorfullness", ColorAppearanceParams::TC_MODE_COLORF} + {"Chroma", ColorAppearanceParams::CTCMode::CHROMA}, + {"Saturation", ColorAppearanceParams::CTCMode::SATUR}, + {"Colorfullness", ColorAppearanceParams::CTCMode::COLORF} }, colorappearance.curveMode3, pedited->colorappearance.curveMode3 diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 62aab66bd..20c9db026 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -253,18 +253,14 @@ private: /** * Parameters of the tone curve */ -class ToneCurveParams -{ - -public: - - enum eTCModeId { - TC_MODE_STD, // Standard modes, the curve is applied on all component individually - TC_MODE_WEIGHTEDSTD, // Weighted standard mode - TC_MODE_FILMLIKE, // Film-like mode, as defined in Adobe's reference code - TC_MODE_SATANDVALBLENDING, // Modify the Saturation and Value channel - TC_MODE_LUMINANCE, // Modify the Luminance channel with coefficients from Rec 709's - TC_MODE_PERCEPTUAL // Keep color appearance constant using perceptual modeling +struct ToneCurveParams { + enum class Mode { + STD, // Standard modes, the curve is applied on all component individually + WEIGHTEDSTD, // Weighted standard mode + FILMLIKE, // Film-like mode, as defined in Adobe's reference code + SATANDVALBLENDING, // Modify the Saturation and Value channel + LUMINANCE, // Modify the Luminance channel with coefficients from Rec 709's + PERCEPTUAL // Keep color appearance constant using perceptual modeling }; bool autoexp; @@ -274,8 +270,8 @@ public: double expcomp; std::vector curve; std::vector curve2; - eTCModeId curveMode; - eTCModeId curveMode2; + Mode curveMode; + Mode curveMode2; int brightness; int black; int contrast; @@ -284,20 +280,17 @@ public: int hlcompr; // Highlight Recovery's compression int hlcomprthresh; // Highlight Recovery's threshold - ToneCurveParams () - { - setDefaults(); - } + ToneCurveParams(); + void setDefaults(); - static bool HLReconstructionNecessary (LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw); + static bool HLReconstructionNecessary(LUTu& histRedRaw, LUTu& histGreenRaw, LUTu& histBlueRaw); }; + /** * Parameters of Retinex */ -class RetinexParams +struct RetinexParams { - -public: bool enabled; std::vector cdcurve; std::vector cdHcurve; @@ -330,23 +323,22 @@ public: int highl; int skal; bool medianmap; - RetinexParams (); + + RetinexParams(); void setDefaults(); - void getCurves (RetinextransmissionCurve &transmissionCurveLUT, RetinexgaintransmissionCurve &gaintransmissionCurveLUT) const; + void getCurves(RetinextransmissionCurve& transmissionCurveLUT, RetinexgaintransmissionCurve& gaintransmissionCurveLUT) const; - static void getDefaultgaintransmissionCurve (std::vector &curve); + static void getDefaultgaintransmissionCurve (std::vector& curve); - static void getDefaulttransmissionCurve (std::vector &curve); + static void getDefaulttransmissionCurve (std::vector& curve); }; /** * Parameters of the luminance curve */ -class LCurveParams +struct LCurveParams { - -public: std::vector lcurve; std::vector acurve; std::vector bcurve; @@ -367,10 +359,7 @@ public: /** * Parameters of the RGB curves */ -class RGBCurvesParams -{ - -public: +struct RGBCurvesParams { bool lumamode; std::vector rcurve; std::vector gcurve; @@ -381,10 +370,7 @@ public: * Parameters of the Color Toning */ -class ColorToningParams -{ - -public: +struct ColorToningParams { bool enabled; bool autosat; std::vector opacityCurve; @@ -429,28 +415,26 @@ public: double sathigh; bool lumamode; - ColorToningParams (); + ColorToningParams(); void setDefaults(); // SHOULD BE GENERALIZED TO ALL CLASSES! - /// @brief Transform the mixer values to their curve equivalences - void mixerToCurve (std::vector &colorCurve, std::vector &opacityCurve) const; - /// @brief Specifically transform the sliders values to their curve equivalences - void slidersToCurve (std::vector &colorCurve, std::vector &opacityCurve) const; - /// @brief Fill the ColorGradientCurve and OpacityCurve LUTf from the control points curve or sliders value - void getCurves (ColorGradientCurve &colorCurveLUT, OpacityCurve &opacityCurveLUT, const double xyz_rgb[3][3], const double rgb_xyz[3][3], bool &opautili) const; - static void getDefaultColorCurve (std::vector &curve); - static void getDefaultOpacityCurve (std::vector &curve); - static void getDefaultCLCurve (std::vector &curve); - static void getDefaultCL2Curve (std::vector &curve); + /// @brief Transform the mixer values to their curve equivalences + void mixerToCurve(std::vector& colorCurve, std::vector& opacityCurve) const; + /// @brief Specifically transform the sliders values to their curve equivalences + void slidersToCurve(std::vector& colorCurve, std::vector& opacityCurve) const; + /// @brief Fill the ColorGradientCurve and OpacityCurve LUTf from the control points curve or sliders value + void getCurves(ColorGradientCurve& colorCurveLUT, OpacityCurve& opacityCurveLUT, const double xyz_rgb[3][3], const double rgb_xyz[3][3], bool& opautili) const; + + static void getDefaultColorCurve(std::vector& curve); + static void getDefaultOpacityCurve(std::vector& curve); + static void getDefaultCLCurve(std::vector& curve); + static void getDefaultCL2Curve(std::vector& curve); }; /** * Parameters of the sharpening */ -class SharpeningParams -{ - -public: +struct SharpeningParams { bool enabled; double radius; int amount; @@ -468,17 +452,15 @@ public: SharpeningParams(); }; -class SharpenEdgeParams -{ -public: + +struct SharpenEdgeParams { bool enabled; int passes; double amount; bool threechannels; }; -class SharpenMicroParams -{ -public: + +struct SharpenMicroParams { bool enabled; bool matrix; double amount; @@ -488,10 +470,7 @@ public: /** * Parameters of the vibrance */ -class VibranceParams -{ - -public: +struct VibranceParams { bool enabled; int pastels; int saturated; @@ -504,83 +483,57 @@ public: VibranceParams(); }; -/** - * Parameters of the color boost - */ -/*class ColorBoostParams { - - public: - int amount; - bool avoidclip; - bool enable_saturationlimiter; - double saturationlimit; -};*/ - /** * Parameters of the white balance adjustments */ +struct WBEntry { + enum class Type { + CAMERA, + AUTO, + DAYLIGHT, + CLOUDY, + SHADE, + WATER, + TUNGSTEN, + FLUORESCENT, + LAMP, + FLASH, + LED, + // CUSTOM one must remain the last one! + CUSTOM + }; -enum WBTypes { - WBT_CAMERA, - WBT_AUTO, - WBT_DAYLIGHT, - WBT_CLOUDY, - WBT_SHADE, - WBT_WATER, - WBT_TUNGSTEN, - WBT_FLUORESCENT, - WBT_LAMP, - WBT_FLASH, - WBT_LED, - // WBT_CUSTOM one must remain the last one! - WBT_CUSTOM -}; - -class WBEntry -{ -public: Glib::ustring ppLabel; - enum WBTypes type; + Type type; Glib::ustring GUILabel; int temperature; double green; 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) {}; }; -class WBParams -{ - -public: - static std::vector wbEntries; +struct WBParams { + static const std::vector wbEntries; Glib::ustring method; int temperature; double green; double equal; double tempBias; - - static void init(); - static void cleanup(); }; /** * Parameters of colorappearance */ -class ColorAppearanceParams -{ - -public: - enum eTCModeId { - TC_MODE_LIGHT, // Lightness mode - TC_MODE_BRIGHT, // Brightness mode +struct ColorAppearanceParams { + enum class TCMode { + LIGHT, // Lightness mode + BRIGHT, // Brightness mode }; - enum eCTCModeId { - TC_MODE_CHROMA, // chroma mode - TC_MODE_SATUR, // saturation mode - TC_MODE_COLORF, // colorfullness mode + enum class CTCMode { + CHROMA, // chroma mode + SATUR, // saturation mode + COLORF, // colorfullness mode }; bool enabled; @@ -591,9 +544,9 @@ public: std::vector curve; std::vector curve2; std::vector curve3; - eTCModeId curveMode; - eTCModeId curveMode2; - eCTCModeId curveMode3; + TCMode curveMode; + TCMode curveMode2; + CTCMode curveMode3; Glib::ustring surround; Glib::ustring surrsrc; @@ -625,50 +578,12 @@ public: double greenout; int tempsc; double greensc; - - // bool sharpcie; }; -/** - * Parameters of the color shift - */ -/*class ColorShiftParams { - - public: - double a; - double b; -};*/ - -/** - * Parameters of the luminance denoising - */ -/*class LumaDenoiseParams { - - public: - bool enabled; - double radius; - int edgetolerance; -};*/ - -/** - * Parameters of the color denoising - */ -/*class ColorDenoiseParams { - - public: - bool enabled; - int edgetolerance; - bool edgesensitive; - int amount; -};*/ - /** * Parameters of defringing */ -class DefringeParams -{ - -public: +struct DefringeParams { bool enabled; double radius; float threshold; @@ -678,10 +593,7 @@ public: /** * Parameters of impulse denoising */ -class ImpulseDenoiseParams -{ - -public: +struct ImpulseDenoiseParams { bool enabled; int thresh; @@ -690,10 +602,7 @@ public: /** * Parameters of the directional pyramid denoising */ -class DirPyrDenoiseParams -{ - -public: +struct DirPyrDenoiseParams { std::vector lcurve; std::vector cccurve; @@ -718,19 +627,14 @@ public: Glib::ustring rgbmethod; int passes; - DirPyrDenoiseParams (); + DirPyrDenoiseParams(); void setDefaults(); // SHOULD BE GENERALIZED TO ALL CLASSES! - void getCurves (NoiseCurve &lCurve, NoiseCurve &cCurve) const; - - static void getDefaultNoisCurve (std::vector &curve); - static void getDefaultCCCurve (std::vector &curve); + void getCurves(NoiseCurve& lCurve, NoiseCurve& cCurve) const; }; -//EPD related parameters. -class EPDParams -{ -public: +// EPD related parameters. +struct EPDParams { bool enabled; double strength; double gamma; @@ -739,34 +643,20 @@ public: int reweightingIterates; }; - // Fattal02 Tone-Mapping parameters -class FattalToneMappingParams { -public: +struct FattalToneMappingParams { bool enabled; int threshold; int amount; - FattalToneMappingParams() - { - setDefaults(); - } - - void setDefaults() - { - enabled = false; - threshold = 0; - amount = 0; - } + FattalToneMappingParams(); + void setDefaults(); }; /** * Parameters of the shadow/highlight enhancement */ -class SHParams -{ - -public: +struct SHParams { bool enabled; bool hq; int highlights; @@ -780,10 +670,7 @@ public: /** * Parameters of the cropping */ -class CropParams -{ - -public: +struct CropParams { bool enabled; int x; int y; @@ -794,63 +681,45 @@ public: Glib::ustring orientation; Glib::ustring guide; - CropParams() : enabled (false), x (0), y (0), w (0), h (0), fixratio (false) {}; - void mapToResized (int resizedWidth, int resizedHeight, int scale, int &x1, int &x2, int &y1, int &y2) const; + CropParams(); + void mapToResized (int resizedWidth, int resizedHeight, int scale, int& x1, int& x2, int& y1, int& y2) const; }; /** * Parameters of the coarse transformations like 90 deg rotations and h/v flipping */ -class CoarseTransformParams -{ - -public: +struct CoarseTransformParams { int rotate; bool hflip; bool vflip; - CoarseTransformParams() - { - setDefaults(); - } + CoarseTransformParams(); void setDefaults(); }; /** * Common transformation parameters */ -class CommonTransformParams -{ - -public: +struct CommonTransformParams { bool autofill; }; /** * Parameters of the rotation */ -class RotateParams -{ - -public: +struct RotateParams { double degree; }; /** * Parameters of the distortion correction */ -class DistortionParams -{ - -public: +struct DistortionParams { double amount; }; // Lens profile correction parameters -class LensProfParams -{ - -public: +struct LensProfParams { enum class LcMode { NONE, // No lens correction LENSFUNAUTOMATCH, // Lens correction using auto matched lensfun database entry @@ -858,7 +727,6 @@ public: LCP // Lens correction using lcp file }; - static const char *methodstring[static_cast(LcMode::LCP) + 1u]; LcMode lcMode; Glib::ustring lcpFile; bool useDist, useVign, useCA; @@ -866,56 +734,24 @@ public: Glib::ustring lfCameraModel; Glib::ustring lfLens; - LensProfParams() - { - setDefaults(); - } + LensProfParams(); void setDefaults(); - bool useLensfun() const - { - return lcMode == LcMode::LENSFUNAUTOMATCH || lcMode == LcMode::LENSFUNMANUAL; - } + bool useLensfun() const; + bool lfAutoMatch() const; + bool useLcp() const; + bool lfManual() const; - bool lfAutoMatch() const - { - return lcMode == LcMode::LENSFUNAUTOMATCH; - } - - bool useLcp() const - { - return lcMode == LcMode::LCP && lcpFile.length() > 0; - } - - bool lfManual() const - { - return lcMode == LcMode::LENSFUNMANUAL; - } - - Glib::ustring getMethodString(LcMode mode) const - { - return methodstring[static_cast(mode)]; - } - - LcMode getMethodNumber(const Glib::ustring &mode) const - { - for(size_t i = 0; i <= static_cast(LcMode::LCP); ++i) { - if(methodstring[i] == mode) { - return static_cast(i); - } - } - return LcMode::NONE; - } + const std::vector& getMethodStrings() const; + Glib::ustring getMethodString(LcMode mode) const; + LcMode getMethodNumber(const Glib::ustring& mode) const; }; /** * Parameters of the perspective correction */ -class PerspectiveParams -{ - -public: +struct PerspectiveParams { double horizontal; double vertical; }; @@ -923,10 +759,7 @@ public: /** * Parameters of the gradient filter */ -class GradientParams -{ - -public: +struct GradientParams { bool enabled; double degree; int feather; @@ -938,10 +771,7 @@ public: /** * Parameters of the post-crop vignette filter */ -class PCVignetteParams -{ - -public: +struct PCVignetteParams { bool enabled; double strength; int feather; @@ -951,10 +781,7 @@ public: /** * Parameters of the vignetting correction */ -class VignettingParams -{ - -public: +struct VignettingParams { int amount; int radius; int strength; @@ -965,10 +792,7 @@ public: /** * Parameters of the color mixer */ -class ChannelMixerParams -{ - -public: +struct ChannelMixerParams { int red[3]; int green[3]; int blue[3]; @@ -1185,12 +1009,12 @@ public: WaveletParams (); void setDefaults(); - void getCurves (WavCurve &cCurve, WavOpacityCurveRG &opacityCurveLUTRG, WavOpacityCurveBY &opacityCurveLUTBY, WavOpacityCurveW &opacityCurveLUTW, WavOpacityCurveWL &opacityCurveLUTWL) const; - static void getDefaultCCWCurve (std::vector &curve); - static void getDefaultOpacityCurveRG (std::vector &curve); - static void getDefaultOpacityCurveBY (std::vector &curve); - static void getDefaultOpacityCurveW (std::vector &curve); - static void getDefaultOpacityCurveWL (std::vector &curve); + void getCurves (WavCurve& cCurve, WavOpacityCurveRG& opacityCurveLUTRG, WavOpacityCurveBY& opacityCurveLUTBY, WavOpacityCurveW& opacityCurveLUTW, WavOpacityCurveWL& opacityCurveLUTWL) const; + static void getDefaultCCWCurve (std::vector& curve); + static void getDefaultOpacityCurveRG (std::vector& curve); + static void getDefaultOpacityCurveBY (std::vector& curve); + static void getDefaultOpacityCurveW (std::vector& curve); + static void getDefaultOpacityCurveWL (std::vector& curve); }; @@ -1420,7 +1244,7 @@ public: CACorrParams cacorrection; ///< Lens c/a correction parameters VignettingParams vignetting; ///< Lens vignetting correction parameters ChannelMixerParams chmixer; ///< Channel mixer parameters - BlackWhiteParams blackwhite; ///< Black & White parameters + BlackWhiteParams blackwhite; ///< Black& White parameters ResizeParams resize; ///< Resize parameters ColorManagementParams icm; ///< profiles/color spaces used during the image processing RAWParams raw; ///< RAW parameters before demosaicing @@ -1455,14 +1279,14 @@ public: * @param pedited pointer to a ParamsEdited object (optional) to store which values has to be saved * @return Error code (=0 if all supplied filenames where created correctly) */ - int save (const Glib::ustring &fname, const Glib::ustring &fname2 = "", bool fnameAbsolute = true, ParamsEdited* pedited = nullptr); + int save (const Glib::ustring& fname, const Glib::ustring& fname2 = "", bool fnameAbsolute = true, ParamsEdited* pedited = nullptr); /** * Loads the parameters from a file. * @param fname the name of the file * @params pedited pointer to a ParamsEdited object (optional) to store which values has been loaded * @return Error code (=0 if no error) */ - int load (const Glib::ustring &fname, ParamsEdited* pedited = nullptr); + int load (const Glib::ustring& fname, ParamsEdited* pedited = nullptr); /** Creates a new instance of ProcParams. * @return a pointer to the new ProcParams instance. */ @@ -1484,7 +1308,7 @@ private: * @param content the text to write * @return Error code (=0 if no error) * */ - int write (const Glib::ustring &fname, const Glib::ustring &content) const; + int write (const Glib::ustring& fname, const Glib::ustring& content) const; }; @@ -1514,7 +1338,7 @@ public: PartialProfile (const ProcParams* pp, const ParamsEdited* pe = nullptr); void deleteInstance (); void clearGeneral (); - int load (const Glib::ustring &fName); + int load (const Glib::ustring& fName); void set (bool v); const void applyTo (ProcParams *destParams) const ; }; diff --git a/rtengine/utils.h b/rtengine/utils.h index 9c56ad0a0..5730c2544 100644 --- a/rtengine/utils.h +++ b/rtengine/utils.h @@ -38,7 +38,7 @@ void hflip(unsigned char* img, int w, int h); void vflip(unsigned char* img, int w, int h); template -typename std::underlying_type::type toUnderlying(ENUM value) +constexpr typename std::underlying_type::type toUnderlying(ENUM value) { return static_cast::type>(value); } diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc index 91f58f42e..7d8eb7de4 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -799,9 +799,9 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) shape->setCurve (pp->colorappearance.curve); shape2->setCurve (pp->colorappearance.curve2); shape3->setCurve (pp->colorappearance.curve3); - toneCurveMode->set_active (pp->colorappearance.curveMode); - toneCurveMode2->set_active (pp->colorappearance.curveMode2); - toneCurveMode3->set_active (pp->colorappearance.curveMode3); + toneCurveMode->set_active (toUnderlying(pp->colorappearance.curveMode)); + toneCurveMode2->set_active (toUnderlying(pp->colorappearance.curveMode2)); + toneCurveMode3->set_active (toUnderlying(pp->colorappearance.curveMode3)); curveMode3Changed(); // This will set the correct sensitive state of depending Adjusters if (pedited) { @@ -1044,27 +1044,27 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited) int tcMode = toneCurveMode->get_active_row_number(); if (tcMode == 0) { - pp->colorappearance.curveMode = ColorAppearanceParams::TC_MODE_LIGHT; + pp->colorappearance.curveMode = ColorAppearanceParams::TCMode::LIGHT; } else if (tcMode == 1) { - pp->colorappearance.curveMode = ColorAppearanceParams::TC_MODE_BRIGHT; + pp->colorappearance.curveMode = ColorAppearanceParams::TCMode::BRIGHT; } tcMode = toneCurveMode2->get_active_row_number(); if (tcMode == 0) { - pp->colorappearance.curveMode2 = ColorAppearanceParams::TC_MODE_LIGHT; + pp->colorappearance.curveMode2 = ColorAppearanceParams::TCMode::LIGHT; } else if (tcMode == 1) { - pp->colorappearance.curveMode2 = ColorAppearanceParams::TC_MODE_BRIGHT; + pp->colorappearance.curveMode2 = ColorAppearanceParams::TCMode::BRIGHT; } int tcMode3 = toneCurveMode3->get_active_row_number(); if (tcMode3 == 0) { - pp->colorappearance.curveMode3 = ColorAppearanceParams::TC_MODE_CHROMA; + pp->colorappearance.curveMode3 = ColorAppearanceParams::CTCMode::CHROMA; } else if (tcMode3 == 1) { - pp->colorappearance.curveMode3 = ColorAppearanceParams::TC_MODE_SATUR; + pp->colorappearance.curveMode3 = ColorAppearanceParams::CTCMode::SATUR; } else if (tcMode3 == 2) { - pp->colorappearance.curveMode3 = ColorAppearanceParams::TC_MODE_COLORF; + pp->colorappearance.curveMode3 = ColorAppearanceParams::CTCMode::COLORF; } if (pedited) { diff --git a/rtgui/dirpyrdenoise.cc b/rtgui/dirpyrdenoise.cc index 168a9df03..2a90f183e 100644 --- a/rtgui/dirpyrdenoise.cc +++ b/rtgui/dirpyrdenoise.cc @@ -61,7 +61,7 @@ DirPyrDenoise::DirPyrDenoise () : FoldableToolPanel(this, "dirpyrdenoise", M("TP NoiscurveEditorG = new CurveEditorGroup (options.lastDenoiseCurvesDir, M("TP_DIRPYRDENOISE_LCURVE")); //curveEditorG = new CurveEditorGroup (options.lastLabCurvesDir); NoiscurveEditorG->setCurveListener (this); - rtengine::DirPyrDenoiseParams::getDefaultNoisCurve(defaultCurve); + defaultCurve = rtengine::DirPyrDenoiseParams().lcurve; lshape = static_cast(NoiscurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); lshape->setIdentityValue(0.); lshape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); @@ -145,7 +145,7 @@ DirPyrDenoise::DirPyrDenoise () : FoldableToolPanel(this, "dirpyrdenoise", M("TP CCcurveEditorG = new CurveEditorGroup (options.lastDenoiseCurvesDir, M("TP_DIRPYRDENOISE_CCCURVE")); CCcurveEditorG->setCurveListener (this); - rtengine::DirPyrDenoiseParams::getDefaultCCCurve(defaultCurve); + defaultCurve = rtengine::DirPyrDenoiseParams().cccurve; ccshape = static_cast(CCcurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); ccshape->setIdentityValue(0.); ccshape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index 28dcf9f3d..558b0fe6b 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -223,8 +223,8 @@ void ToneCurve::read (const ProcParams* pp, const ParamsEdited* pedited) shape->setCurve (pp->toneCurve.curve); shape2->setCurve (pp->toneCurve.curve2); - toneCurveMode->set_active(pp->toneCurve.curveMode); - toneCurveMode2->set_active(pp->toneCurve.curveMode2); + toneCurveMode->set_active(rtengine::toUnderlying(pp->toneCurve.curveMode)); + toneCurveMode2->set_active(rtengine::toUnderlying(pp->toneCurve.curveMode2)); if (pedited) { expcomp->setEditedState (pedited->toneCurve.expcomp ? Edited : UnEdited); @@ -314,33 +314,33 @@ void ToneCurve::write (ProcParams* pp, ParamsEdited* pedited) int tcMode = toneCurveMode->get_active_row_number(); if (tcMode == 0) { - pp->toneCurve.curveMode = ToneCurveParams::TC_MODE_STD; + pp->toneCurve.curveMode = ToneCurveParams::Mode::STD; } else if (tcMode == 1) { - pp->toneCurve.curveMode = ToneCurveParams::TC_MODE_WEIGHTEDSTD; + pp->toneCurve.curveMode = ToneCurveParams::Mode::WEIGHTEDSTD; } else if (tcMode == 2) { - pp->toneCurve.curveMode = ToneCurveParams::TC_MODE_FILMLIKE; + pp->toneCurve.curveMode = ToneCurveParams::Mode::FILMLIKE; } else if (tcMode == 3) { - pp->toneCurve.curveMode = ToneCurveParams::TC_MODE_SATANDVALBLENDING; + pp->toneCurve.curveMode = ToneCurveParams::Mode::SATANDVALBLENDING; } else if (tcMode == 4) { - pp->toneCurve.curveMode = ToneCurveParams::TC_MODE_LUMINANCE; + pp->toneCurve.curveMode = ToneCurveParams::Mode::LUMINANCE; } else if (tcMode == 5) { - pp->toneCurve.curveMode = ToneCurveParams::TC_MODE_PERCEPTUAL; + pp->toneCurve.curveMode = ToneCurveParams::Mode::PERCEPTUAL; } tcMode = toneCurveMode2->get_active_row_number(); if (tcMode == 0) { - pp->toneCurve.curveMode2 = ToneCurveParams::TC_MODE_STD; + pp->toneCurve.curveMode2 = ToneCurveParams::Mode::STD; } else if (tcMode == 1) { - pp->toneCurve.curveMode2 = ToneCurveParams::TC_MODE_WEIGHTEDSTD; + pp->toneCurve.curveMode2 = ToneCurveParams::Mode::WEIGHTEDSTD; } else if (tcMode == 2) { - pp->toneCurve.curveMode2 = ToneCurveParams::TC_MODE_FILMLIKE; + pp->toneCurve.curveMode2 = ToneCurveParams::Mode::FILMLIKE; } else if (tcMode == 3) { - pp->toneCurve.curveMode2 = ToneCurveParams::TC_MODE_SATANDVALBLENDING; + pp->toneCurve.curveMode2 = ToneCurveParams::Mode::SATANDVALBLENDING; } else if (tcMode == 4) { - pp->toneCurve.curveMode2 = ToneCurveParams::TC_MODE_LUMINANCE; + pp->toneCurve.curveMode2 = ToneCurveParams::Mode::LUMINANCE; } else if (tcMode == 5) { - pp->toneCurve.curveMode2 = ToneCurveParams::TC_MODE_PERCEPTUAL; + pp->toneCurve.curveMode2 = ToneCurveParams::Mode::PERCEPTUAL; } if (pedited) { diff --git a/rtgui/whitebalance.cc b/rtgui/whitebalance.cc index d16dafa08..fc6a880f3 100644 --- a/rtgui/whitebalance.cc +++ b/rtgui/whitebalance.cc @@ -34,7 +34,7 @@ using namespace rtengine; using namespace rtengine::procparams; -Glib::RefPtr WhiteBalance::wbPixbufs[rtengine::procparams::WBT_CUSTOM + 1]; +Glib::RefPtr WhiteBalance::wbPixbufs[toUnderlying(WBEntry::Type::CUSTOM) + 1]; /* Glib::RefPtr WhiteBalance::wbCameraPB, WhiteBalance::wbAutoPB, WhiteBalance::wbSunPB, WhiteBalance::wbTungstenPB, WhiteBalance::wbCloudyPB, WhiteBalance::wbShadePB, WhiteBalance::wbFluorescentPB, WhiteBalance::wbLampPB, @@ -43,24 +43,24 @@ Glib::RefPtr WhiteBalance::wbCameraPB, WhiteBalance::wbAutoPB, Whit void WhiteBalance::init () { - wbPixbufs[WBT_CAMERA] = RTImage::createFromFile ("wb-camera.png"); - wbPixbufs[WBT_AUTO] = RTImage::createFromFile ("wb-auto.png"); - wbPixbufs[WBT_DAYLIGHT] = RTImage::createFromFile ("wb-sun.png"); - wbPixbufs[WBT_CLOUDY] = RTImage::createFromFile ("wb-cloudy.png"); - wbPixbufs[WBT_SHADE] = RTImage::createFromFile ("wb-shade.png"); - wbPixbufs[WBT_WATER] = RTImage::createFromFile ("wb-water.png"); -// wbPixbufs[WBT_WATER2] = RTImage::createFromFile ("wb-water.png"); - wbPixbufs[WBT_TUNGSTEN] = RTImage::createFromFile ("wb-tungsten.png"); - wbPixbufs[WBT_FLUORESCENT] = RTImage::createFromFile ("wb-fluorescent.png"); - wbPixbufs[WBT_LAMP] = RTImage::createFromFile ("wb-lamp.png"); - wbPixbufs[WBT_FLASH] = RTImage::createFromFile ("wb-flash.png"); - wbPixbufs[WBT_LED] = RTImage::createFromFile ("wb-led.png"); - wbPixbufs[WBT_CUSTOM] = RTImage::createFromFile ("wb-custom.png"); + wbPixbufs[toUnderlying(WBEntry::Type::CAMERA)] = RTImage::createFromFile ("wb-camera.png"); + wbPixbufs[toUnderlying(WBEntry::Type::AUTO)] = RTImage::createFromFile ("wb-auto.png"); + wbPixbufs[toUnderlying(WBEntry::Type::DAYLIGHT)] = RTImage::createFromFile ("wb-sun.png"); + wbPixbufs[toUnderlying(WBEntry::Type::CLOUDY)] = RTImage::createFromFile ("wb-cloudy.png"); + wbPixbufs[toUnderlying(WBEntry::Type::SHADE)] = RTImage::createFromFile ("wb-shade.png"); + wbPixbufs[toUnderlying(WBEntry::Type::WATER)] = RTImage::createFromFile ("wb-water.png"); +// wbPixbufs[WBEntry::Type::WATER2] = RTImage::createFromFile ("wb-water.png"); + wbPixbufs[toUnderlying(WBEntry::Type::TUNGSTEN)] = RTImage::createFromFile ("wb-tungsten.png"); + wbPixbufs[toUnderlying(WBEntry::Type::FLUORESCENT)] = RTImage::createFromFile ("wb-fluorescent.png"); + wbPixbufs[toUnderlying(WBEntry::Type::LAMP)] = RTImage::createFromFile ("wb-lamp.png"); + wbPixbufs[toUnderlying(WBEntry::Type::FLASH)] = RTImage::createFromFile ("wb-flash.png"); + wbPixbufs[toUnderlying(WBEntry::Type::LED)] = RTImage::createFromFile ("wb-led.png"); + wbPixbufs[toUnderlying(WBEntry::Type::CUSTOM)] = RTImage::createFromFile ("wb-custom.png"); } void WhiteBalance::cleanup () { - for (unsigned int i = 0; i < WBT_CUSTOM + 1; i++) { + for (unsigned int i = 0; i < toUnderlying(WBEntry::Type::CUSTOM) + 1; i++) { wbPixbufs[i].reset(); } } @@ -163,68 +163,68 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, "whitebalance", M("TP_WB // Assign the model to the Combobox method->set_model(refTreeModel); - enum WBTypes oldType = WBParams::wbEntries[0]->type; - enum WBTypes currType; + WBEntry::Type oldType = WBParams::wbEntries[0].type; + WBEntry::Type currType; Gtk::TreeModel::Row row, childrow; for (unsigned int i = 0; i < WBParams::wbEntries.size(); i++) { - if (oldType != (currType = WBParams::wbEntries[i]->type)) { + if (oldType != (currType = WBParams::wbEntries[i].type)) { // New entry type - if (currType == WBT_FLUORESCENT) { + if (currType == WBEntry::Type::FLUORESCENT) { // Creating the Fluorescent subcategory header row = *(refTreeModel->append()); - row[methodColumns.colIcon] = wbPixbufs[currType]; + row[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)]; row[methodColumns.colLabel] = M("TP_WBALANCE_FLUO_HEADER"); row[methodColumns.colId] = i + 100; } - if (currType == WBT_WATER) { + if (currType == WBEntry::Type::WATER) { // Creating the under water subcategory header row = *(refTreeModel->append()); - row[methodColumns.colIcon] = wbPixbufs[currType]; + row[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)]; row[methodColumns.colLabel] = M("TP_WBALANCE_WATER_HEADER"); row[methodColumns.colId] = i + 100; } - if (currType == WBT_LAMP) { + if (currType == WBEntry::Type::LAMP) { // Creating the Lamp subcategory header row = *(refTreeModel->append()); - row[methodColumns.colIcon] = wbPixbufs[currType]; + row[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)]; row[methodColumns.colLabel] = M("TP_WBALANCE_LAMP_HEADER"); row[methodColumns.colId] = i + 100; } - if (currType == WBT_LED) { + if (currType == WBEntry::Type::LED) { // Creating the LED subcategory header row = *(refTreeModel->append()); - row[methodColumns.colIcon] = wbPixbufs[currType]; + row[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)]; row[methodColumns.colLabel] = M("TP_WBALANCE_LED_HEADER"); row[methodColumns.colId] = i + 100; } - if (currType == WBT_FLASH) { + if (currType == WBEntry::Type::FLASH) { // Creating the Flash subcategory header row = *(refTreeModel->append()); - row[methodColumns.colIcon] = wbPixbufs[currType]; + row[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)]; row[methodColumns.colLabel] = M("TP_WBALANCE_FLASH_HEADER"); row[methodColumns.colId] = i + 100; } } - if (currType == WBT_FLUORESCENT - || currType == WBT_LAMP - || currType == WBT_WATER - || currType == WBT_FLASH - || currType == WBT_LED + if (currType == WBEntry::Type::FLUORESCENT + || currType == WBEntry::Type::LAMP + || currType == WBEntry::Type::WATER + || currType == WBEntry::Type::FLASH + || currType == WBEntry::Type::LED ) { childrow = *(refTreeModel->append(row.children())); - childrow[methodColumns.colIcon] = wbPixbufs[currType]; - childrow[methodColumns.colLabel] = WBParams::wbEntries[i]->GUILabel; + childrow[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)]; + childrow[methodColumns.colLabel] = WBParams::wbEntries[i].GUILabel; childrow[methodColumns.colId] = i; } else { row = *(refTreeModel->append()); - row[methodColumns.colIcon] = wbPixbufs[currType]; - row[methodColumns.colLabel] = WBParams::wbEntries[i]->GUILabel; + row[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)]; + row[methodColumns.colLabel] = WBParams::wbEntries[i].GUILabel; row[methodColumns.colId] = i; } @@ -362,12 +362,24 @@ void WhiteBalance::adjusterChanged (Adjuster* a, double newval) } Glib::ustring colLabel = row[methodColumns.colLabel]; - WBEntry* ppMethod = findWBEntry (row[methodColumns.colLabel], WBLT_GUI); - WBEntry* wbCustom = findWBEntry ("Custom", WBLT_PP); + const std::pair ppMethod = findWBEntry (row[methodColumns.colLabel], WBLT_GUI); + const std::pair wbCustom = findWBEntry ("Custom", WBLT_PP); - if (!ppMethod || (ppMethod->ppLabel != wbCustom->ppLabel && !((a == equal || a == tempBias) && ppMethod->type == WBT_AUTO)) ) { + if ( + !ppMethod.first + || ( + ppMethod.second.ppLabel != wbCustom.second.ppLabel + && !( + ( + a == equal + || a == tempBias + ) + && ppMethod.second.type == WBEntry::Type::AUTO + ) + ) + ) { methconn.block(true); - opt = setActiveMethod(wbCustom->GUILabel); + opt = setActiveMethod(wbCustom.second.GUILabel); tempBias->set_sensitive(false); cache_customWB (tVal, gVal); @@ -429,12 +441,12 @@ void WhiteBalance::optChanged () tempBias->setEditedState (UnEdited); } else { unsigned int methodId = findWBEntryId (row[methodColumns.colLabel], WBLT_GUI); - WBEntry* currMethod = WBParams::wbEntries[methodId]; + const WBEntry& currMethod = WBParams::wbEntries[methodId]; - tempBias->set_sensitive(currMethod->type == WBT_AUTO); + tempBias->set_sensitive(currMethod.type == WBEntry::Type::AUTO); - switch (currMethod->type) { - case WBT_CAMERA: + switch (currMethod.type) { + case WBEntry::Type::CAMERA: if (wbp) { double ctemp, cgreen; wbp->getCamWB (ctemp, cgreen); @@ -451,7 +463,7 @@ void WhiteBalance::optChanged () break; - case WBT_AUTO: + case WBEntry::Type::AUTO: if (wbp) { if (batchMode) { temp->setEditedState (UnEdited); @@ -464,7 +476,7 @@ void WhiteBalance::optChanged () break; - case WBT_CUSTOM: + case WBEntry::Type::CUSTOM: if (custom_temp > 0) { temp->setValue (temp->getAddMode() ? 0.0 : custom_temp); green->setValue (green->getAddMode() ? 0.0 : custom_green); @@ -484,19 +496,19 @@ void WhiteBalance::optChanged () break; /* All other solution are the default cases - case WBT_DAYLIGHT: - case WBT_CLOUDY: - case WBT_SHADE: - case WBT_TUNGSTEN: - case WBT_FLUORESCENT: - case WBT_LAMP: - case WBT_FLASH: - case WBT_LED:*/ + case WBEntry::Type::DAYLIGHT: + case WBEntry::Type::CLOUDY: + case WBEntry::Type::SHADE: + case WBEntry::Type::TUNGSTEN: + case WBEntry::Type::FLUORESCENT: + case WBEntry::Type::LAMP: + case WBEntry::Type::FLASH: + case WBEntry::Type::LED:*/ default: // recall custom WB settings if it exists, set to 1.0 otherwise - temp->setValue ( temp->getAddMode() ? 0.0 : (double)(currMethod->temperature)); - green->setValue (green->getAddMode() ? 0.0 : (double)(currMethod->green)); - equal->setValue (equal->getAddMode() ? 0.0 : (double)(currMethod->equal)); + temp->setValue ( temp->getAddMode() ? 0.0 : (double)(currMethod.temperature)); + green->setValue (green->getAddMode() ? 0.0 : (double)(currMethod.green)); + equal->setValue (equal->getAddMode() ? 0.0 : (double)(currMethod.equal)); if (batchMode) { temp->setEditedState (Edited); @@ -551,17 +563,21 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited) if (pedited && !pedited->wb.method) { opt = setActiveMethod(M("GENERAL_UNCHANGED")); } else { - WBEntry* wbValues = findWBEntry(pp->wb.method, WBLT_PP); + const WBEntry& wbValues = + [this, pp]() -> const WBEntry& + { + const std::pair res = findWBEntry(pp->wb.method, WBLT_PP); + return + !res.first + ? findWBEntry("Camera", WBLT_PP).second + : res.second; + }(); - if (!wbValues) { - wbValues = findWBEntry("Camera", WBLT_PP); - } - - opt = setActiveMethod(wbValues->GUILabel); + opt = setActiveMethod(wbValues.GUILabel); // temperature is reset to the associated temperature, or 0.0 if addMode is set. - switch (wbValues->type) { - case WBT_CUSTOM: + switch (wbValues.type) { + case WBEntry::Type::CUSTOM: temp->setValue (temp->getAddMode() ? 0.0 : pp->wb.temperature); green->setValue (green->getAddMode() ? 0.0 : pp->wb.green); equal->setValue (equal->getAddMode() ? 0.0 : pp->wb.equal); @@ -578,7 +594,7 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited) break; - case WBT_CAMERA: + case WBEntry::Type::CAMERA: if (wbp) { double ctemp = -1.0; double cgreen = -1.0; @@ -600,7 +616,7 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited) break; - case WBT_AUTO: + case WBEntry::Type::AUTO: // the equalizer's value is restored for the AutoWB equal->setValue (equal->getAddMode() ? 0.0 : pp->wb.equal); tempBias->setValue (tempBias->getAddMode() ? 0.0 : pp->wb.tempBias); @@ -620,18 +636,18 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited) /* All those types are the "default" case: - case WBT_DAYLIGHT: - case WBT_CLOUDY: - case WBT_SHADE: - case WBT_TUNGSTEN: - case WBT_FLUORESCENT: - case WBT_LAMP: - case WBT_FLASH: - case WBT_LED: + case WBEntry::Type::DAYLIGHT: + case WBEntry::Type::CLOUDY: + case WBEntry::Type::SHADE: + case WBEntry::Type::TUNGSTEN: + case WBEntry::Type::FLUORESCENT: + case WBEntry::Type::LAMP: + case WBEntry::Type::FLASH: + case WBEntry::Type::LED: */ default: // Set the associated temperature, or 0.0 if in ADD mode - temp->setValue(temp->getAddMode() ? 0.0 : (double)wbValues->temperature); + temp->setValue(temp->getAddMode() ? 0.0 : (double)wbValues.temperature); // Set the stored temperature, or 0.0 if in ADD mode green->setValue(green->getAddMode() ? 0.0 : pp->wb.green); equal->setValue(equal->getAddMode() ? 0.0 : pp->wb.equal); @@ -648,7 +664,7 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited) break; } - tempBias->set_sensitive(wbValues->type == WBT_AUTO); + tempBias->set_sensitive(wbValues.type == WBEntry::Type::AUTO); } methconn.block (false); @@ -668,10 +684,10 @@ void WhiteBalance::write (ProcParams* pp, ParamsEdited* pedited) pedited->wb.method = row[methodColumns.colLabel] != M("GENERAL_UNCHANGED"); } - WBEntry* ppMethod = findWBEntry (row[methodColumns.colLabel], WBLT_GUI); + const std::pair ppMethod = findWBEntry (row[methodColumns.colLabel], WBLT_GUI); - if (ppMethod) { - pp->wb.method = ppMethod->ppLabel; + if (ppMethod.first) { + pp->wb.method = ppMethod.second.ppLabel; } pp->wb.temperature = temp->getIntValue (); @@ -739,10 +755,10 @@ void WhiteBalance::setWB (int vtemp, double vgreen) { methconn.block(true); - WBEntry *wbValues = findWBEntry("Custom", WBLT_PP); + const std::pair wbValues = findWBEntry("Custom", WBLT_PP); temp->setValue (vtemp); green->setValue (vgreen); - opt = setActiveMethod(wbValues->GUILabel); + opt = setActiveMethod(wbValues.second.GUILabel); cache_customWB (vtemp, vgreen); // sequence in which this call is made is important; must be before "method->set_active (2);" cache_customEqual(equal->getValue()); temp->setEditedState (Edited); @@ -792,10 +808,10 @@ void WhiteBalance::cache_customWB(int temp, double green) cache_customGreen (green); } -unsigned int WhiteBalance::findWBEntryId (const Glib::ustring &label, enum WB_LabelType lblType) +unsigned int WhiteBalance::findWBEntryId (const Glib::ustring& label, enum WB_LabelType lblType) { for (unsigned int i = 0; i < WBParams::wbEntries.size(); i++) { - if (label == (lblType == WBLT_GUI ? WBParams::wbEntries[i]->GUILabel : WBParams::wbEntries[i]->ppLabel)) { + if (label == (lblType == WBLT_GUI ? WBParams::wbEntries[i].GUILabel : WBParams::wbEntries[i].ppLabel)) { return i; } } @@ -803,15 +819,15 @@ unsigned int WhiteBalance::findWBEntryId (const Glib::ustring &label, enum WB_La return 0; // default to camera wb } -WBEntry* WhiteBalance::findWBEntry (Glib::ustring label, enum WB_LabelType lblType) +std::pair WhiteBalance::findWBEntry(const Glib::ustring& label, enum WB_LabelType lblType) { - for (unsigned int i = 0; i < WBParams::wbEntries.size(); i++) { - if (label == (lblType == WBLT_GUI ? WBParams::wbEntries[i]->GUILabel : WBParams::wbEntries[i]->ppLabel)) { - return WBParams::wbEntries[i]; + for (unsigned int i = 0; i < WBParams::wbEntries.size(); ++i) { + if (label == (lblType == WBLT_GUI ? WBParams::wbEntries[i].GUILabel : WBParams::wbEntries[i].ppLabel)) { + return {true, WBParams::wbEntries[i]}; } } - return nullptr; + return {false, WBParams::wbEntries[0]}; } int WhiteBalance::_setActiveMethod(Glib::ustring &label, Gtk::TreeModel::Children &children) diff --git a/rtgui/whitebalance.h b/rtgui/whitebalance.h index 7366e55b5..d1fafcea3 100644 --- a/rtgui/whitebalance.h +++ b/rtgui/whitebalance.h @@ -57,7 +57,7 @@ protected: } }; - static Glib::RefPtr wbPixbufs[rtengine::procparams::WBT_CUSTOM + 1]; + static Glib::RefPtr wbPixbufs[rtengine::toUnderlying(rtengine::procparams::WBEntry::Type::CUSTOM) + 1]; Glib::RefPtr refTreeModel; MethodColumns methodColumns; MyComboBox* method; @@ -85,9 +85,9 @@ protected: int setActiveMethod (Glib::ustring label); int _setActiveMethod (Glib::ustring &label, Gtk::TreeModel::Children &children); - Gtk::TreeModel::Row getActiveMethod (); - unsigned int findWBEntryId (const Glib::ustring &label, enum WB_LabelType lblType = WBLT_GUI); - rtengine::procparams::WBEntry* findWBEntry (Glib::ustring label, enum WB_LabelType lblType = WBLT_GUI); + Gtk::TreeModel::Row getActiveMethod(); + unsigned int findWBEntryId (const Glib::ustring& label, enum WB_LabelType lblType = WBLT_GUI); + std::pair findWBEntry (const Glib::ustring& label, enum WB_LabelType lblType = WBLT_GUI); public: