Merge pull request #4192 from Beep6581/procparams-cleanup

Procparams cleanup
This commit is contained in:
Beep6581 2017-12-05 23:16:00 +01:00 committed by GitHub
commit a5571a4379
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
38 changed files with 4464 additions and 8552 deletions

View File

@ -45,7 +45,7 @@ SSEFUNCTION void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw,
volatile double progress = 0.0; volatile double progress = 0.0;
if (plistener) { if (plistener) {
plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::amaze])); plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AMAZE)));
plistener->setProgress (0.0); plistener->setProgress (0.0);
} }

View File

@ -65,7 +65,7 @@ extern const Settings* settings;
void RawImageSource::eahd_demosaic () void RawImageSource::eahd_demosaic ()
{ {
if (plistener) { if (plistener) {
plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::eahd])); plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::EAHD)));
plistener->setProgress (0.0); plistener->setProgress (0.0);
} }
@ -494,7 +494,7 @@ void RawImageSource::hphd_green (float** hpmap)
void RawImageSource::hphd_demosaic () void RawImageSource::hphd_demosaic ()
{ {
if (plistener) { if (plistener) {
plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::hphd])); plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::HPHD)));
plistener->setProgress (0.0); plistener->setProgress (0.0);
} }
@ -595,7 +595,7 @@ void RawImageSource::vng4_demosaic ()
const bool plistenerActive = plistener; const bool plistenerActive = plistener;
if (plistenerActive) { if (plistenerActive) {
plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::vng4])); plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::VNG4)));
plistener->setProgress (progress); plistener->setProgress (progress);
} }
@ -893,7 +893,7 @@ void RawImageSource::ppg_demosaic()
if (plistener) { if (plistener) {
// looks like ppg isn't supported anymore // looks like ppg isn't supported anymore
//plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::ppg])); //plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::ppg)));
plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), "xxx")); plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), "xxx"));
plistener->setProgress (0.0); plistener->setProgress (0.0);
} }
@ -1201,7 +1201,7 @@ void RawImageSource::jdl_interpolate_omp() // from "Lassus"
if (plistener) { if (plistener) {
// this function seems to be unused // this function seems to be unused
//plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::jdl])); //plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::jdl)));
plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), "xxx")); plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), "xxx"));
plistener->setProgress (0.0); plistener->setProgress (0.0);
} }
@ -1397,7 +1397,7 @@ SSEFUNCTION void RawImageSource::lmmse_interpolate_omp(int winw, int winh, array
} }
if (plistener) { if (plistener) {
plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::lmmse])); plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::LMMSE)));
plistener->setProgress (0.0); plistener->setProgress (0.0);
} }
@ -1975,7 +1975,7 @@ SSEFUNCTION void RawImageSource::igv_interpolate(int winw, int winh)
border_interpolate2(winw, winh, 7); border_interpolate2(winw, winh, 7);
if (plistener) { if (plistener) {
plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::igv])); plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::IGV)));
plistener->setProgress (0.0); plistener->setProgress (0.0);
} }
@ -2365,7 +2365,7 @@ void RawImageSource::igv_interpolate(int winw, int winh)
border_interpolate2(winw, winh, 7); border_interpolate2(winw, winh, 7);
if (plistener) { if (plistener) {
plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::igv])); plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::IGV)));
plistener->setProgress (0.0); plistener->setProgress (0.0);
} }
@ -2640,7 +2640,7 @@ void RawImageSource::ahd_demosaic()
const float d65_white[3] = { 0.950456, 1, 1.088754 }; const float d65_white[3] = { 0.950456, 1, 1.088754 };
if (plistener) { if (plistener) {
plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::ahd])); plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AHD)));
plistener->setProgress (0.0); plistener->setProgress (0.0);
} }
@ -3703,7 +3703,7 @@ BENCHFUN
double currentProgress = 0.0; double currentProgress = 0.0;
if(plistener) { if(plistener) {
plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::dcb])); plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::DCB)));
plistener->setProgress (currentProgress); plistener->setProgress (currentProgress);
} }

View File

@ -62,7 +62,7 @@ SSEFUNCTION void RawImageSource::fast_demosaic()
//int winw=W, winh=H; //int winw=W, winh=H;
if (plistener) { if (plistener) {
plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::fast])); plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::FAST)));
plistener->setProgress (progress); plistener->setProgress (progress);
} }

View File

@ -171,14 +171,14 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
if ( !highDetailNeeded ) { if ( !highDetailNeeded ) {
// if below 100% magnification, take a fast path // if below 100% magnification, take a fast path
if (rp.bayersensor.method != RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::none] && rp.bayersensor.method != RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::mono]) { if (rp.bayersensor.method != RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::NONE) && rp.bayersensor.method != RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::NONE)) {
rp.bayersensor.method = RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::fast]; rp.bayersensor.method = RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::FAST);
} }
//bayerrp.all_enhance = false; //bayerrp.all_enhance = false;
if (rp.xtranssensor.method != RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::none] && rp.xtranssensor.method != RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::mono]) { if (rp.xtranssensor.method != RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::NONE) && rp.xtranssensor.method != RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::NONE)) {
rp.xtranssensor.method = RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::fast]; rp.xtranssensor.method = RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::FAST);
} }
rp.bayersensor.ccSteps = 0; rp.bayersensor.ccSteps = 0;

View File

@ -438,11 +438,11 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L
} }
// extracting datas from 'params' to avoid cache flush (to be confirmed) // extracting datas from 'params' to avoid cache flush (to be confirmed)
ColorAppearanceParams::eTCModeId curveMode = params->colorappearance.curveMode; ColorAppearanceParams::TcMode curveMode = params->colorappearance.curveMode;
ColorAppearanceParams::eTCModeId curveMode2 = params->colorappearance.curveMode2; ColorAppearanceParams::TcMode curveMode2 = params->colorappearance.curveMode2;
bool hasColCurve1 = bool (customColCurve1); bool hasColCurve1 = bool (customColCurve1);
bool hasColCurve2 = bool (customColCurve2); bool hasColCurve2 = bool (customColCurve2);
ColorAppearanceParams::eCTCModeId curveMode3 = params->colorappearance.curveMode3; ColorAppearanceParams::CtcMode curveMode3 = params->colorappearance.curveMode3;
bool hasColCurve3 = bool (customColCurve3); bool hasColCurve3 = bool (customColCurve3);
@ -801,7 +801,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L
} }
if (hasColCurve1) {//curve 1 with Lightness and Brightness 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 Jj=(float) Jpro*327.68;
float Jold=Jj; float Jold=Jj;
const Lightcurve& userColCurve = static_cast<const Lightcurve&>(customColCurve1); const Lightcurve& userColCurve = static_cast<const Lightcurve&>(customColCurve1);
@ -839,7 +839,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L
} }
t1L = true; 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 //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 coef = ((aw + 4.f) * (4.f / c)) / 100.f;
float Qanc = Qpro; float Qanc = Qpro;
@ -887,7 +887,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L
} }
if (hasColCurve2) {//curve 2 with Lightness and Brightness 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 Jj = (float) Jpro * 327.68;
float Jold = Jj; float Jold = Jj;
/* /*
@ -930,7 +930,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L
Jpro = 1.; Jpro = 1.;
} }
} else if (curveMode2 == ColorAppearanceParams::TC_MODE_BRIGHT) { // } else if (curveMode2 == ColorAppearanceParams::TcMode::BRIGHT) { //
float Qanc = Qpro; float Qanc = Qpro;
float coef = ((aw + 4.f) * (4.f / c)) / 100.f; float coef = ((aw + 4.f) * (4.f / c)) / 100.f;
float Qq = (float) Qpro * 327.68f * (1.f / coef); float Qq = (float) Qpro * 327.68f * (1.f / coef);
@ -988,7 +988,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L
} }
if (hasColCurve3) {//curve 3 with chroma saturation colorfullness 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 parsat = 0.8; //0.68;
double coef = 327.68 / parsat; double coef = 327.68 / parsat;
float Cc = (float) Cpro * coef; float Cc = (float) Cpro * coef;
@ -1012,7 +1012,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L
} }
// Cpro=Cc/coef; // Cpro=Cc/coef;
} else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { // } else if (curveMode3 == ColorAppearanceParams::CtcMode::SATUR) { //
double parsat = 0.8; //0.6 double parsat = 0.8; //0.6
double coef = 327.68 / parsat; double coef = 327.68 / parsat;
float Ss = (float) spro * coef; float Ss = (float) spro * coef;
@ -1032,7 +1032,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L
Cpro = (spro * spro * Qpro) / (10000.0); Cpro = (spro * spro * Qpro) / (10000.0);
c1s = 1; c1s = 1;
} else if (curveMode3 == ColorAppearanceParams::TC_MODE_COLORF) { // } else if (curveMode3 == ColorAppearanceParams::CtcMode::COLORF) { //
double parsat = 0.8; //0.68; double parsat = 0.8; //0.68;
double coef = 327.68 / parsat; double coef = 327.68 / parsat;
float Mm = (float) Mpro * coef; float Mm = (float) Mpro * coef;
@ -1117,21 +1117,21 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L
int libr = 0; int libr = 0;
int colch = 0; int colch = 0;
if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { if (curveMode == ColorAppearanceParams::TcMode::BRIGHT) {
brli = 70.0; brli = 70.0;
libr = 1; libr = 1;
} else if (curveMode == ColorAppearanceParams::TC_MODE_LIGHT) { } else if (curveMode == ColorAppearanceParams::TcMode::LIGHT) {
brli = 327.; brli = 327.;
libr = 0; libr = 0;
} }
if (curveMode3 == ColorAppearanceParams::TC_MODE_CHROMA) { if (curveMode3 == ColorAppearanceParams::CtcMode::CHROMA) {
chsacol = 400.;//327.; chsacol = 400.;//327.;
colch = 0; colch = 0;
} else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { } else if (curveMode3 == ColorAppearanceParams::CtcMode::SATUR) {
chsacol = 450.0; chsacol = 450.0;
colch = 1; colch = 1;
} else if (curveMode3 == ColorAppearanceParams::TC_MODE_COLORF) { } else if (curveMode3 == ColorAppearanceParams::CtcMode::COLORF) {
chsacol = 400.;//327.0; chsacol = 400.;//327.0;
colch = 2; colch = 2;
} }
@ -1302,9 +1302,9 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L
// if (params->dirpyrequalizer.algo=="FI") choice=0; // if (params->dirpyrequalizer.algo=="FI") choice=0;
// else if(params->dirpyrequalizer.algo=="LA") choice=1; // else if(params->dirpyrequalizer.algo=="LA") choice=1;
if (rtt == 1) { if (rtt == 1) {
float b_l = static_cast<float> (params->dirpyrequalizer.hueskin.value[0]) / 100.0f; float b_l = static_cast<float> (params->dirpyrequalizer.hueskin.getBottomLeft()) / 100.0f;
float t_l = static_cast<float> (params->dirpyrequalizer.hueskin.value[1]) / 100.0f; float t_l = static_cast<float> (params->dirpyrequalizer.hueskin.getTopLeft()) / 100.0f;
float t_r = static_cast<float> (params->dirpyrequalizer.hueskin.value[3]) / 100.0f; float t_r = static_cast<float> (params->dirpyrequalizer.hueskin.getTopRight()) / 100.0f;
dirpyr_equalizercam (ncie, ncie->sh_p, ncie->sh_p, ncie->W, ncie->H, ncie->h_p, ncie->C_p, params->dirpyrequalizer.mult, params->dirpyrequalizer.threshold, params->dirpyrequalizer.skinprotect, true, b_l, t_l, t_r, scale); //contrast by detail adapted to CIECAM dirpyr_equalizercam (ncie, ncie->sh_p, ncie->sh_p, ncie->W, ncie->H, ncie->h_p, ncie->C_p, params->dirpyrequalizer.mult, params->dirpyrequalizer.threshold, params->dirpyrequalizer.skinprotect, true, b_l, t_l, t_r, scale); //contrast by detail adapted to CIECAM
} }
} }
@ -1378,21 +1378,21 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L
int libr = 0; int libr = 0;
int colch = 0; int colch = 0;
if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { if (curveMode == ColorAppearanceParams::TcMode::BRIGHT) {
brli = 70.0; brli = 70.0;
libr = 1; libr = 1;
} else if (curveMode == ColorAppearanceParams::TC_MODE_LIGHT) { } else if (curveMode == ColorAppearanceParams::TcMode::LIGHT) {
brli = 327.; brli = 327.;
libr = 0; libr = 0;
} }
if (curveMode3 == ColorAppearanceParams::TC_MODE_CHROMA) { if (curveMode3 == ColorAppearanceParams::CtcMode::CHROMA) {
chsacol = 400.;//327.; chsacol = 400.;//327.;
colch = 0; colch = 0;
} else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { } else if (curveMode3 == ColorAppearanceParams::CtcMode::SATUR) {
chsacol = 450.0; chsacol = 450.0;
colch = 1; colch = 1;
} else if (curveMode3 == ColorAppearanceParams::TC_MODE_COLORF) { } else if (curveMode3 == ColorAppearanceParams::CtcMode::COLORF) {
chsacol = 400.;//327.0; chsacol = 400.;//327.0;
colch = 2; colch = 2;
} }
@ -1752,14 +1752,14 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw
const float rstprotection = 100. - params->colorappearance.rstprotection; const float rstprotection = 100. - params->colorappearance.rstprotection;
// extracting datas from 'params' to avoid cache flush (to be confirmed) // 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 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 bool hasColCurve2 = bool (customColCurve2);
const ColorAppearanceParams::eCTCModeId curveMode3 = params->colorappearance.curveMode3; const ColorAppearanceParams::CtcMode curveMode3 = params->colorappearance.curveMode3;
const bool hasColCurve3 = bool (customColCurve3); const bool hasColCurve3 = bool (customColCurve3);
bool needJ = (alg == 0 || alg == 1 || alg == 3); bool needJ = (alg == 0 || alg == 1 || alg == 3);
@ -2212,7 +2212,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw
} }
if (hasColCurve1) {//curve 1 with Lightness and Brightness 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 Jj = (float) Jpro * 327.68f;
float Jold = Jj; float Jold = Jj;
float Jold100 = (float) Jpro; float Jold100 = (float) Jpro;
@ -2241,7 +2241,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw
if (Jpro < 1.f) { if (Jpro < 1.f) {
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 //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 coef = ((aw + 4.f) * (4.f / c)) / 100.f;
float Qanc = Qpro; float Qanc = Qpro;
@ -2285,7 +2285,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw
} }
if (hasColCurve2) {//curve 2 with Lightness and Brightness 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 Jj = (float) Jpro * 327.68f;
float Jold = Jj; float Jold = Jj;
float Jold100 = (float) Jpro; float Jold100 = (float) Jpro;
@ -2323,7 +2323,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw
Jpro = 1.f; Jpro = 1.f;
} }
} else if (curveMode2 == ColorAppearanceParams::TC_MODE_BRIGHT) { // } else if (curveMode2 == ColorAppearanceParams::TcMode::BRIGHT) { //
float Qanc = Qpro; float Qanc = Qpro;
float coef = ((aw + 4.f) * (4.f / c)) / 100.f; float coef = ((aw + 4.f) * (4.f / c)) / 100.f;
@ -2380,7 +2380,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw
} }
if (hasColCurve3) {//curve 3 with chroma saturation colorfullness 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 parsat = 0.8f; //0.68;
float coef = 327.68f / parsat; float coef = 327.68f / parsat;
float Cc = (float) Cpro * coef; float Cc = (float) Cpro * coef;
@ -2403,7 +2403,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw
Cpro = 50.f; Cpro = 50.f;
} }
*/ */
} else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { // } else if (curveMode3 == ColorAppearanceParams::CtcMode::SATUR) { //
float parsat = 0.8f; //0.6 float parsat = 0.8f; //0.6
float coef = 327.68f / parsat; float coef = 327.68f / parsat;
float Ss = (float) spro * coef; float Ss = (float) spro * coef;
@ -2420,7 +2420,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw
Color::skinredfloat (Jpro, hpro, Ss, Sold, dred, protect_red, sk, rstprotection, ko, spro); Color::skinredfloat (Jpro, hpro, Ss, Sold, dred, protect_red, sk, rstprotection, ko, spro);
Qpro = ( 4.0f / c ) * sqrtf ( Jpro / 100.0f ) * ( aw + 4.0f ) ; Qpro = ( 4.0f / c ) * sqrtf ( Jpro / 100.0f ) * ( aw + 4.0f ) ;
Cpro = (spro * spro * Qpro) / (10000.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 parsat = 0.8f; //0.68;
float coef = 327.68f / parsat; float coef = 327.68f / parsat;
float Mm = (float) Mpro * coef; float Mm = (float) Mpro * coef;
@ -2490,10 +2490,10 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw
float colch; float colch;
//update histogram //update histogram
if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { if (curveMode == ColorAppearanceParams::TcMode::BRIGHT) {
brli = 70.0f; brli = 70.0f;
libr = Q; //40.0 to 100.0 approximative factor for Q - 327 for J 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; brli = 327.f;
libr = J; //327 for J libr = J; //327 for J
} }
@ -2501,13 +2501,13 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw
posl = (int) (libr * brli); posl = (int) (libr * brli);
hist16JCAM[posl]++; hist16JCAM[posl]++;
if (curveMode3 == ColorAppearanceParams::TC_MODE_CHROMA) { if (curveMode3 == ColorAppearanceParams::CtcMode::CHROMA) {
chsacol = 400.f;//327 chsacol = 400.f;//327
colch = C; //450.0 approximative factor for s 320 for M 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; chsacol = 450.0f;
colch = s; colch = s;
} else { /*if(curveMode3 == ColorAppearanceParams::TC_MODE_COLORF)*/ } else { /*if(curveMode3 == ColorAppearanceParams::CTCMode::COLORF)*/
chsacol = 400.0f;//327 chsacol = 400.0f;//327
colch = M; colch = M;
} }
@ -2743,9 +2743,9 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw
// else if(params->dirpyrequalizer.algo=="LA") choice=1; // else if(params->dirpyrequalizer.algo=="LA") choice=1;
if (rtt == 1) { if (rtt == 1) {
float b_l = static_cast<float> (params->dirpyrequalizer.hueskin.value[0]) / 100.0f; float b_l = static_cast<float> (params->dirpyrequalizer.hueskin.getBottomLeft()) / 100.0f;
float t_l = static_cast<float> (params->dirpyrequalizer.hueskin.value[1]) / 100.0f; float t_l = static_cast<float> (params->dirpyrequalizer.hueskin.getTopLeft()) / 100.0f;
float t_r = static_cast<float> (params->dirpyrequalizer.hueskin.value[3]) / 100.0f; float t_r = static_cast<float> (params->dirpyrequalizer.hueskin.getTopRight()) / 100.0f;
lab->deleteLab(); lab->deleteLab();
dirpyr_equalizercam (ncie, ncie->sh_p, ncie->sh_p, ncie->W, ncie->H, ncie->h_p, ncie->C_p, params->dirpyrequalizer.mult, params->dirpyrequalizer.threshold, params->dirpyrequalizer.skinprotect, true, b_l, t_l, t_r, scale); //contrast by detail adapted to CIECAM dirpyr_equalizercam (ncie, ncie->sh_p, ncie->sh_p, ncie->W, ncie->H, ncie->h_p, ncie->C_p, params->dirpyrequalizer.mult, params->dirpyrequalizer.threshold, params->dirpyrequalizer.skinprotect, true, b_l, t_l, t_r, scale); //contrast by detail adapted to CIECAM
lab->reallocLab(); lab->reallocLab();
@ -2837,10 +2837,10 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw
float libr; float libr;
float colch; float colch;
if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { if (curveMode == ColorAppearanceParams::TcMode::BRIGHT) {
brli = 70.0f; brli = 70.0f;
libr = ncie->Q_p[i][j]; //40.0 to 100.0 approximative factor for Q - 327 for J 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; brli = 327.f;
libr = ncie->J_p[i][j]; //327 for J libr = ncie->J_p[i][j]; //327 for J
} }
@ -2848,13 +2848,13 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw
posl = (int) (libr * brli); posl = (int) (libr * brli);
hist16JCAM[posl]++; hist16JCAM[posl]++;
if (curveMode3 == ColorAppearanceParams::TC_MODE_CHROMA) { if (curveMode3 == ColorAppearanceParams::CtcMode::CHROMA) {
chsacol = 400.f;//327.f; chsacol = 400.f;//327.f;
colch = ncie_C_p; colch = ncie_C_p;
} else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { } else if (curveMode3 == ColorAppearanceParams::CtcMode::SATUR) {
chsacol = 450.0f; chsacol = 450.0f;
colch = 100.f * sqrtf (ncie_C_p / ncie->Q_p[i][j]); 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; chsacol = 400.f;//327.0f;
colch = ncie->M_p[i][j]; colch = ncie->M_p[i][j];
} }
@ -3250,25 +3250,25 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
const float hlrange = 65536.0 - shoulder; const float hlrange = 65536.0 - shoulder;
const bool isProPhoto = (params->icm.working == "ProPhoto"); const bool isProPhoto = (params->icm.working == "ProPhoto");
// extracting datas from 'params' to avoid cache flush (to be confirmed) // extracting datas from 'params' to avoid cache flush (to be confirmed)
ToneCurveParams::eTCModeId curveMode = params->toneCurve.curveMode; ToneCurveParams::TcMode curveMode = params->toneCurve.curveMode;
ToneCurveParams::eTCModeId curveMode2 = params->toneCurve.curveMode2; ToneCurveParams::TcMode curveMode2 = params->toneCurve.curveMode2;
bool highlight = params->toneCurve.hrenabled;//Get the value if "highlight reconstruction" is activated bool highlight = params->toneCurve.hrenabled;//Get the value if "highlight reconstruction" is activated
bool hasToneCurve1 = bool (customToneCurve1); bool hasToneCurve1 = bool (customToneCurve1);
bool hasToneCurve2 = bool (customToneCurve2); bool hasToneCurve2 = bool (customToneCurve2);
BlackWhiteParams::eTCModeId beforeCurveMode = params->blackwhite.beforeCurveMode; BlackWhiteParams::TcMode beforeCurveMode = params->blackwhite.beforeCurveMode;
BlackWhiteParams::eTCModeId afterCurveMode = params->blackwhite.afterCurveMode; BlackWhiteParams::TcMode afterCurveMode = params->blackwhite.afterCurveMode;
bool hasToneCurvebw1 = bool (customToneCurvebw1); bool hasToneCurvebw1 = bool (customToneCurvebw1);
bool hasToneCurvebw2 = bool (customToneCurvebw2); bool hasToneCurvebw2 = bool (customToneCurvebw2);
PerceptualToneCurveState ptc1ApplyState, ptc2ApplyState; PerceptualToneCurveState ptc1ApplyState, ptc2ApplyState;
if (hasToneCurve1 && curveMode == ToneCurveParams::TC_MODE_PERCEPTUAL) { if (hasToneCurve1 && curveMode == ToneCurveParams::TcMode::PERCEPTUAL) {
const PerceptualToneCurve& userToneCurve = static_cast<const PerceptualToneCurve&> (customToneCurve1); const PerceptualToneCurve& userToneCurve = static_cast<const PerceptualToneCurve&> (customToneCurve1);
userToneCurve.initApplyState (ptc1ApplyState, params->icm.working); userToneCurve.initApplyState (ptc1ApplyState, params->icm.working);
} }
if (hasToneCurve2 && curveMode2 == ToneCurveParams::TC_MODE_PERCEPTUAL) { if (hasToneCurve2 && curveMode2 == ToneCurveParams::TcMode::PERCEPTUAL) {
const PerceptualToneCurve& userToneCurve = static_cast<const PerceptualToneCurve&> (customToneCurve2); const PerceptualToneCurve& userToneCurve = static_cast<const PerceptualToneCurve&> (customToneCurve2);
userToneCurve.initApplyState (ptc2ApplyState, params->icm.working); userToneCurve.initApplyState (ptc2ApplyState, params->icm.working);
} }
@ -3317,8 +3317,8 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
float RedHigh = (100.f + float (params->colorToning.redhigh)) / 100.f; //printf("RedH=%f\n",RedHigh); float RedHigh = (100.f + float (params->colorToning.redhigh)) / 100.f; //printf("RedH=%f\n",RedHigh);
float GreenHigh = (100.f + float (params->colorToning.greenhigh)) / 100.f; float GreenHigh = (100.f + float (params->colorToning.greenhigh)) / 100.f;
float BlueHigh = (100.f + float (params->colorToning.bluehigh)) / 100.f; float BlueHigh = (100.f + float (params->colorToning.bluehigh)) / 100.f;
float SatLow = float (params->colorToning.shadowsColSat.value[0]) / 100.f; float SatLow = float (params->colorToning.shadowsColSat.getBottom()) / 100.f;
float SatHigh = float (params->colorToning.hlColSat.value[0]) / 100.f; float SatHigh = float (params->colorToning.hlColSat.getBottom()) / 100.f;
float Balan = float (params->colorToning.balance); float Balan = float (params->colorToning.balance);
@ -3621,21 +3621,21 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
} }
if (hasToneCurve1) { if (hasToneCurve1) {
if (curveMode == ToneCurveParams::TC_MODE_STD) { // Standard if (curveMode == ToneCurveParams::TcMode::STD) { // Standard
for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) {
const StandardToneCurve& userToneCurve = static_cast<const StandardToneCurve&> (customToneCurve1); const StandardToneCurve& userToneCurve = static_cast<const StandardToneCurve&> (customToneCurve1);
userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); 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::TcMode::FILMLIKE) { // Adobe like
for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) {
const AdobeToneCurve& userToneCurve = static_cast<const AdobeToneCurve&> (customToneCurve1); const AdobeToneCurve& userToneCurve = static_cast<const AdobeToneCurve&> (customToneCurve1);
userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); 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::TcMode::SATANDVALBLENDING) { // apply the curve on the saturation and value channels
for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) {
const SatAndValueBlendingToneCurve& userToneCurve = static_cast<const SatAndValueBlendingToneCurve&> (customToneCurve1); const SatAndValueBlendingToneCurve& userToneCurve = static_cast<const SatAndValueBlendingToneCurve&> (customToneCurve1);
@ -3645,7 +3645,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); 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::TcMode::WEIGHTEDSTD) { // apply the curve to the rgb channels, weighted
const WeightedStdToneCurve& userToneCurve = static_cast<const WeightedStdToneCurve&> (customToneCurve1); const WeightedStdToneCurve& userToneCurve = static_cast<const WeightedStdToneCurve&> (customToneCurve1);
for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int i = istart, ti = 0; i < tH; i++, ti++) {
@ -3656,7 +3656,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); 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::TcMode::LUMINANCE) { // apply the curve to the luminance channel
const LuminanceToneCurve& userToneCurve = static_cast<const LuminanceToneCurve&> (customToneCurve1); const LuminanceToneCurve& userToneCurve = static_cast<const LuminanceToneCurve&> (customToneCurve1);
for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int i = istart, ti = 0; i < tH; i++, ti++) {
@ -3667,7 +3667,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); 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::TcMode::PERCEPTUAL) { // apply curve while keeping color appearance constant
const PerceptualToneCurve& userToneCurve = static_cast<const PerceptualToneCurve&> (customToneCurve1); const PerceptualToneCurve& userToneCurve = static_cast<const PerceptualToneCurve&> (customToneCurve1);
for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int i = istart, ti = 0; i < tH; i++, ti++) {
@ -3692,28 +3692,28 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
} }
if (hasToneCurve2) { if (hasToneCurve2) {
if (curveMode2 == ToneCurveParams::TC_MODE_STD) { // Standard if (curveMode2 == ToneCurveParams::TcMode::STD) { // Standard
for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) {
const StandardToneCurve& userToneCurve = static_cast<const StandardToneCurve&> (customToneCurve2); const StandardToneCurve& userToneCurve = static_cast<const StandardToneCurve&> (customToneCurve2);
userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); 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::TcMode::FILMLIKE) { // Adobe like
for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) {
const AdobeToneCurve& userToneCurve = static_cast<const AdobeToneCurve&> (customToneCurve2); const AdobeToneCurve& userToneCurve = static_cast<const AdobeToneCurve&> (customToneCurve2);
userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); 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::TcMode::SATANDVALBLENDING) { // apply the curve on the saturation and value channels
for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) {
const SatAndValueBlendingToneCurve& userToneCurve = static_cast<const SatAndValueBlendingToneCurve&> (customToneCurve2); const SatAndValueBlendingToneCurve& userToneCurve = static_cast<const SatAndValueBlendingToneCurve&> (customToneCurve2);
userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); 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::TcMode::WEIGHTEDSTD) { // apply the curve to the rgb channels, weighted
const WeightedStdToneCurve& userToneCurve = static_cast<const WeightedStdToneCurve&> (customToneCurve2); const WeightedStdToneCurve& userToneCurve = static_cast<const WeightedStdToneCurve&> (customToneCurve2);
for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int i = istart, ti = 0; i < tH; i++, ti++) {
@ -3721,7 +3721,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); 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::TcMode::LUMINANCE) { // apply the curve to the luminance channel
const LuminanceToneCurve& userToneCurve = static_cast<const LuminanceToneCurve&> (customToneCurve2); const LuminanceToneCurve& userToneCurve = static_cast<const LuminanceToneCurve&> (customToneCurve2);
for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int i = istart, ti = 0; i < tH; i++, ti++) {
@ -3729,7 +3729,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); 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::TcMode::PERCEPTUAL) { // apply curve while keeping color appearance constant
const PerceptualToneCurve& userToneCurve = static_cast<const PerceptualToneCurve&> (customToneCurve2); const PerceptualToneCurve& userToneCurve = static_cast<const PerceptualToneCurve&> (customToneCurve2);
for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int i = istart, ti = 0; i < tH; i++, ti++) {
@ -4192,21 +4192,21 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
//black and white //black and white
if (blackwhite) { if (blackwhite) {
if (hasToneCurvebw1) { if (hasToneCurvebw1) {
if (beforeCurveMode == BlackWhiteParams::TC_MODE_STD_BW) { // Standard if (beforeCurveMode == BlackWhiteParams::TcMode::STD_BW) { // Standard
for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) {
const StandardToneCurve& userToneCurvebw = static_cast<const StandardToneCurve&> (customToneCurvebw1); const StandardToneCurve& userToneCurvebw = static_cast<const StandardToneCurve&> (customToneCurvebw1);
userToneCurvebw.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); userToneCurvebw.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]);
} }
} }
} else if (beforeCurveMode == BlackWhiteParams::TC_MODE_FILMLIKE_BW) { // Adobe like } else if (beforeCurveMode == BlackWhiteParams::TcMode::FILMLIKE_BW) { // Adobe like
for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) {
const AdobeToneCurve& userToneCurvebw = static_cast<const AdobeToneCurve&> (customToneCurvebw1); const AdobeToneCurve& userToneCurvebw = static_cast<const AdobeToneCurve&> (customToneCurvebw1);
userToneCurvebw.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); userToneCurvebw.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]);
} }
} }
} else if (beforeCurveMode == BlackWhiteParams::TC_MODE_SATANDVALBLENDING_BW) { // apply the curve on the saturation and value channels } else if (beforeCurveMode == BlackWhiteParams::TcMode::SATANDVALBLENDING_BW) { // apply the curve on the saturation and value channels
for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) {
const SatAndValueBlendingToneCurve& userToneCurvebw = static_cast<const SatAndValueBlendingToneCurve&> (customToneCurvebw1); const SatAndValueBlendingToneCurve& userToneCurvebw = static_cast<const SatAndValueBlendingToneCurve&> (customToneCurvebw1);
@ -4216,7 +4216,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
userToneCurvebw.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); userToneCurvebw.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]);
} }
} }
} else if (beforeCurveMode == BlackWhiteParams::TC_MODE_WEIGHTEDSTD_BW) { // apply the curve to the rgb channels, weighted } else if (beforeCurveMode == BlackWhiteParams::TcMode::WEIGHTEDSTD_BW) { // apply the curve to the rgb channels, weighted
for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) {
const WeightedStdToneCurve& userToneCurvebw = static_cast<const WeightedStdToneCurve&> (customToneCurvebw1); const WeightedStdToneCurve& userToneCurvebw = static_cast<const WeightedStdToneCurve&> (customToneCurvebw1);
@ -4652,7 +4652,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
if (hasToneCurvebw2) { if (hasToneCurvebw2) {
if (afterCurveMode == BlackWhiteParams::TC_MODE_STD_BW) { // Standard if (afterCurveMode == BlackWhiteParams::TcMode::STD_BW) { // Standard
#ifdef _OPENMP #ifdef _OPENMP
#pragma omp parallel for schedule(dynamic, 5) #pragma omp parallel for schedule(dynamic, 5)
#endif #endif
@ -4663,7 +4663,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
userToneCurve.Apply (tmpImage->r (i, j), tmpImage->g (i, j), tmpImage->b (i, j)); userToneCurve.Apply (tmpImage->r (i, j), tmpImage->g (i, j), tmpImage->b (i, j));
} }
} }
} else if (afterCurveMode == BlackWhiteParams::TC_MODE_WEIGHTEDSTD_BW) { // apply the curve to the rgb channels, weighted } else if (afterCurveMode == BlackWhiteParams::TcMode::WEIGHTEDSTD_BW) { // apply the curve to the rgb channels, weighted
#ifdef _OPENMP #ifdef _OPENMP
#pragma omp parallel for schedule(dynamic, 5) #pragma omp parallel for schedule(dynamic, 5)
#endif #endif
@ -6488,9 +6488,9 @@ void ImProcFunctions::badpixlab (LabImage* lab, double rad, int thr, int mode, f
void ImProcFunctions::dirpyrequalizer (LabImage* lab, int scale) void ImProcFunctions::dirpyrequalizer (LabImage* lab, int scale)
{ {
if (params->dirpyrequalizer.enabled && lab->W >= 8 && lab->H >= 8) { if (params->dirpyrequalizer.enabled && lab->W >= 8 && lab->H >= 8) {
float b_l = static_cast<float> (params->dirpyrequalizer.hueskin.value[0]) / 100.0f; float b_l = static_cast<float> (params->dirpyrequalizer.hueskin.getBottomLeft()) / 100.0f;
float t_l = static_cast<float> (params->dirpyrequalizer.hueskin.value[1]) / 100.0f; float t_l = static_cast<float> (params->dirpyrequalizer.hueskin.getTopLeft()) / 100.0f;
float t_r = static_cast<float> (params->dirpyrequalizer.hueskin.value[3]) / 100.0f; float t_r = static_cast<float> (params->dirpyrequalizer.hueskin.getTopRight()) / 100.0f;
// if (params->dirpyrequalizer.algo=="FI") choice=0; // if (params->dirpyrequalizer.algo=="FI") choice=0;
// else if(params->dirpyrequalizer.algo=="LA") choice=1; // else if(params->dirpyrequalizer.algo=="LA") choice=1;
float artifact = (float) settings->artifact_cbdl; float artifact = (float) settings->artifact_cbdl;

View File

@ -126,7 +126,7 @@ void ImProcFunctions::vibrance (LabImage* lab)
const float chromaPastel = float (params->vibrance.pastels) / 100.0f; const float chromaPastel = float (params->vibrance.pastels) / 100.0f;
const float chromaSatur = float (params->vibrance.saturated) / 100.0f; const float chromaSatur = float (params->vibrance.saturated) / 100.0f;
const float p00 = 0.07f; const float p00 = 0.07f;
const float limitpastelsatur = (static_cast<float> (params->vibrance.psthreshold.value[ThresholdSelector::TS_TOPLEFT]) / 100.0f) * (1.0f - p00) + p00; const float limitpastelsatur = (static_cast<float>(params->vibrance.psthreshold.getTopLeft()) / 100.0f) * (1.0f - p00) + p00;
const float maxdp = (limitpastelsatur - p00) / 4.0f; const float maxdp = (limitpastelsatur - p00) / 4.0f;
const float maxds = (1.0 - limitpastelsatur) / 4.0f; const float maxds = (1.0 - limitpastelsatur) / 4.0f;
const float p0 = p00 + maxdp; const float p0 = p00 + maxdp;
@ -135,7 +135,7 @@ void ImProcFunctions::vibrance (LabImage* lab)
const float s0 = limitpastelsatur + maxds; const float s0 = limitpastelsatur + maxds;
const float s1 = limitpastelsatur + 2.0f * maxds; const float s1 = limitpastelsatur + 2.0f * maxds;
const float s2 = limitpastelsatur + 3.0f * maxds; const float s2 = limitpastelsatur + 3.0f * maxds;
const float transitionweighting = static_cast<float> (params->vibrance.psthreshold.value[ThresholdSelector::TS_BOTTOMLEFT]) / 100.0f; const float transitionweighting = static_cast<float>(params->vibrance.psthreshold.getBottomLeft()) / 100.0f;
float chromamean = 0.0f; float chromamean = 0.0f;
if (chromaPastel != chromaSatur) { if (chromaPastel != chromaSatur) {

View File

@ -432,56 +432,56 @@ SSEFUNCTION void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int
cp.thH = float(waparams.thrH); cp.thH = float(waparams.thrH);
cp.sky = waparams.sky; cp.sky = waparams.sky;
//skin //skin
cp.b_l = static_cast<float>(params->wavelet.hueskin.value[0]) / 100.0f; cp.b_l = static_cast<float>(params->wavelet.hueskin.getBottomLeft()) / 100.0f;
cp.t_l = static_cast<float>(params->wavelet.hueskin.value[1]) / 100.0f; cp.t_l = static_cast<float>(params->wavelet.hueskin.getTopLeft()) / 100.0f;
cp.b_r = static_cast<float>(params->wavelet.hueskin.value[2]) / 100.0f; cp.b_r = static_cast<float>(params->wavelet.hueskin.getBottomRight()) / 100.0f;
cp.t_r = static_cast<float>(params->wavelet.hueskin.value[3]) / 100.0f; cp.t_r = static_cast<float>(params->wavelet.hueskin.getTopRight()) / 100.0f;
cp.b_ly = static_cast<float>(params->wavelet.hueskin2.value[0]) / 100.0f; cp.b_ly = static_cast<float>(params->wavelet.hueskin2.getBottomLeft()) / 100.0f;
cp.t_ly = static_cast<float>(params->wavelet.hueskin2.value[1]) / 100.0f; cp.t_ly = static_cast<float>(params->wavelet.hueskin2.getTopLeft()) / 100.0f;
cp.b_ry = static_cast<float>(params->wavelet.hueskin2.value[2]) / 100.0f; cp.b_ry = static_cast<float>(params->wavelet.hueskin2.getBottomRight()) / 100.0f;
cp.t_ry = static_cast<float>(params->wavelet.hueskin2.value[3]) / 100.0f; cp.t_ry = static_cast<float>(params->wavelet.hueskin2.getTopRight()) / 100.0f;
cp.numlevH = params->wavelet.threshold; cp.numlevH = params->wavelet.threshold;
//shadows //shadows
cp.b_lsl = static_cast<float>(params->wavelet.bllev.value[0]); cp.b_lsl = static_cast<float>(params->wavelet.bllev.getBottomLeft());
cp.t_lsl = static_cast<float>(params->wavelet.bllev.value[1]); cp.t_lsl = static_cast<float>(params->wavelet.bllev.getTopLeft());
cp.b_rsl = static_cast<float>(params->wavelet.bllev.value[2]); cp.b_rsl = static_cast<float>(params->wavelet.bllev.getBottomRight());
cp.t_rsl = static_cast<float>(params->wavelet.bllev.value[3]); cp.t_rsl = static_cast<float>(params->wavelet.bllev.getTopRight());
cp.numlevS = params->wavelet.threshold2; cp.numlevS = params->wavelet.threshold2;
int maxlevS = 9 - cp.numlevH; int maxlevS = 9 - cp.numlevH;
cp.numlevS = MIN(cp.numlevS, maxlevS); cp.numlevS = MIN(cp.numlevS, maxlevS);
//printf("levHigh=%d levShad=%d\n",cp.numlevH,cp.numlevS); //printf("levHigh=%d levShad=%d\n",cp.numlevH,cp.numlevS);
//highlight //highlight
cp.b_lhl = static_cast<float>(params->wavelet.hllev.value[0]); cp.b_lhl = static_cast<float>(params->wavelet.hllev.getBottomLeft());
cp.t_lhl = static_cast<float>(params->wavelet.hllev.value[1]); cp.t_lhl = static_cast<float>(params->wavelet.hllev.getTopLeft());
cp.b_rhl = static_cast<float>(params->wavelet.hllev.value[2]); cp.b_rhl = static_cast<float>(params->wavelet.hllev.getBottomRight());
cp.t_rhl = static_cast<float>(params->wavelet.hllev.value[3]); cp.t_rhl = static_cast<float>(params->wavelet.hllev.getTopRight());
//printf("BL=%f TL=%f BR=%f TR=%f\n",cp.b_lhl,cp.t_lhl,cp.b_rhl,cp.t_rhl); //printf("BL=%f TL=%f BR=%f TR=%f\n",cp.b_lhl,cp.t_lhl,cp.b_rhl,cp.t_rhl);
//pastel //pastel
cp.b_lpast = static_cast<float>(params->wavelet.pastlev.value[0]); cp.b_lpast = static_cast<float>(params->wavelet.pastlev.getBottomLeft());
cp.t_lpast = static_cast<float>(params->wavelet.pastlev.value[1]); cp.t_lpast = static_cast<float>(params->wavelet.pastlev.getTopLeft());
cp.b_rpast = static_cast<float>(params->wavelet.pastlev.value[2]); cp.b_rpast = static_cast<float>(params->wavelet.pastlev.getBottomRight());
cp.t_rpast = static_cast<float>(params->wavelet.pastlev.value[3]); cp.t_rpast = static_cast<float>(params->wavelet.pastlev.getTopRight());
//saturated //saturated
cp.b_lsat = static_cast<float>(params->wavelet.satlev.value[0]); cp.b_lsat = static_cast<float>(params->wavelet.satlev.getBottomLeft());
cp.t_lsat = static_cast<float>(params->wavelet.satlev.value[1]); cp.t_lsat = static_cast<float>(params->wavelet.satlev.getTopLeft());
cp.b_rsat = static_cast<float>(params->wavelet.satlev.value[2]); cp.b_rsat = static_cast<float>(params->wavelet.satlev.getBottomRight());
cp.t_rsat = static_cast<float>(params->wavelet.satlev.value[3]); cp.t_rsat = static_cast<float>(params->wavelet.satlev.getTopRight());
//edge local contrast //edge local contrast
cp.edg_low = static_cast<float>(params->wavelet.edgcont.value[0]); cp.edg_low = static_cast<float>(params->wavelet.edgcont.getBottomLeft());
cp.edg_mean = static_cast<float>(params->wavelet.edgcont.value[1]); cp.edg_mean = static_cast<float>(params->wavelet.edgcont.getTopLeft());
cp.edg_max = static_cast<float>(params->wavelet.edgcont.value[2]); cp.edg_max = static_cast<float>(params->wavelet.edgcont.getBottomRight());
cp.edg_sd = static_cast<float>(params->wavelet.edgcont.value[3]); cp.edg_sd = static_cast<float>(params->wavelet.edgcont.getTopRight());
//level noise //level noise
cp.lev0s = static_cast<float>(params->wavelet.level0noise.value[0]); cp.lev0s = static_cast<float>(params->wavelet.level0noise.getBottom());
cp.lev0n = static_cast<float>(params->wavelet.level0noise.value[1]); cp.lev0n = static_cast<float>(params->wavelet.level0noise.getTop());
cp.lev1s = static_cast<float>(params->wavelet.level1noise.value[0]); cp.lev1s = static_cast<float>(params->wavelet.level1noise.getBottom());
cp.lev1n = static_cast<float>(params->wavelet.level1noise.value[1]); cp.lev1n = static_cast<float>(params->wavelet.level1noise.getTop());
cp.lev2s = static_cast<float>(params->wavelet.level2noise.value[0]); cp.lev2s = static_cast<float>(params->wavelet.level2noise.getBottom());
cp.lev2n = static_cast<float>(params->wavelet.level2noise.value[1]); cp.lev2n = static_cast<float>(params->wavelet.level2noise.getTop());
cp.lev3s = static_cast<float>(params->wavelet.level3noise.value[0]); cp.lev3s = static_cast<float>(params->wavelet.level3noise.getBottom());
cp.lev3n = static_cast<float>(params->wavelet.level3noise.value[1]); cp.lev3n = static_cast<float>(params->wavelet.level3noise.getTop());
cp.detectedge = params->wavelet.medianlev; cp.detectedge = params->wavelet.medianlev;
//printf("low=%f mean=%f sd=%f max=%f\n",cp.edg_low,cp.edg_mean,cp.edg_sd,cp.edg_max); //printf("low=%f mean=%f sd=%f max=%f\n",cp.edg_low,cp.edg_mean,cp.edg_sd,cp.edg_max);

View File

@ -311,11 +311,11 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA
bayerParams.pixelShiftAutomatic = true; bayerParams.pixelShiftAutomatic = true;
if(bayerParams.pixelShiftMotionCorrectionMethod == RAWParams::BayerSensor::Automatic) { if(bayerParams.pixelShiftMotionCorrectionMethod == RAWParams::BayerSensor::PSMotionCorrectionMethod::AUTO) {
bool pixelShiftEqualBright = bayerParams.pixelShiftEqualBright; bool pixelShiftEqualBright = bayerParams.pixelShiftEqualBright;
bayerParams.setPixelShiftDefaults(); bayerParams.setPixelShiftDefaults();
bayerParams.pixelShiftEqualBright = pixelShiftEqualBright; bayerParams.pixelShiftEqualBright = pixelShiftEqualBright;
} else if(bayerParams.pixelShiftMotionCorrectionMethod == RAWParams::BayerSensor::Off) { } else if(bayerParams.pixelShiftMotionCorrectionMethod == RAWParams::BayerSensor::PSMotionCorrectionMethod::OFF) {
bayerParams.pixelShiftAutomatic = false; bayerParams.pixelShiftAutomatic = false;
bayerParams.pixelShiftShowMotion = false; bayerParams.pixelShiftShowMotion = false;
} }
@ -506,7 +506,7 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA
static const float ePerIsoK70 = 0.5f; static const float ePerIsoK70 = 0.5f;
if(plistener) { if(plistener) {
plistener->setProgressStr(Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::pixelshift])); plistener->setProgressStr(Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::PIXELSHIFT)));
plistener->setProgress(0.0); plistener->setProgress(0.0);
} }

View File

@ -108,10 +108,10 @@ PreviewImage::PreviewImage (const Glib::ustring &fname, const Glib::ustring &ext
rawImage.getFullSize (fw, fh, TR_NONE); rawImage.getFullSize (fw, fh, TR_NONE);
PreviewProps pp (0, 0, fw, fh, 1); PreviewProps pp (0, 0, fw, fh, 1);
params.icm.input = Glib::ustring("(embedded)"); params.icm.input = Glib::ustring("(embedded)");
params.raw.bayersensor.method = RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::fast]; params.raw.bayersensor.method = RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::FAST);
params.raw.deadPixelFilter = false; params.raw.deadPixelFilter = false;
params.raw.ca_autocorrect = false; params.raw.ca_autocorrect = false;
params.raw.xtranssensor.method = RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::fast]; params.raw.xtranssensor.method = RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::FAST);
rawImage.preprocess(params.raw, params.lensProf, params.coarse); rawImage.preprocess(params.raw, params.lensProf, params.coarse);
rawImage.demosaic(params.raw); rawImage.demosaic(params.raw);
Imagefloat image(fw, fh); Imagefloat image(fw, fh);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -650,8 +650,8 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima
const float new_pre_mul[4] = { ri->get_pre_mul(0) / rm, ri->get_pre_mul(1) / gm, ri->get_pre_mul(2) / bm, ri->get_pre_mul(3) / gm }; const float new_pre_mul[4] = { ri->get_pre_mul(0) / rm, ri->get_pre_mul(1) / gm, ri->get_pre_mul(2) / bm, ri->get_pre_mul(3) / gm };
float new_scale_mul[4]; float new_scale_mul[4];
bool isMono = (ri->getSensorType() == ST_FUJI_XTRANS && raw.xtranssensor.method == RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::mono]) bool isMono = (ri->getSensorType() == ST_FUJI_XTRANS && raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::MONO))
|| (ri->getSensorType() == ST_BAYER && raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::mono]); || (ri->getSensorType() == ST_BAYER && raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::MONO));
float gain = calculate_scale_mul(new_scale_mul, new_pre_mul, c_white, cblacksom, isMono, ri->get_colors()); float gain = calculate_scale_mul(new_scale_mul, new_pre_mul, c_white, cblacksom, isMono, ri->get_colors());
rm = new_scale_mul[0] / scale_mul[0] * gain; rm = new_scale_mul[0] / scale_mul[0] * gain;
gm = new_scale_mul[1] / scale_mul[1] * gain; gm = new_scale_mul[1] / scale_mul[1] * gain;
@ -1921,7 +1921,7 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le
} }
// check if it is an olympus E camera or green equilibration is enabled. If yes, compute G channel pre-compensation factors // check if it is an olympus E camera or green equilibration is enabled. If yes, compute G channel pre-compensation factors
if ( ri->getSensorType() == ST_BAYER && (raw.bayersensor.greenthresh || (((idata->getMake().size() >= 7 && idata->getMake().substr(0, 7) == "OLYMPUS" && idata->getModel()[0] == 'E') || (idata->getMake().size() >= 9 && idata->getMake().substr(0, 9) == "Panasonic")) && raw.bayersensor.method != RAWParams::BayerSensor::methodstring[ RAWParams::BayerSensor::vng4])) ) { if ( ri->getSensorType() == ST_BAYER && (raw.bayersensor.greenthresh || (((idata->getMake().size() >= 7 && idata->getMake().substr(0, 7) == "OLYMPUS" && idata->getModel()[0] == 'E') || (idata->getMake().size() >= 9 && idata->getMake().substr(0, 9) == "Panasonic")) && raw.bayersensor.method != RAWParams::BayerSensor::getMethodString( RAWParams::BayerSensor::Method::VNG4))) ) {
// global correction // global correction
if(numFrames == 4) { if(numFrames == 4) {
for(int i = 0; i < 4; ++i) { for(int i = 0; i < 4; ++i) {
@ -2027,27 +2027,27 @@ void RawImageSource::demosaic(const RAWParams &raw)
t1.set(); t1.set();
if (ri->getSensorType() == ST_BAYER) { if (ri->getSensorType() == ST_BAYER) {
if ( raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::hphd] ) { if ( raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::HPHD) ) {
hphd_demosaic (); hphd_demosaic ();
} else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::vng4] ) { } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::VNG4) ) {
vng4_demosaic (); vng4_demosaic ();
} else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::ahd] ) { } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AHD) ) {
ahd_demosaic (); ahd_demosaic ();
} else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::amaze] ) { } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AMAZE) ) {
amaze_demosaic_RT (0, 0, W, H, rawData, red, green, blue); amaze_demosaic_RT (0, 0, W, H, rawData, red, green, blue);
} else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::pixelshift] ) { } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::PIXELSHIFT) ) {
pixelshift(0, 0, W, H, raw.bayersensor, currFrame, ri->get_model(), raw.expos); pixelshift(0, 0, W, H, raw.bayersensor, currFrame, ri->get_model(), raw.expos);
} else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::dcb] ) { } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::DCB) ) {
dcb_demosaic(raw.bayersensor.dcb_iterations, raw.bayersensor.dcb_enhance); dcb_demosaic(raw.bayersensor.dcb_iterations, raw.bayersensor.dcb_enhance);
} else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::eahd]) { } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::EAHD)) {
eahd_demosaic (); eahd_demosaic ();
} else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::igv]) { } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::IGV)) {
igv_interpolate(W, H); igv_interpolate(W, H);
} else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::lmmse]) { } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::LMMSE)) {
lmmse_interpolate_omp(W, H, rawData, red, green, blue, raw.bayersensor.lmmse_iterations); lmmse_interpolate_omp(W, H, rawData, red, green, blue, raw.bayersensor.lmmse_iterations);
} else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::fast] ) { } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::FAST) ) {
fast_demosaic(); fast_demosaic();
} else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::mono] ) { } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::MONO) ) {
nodemosaic(true); nodemosaic(true);
} else { } else {
nodemosaic(false); nodemosaic(false);
@ -2056,13 +2056,13 @@ void RawImageSource::demosaic(const RAWParams &raw)
//if (raw.all_enhance) refinement_lassus(); //if (raw.all_enhance) refinement_lassus();
} else if (ri->getSensorType() == ST_FUJI_XTRANS) { } else if (ri->getSensorType() == ST_FUJI_XTRANS) {
if (raw.xtranssensor.method == RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::fast] ) { if (raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::FAST) ) {
fast_xtrans_interpolate(); fast_xtrans_interpolate();
} else if (raw.xtranssensor.method == RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::onePass]) { } else if (raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::ONE_PASS)) {
xtrans_interpolate(1, false); xtrans_interpolate(1, false);
} else if (raw.xtranssensor.method == RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::threePass] ) { } else if (raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::THREE_PASS) ) {
xtrans_interpolate(3, true); xtrans_interpolate(3, true);
} else if(raw.xtranssensor.method == RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::mono] ) { } else if(raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::MONO) ) {
nodemosaic(true); nodemosaic(true);
} else { } else {
nodemosaic(false); nodemosaic(false);
@ -2803,14 +2803,14 @@ void RawImageSource::processFlatField(const RAWParams &raw, RawImage *riFlatFile
BS += BS & 1; BS += BS & 1;
//function call to cfabloxblur //function call to cfabloxblur
if (raw.ff_BlurType == RAWParams::ff_BlurTypestring[RAWParams::v_ff]) { if (raw.ff_BlurType == RAWParams::getFlatFieldBlurTypeString(RAWParams::FlatFieldBlurType::V)) {
cfaboxblur(riFlatFile, cfablur, 2 * BS, 0); cfaboxblur(riFlatFile, cfablur, 2 * BS, 0);
} else if (raw.ff_BlurType == RAWParams::ff_BlurTypestring[RAWParams::h_ff]) { } else if (raw.ff_BlurType == RAWParams::getFlatFieldBlurTypeString(RAWParams::FlatFieldBlurType::H)) {
cfaboxblur(riFlatFile, cfablur, 0, 2 * BS); cfaboxblur(riFlatFile, cfablur, 0, 2 * BS);
} else if (raw.ff_BlurType == RAWParams::ff_BlurTypestring[RAWParams::vh_ff]) { } else if (raw.ff_BlurType == RAWParams::getFlatFieldBlurTypeString(RAWParams::FlatFieldBlurType::VH)) {
//slightly more complicated blur if trying to correct both vertical and horizontal anomalies //slightly more complicated blur if trying to correct both vertical and horizontal anomalies
cfaboxblur(riFlatFile, cfablur, BS, BS); //first do area blur to correct vignette cfaboxblur(riFlatFile, cfablur, BS, BS); //first do area blur to correct vignette
} else { //(raw.ff_BlurType == RAWParams::ff_BlurTypestring[RAWParams::area_ff]) } else { //(raw.ff_BlurType == RAWParams::getFlatFieldBlurTypeString(RAWParams::area_ff))
cfaboxblur(riFlatFile, cfablur, BS, BS); cfaboxblur(riFlatFile, cfablur, BS, BS);
} }
@ -3008,7 +3008,7 @@ void RawImageSource::processFlatField(const RAWParams &raw, RawImage *riFlatFile
} }
} }
if (raw.ff_BlurType == RAWParams::ff_BlurTypestring[RAWParams::vh_ff]) { if (raw.ff_BlurType == RAWParams::getFlatFieldBlurTypeString(RAWParams::FlatFieldBlurType::VH)) {
float *cfablur1 = (float (*)) malloc (H * W * sizeof * cfablur1); float *cfablur1 = (float (*)) malloc (H * W * sizeof * cfablur1);
float *cfablur2 = (float (*)) malloc (H * W * sizeof * cfablur2); float *cfablur2 = (float (*)) malloc (H * W * sizeof * cfablur2);
//slightly more complicated blur if trying to correct both vertical and horizontal anomalies //slightly more complicated blur if trying to correct both vertical and horizontal anomalies
@ -3429,7 +3429,7 @@ void RawImageSource::scaleColors(int winx, int winy, int winw, int winh, const R
black_lev[2] = raw.bayersensor.black2; //B black_lev[2] = raw.bayersensor.black2; //B
black_lev[3] = raw.bayersensor.black3; //G2 black_lev[3] = raw.bayersensor.black3; //G2
isMono = RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::mono] == raw.bayersensor.method; isMono = RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::MONO) == raw.bayersensor.method;
} else if (getSensorType() == ST_FUJI_XTRANS) { } else if (getSensorType() == ST_FUJI_XTRANS) {
black_lev[0] = raw.xtranssensor.blackred; //R black_lev[0] = raw.xtranssensor.blackred; //R
@ -3437,7 +3437,7 @@ void RawImageSource::scaleColors(int winx, int winy, int winw, int winh, const R
black_lev[2] = raw.xtranssensor.blackblue; //B black_lev[2] = raw.xtranssensor.blackblue; //B
black_lev[3] = raw.xtranssensor.blackgreen; //G2 (set, only used with a Bayer filter) black_lev[3] = raw.xtranssensor.blackgreen; //G2 (set, only used with a Bayer filter)
isMono = RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::mono] == raw.xtranssensor.method; isMono = RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::MONO) == raw.xtranssensor.method;
} }
for(int i = 0; i < 4 ; i++) { for(int i = 0; i < 4 ; i++) {

View File

@ -1475,16 +1475,12 @@ private:
params.defringe.radius); params.defringe.radius);
adjust_radius (defaultparams.sh.radius, scale_factor, params.sh.radius); adjust_radius (defaultparams.sh.radius, scale_factor, params.sh.radius);
if (params.raw.xtranssensor.method == if (params.raw.xtranssensor.method == procparams::RAWParams::XTransSensor::getMethodString(procparams::RAWParams::XTransSensor::Method::THREE_PASS)) {
procparams::RAWParams::XTransSensor::methodstring[ params.raw.xtranssensor.method = procparams::RAWParams::XTransSensor::getMethodString(procparams::RAWParams::XTransSensor::Method::ONE_PASS);
procparams::RAWParams::XTransSensor::threePass]) {
params.raw.xtranssensor.method =
procparams::RAWParams::XTransSensor::methodstring[
procparams::RAWParams::XTransSensor::onePass];
} }
if (params.raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[procparams::RAWParams::BayerSensor::pixelshift]) { if (params.raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::PIXELSHIFT)) {
params.raw.bayersensor.method = procparams::RAWParams::BayerSensor::methodstring[params.raw.bayersensor.pixelShiftLmmse ? procparams::RAWParams::BayerSensor::lmmse : procparams::RAWParams::BayerSensor::amaze]; params.raw.bayersensor.method = procparams::RAWParams::BayerSensor::getMethodString(params.raw.bayersensor.pixelShiftLmmse ? procparams::RAWParams::BayerSensor::Method::LMMSE : procparams::RAWParams::BayerSensor::Method::AMAZE);
} }
} }

View File

@ -38,7 +38,7 @@ void hflip(unsigned char* img, int w, int h);
void vflip(unsigned char* img, int w, int h); void vflip(unsigned char* img, int w, int h);
template<typename ENUM> template<typename ENUM>
typename std::underlying_type<ENUM>::type toUnderlying(ENUM value) constexpr typename std::underlying_type<ENUM>::type toUnderlying(ENUM value)
{ {
return static_cast<typename std::underlying_type<ENUM>::type>(value); return static_cast<typename std::underlying_type<ENUM>::type>(value);
} }

View File

@ -29,8 +29,8 @@ BayerProcess::BayerProcess () : FoldableToolPanel(this, "bayerprocess", M("TP_RA
hb1->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4); hb1->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4);
method = Gtk::manage (new MyComboBoxText ()); method = Gtk::manage (new MyComboBoxText ());
for( size_t i = 0; i < procparams::RAWParams::BayerSensor::numMethods; i++) { for(const auto method_string : procparams::RAWParams::BayerSensor::getMethodStrings()) {
method->append(M("TP_RAW_" + Glib::ustring(procparams::RAWParams::BayerSensor::methodstring[i]).uppercase())); method->append(M("TP_RAW_" + Glib::ustring(method_string).uppercase()));
} }
method->set_active(0); method->set_active(0);
@ -112,7 +112,7 @@ BayerProcess::BayerProcess () : FoldableToolPanel(this, "bayerprocess", M("TP_RA
pixelShiftMotionMethod->append(M("TP_RAW_PIXELSHIFTMM_OFF")); pixelShiftMotionMethod->append(M("TP_RAW_PIXELSHIFTMM_OFF"));
pixelShiftMotionMethod->append(M("TP_RAW_PIXELSHIFTMM_AUTO")); pixelShiftMotionMethod->append(M("TP_RAW_PIXELSHIFTMM_AUTO"));
pixelShiftMotionMethod->append(M("TP_RAW_PIXELSHIFTMM_CUSTOM")); pixelShiftMotionMethod->append(M("TP_RAW_PIXELSHIFTMM_CUSTOM"));
pixelShiftMotionMethod->set_active(RAWParams::BayerSensor::ePSMotionCorrectionMethod::Automatic); pixelShiftMotionMethod->set_active(toUnderlying(RAWParams::BayerSensor::PSMotionCorrectionMethod::AUTO));
pixelShiftMotionMethod->show(); pixelShiftMotionMethod->show();
hb3->pack_start(*pixelShiftMotionMethod); hb3->pack_start(*pixelShiftMotionMethod);
pixelShiftFrame->pack_start(*hb3); pixelShiftFrame->pack_start(*hb3);
@ -347,11 +347,11 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params
pixelShiftMotionCorrection->block (true); pixelShiftMotionCorrection->block (true);
#endif #endif
method->set_active(procparams::RAWParams::BayerSensor::numMethods); method->set_active(std::numeric_limits<int>::max());
imageNumber->set_active(pp->raw.bayersensor.imageNum); imageNumber->set_active(pp->raw.bayersensor.imageNum);
for( size_t i = 0; i < procparams::RAWParams::BayerSensor::numMethods; i++) { for (size_t i = 0; i < procparams::RAWParams::BayerSensor::getMethodStrings().size(); ++i) {
if( pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[i]) { if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodStrings()[i]) {
method->set_active(i); method->set_active(i);
oldMethod = i; oldMethod = i;
break; break;
@ -452,7 +452,7 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params
#endif #endif
if(!pedited->raw.bayersensor.method) { if(!pedited->raw.bayersensor.method) {
method->set_active(procparams::RAWParams::BayerSensor::numMethods); // No name method->set_active(std::numeric_limits<int>::max()); // No name
} }
if(!pedited->raw.bayersensor.imageNum) { if(!pedited->raw.bayersensor.imageNum) {
imageNumber->set_active_text(M("GENERAL_UNCHANGED")); imageNumber->set_active_text(M("GENERAL_UNCHANGED"));
@ -468,21 +468,21 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params
} }
if (!batchMode) { if (!batchMode) {
if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[procparams::RAWParams::BayerSensor::dcb] || if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::DCB) ||
method->get_active_row_number() == procparams::RAWParams::BayerSensor::numMethods) { method->get_active_row_number() == std::numeric_limits<int>::max()) {
dcbOptions->show(); dcbOptions->show();
} else { } else {
dcbOptions->hide(); dcbOptions->hide();
} }
if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[procparams::RAWParams::BayerSensor::lmmse] || if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::LMMSE) ||
method->get_active_row_number() == procparams::RAWParams::BayerSensor::numMethods) { method->get_active_row_number() == std::numeric_limits<int>::max()) {
lmmseOptions->show(); lmmseOptions->show();
} else { } else {
lmmseOptions->hide(); lmmseOptions->hide();
} }
if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[procparams::RAWParams::BayerSensor::pixelshift] || if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::PIXELSHIFT) ||
method->get_active_row_number() == procparams::RAWParams::BayerSensor::numMethods) { method->get_active_row_number() == std::numeric_limits<int>::max()) {
if(pp->raw.bayersensor.pixelShiftMotionCorrectionMethod == RAWParams::BayerSensor::Custom) { if(pp->raw.bayersensor.pixelShiftMotionCorrectionMethod == RAWParams::BayerSensor::PSMotionCorrectionMethod::CUSTOM) {
pixelShiftOptions->show(); pixelShiftOptions->show();
} else { } else {
pixelShiftOptions->hide(); pixelShiftOptions->hide();
@ -493,9 +493,9 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params
} }
// Flase color suppression is applied to all demozaicing method, so don't hide anything // Flase color suppression is applied to all demozaicing method, so don't hide anything
/*if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[procparams::RAWParams::BayerSensor::eahd] || /*if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::EAHD) ||
pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[procparams::RAWParams::BayerSensor::hphd] || pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::HPHD) ||
pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[procparams::RAWParams::BayerSensor::vng4]) pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::VNG4))
ccSteps->show(); ccSteps->show();
else else
ccSteps->hide();*/ ccSteps->hide();*/
@ -520,7 +520,7 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe
pp->raw.bayersensor.dcb_enhance = dcbEnhance->getLastActive (); pp->raw.bayersensor.dcb_enhance = dcbEnhance->getLastActive ();
//pp->raw.bayersensor.all_enhance = allEnhance->getLastActive (); //pp->raw.bayersensor.all_enhance = allEnhance->getLastActive ();
pp->raw.bayersensor.lmmse_iterations = lmmseIterations->getIntValue(); pp->raw.bayersensor.lmmse_iterations = lmmseIterations->getIntValue();
pp->raw.bayersensor.pixelShiftMotionCorrectionMethod = (RAWParams::BayerSensor::ePSMotionCorrectionMethod)pixelShiftMotionMethod->get_active_row_number(); pp->raw.bayersensor.pixelShiftMotionCorrectionMethod = (RAWParams::BayerSensor::PSMotionCorrectionMethod)pixelShiftMotionMethod->get_active_row_number();
pp->raw.bayersensor.pixelShiftEperIso = pixelShiftEperIso->getValue(); pp->raw.bayersensor.pixelShiftEperIso = pixelShiftEperIso->getValue();
pp->raw.bayersensor.pixelShiftSigma = pixelShiftSigma->getValue(); pp->raw.bayersensor.pixelShiftSigma = pixelShiftSigma->getValue();
pp->raw.bayersensor.pixelShiftShowMotion = pixelShiftShowMotion->getLastActive (); pp->raw.bayersensor.pixelShiftShowMotion = pixelShiftShowMotion->getLastActive ();
@ -554,8 +554,8 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe
#endif #endif
int currentRow = method->get_active_row_number(); int currentRow = method->get_active_row_number();
if( currentRow >= 0 && currentRow < procparams::RAWParams::BayerSensor::numMethods) { if( currentRow >= 0 && currentRow < std::numeric_limits<int>::max()) {
pp->raw.bayersensor.method = procparams::RAWParams::BayerSensor::methodstring[currentRow]; pp->raw.bayersensor.method = procparams::RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method(currentRow));
} }
currentRow = imageNumber->get_active_row_number(); currentRow = imageNumber->get_active_row_number();
@ -566,7 +566,7 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe
if (pedited) { if (pedited) {
pedited->raw.bayersensor.ccSteps = ccSteps->getEditedState (); pedited->raw.bayersensor.ccSteps = ccSteps->getEditedState ();
pedited->raw.bayersensor.method = method->get_active_row_number() != procparams::RAWParams::BayerSensor::numMethods; pedited->raw.bayersensor.method = method->get_active_row_number() != std::numeric_limits<int>::max();
pedited->raw.bayersensor.imageNum = imageNumber->get_active_text() != M("GENERAL_UNCHANGED"); pedited->raw.bayersensor.imageNum = imageNumber->get_active_text() != M("GENERAL_UNCHANGED");
pedited->raw.bayersensor.dcbIterations = dcbIterations->getEditedState (); pedited->raw.bayersensor.dcbIterations = dcbIterations->getEditedState ();
pedited->raw.bayersensor.dcbEnhance = !dcbEnhance->get_inconsistent(); pedited->raw.bayersensor.dcbEnhance = !dcbEnhance->get_inconsistent();
@ -610,7 +610,7 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe
void BayerProcess::setBatchMode(bool batchMode) void BayerProcess::setBatchMode(bool batchMode)
{ {
method->append (M("GENERAL_UNCHANGED")); method->append (M("GENERAL_UNCHANGED"));
method->set_active(procparams::RAWParams::BayerSensor::numMethods); // No name method->set_active(std::numeric_limits<int>::max()); // No name
#ifdef PIXELSHIFTDEV #ifdef PIXELSHIFTDEV
pixelShiftMotionCorrection->append (M("GENERAL_UNCHANGED")); pixelShiftMotionCorrection->append (M("GENERAL_UNCHANGED"));
pixelShiftMotionCorrection->set_active_text (M("GENERAL_UNCHANGED")); pixelShiftMotionCorrection->set_active_text (M("GENERAL_UNCHANGED"));
@ -750,22 +750,23 @@ void BayerProcess::psMotionCorrectionChanged ()
void BayerProcess::methodChanged () void BayerProcess::methodChanged ()
{ {
int curSelection = method->get_active_row_number(); const int curSelection = method->get_active_row_number();
const RAWParams::BayerSensor::Method method = RAWParams::BayerSensor::Method(curSelection);
if (!batchMode) { if (!batchMode) {
if ( curSelection == procparams::RAWParams::BayerSensor::dcb) { if (method == procparams::RAWParams::BayerSensor::Method::DCB) {
dcbOptions->show(); dcbOptions->show();
} else { } else {
dcbOptions->hide(); dcbOptions->hide();
} }
if ( curSelection == procparams::RAWParams::BayerSensor::lmmse) { if (method == procparams::RAWParams::BayerSensor::Method::LMMSE) {
lmmseOptions->show(); lmmseOptions->show();
} else { } else {
lmmseOptions->hide(); lmmseOptions->hide();
} }
if ( curSelection == procparams::RAWParams::BayerSensor::pixelshift) { if (method == procparams::RAWParams::BayerSensor::Method::PIXELSHIFT) {
if(pixelShiftMotionMethod->get_active_row_number() == 2) { if(pixelShiftMotionMethod->get_active_row_number() == 2) {
pixelShiftOptions->show(); pixelShiftOptions->show();
} else { } else {
@ -780,10 +781,10 @@ void BayerProcess::methodChanged ()
Glib::ustring methodName = ""; Glib::ustring methodName = "";
bool ppreq = false; bool ppreq = false;
if( curSelection >= 0 && curSelection < procparams::RAWParams::BayerSensor::numMethods) { if (curSelection >= 0 && curSelection < std::numeric_limits<int>::max()) {
methodName = procparams::RAWParams::BayerSensor::methodstring[curSelection]; methodName = procparams::RAWParams::BayerSensor::getMethodString(method);
if (curSelection == procparams::RAWParams::BayerSensor::mono || oldMethod == procparams::RAWParams::BayerSensor::mono) { if (method == procparams::RAWParams::BayerSensor::Method::MONO || RAWParams::BayerSensor::Method(oldMethod) == procparams::RAWParams::BayerSensor::Method::MONO) {
ppreq = true; ppreq = true;
} }
} }

View File

@ -500,7 +500,7 @@ void BlackWhite::read (const ProcParams* pp, const ParamsEdited* pedited)
mixerPurple->setValue (pp->blackwhite.mixerPurple); mixerPurple->setValue (pp->blackwhite.mixerPurple);
luminanceCurve->setCurve (pp->blackwhite.luminanceCurve); luminanceCurve->setCurve (pp->blackwhite.luminanceCurve);
beforeCurve->setCurve (pp->blackwhite.beforeCurve); beforeCurve->setCurve (pp->blackwhite.beforeCurve);
beforeCurveMode->set_active(pp->blackwhite.beforeCurveMode); beforeCurveMode->set_active(toUnderlying(pp->blackwhite.beforeCurveMode));
afterCurve->setCurve (pp->blackwhite.afterCurve); afterCurve->setCurve (pp->blackwhite.afterCurve);
// afterCurveMode->set_active(pp->blackwhite.afterCurveMode); // afterCurveMode->set_active(pp->blackwhite.afterCurveMode);
@ -583,18 +583,18 @@ void BlackWhite::write (ProcParams* pp, ParamsEdited* pedited)
int tcMode = beforeCurveMode->get_active_row_number(); int tcMode = beforeCurveMode->get_active_row_number();
if (tcMode == 0) { if (tcMode == 0) {
pp->blackwhite.beforeCurveMode = BlackWhiteParams::TC_MODE_STD_BW; pp->blackwhite.beforeCurveMode = BlackWhiteParams::TcMode::STD_BW;
} else if (tcMode == 1) { } else if (tcMode == 1) {
pp->blackwhite.beforeCurveMode = BlackWhiteParams::TC_MODE_WEIGHTEDSTD_BW; pp->blackwhite.beforeCurveMode = BlackWhiteParams::TcMode::WEIGHTEDSTD_BW;
} else if (tcMode == 2) { } else if (tcMode == 2) {
pp->blackwhite.beforeCurveMode = BlackWhiteParams::TC_MODE_FILMLIKE_BW; pp->blackwhite.beforeCurveMode = BlackWhiteParams::TcMode::FILMLIKE_BW;
} else if (tcMode == 3) { } else if (tcMode == 3) {
pp->blackwhite.beforeCurveMode = BlackWhiteParams::TC_MODE_SATANDVALBLENDING_BW; pp->blackwhite.beforeCurveMode = BlackWhiteParams::TcMode::SATANDVALBLENDING_BW;
} }
// tcMode = afterCurveMode->get_active_row_number(); // tcMode = afterCurveMode->get_active_row_number();
// if (tcMode == 0) pp->blackwhite.afterCurveMode = BlackWhiteParams::TC_MODE_STD_BW; // if (tcMode == 0) pp->blackwhite.afterCurveMode = BlackWhiteParams::TCMode::STD_BW;
// else if (tcMode == 1) pp->blackwhite.afterCurveMode = BlackWhiteParams::TC_MODE_WEIGHTEDSTD; // else if (tcMode == 1) pp->blackwhite.afterCurveMode = BlackWhiteParams::TCMode::WEIGHTEDSTD;
if (pedited) { if (pedited) {
pedited->blackwhite.enabled = !get_inconsistent(); pedited->blackwhite.enabled = !get_inconsistent();

View File

@ -799,9 +799,9 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
shape->setCurve (pp->colorappearance.curve); shape->setCurve (pp->colorappearance.curve);
shape2->setCurve (pp->colorappearance.curve2); shape2->setCurve (pp->colorappearance.curve2);
shape3->setCurve (pp->colorappearance.curve3); shape3->setCurve (pp->colorappearance.curve3);
toneCurveMode->set_active (pp->colorappearance.curveMode); toneCurveMode->set_active (toUnderlying(pp->colorappearance.curveMode));
toneCurveMode2->set_active (pp->colorappearance.curveMode2); toneCurveMode2->set_active (toUnderlying(pp->colorappearance.curveMode2));
toneCurveMode3->set_active (pp->colorappearance.curveMode3); toneCurveMode3->set_active (toUnderlying(pp->colorappearance.curveMode3));
curveMode3Changed(); // This will set the correct sensitive state of depending Adjusters curveMode3Changed(); // This will set the correct sensitive state of depending Adjusters
if (pedited) { if (pedited) {
@ -1044,27 +1044,27 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited)
int tcMode = toneCurveMode->get_active_row_number(); int tcMode = toneCurveMode->get_active_row_number();
if (tcMode == 0) { if (tcMode == 0) {
pp->colorappearance.curveMode = ColorAppearanceParams::TC_MODE_LIGHT; pp->colorappearance.curveMode = ColorAppearanceParams::TcMode::LIGHT;
} else if (tcMode == 1) { } else if (tcMode == 1) {
pp->colorappearance.curveMode = ColorAppearanceParams::TC_MODE_BRIGHT; pp->colorappearance.curveMode = ColorAppearanceParams::TcMode::BRIGHT;
} }
tcMode = toneCurveMode2->get_active_row_number(); tcMode = toneCurveMode2->get_active_row_number();
if (tcMode == 0) { if (tcMode == 0) {
pp->colorappearance.curveMode2 = ColorAppearanceParams::TC_MODE_LIGHT; pp->colorappearance.curveMode2 = ColorAppearanceParams::TcMode::LIGHT;
} else if (tcMode == 1) { } else if (tcMode == 1) {
pp->colorappearance.curveMode2 = ColorAppearanceParams::TC_MODE_BRIGHT; pp->colorappearance.curveMode2 = ColorAppearanceParams::TcMode::BRIGHT;
} }
int tcMode3 = toneCurveMode3->get_active_row_number(); int tcMode3 = toneCurveMode3->get_active_row_number();
if (tcMode3 == 0) { if (tcMode3 == 0) {
pp->colorappearance.curveMode3 = ColorAppearanceParams::TC_MODE_CHROMA; pp->colorappearance.curveMode3 = ColorAppearanceParams::CtcMode::CHROMA;
} else if (tcMode3 == 1) { } else if (tcMode3 == 1) {
pp->colorappearance.curveMode3 = ColorAppearanceParams::TC_MODE_SATUR; pp->colorappearance.curveMode3 = ColorAppearanceParams::CtcMode::SATUR;
} else if (tcMode3 == 2) { } else if (tcMode3 == 2) {
pp->colorappearance.curveMode3 = ColorAppearanceParams::TC_MODE_COLORF; pp->colorappearance.curveMode3 = ColorAppearanceParams::CtcMode::COLORF;
} }
if (pedited) { if (pedited) {

View File

@ -54,14 +54,14 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR
colorShape->setLeftBarBgGradient(milestones); colorShape->setLeftBarBgGradient(milestones);
const ColorToningParams default_params;
// luminance gradient // luminance gradient
milestones.clear(); milestones.clear();
milestones.push_back( GradientMilestone(0., 0., 0., 0.) ); milestones.push_back( GradientMilestone(0., 0., 0., 0.) );
milestones.push_back( GradientMilestone(1., 1., 1., 1.) ); milestones.push_back( GradientMilestone(1., 1., 1., 1.) );
colorShape->setBottomBarBgGradient(milestones); colorShape->setBottomBarBgGradient(milestones);
std::vector<double> defaultCurve; colorShape->setResetCurve(FCT_MinMaxCPoints, default_params.colorCurve);
rtengine::ColorToningParams::getDefaultColorCurve(defaultCurve);
colorShape->setResetCurve(FCT_MinMaxCPoints, defaultCurve);
// This will add the reset button at the end of the curveType buttons // This will add the reset button at the end of the curveType buttons
colorCurveEditorG->curveListComplete(); colorCurveEditorG->curveListComplete();
@ -88,10 +88,9 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR
opacityCurveEditorG = new CurveEditorGroup (options.lastColorToningCurvesDir, M("TP_COLORTONING_OPACITY")); opacityCurveEditorG = new CurveEditorGroup (options.lastColorToningCurvesDir, M("TP_COLORTONING_OPACITY"));
opacityCurveEditorG->setCurveListener (this); opacityCurveEditorG->setCurveListener (this);
rtengine::ColorToningParams::getDefaultOpacityCurve(defaultCurve);
opacityShape = static_cast<FlatCurveEditor*>(opacityCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); opacityShape = static_cast<FlatCurveEditor*>(opacityCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false));
opacityShape->setIdentityValue(0.); opacityShape->setIdentityValue(0.);
opacityShape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); opacityShape->setResetCurve(FlatCurveType(default_params.opacityCurve.at(0)), default_params.opacityCurve);
opacityShape->setBottomBarBgGradient(milestones); opacityShape->setBottomBarBgGradient(milestones);
// This will add the reset button at the end of the curveType buttons // This will add the reset button at the end of the curveType buttons
@ -107,9 +106,8 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR
clCurveEditorG = new CurveEditorGroup (options.lastColorToningCurvesDir, M("TP_COLORTONING_CHROMAC")); clCurveEditorG = new CurveEditorGroup (options.lastColorToningCurvesDir, M("TP_COLORTONING_CHROMAC"));
clCurveEditorG->setCurveListener (this); clCurveEditorG->setCurveListener (this);
rtengine::ColorToningParams::getDefaultCLCurve(defaultCurve);
clshape = static_cast<DiagonalCurveEditor*>(clCurveEditorG->addCurve(CT_Diagonal, M("TP_COLORTONING_AB"), irg, false)); clshape = static_cast<DiagonalCurveEditor*>(clCurveEditorG->addCurve(CT_Diagonal, M("TP_COLORTONING_AB"), irg, false));
clshape->setResetCurve(DiagonalCurveType(defaultCurve.at(0)), defaultCurve); clshape->setResetCurve(DiagonalCurveType(default_params.clcurve.at(0)), default_params.clcurve);
clshape->setTooltip(M("TP_COLORTONING_CURVEEDITOR_CL_TOOLTIP")); clshape->setTooltip(M("TP_COLORTONING_CURVEEDITOR_CL_TOOLTIP"));
clshape->setLeftBarColorProvider(this, 1); clshape->setLeftBarColorProvider(this, 1);
@ -127,9 +125,8 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR
cl2CurveEditorG = new CurveEditorGroup (options.lastColorToningCurvesDir, M("TP_COLORTONING_CHROMAC")); cl2CurveEditorG = new CurveEditorGroup (options.lastColorToningCurvesDir, M("TP_COLORTONING_CHROMAC"));
cl2CurveEditorG->setCurveListener (this); cl2CurveEditorG->setCurveListener (this);
rtengine::ColorToningParams::getDefaultCL2Curve(defaultCurve);
cl2shape = static_cast<DiagonalCurveEditor*>(cl2CurveEditorG->addCurve(CT_Diagonal, M("TP_COLORTONING_BY"), iby, false)); cl2shape = static_cast<DiagonalCurveEditor*>(cl2CurveEditorG->addCurve(CT_Diagonal, M("TP_COLORTONING_BY"), iby, false));
cl2shape->setResetCurve(DiagonalCurveType(defaultCurve.at(0)), defaultCurve); cl2shape->setResetCurve(DiagonalCurveType(default_params.cl2curve.at(0)), default_params.cl2curve);
cl2shape->setTooltip(M("TP_COLORTONING_CURVEEDITOR_CL_TOOLTIP")); cl2shape->setTooltip(M("TP_COLORTONING_CURVEEDITOR_CL_TOOLTIP"));
cl2shape->setLeftBarColorProvider(this, 1); cl2shape->setLeftBarColorProvider(this, 1);

View File

@ -1047,7 +1047,7 @@ void CropWindow::pointerMoved (int bstate, int x, int y)
if(ipc) { if(ipc) {
procparams::ProcParams params; procparams::ProcParams params;
ipc->getParams(&params); ipc->getParams(&params);
if(params.raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::none] || params.raw.xtranssensor.method == RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::none]) { if(params.raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::NONE) || params.raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::NONE)) {
ImageSource *isrc = static_cast<ImageSource*>(ipc->getInitialImage()); ImageSource *isrc = static_cast<ImageSource*>(ipc->getInitialImage());
isrc->getRawValues(mx, my, params.coarse.rotate, rval, gval, bval); isrc->getRawValues(mx, my, params.coarse.rotate, rval, gval, bval);
} }

View File

@ -77,7 +77,7 @@ void DarkFrame::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi
dfAuto->set_active( pp->raw.df_autoselect ); dfAuto->set_active( pp->raw.df_autoselect );
if(pedited ) { if(pedited ) {
dfAuto->set_inconsistent(!pedited->raw.dfAuto ); dfAuto->set_inconsistent(!pedited->raw.df_autoselect );
} }
if (Glib::file_test (pp->raw.dark_frame, Glib::FILE_TEST_EXISTS)) { if (Glib::file_test (pp->raw.dark_frame, Glib::FILE_TEST_EXISTS)) {
@ -152,7 +152,7 @@ void DarkFrame::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedit
if (pedited) { if (pedited) {
pedited->raw.darkFrame = dfChanged; pedited->raw.darkFrame = dfChanged;
pedited->raw.dfAuto = !dfAuto->get_inconsistent(); pedited->raw.df_autoselect = !dfAuto->get_inconsistent();
} }
} }

View File

@ -61,7 +61,7 @@ DirPyrDenoise::DirPyrDenoise () : FoldableToolPanel(this, "dirpyrdenoise", M("TP
NoiscurveEditorG = new CurveEditorGroup (options.lastDenoiseCurvesDir, M("TP_DIRPYRDENOISE_LCURVE")); NoiscurveEditorG = new CurveEditorGroup (options.lastDenoiseCurvesDir, M("TP_DIRPYRDENOISE_LCURVE"));
//curveEditorG = new CurveEditorGroup (options.lastLabCurvesDir); //curveEditorG = new CurveEditorGroup (options.lastLabCurvesDir);
NoiscurveEditorG->setCurveListener (this); NoiscurveEditorG->setCurveListener (this);
rtengine::DirPyrDenoiseParams::getDefaultNoisCurve(defaultCurve); defaultCurve = rtengine::DirPyrDenoiseParams().lcurve;
lshape = static_cast<FlatCurveEditor*>(NoiscurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); lshape = static_cast<FlatCurveEditor*>(NoiscurveEditorG->addCurve(CT_Flat, "", nullptr, false, false));
lshape->setIdentityValue(0.); lshape->setIdentityValue(0.);
lshape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); 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 = new CurveEditorGroup (options.lastDenoiseCurvesDir, M("TP_DIRPYRDENOISE_CCCURVE"));
CCcurveEditorG->setCurveListener (this); CCcurveEditorG->setCurveListener (this);
rtengine::DirPyrDenoiseParams::getDefaultCCCurve(defaultCurve); defaultCurve = rtengine::DirPyrDenoiseParams().cccurve;
ccshape = static_cast<FlatCurveEditor*>(CCcurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); ccshape = static_cast<FlatCurveEditor*>(CCcurveEditorG->addCurve(CT_Flat, "", nullptr, false, false));
ccshape->setIdentityValue(0.); ccshape->setIdentityValue(0.);
ccshape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); ccshape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve);

View File

@ -68,8 +68,8 @@ ExportPanel::ExportPanel () : listener (nullptr)
hb_raw_bayer_method->pack_start (*Gtk::manage (new Gtk::Label ( M ("EXPORT_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4); hb_raw_bayer_method->pack_start (*Gtk::manage (new Gtk::Label ( M ("EXPORT_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4);
raw_bayer_method = Gtk::manage (new MyComboBoxText ()); raw_bayer_method = Gtk::manage (new MyComboBoxText ());
for ( size_t i = 0; i < procparams::RAWParams::BayerSensor::numMethods; i++) { for (const auto method_string : RAWParams::BayerSensor::getMethodStrings()) {
raw_bayer_method->append (procparams::RAWParams::BayerSensor::methodstring[i]); raw_bayer_method->append(method_string);
} }
raw_bayer_method->set_active (0); raw_bayer_method->set_active (0);
@ -91,8 +91,8 @@ ExportPanel::ExportPanel () : listener (nullptr)
hb_raw_xtrans_method->pack_start (*Gtk::manage (new Gtk::Label ( M ("EXPORT_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4); hb_raw_xtrans_method->pack_start (*Gtk::manage (new Gtk::Label ( M ("EXPORT_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4);
raw_xtrans_method = Gtk::manage (new MyComboBoxText ()); raw_xtrans_method = Gtk::manage (new MyComboBoxText ());
for ( size_t i = 0; i < procparams::RAWParams::XTransSensor::numMethods; i++) { for (const auto method_string : RAWParams::XTransSensor::getMethodStrings()) {
raw_xtrans_method->append (procparams::RAWParams::XTransSensor::methodstring[i]); raw_xtrans_method->append(method_string);
} }
raw_xtrans_method->set_active (0); raw_xtrans_method->set_active (0);
@ -275,15 +275,15 @@ void ExportPanel::SaveSettingsAsDefault()
//saving Bayer demosaic_method //saving Bayer demosaic_method
int currentRow = raw_bayer_method->get_active_row_number(); int currentRow = raw_bayer_method->get_active_row_number();
if ( currentRow >= 0 && currentRow < procparams::RAWParams::BayerSensor::numMethods) { if (currentRow >= 0 && currentRow < std::numeric_limits<int>::max()) {
FE_OPT_STORE_ (options.fastexport_raw_bayer_method, procparams::RAWParams::BayerSensor::methodstring[currentRow]); FE_OPT_STORE_ (options.fastexport_raw_bayer_method, procparams::RAWParams::BayerSensor::getMethodStrings()[currentRow]);
} }
//saving X-Trans demosaic_method //saving X-Trans demosaic_method
currentRow = raw_xtrans_method->get_active_row_number(); currentRow = raw_xtrans_method->get_active_row_number();
if ( currentRow >= 0 && currentRow < procparams::RAWParams::XTransSensor::numMethods) { if (currentRow >= 0 && currentRow < std::numeric_limits<int>::max()) {
FE_OPT_STORE_ (options.fastexport_raw_xtrans_method, procparams::RAWParams::XTransSensor::methodstring[currentRow]); FE_OPT_STORE_ (options.fastexport_raw_xtrans_method, procparams::RAWParams::XTransSensor::getMethodStrings()[currentRow]);
} }
// options.fastexport_icm_input = icm_input ; // options.fastexport_icm_input = icm_input ;
@ -337,20 +337,20 @@ void ExportPanel::LoadDefaultSettings()
bypass_raw_ff->set_active (options.fastexport_bypass_raw_ff ); bypass_raw_ff->set_active (options.fastexport_bypass_raw_ff );
// Bayer demosaic method // Bayer demosaic method
raw_bayer_method->set_active (procparams::RAWParams::BayerSensor::numMethods); raw_bayer_method->set_active(std::numeric_limits<int>::max());
for ( size_t i = 0; i < procparams::RAWParams::BayerSensor::numMethods; i++) for (size_t i = 0; i < RAWParams::BayerSensor::getMethodStrings().size(); ++i)
if ( options.fastexport_raw_bayer_method == procparams::RAWParams::BayerSensor::methodstring[i]) { if (options.fastexport_raw_bayer_method == procparams::RAWParams::BayerSensor::getMethodStrings()[i]) {
raw_bayer_method->set_active (i); raw_bayer_method->set_active(i);
break; break;
} }
// X-Trans demosaic method // X-Trans demosaic method
raw_xtrans_method->set_active (procparams::RAWParams::XTransSensor::numMethods); raw_xtrans_method->set_active(std::numeric_limits<int>::max());
for ( size_t i = 0; i < procparams::RAWParams::XTransSensor::numMethods; i++) for (size_t i = 0; i < procparams::RAWParams::XTransSensor::getMethodStrings().size(); ++i)
if ( options.fastexport_raw_xtrans_method == procparams::RAWParams::XTransSensor::methodstring[i]) { if (options.fastexport_raw_xtrans_method == procparams::RAWParams::XTransSensor::getMethodStrings()[i]) {
raw_xtrans_method->set_active (i); raw_xtrans_method->set_active(i);
break; break;
} }

View File

@ -1021,7 +1021,7 @@ void FileBrowser::pasteProfile ()
for (unsigned int i = 0; i < mselected.size(); i++) { for (unsigned int i = 0; i < mselected.size(); i++) {
// copying read only clipboard PartialProfile to a temporary one // copying read only clipboard PartialProfile to a temporary one
rtengine::procparams::PartialProfile cbPartProf = clipboard.getPartialProfile(); const rtengine::procparams::PartialProfile& cbPartProf = clipboard.getPartialProfile();
rtengine::procparams::PartialProfile pastedPartProf(cbPartProf.pparams, cbPartProf.pedited, true); rtengine::procparams::PartialProfile pastedPartProf(cbPartProf.pparams, cbPartProf.pedited, true);
// applying the PartialProfile to the thumb's ProcParams // applying the PartialProfile to the thumb's ProcParams
@ -1069,7 +1069,7 @@ void FileBrowser::partPasteProfile ()
for (unsigned int i = 0; i < mselected.size(); i++) { for (unsigned int i = 0; i < mselected.size(); i++) {
// copying read only clipboard PartialProfile to a temporary one, initialized to the thumb's ProcParams // copying read only clipboard PartialProfile to a temporary one, initialized to the thumb's ProcParams
mselected[i]->thumbnail->createProcParamsForUpdate(false, false); // this can execute customprofilebuilder to generate param file mselected[i]->thumbnail->createProcParamsForUpdate(false, false); // this can execute customprofilebuilder to generate param file
rtengine::procparams::PartialProfile cbPartProf = clipboard.getPartialProfile(); const rtengine::procparams::PartialProfile& cbPartProf = clipboard.getPartialProfile();
rtengine::procparams::PartialProfile pastedPartProf(&mselected[i]->thumbnail->getProcParams (), nullptr); rtengine::procparams::PartialProfile pastedPartProf(&mselected[i]->thumbnail->getProcParams (), nullptr);
// pushing the selected values of the clipboard PartialProfile to the temporary PartialProfile // pushing the selected values of the clipboard PartialProfile to the temporary PartialProfile

View File

@ -111,13 +111,14 @@ void FlatField::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi
flatFieldBlurTypeconn.block (true); flatFieldBlurTypeconn.block (true);
//flatFieldBlurType //flatFieldBlurType
for( size_t i = 0; i < procparams::RAWParams::numFlatFileBlurTypes; i++) for (size_t i = 0; i < procparams::RAWParams::getFlatFieldBlurTypeStrings().size(); ++i) {
if( pp->raw.ff_BlurType == procparams::RAWParams::ff_BlurTypestring[i]) { if (pp->raw.ff_BlurType == procparams::RAWParams::getFlatFieldBlurTypeStrings()[i]) {
flatFieldBlurType->set_active(i); flatFieldBlurType->set_active(i);
break; break;
} }
}
if (multiImage || pp->raw.ff_BlurType == procparams::RAWParams::ff_BlurTypestring[procparams::RAWParams::area_ff]) { if (multiImage || pp->raw.ff_BlurType == procparams::RAWParams::getFlatFieldBlurTypeString(procparams::RAWParams::FlatFieldBlurType::AREA)) {
flatFieldClipControl->show(); flatFieldClipControl->show();
} else { } else {
flatFieldClipControl->hide(); flatFieldClipControl->hide();
@ -135,7 +136,7 @@ void FlatField::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi
flatFieldClipControl->setAutoInconsistent(multiImage && !pedited->raw.ff_AutoClipControl); flatFieldClipControl->setAutoInconsistent(multiImage && !pedited->raw.ff_AutoClipControl);
if( !pedited->raw.ff_BlurType ) { if( !pedited->raw.ff_BlurType ) {
flatFieldBlurType->set_active(procparams::RAWParams::numFlatFileBlurTypes); // No name flatFieldBlurType->set_active(std::numeric_limits<int>::max()); // No name
} }
} }
@ -216,8 +217,8 @@ void FlatField::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedit
int currentRow = flatFieldBlurType->get_active_row_number(); int currentRow = flatFieldBlurType->get_active_row_number();
if( currentRow >= 0 && currentRow < procparams::RAWParams::numFlatFileBlurTypes) { if( currentRow >= 0 && currentRow < std::numeric_limits<int>::max()) {
pp->raw.ff_BlurType = procparams::RAWParams::ff_BlurTypestring[currentRow]; pp->raw.ff_BlurType = procparams::RAWParams::getFlatFieldBlurTypeStrings()[currentRow];
} }
if (pedited) { if (pedited) {
@ -226,7 +227,7 @@ void FlatField::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedit
pedited->raw.ff_BlurRadius = flatFieldBlurRadius->getEditedState (); pedited->raw.ff_BlurRadius = flatFieldBlurRadius->getEditedState ();
pedited->raw.ff_clipControl = flatFieldClipControl->getEditedState (); pedited->raw.ff_clipControl = flatFieldClipControl->getEditedState ();
pedited->raw.ff_AutoClipControl = !flatFieldClipControl->getAutoInconsistent(); pedited->raw.ff_AutoClipControl = !flatFieldClipControl->getAutoInconsistent();
pedited->raw.ff_BlurType = flatFieldBlurType->get_active_row_number() != procparams::RAWParams::numFlatFileBlurTypes; pedited->raw.ff_BlurType = flatFieldBlurType->get_active_row_number() != std::numeric_limits<int>::max();
} }
} }
@ -336,15 +337,16 @@ void FlatField::flatFieldFile_Reset()
void FlatField::flatFieldBlurTypeChanged () void FlatField::flatFieldBlurTypeChanged ()
{ {
int curSelection = flatFieldBlurType->get_active_row_number(); const int curSelection = flatFieldBlurType->get_active_row_number();
const RAWParams::FlatFieldBlurType blur_type = RAWParams::FlatFieldBlurType(curSelection);
Glib::ustring s = ""; Glib::ustring s;
if( curSelection >= 0 && curSelection < procparams::RAWParams::numFlatFileBlurTypes) { if (curSelection >= 0 && curSelection < std::numeric_limits<int>::max()) {
s = flatFieldBlurType->get_active_text(); s = flatFieldBlurType->get_active_text();
} }
if (multiImage || curSelection == procparams::RAWParams::area_ff) { if (multiImage || blur_type == procparams::RAWParams::FlatFieldBlurType::AREA) {
flatFieldClipControl->show(); flatFieldClipControl->show();
} else { } else {
flatFieldClipControl->hide(); flatFieldClipControl->hide();

View File

@ -423,14 +423,14 @@ void ParamsEdited::set (bool v)
raw.xtranssensor.exBlackRed = v; raw.xtranssensor.exBlackRed = v;
raw.xtranssensor.exBlackGreen = v; raw.xtranssensor.exBlackGreen = v;
raw.xtranssensor.exBlackBlue = v; raw.xtranssensor.exBlackBlue = v;
raw.caCorrection = v; raw.ca_autocorrect = v;
raw.caBlue = v; raw.cablue = v;
raw.caRed = v; raw.cared = v;
raw.hotPixelFilter = v; raw.hotPixelFilter = v;
raw.deadPixelFilter = v; raw.deadPixelFilter = v;
raw.hotDeadPixelThresh = v; raw.hotdeadpix_thresh = v;
raw.darkFrame = v; raw.darkFrame = v;
raw.dfAuto = v; raw.df_autoselect = v;
raw.ff_file = v; raw.ff_file = v;
raw.ff_AutoSelect = v; raw.ff_AutoSelect = v;
raw.ff_BlurRadius = v; raw.ff_BlurRadius = v;
@ -965,14 +965,14 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
raw.xtranssensor.exBlackRed = raw.xtranssensor.exBlackRed && p.raw.xtranssensor.blackred == other.raw.xtranssensor.blackred; raw.xtranssensor.exBlackRed = raw.xtranssensor.exBlackRed && p.raw.xtranssensor.blackred == other.raw.xtranssensor.blackred;
raw.xtranssensor.exBlackGreen = raw.xtranssensor.exBlackGreen && p.raw.xtranssensor.blackgreen == other.raw.xtranssensor.blackgreen; raw.xtranssensor.exBlackGreen = raw.xtranssensor.exBlackGreen && p.raw.xtranssensor.blackgreen == other.raw.xtranssensor.blackgreen;
raw.xtranssensor.exBlackBlue = raw.xtranssensor.exBlackBlue && p.raw.xtranssensor.blackblue == other.raw.xtranssensor.blackblue; raw.xtranssensor.exBlackBlue = raw.xtranssensor.exBlackBlue && p.raw.xtranssensor.blackblue == other.raw.xtranssensor.blackblue;
raw.caCorrection = raw.caCorrection && p.raw.ca_autocorrect == other.raw.ca_autocorrect; raw.ca_autocorrect = raw.ca_autocorrect && p.raw.ca_autocorrect == other.raw.ca_autocorrect;
raw.caRed = raw.caRed && p.raw.cared == other.raw.cared; raw.cared = raw.cared && p.raw.cared == other.raw.cared;
raw.caBlue = raw.caBlue && p.raw.cablue == other.raw.cablue; raw.cablue = raw.cablue && p.raw.cablue == other.raw.cablue;
raw.hotPixelFilter = raw.hotPixelFilter && p.raw.hotPixelFilter == other.raw.hotPixelFilter; raw.hotPixelFilter = raw.hotPixelFilter && p.raw.hotPixelFilter == other.raw.hotPixelFilter;
raw.deadPixelFilter = raw.deadPixelFilter && p.raw.deadPixelFilter == other.raw.deadPixelFilter; raw.deadPixelFilter = raw.deadPixelFilter && p.raw.deadPixelFilter == other.raw.deadPixelFilter;
raw.hotDeadPixelThresh = raw.hotDeadPixelThresh && p.raw.hotdeadpix_thresh == other.raw.hotdeadpix_thresh; raw.hotdeadpix_thresh = raw.hotdeadpix_thresh && p.raw.hotdeadpix_thresh == other.raw.hotdeadpix_thresh;
raw.darkFrame = raw.darkFrame && p.raw.dark_frame == other.raw.dark_frame; raw.darkFrame = raw.darkFrame && p.raw.dark_frame == other.raw.dark_frame;
raw.dfAuto = raw.dfAuto && p.raw.df_autoselect == other.raw.df_autoselect; raw.df_autoselect = raw.df_autoselect && p.raw.df_autoselect == other.raw.df_autoselect;
raw.ff_file = raw.ff_file && p.raw.ff_file == other.raw.ff_file; raw.ff_file = raw.ff_file && p.raw.ff_file == other.raw.ff_file;
raw.ff_AutoSelect = raw.ff_AutoSelect && p.raw.ff_AutoSelect == other.raw.ff_AutoSelect; raw.ff_AutoSelect = raw.ff_AutoSelect && p.raw.ff_AutoSelect == other.raw.ff_AutoSelect;
raw.ff_BlurRadius = raw.ff_BlurRadius && p.raw.ff_BlurRadius == other.raw.ff_BlurRadius; raw.ff_BlurRadius = raw.ff_BlurRadius && p.raw.ff_BlurRadius == other.raw.ff_BlurRadius;
@ -2571,15 +2571,15 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
toEdit.raw.xtranssensor.blackblue = dontforceSet && options.baBehav[ADDSET_RAWEXPOS_BLACKS] ? toEdit.raw.xtranssensor.blackblue + mods.raw.xtranssensor.blackblue : mods.raw.xtranssensor.blackblue; toEdit.raw.xtranssensor.blackblue = dontforceSet && options.baBehav[ADDSET_RAWEXPOS_BLACKS] ? toEdit.raw.xtranssensor.blackblue + mods.raw.xtranssensor.blackblue : mods.raw.xtranssensor.blackblue;
} }
if (raw.caCorrection) { if (raw.ca_autocorrect) {
toEdit.raw.ca_autocorrect = mods.raw.ca_autocorrect; toEdit.raw.ca_autocorrect = mods.raw.ca_autocorrect;
} }
if (raw.caRed) { if (raw.cared) {
toEdit.raw.cared = dontforceSet && options.baBehav[ADDSET_RAWCACORR] ? toEdit.raw.cared + mods.raw.cared : mods.raw.cared; toEdit.raw.cared = dontforceSet && options.baBehav[ADDSET_RAWCACORR] ? toEdit.raw.cared + mods.raw.cared : mods.raw.cared;
} }
if (raw.caBlue) { if (raw.cablue) {
toEdit.raw.cablue = dontforceSet && options.baBehav[ADDSET_RAWCACORR] ? toEdit.raw.cablue + mods.raw.cablue : mods.raw.cablue; toEdit.raw.cablue = dontforceSet && options.baBehav[ADDSET_RAWCACORR] ? toEdit.raw.cablue + mods.raw.cablue : mods.raw.cablue;
} }
@ -2599,7 +2599,7 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
toEdit.raw.deadPixelFilter = mods.raw.deadPixelFilter; toEdit.raw.deadPixelFilter = mods.raw.deadPixelFilter;
} }
if (raw.hotDeadPixelThresh) { if (raw.hotdeadpix_thresh) {
toEdit.raw.hotdeadpix_thresh = mods.raw.hotdeadpix_thresh; toEdit.raw.hotdeadpix_thresh = mods.raw.hotdeadpix_thresh;
} }
@ -2607,7 +2607,7 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
toEdit.raw.dark_frame = mods.raw.dark_frame; toEdit.raw.dark_frame = mods.raw.dark_frame;
} }
if (raw.dfAuto) { if (raw.df_autoselect) {
toEdit.raw.df_autoselect = mods.raw.df_autoselect; toEdit.raw.df_autoselect = mods.raw.df_autoselect;
} }
@ -3062,8 +3062,8 @@ bool RAWParamsEdited::XTransSensor::isUnchanged() const
bool RAWParamsEdited::isUnchanged() const bool RAWParamsEdited::isUnchanged() const
{ {
return bayersensor.isUnchanged() && xtranssensor.isUnchanged() && caCorrection && caRed && caBlue && hotPixelFilter && deadPixelFilter && hotDeadPixelThresh && darkFrame return bayersensor.isUnchanged() && xtranssensor.isUnchanged() && ca_autocorrect && cared && cablue && hotPixelFilter && deadPixelFilter && hotdeadpix_thresh && darkFrame
&& dfAuto && ff_file && ff_AutoSelect && ff_BlurRadius && ff_BlurType && exPos && exPreser && ff_AutoClipControl && ff_clipControl; && df_autoselect && ff_file && ff_AutoSelect && ff_BlurRadius && ff_BlurType && exPos && exPreser && ff_AutoClipControl && ff_clipControl;
} }
bool LensProfParamsEdited::isUnchanged() const bool LensProfParamsEdited::isUnchanged() const

View File

@ -567,7 +567,6 @@ public:
bool gamma; bool gamma;
bool gampos; bool gampos;
bool slpos; bool slpos;
bool gamfree;
bool freegamma; bool freegamma;
}; };
class WaveletParamsEdited class WaveletParamsEdited
@ -764,14 +763,14 @@ public:
BayerSensor bayersensor; BayerSensor bayersensor;
XTransSensor xtranssensor; XTransSensor xtranssensor;
bool caCorrection; bool ca_autocorrect;
bool caRed; bool cared;
bool caBlue; bool cablue;
bool hotPixelFilter; bool hotPixelFilter;
bool deadPixelFilter; bool deadPixelFilter;
bool hotDeadPixelThresh; bool hotdeadpix_thresh;
bool darkFrame; bool darkFrame;
bool dfAuto; bool df_autoselect;
bool ff_file; bool ff_file;
bool ff_AutoSelect; bool ff_AutoSelect;
bool ff_BlurRadius; bool ff_BlurRadius;
@ -839,8 +838,5 @@ public:
void set (bool v); void set (bool v);
void initFrom (const std::vector<rtengine::procparams::ProcParams>& src); void initFrom (const std::vector<rtengine::procparams::ProcParams>& src);
void combine (rtengine::procparams::ProcParams& toEdit, const rtengine::procparams::ProcParams& mods, bool forceSet); void combine (rtengine::procparams::ProcParams& toEdit, const rtengine::procparams::ProcParams& mods, bool forceSet);
bool operator== (const ParamsEdited& other);
bool operator!= (const ParamsEdited& other);
}; };
#endif #endif

View File

@ -943,12 +943,12 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param
} }
if (!raw_ca_autocorrect->get_active ()) { if (!raw_ca_autocorrect->get_active ()) {
filterPE.raw.caCorrection = falsePE.raw.caCorrection; filterPE.raw.ca_autocorrect = falsePE.raw.ca_autocorrect;
} }
if (!raw_caredblue->get_active ()) { if (!raw_caredblue->get_active ()) {
filterPE.raw.caRed = falsePE.raw.caRed; filterPE.raw.cared = falsePE.raw.cared;
filterPE.raw.caBlue = falsePE.raw.caBlue; filterPE.raw.cablue = falsePE.raw.cablue;
} }
if (!raw_hotpix_filt->get_active ()) { if (!raw_hotpix_filt->get_active ()) {
@ -960,7 +960,7 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param
} }
if (!raw_deadpix_filt->get_active () && !raw_hotpix_filt->get_active ()) { if (!raw_deadpix_filt->get_active () && !raw_hotpix_filt->get_active ()) {
filterPE.raw.hotDeadPixelThresh = falsePE.raw.hotDeadPixelThresh; filterPE.raw.hotdeadpix_thresh = falsePE.raw.hotdeadpix_thresh;
} }
if (!df_file->get_active ()) { if (!df_file->get_active ()) {
@ -968,7 +968,7 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param
} }
if (!df_AutoSelect->get_active ()) { if (!df_AutoSelect->get_active ()) {
filterPE.raw.dfAuto = falsePE.raw.dfAuto; filterPE.raw.df_autoselect = falsePE.raw.df_autoselect;
} }
if (!ff_file->get_active ()) { if (!ff_file->get_active ()) {

View File

@ -1,14 +1,15 @@
#ifndef _PPVERSION_ #pragma once
#define _PPVERSION_
// This number has to be incremented whenever the PP3 file format is modified or the behaviour of a tool changes // This number has to be incremented whenever the PP3 file format is modified or the behaviour of a tool changes
#define PPVERSION 327 #define PPVERSION 328
#define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified #define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified
/* /*
Log of version changes Log of version changes
328 2017-11-22
Fix wrong type of ff_clipControl
327 2017-09-15 327 2017-09-15
[Profiles Lens Correction] Added Lensfun [Profiled Lens Correction] Added Lensfun
326 2015-07-26 326 2015-07-26
[Exposure] Added 'Perceptual' tone curve mode [Exposure] Added 'Perceptual' tone curve mode
325 2015-07-23 325 2015-07-23
@ -45,5 +46,3 @@
added [Directional Pyramid Denoising] Method, Redchro, Bluechro added [Directional Pyramid Denoising] Method, Redchro, Bluechro
added [RGB Curves] LumaMode added [RGB Curves] LumaMode
*/ */
#endif

View File

@ -81,7 +81,7 @@ void PreProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedi
pp->raw.hotdeadpix_thresh = hdThreshold->getIntValue(); pp->raw.hotdeadpix_thresh = hdThreshold->getIntValue();
if (pedited) { if (pedited) {
pedited->raw.hotDeadPixelThresh = hdThreshold->getEditedState (); pedited->raw.hotdeadpix_thresh = hdThreshold->getEditedState ();
pedited->raw.hotPixelFilter = !hotPixel->get_inconsistent(); pedited->raw.hotPixelFilter = !hotPixel->get_inconsistent();
pedited->raw.deadPixelFilter = !deadPixel->get_inconsistent(); pedited->raw.deadPixelFilter = !deadPixel->get_inconsistent();
} }

View File

@ -61,9 +61,9 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi
disableListener (); disableListener ();
if(pedited ) { if(pedited ) {
caAutocorrect->setEdited(pedited->raw.caCorrection); caAutocorrect->setEdited(pedited->raw.ca_autocorrect);
caRed->setEditedState( pedited->raw.caRed ? Edited : UnEdited ); caRed->setEditedState( pedited->raw.cared ? Edited : UnEdited );
caBlue->setEditedState( pedited->raw.caBlue ? Edited : UnEdited ); caBlue->setEditedState( pedited->raw.cablue ? Edited : UnEdited );
} }
// disable Red and Blue sliders when caAutocorrect is enabled // disable Red and Blue sliders when caAutocorrect is enabled
@ -84,9 +84,9 @@ void RAWCACorr::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedit
pp->raw.cablue = caBlue->getValue(); pp->raw.cablue = caBlue->getValue();
if (pedited) { if (pedited) {
pedited->raw.caCorrection = !caAutocorrect->get_inconsistent(); pedited->raw.ca_autocorrect = !caAutocorrect->get_inconsistent();
pedited->raw.caRed = caRed->getEditedState (); pedited->raw.cared = caRed->getEditedState ();
pedited->raw.caBlue = caBlue->getEditedState (); pedited->raw.cablue = caBlue->getEditedState ();
} }
} }
@ -132,8 +132,8 @@ void RAWCACorr::setDefaults(const rtengine::procparams::ProcParams* defParams, c
caBlue->setDefault( defParams->raw.cablue); caBlue->setDefault( defParams->raw.cablue);
if (pedited) { if (pedited) {
caRed->setDefaultEditedState( pedited->raw.caRed ? Edited : UnEdited); caRed->setDefaultEditedState( pedited->raw.cared ? Edited : UnEdited);
caBlue->setDefaultEditedState( pedited->raw.caBlue ? Edited : UnEdited); caBlue->setDefaultEditedState( pedited->raw.cablue ? Edited : UnEdited);
} else { } else {
caRed->setDefaultEditedState( Irrelevant ); caRed->setDefaultEditedState( Irrelevant );
caBlue->setDefaultEditedState( Irrelevant ); caBlue->setDefaultEditedState( Irrelevant );

View File

@ -380,14 +380,15 @@ Retinex::Retinex () : FoldableToolPanel (this, "retinex", M ("TP_RETINEX_LABEL")
Gtk::Grid *tranGrid = Gtk::manage (new Gtk::Grid()); Gtk::Grid *tranGrid = Gtk::manage (new Gtk::Grid());
setExpandAlignProperties (tranGrid, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); setExpandAlignProperties (tranGrid, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
const RetinexParams default_params;
// Transmission map curve // Transmission map curve
transmissionCurveEditorG = new CurveEditorGroup (options.lastRetinexDir, M ("TP_RETINEX_TRANSMISSION")); transmissionCurveEditorG = new CurveEditorGroup (options.lastRetinexDir, M ("TP_RETINEX_TRANSMISSION"));
setExpandAlignProperties (transmissionCurveEditorG, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); setExpandAlignProperties (transmissionCurveEditorG, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
transmissionCurveEditorG->setCurveListener (this); transmissionCurveEditorG->setCurveListener (this);
rtengine::RetinexParams::getDefaulttransmissionCurve (defaultCurve);
transmissionShape = static_cast<FlatCurveEditor*> (transmissionCurveEditorG->addCurve (CT_Flat, "", nullptr, false, false)); transmissionShape = static_cast<FlatCurveEditor*> (transmissionCurveEditorG->addCurve (CT_Flat, "", nullptr, false, false));
transmissionShape->setIdentityValue (0.); transmissionShape->setIdentityValue (0.);
transmissionShape->setResetCurve (FlatCurveType (defaultCurve.at (0)), defaultCurve); transmissionShape->setResetCurve (FlatCurveType (default_params.transmissionCurve.at (0)), default_params.transmissionCurve);
// transmissionShape->setBottomBarBgGradient(milestones); // transmissionShape->setBottomBarBgGradient(milestones);
transmissionCurveEditorG->curveListComplete(); transmissionCurveEditorG->curveListComplete();
transmissionCurveEditorG->set_tooltip_markup (M ("TP_RETINEX_TRANSMISSION_TOOLTIP")); transmissionCurveEditorG->set_tooltip_markup (M ("TP_RETINEX_TRANSMISSION_TOOLTIP"));
@ -439,10 +440,9 @@ Retinex::Retinex () : FoldableToolPanel (this, "retinex", M ("TP_RETINEX_LABEL")
gaintransmissionCurve = new CurveEditorGroup (options.lastRetinexDir, M ("TP_RETINEX_GAINTRANSMISSION")); gaintransmissionCurve = new CurveEditorGroup (options.lastRetinexDir, M ("TP_RETINEX_GAINTRANSMISSION"));
setExpandAlignProperties (gaintransmissionCurve, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); setExpandAlignProperties (gaintransmissionCurve, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
gaintransmissionCurve->setCurveListener (this); gaintransmissionCurve->setCurveListener (this);
rtengine::RetinexParams::getDefaultgaintransmissionCurve (defaultCurve);
gaintransmissionShape = static_cast<FlatCurveEditor*> (gaintransmissionCurve->addCurve (CT_Flat, "", nullptr, false, false)); gaintransmissionShape = static_cast<FlatCurveEditor*> (gaintransmissionCurve->addCurve (CT_Flat, "", nullptr, false, false));
gaintransmissionShape->setIdentityValue (0.); gaintransmissionShape->setIdentityValue (0.);
gaintransmissionShape->setResetCurve (FlatCurveType (defaultCurve.at (0)), defaultCurve); gaintransmissionShape->setResetCurve (FlatCurveType (default_params.gaintransmissionCurve.at (0)), default_params.gaintransmissionCurve);
//gaintransmissionShape->setBottomBarBgGradient(milestones); //gaintransmissionShape->setBottomBarBgGradient(milestones);
gaintransmissionCurve->set_tooltip_markup (M ("TP_RETINEX_GAINTRANSMISSION_TOOLTIP")); gaintransmissionCurve->set_tooltip_markup (M ("TP_RETINEX_GAINTRANSMISSION_TOOLTIP"));
gaintransmissionCurve->curveListComplete(); gaintransmissionCurve->curveListComplete();

View File

@ -341,20 +341,20 @@ void ThresholdAdjuster::sendToListener ()
rtengine::procparams::Threshold<double> t = tSelector.getPositions<double>(); rtengine::procparams::Threshold<double> t = tSelector.getPositions<double>();
if (tSelector.isDouble()) { if (tSelector.isDouble()) {
adjusterListener->adjusterChanged (this, t.value[0], t.value[1], t.value[2], t.value[3]); adjusterListener->adjusterChanged (this, t.getBottomLeft(), t.getTopLeft(), t.getBottomRight(), t.getTopRight());
adjusterListener->adjusterChanged2 (this, t.value[0], t.value[1], t.value[2], t.value[3]); adjusterListener->adjusterChanged2 (this, t.getBottomLeft(), t.getTopLeft(), t.getBottomRight(), t.getTopRight());
} else { } else {
adjusterListener->adjusterChanged (this, t.value[0], t.value[1]); adjusterListener->adjusterChanged (this, t.getBottomLeft(), t.getTopLeft());
} }
} else { } else {
// if precision is equal to 0, then we assume that the listener is waiting for integers // if precision is equal to 0, then we assume that the listener is waiting for integers
rtengine::procparams::Threshold<int> t = tSelector.getPositions<int>(); rtengine::procparams::Threshold<int> t = tSelector.getPositions<int>();
if (tSelector.isDouble()) { if (tSelector.isDouble()) {
adjusterListener->adjusterChanged (this, t.value[0], t.value[1], t.value[2], t.value[3]); adjusterListener->adjusterChanged (this, t.getBottomLeft(), t.getTopLeft(), t.getBottomRight(), t.getTopRight());
adjusterListener->adjusterChanged2 (this, t.value[0], t.value[1], t.value[2], t.value[3]); adjusterListener->adjusterChanged2 (this, t.getBottomLeft(), t.getTopLeft(), t.getBottomRight(), t.getTopRight());
} else { } else {
adjusterListener->adjusterChanged (this, t.value[0], t.value[1]); adjusterListener->adjusterChanged (this, t.getBottomLeft(), t.getTopLeft());
} }
} }
} }

View File

@ -138,12 +138,12 @@ public:
template <typename T> template <typename T>
void setDefaults (const rtengine::procparams::Threshold<T> &t) void setDefaults (const rtengine::procparams::Threshold<T> &t)
{ {
defPos[TS_BOTTOMLEFT] = double(t.value[0]); // should we use shapeValue() ? defPos[TS_BOTTOMLEFT] = double(t.getBottomLeft()); // should we use shapeValue() ?
defPos[TS_TOPLEFT] = double(t.value[1]); defPos[TS_TOPLEFT] = double(t.getTopLeft());
if (doubleThresh) { if (doubleThresh) {
defPos[TS_BOTTOMRIGHT] = double(t.value[2]); defPos[TS_BOTTOMRIGHT] = double(t.getBottomRight());
defPos[TS_TOPRIGHT] = double(t.value[3]); defPos[TS_TOPRIGHT] = double(t.getTopRight());
} }
} }
void setDefaults (double bottom, double top); void setDefaults (double bottom, double top);
@ -151,12 +151,12 @@ public:
template <typename T> template <typename T>
void setPositions (const rtengine::procparams::Threshold<T> &tValues) void setPositions (const rtengine::procparams::Threshold<T> &tValues)
{ {
positions[TS_BOTTOMLEFT] = static_cast<double>(tValues.value[TS_BOTTOMLEFT]); positions[TS_BOTTOMLEFT] = static_cast<double>(tValues.getBottomLeft());
positions[TS_TOPLEFT] = static_cast<double>(tValues.value[TS_TOPLEFT]); positions[TS_TOPLEFT] = static_cast<double>(tValues.getTopLeft());
if (tValues.isDouble()) { if (tValues.isDouble()) {
positions[TS_BOTTOMRIGHT] = static_cast<double>(tValues.value[TS_BOTTOMRIGHT]); positions[TS_BOTTOMRIGHT] = static_cast<double>(tValues.getBottomRight());
positions[TS_TOPRIGHT] = static_cast<double>(tValues.value[TS_TOPRIGHT]); positions[TS_TOPRIGHT] = static_cast<double>(tValues.getTopRight());
} }
updateTooltip(); updateTooltip();

View File

@ -223,8 +223,8 @@ void ToneCurve::read (const ProcParams* pp, const ParamsEdited* pedited)
shape->setCurve (pp->toneCurve.curve); shape->setCurve (pp->toneCurve.curve);
shape2->setCurve (pp->toneCurve.curve2); shape2->setCurve (pp->toneCurve.curve2);
toneCurveMode->set_active(pp->toneCurve.curveMode); toneCurveMode->set_active(rtengine::toUnderlying(pp->toneCurve.curveMode));
toneCurveMode2->set_active(pp->toneCurve.curveMode2); toneCurveMode2->set_active(rtengine::toUnderlying(pp->toneCurve.curveMode2));
if (pedited) { if (pedited) {
expcomp->setEditedState (pedited->toneCurve.expcomp ? Edited : UnEdited); 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(); int tcMode = toneCurveMode->get_active_row_number();
if (tcMode == 0) { if (tcMode == 0) {
pp->toneCurve.curveMode = ToneCurveParams::TC_MODE_STD; pp->toneCurve.curveMode = ToneCurveParams::TcMode::STD;
} else if (tcMode == 1) { } else if (tcMode == 1) {
pp->toneCurve.curveMode = ToneCurveParams::TC_MODE_WEIGHTEDSTD; pp->toneCurve.curveMode = ToneCurveParams::TcMode::WEIGHTEDSTD;
} else if (tcMode == 2) { } else if (tcMode == 2) {
pp->toneCurve.curveMode = ToneCurveParams::TC_MODE_FILMLIKE; pp->toneCurve.curveMode = ToneCurveParams::TcMode::FILMLIKE;
} else if (tcMode == 3) { } else if (tcMode == 3) {
pp->toneCurve.curveMode = ToneCurveParams::TC_MODE_SATANDVALBLENDING; pp->toneCurve.curveMode = ToneCurveParams::TcMode::SATANDVALBLENDING;
} else if (tcMode == 4) { } else if (tcMode == 4) {
pp->toneCurve.curveMode = ToneCurveParams::TC_MODE_LUMINANCE; pp->toneCurve.curveMode = ToneCurveParams::TcMode::LUMINANCE;
} else if (tcMode == 5) { } else if (tcMode == 5) {
pp->toneCurve.curveMode = ToneCurveParams::TC_MODE_PERCEPTUAL; pp->toneCurve.curveMode = ToneCurveParams::TcMode::PERCEPTUAL;
} }
tcMode = toneCurveMode2->get_active_row_number(); tcMode = toneCurveMode2->get_active_row_number();
if (tcMode == 0) { if (tcMode == 0) {
pp->toneCurve.curveMode2 = ToneCurveParams::TC_MODE_STD; pp->toneCurve.curveMode2 = ToneCurveParams::TcMode::STD;
} else if (tcMode == 1) { } else if (tcMode == 1) {
pp->toneCurve.curveMode2 = ToneCurveParams::TC_MODE_WEIGHTEDSTD; pp->toneCurve.curveMode2 = ToneCurveParams::TcMode::WEIGHTEDSTD;
} else if (tcMode == 2) { } else if (tcMode == 2) {
pp->toneCurve.curveMode2 = ToneCurveParams::TC_MODE_FILMLIKE; pp->toneCurve.curveMode2 = ToneCurveParams::TcMode::FILMLIKE;
} else if (tcMode == 3) { } else if (tcMode == 3) {
pp->toneCurve.curveMode2 = ToneCurveParams::TC_MODE_SATANDVALBLENDING; pp->toneCurve.curveMode2 = ToneCurveParams::TcMode::SATANDVALBLENDING;
} else if (tcMode == 4) { } else if (tcMode == 4) {
pp->toneCurve.curveMode2 = ToneCurveParams::TC_MODE_LUMINANCE; pp->toneCurve.curveMode2 = ToneCurveParams::TcMode::LUMINANCE;
} else if (tcMode == 5) { } else if (tcMode == 5) {
pp->toneCurve.curveMode2 = ToneCurveParams::TC_MODE_PERCEPTUAL; pp->toneCurve.curveMode2 = ToneCurveParams::TcMode::PERCEPTUAL;
} }
if (pedited) { if (pedited) {

View File

@ -408,12 +408,11 @@ Wavelet::Wavelet() :
opaCurveEditorG->setCurveListener (this); opaCurveEditorG->setCurveListener (this);
std::vector<double> defaultCurve; const WaveletParams default_params;
rtengine::WaveletParams::getDefaultOpacityCurveRG(defaultCurve);
opacityShapeRG = static_cast<FlatCurveEditor*>(opaCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); opacityShapeRG = static_cast<FlatCurveEditor*>(opaCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false));
opacityShapeRG->setIdentityValue(0.); opacityShapeRG->setIdentityValue(0.);
opacityShapeRG->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); opacityShapeRG->setResetCurve(FlatCurveType(default_params.opacityCurveRG.at(0)), default_params.opacityCurveRG);
opaCurveEditorG->curveListComplete(); opaCurveEditorG->curveListComplete();
opaCurveEditorG->show(); opaCurveEditorG->show();
@ -422,10 +421,9 @@ Wavelet::Wavelet() :
opacityCurveEditorG->setCurveListener (this); opacityCurveEditorG->setCurveListener (this);
rtengine::WaveletParams::getDefaultOpacityCurveBY(defaultCurve);
opacityShapeBY = static_cast<FlatCurveEditor*>(opacityCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); opacityShapeBY = static_cast<FlatCurveEditor*>(opacityCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false));
opacityShapeBY->setIdentityValue(0.); opacityShapeBY->setIdentityValue(0.);
opacityShapeBY->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); opacityShapeBY->setResetCurve(FlatCurveType(default_params.opacityCurveBY.at(0)), default_params.opacityCurveBY);
opacityCurveEditorG->curveListComplete(); opacityCurveEditorG->curveListComplete();
opacityCurveEditorG->show(); opacityCurveEditorG->show();
@ -502,11 +500,10 @@ Wavelet::Wavelet() :
// <-- Edge Sharpness Local Contrast curve // <-- Edge Sharpness Local Contrast curve
CCWcurveEditorG->setCurveListener (this); CCWcurveEditorG->setCurveListener (this);
rtengine::WaveletParams::getDefaultCCWCurve(defaultCurve);
ccshape = static_cast<FlatCurveEditor*>(CCWcurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); ccshape = static_cast<FlatCurveEditor*>(CCWcurveEditorG->addCurve(CT_Flat, "", nullptr, false, false));
ccshape->setIdentityValue(0.); ccshape->setIdentityValue(0.);
ccshape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); ccshape->setResetCurve(FlatCurveType(default_params.ccwcurve.at(0)), default_params.ccwcurve);
ccshape->setTooltip(M("TP_WAVELET_CURVEEDITOR_CC_TOOLTIP")); ccshape->setTooltip(M("TP_WAVELET_CURVEEDITOR_CC_TOOLTIP"));
CCWcurveEditorG->curveListComplete(); CCWcurveEditorG->curveListComplete();
@ -781,10 +778,9 @@ Wavelet::Wavelet() :
opacityCurveEditorW->setCurveListener (this); opacityCurveEditorW->setCurveListener (this);
rtengine::WaveletParams::getDefaultOpacityCurveW(defaultCurve);
opacityShape = static_cast<FlatCurveEditor*>(opacityCurveEditorW->addCurve(CT_Flat, "", nullptr, false, false)); opacityShape = static_cast<FlatCurveEditor*>(opacityCurveEditorW->addCurve(CT_Flat, "", nullptr, false, false));
opacityShape->setIdentityValue(0.); opacityShape->setIdentityValue(0.);
opacityShape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); opacityShape->setResetCurve(FlatCurveType(default_params.opacityCurveW.at(0)), default_params.opacityCurveW);
opacityShape->setBottomBarBgGradient(milestones2); opacityShape->setBottomBarBgGradient(milestones2);
// This will add the reset button at the end of the curveType buttons // This will add the reset button at the end of the curveType buttons
@ -798,10 +794,9 @@ Wavelet::Wavelet() :
opacityCurveEditorWL->setCurveListener (this); opacityCurveEditorWL->setCurveListener (this);
rtengine::WaveletParams::getDefaultOpacityCurveWL(defaultCurve);
opacityShapeWL = static_cast<FlatCurveEditor*>(opacityCurveEditorWL->addCurve(CT_Flat, "", nullptr, false, false)); opacityShapeWL = static_cast<FlatCurveEditor*>(opacityCurveEditorWL->addCurve(CT_Flat, "", nullptr, false, false));
opacityShapeWL->setIdentityValue(0.); opacityShapeWL->setIdentityValue(0.);
opacityShapeWL->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); opacityShapeWL->setResetCurve(FlatCurveType(default_params.opacityCurveWL.at(0)), default_params.opacityCurveWL);
opacityShapeWL->setTooltip(M("TP_WAVELET_OPACITYWL_TOOLTIP")); opacityShapeWL->setTooltip(M("TP_WAVELET_OPACITYWL_TOOLTIP"));
// This will add the reset button at the end of the curveType buttons // This will add the reset button at the end of the curveType buttons

View File

@ -34,7 +34,7 @@
using namespace rtengine; using namespace rtengine;
using namespace rtengine::procparams; using namespace rtengine::procparams;
Glib::RefPtr<Gdk::Pixbuf> WhiteBalance::wbPixbufs[rtengine::procparams::WBT_CUSTOM + 1]; Glib::RefPtr<Gdk::Pixbuf> WhiteBalance::wbPixbufs[toUnderlying(WBEntry::Type::CUSTOM) + 1];
/* /*
Glib::RefPtr<Gdk::Pixbuf> WhiteBalance::wbCameraPB, WhiteBalance::wbAutoPB, WhiteBalance::wbSunPB, WhiteBalance::wbTungstenPB, Glib::RefPtr<Gdk::Pixbuf> WhiteBalance::wbCameraPB, WhiteBalance::wbAutoPB, WhiteBalance::wbSunPB, WhiteBalance::wbTungstenPB,
WhiteBalance::wbCloudyPB, WhiteBalance::wbShadePB, WhiteBalance::wbFluorescentPB, WhiteBalance::wbLampPB, WhiteBalance::wbCloudyPB, WhiteBalance::wbShadePB, WhiteBalance::wbFluorescentPB, WhiteBalance::wbLampPB,
@ -43,24 +43,24 @@ Glib::RefPtr<Gdk::Pixbuf> WhiteBalance::wbCameraPB, WhiteBalance::wbAutoPB, Whit
void WhiteBalance::init () void WhiteBalance::init ()
{ {
wbPixbufs[WBT_CAMERA] = RTImage::createFromFile ("wb-camera.png"); wbPixbufs[toUnderlying(WBEntry::Type::CAMERA)] = RTImage::createFromFile ("wb-camera.png");
wbPixbufs[WBT_AUTO] = RTImage::createFromFile ("wb-auto.png"); wbPixbufs[toUnderlying(WBEntry::Type::AUTO)] = RTImage::createFromFile ("wb-auto.png");
wbPixbufs[WBT_DAYLIGHT] = RTImage::createFromFile ("wb-sun.png"); wbPixbufs[toUnderlying(WBEntry::Type::DAYLIGHT)] = RTImage::createFromFile ("wb-sun.png");
wbPixbufs[WBT_CLOUDY] = RTImage::createFromFile ("wb-cloudy.png"); wbPixbufs[toUnderlying(WBEntry::Type::CLOUDY)] = RTImage::createFromFile ("wb-cloudy.png");
wbPixbufs[WBT_SHADE] = RTImage::createFromFile ("wb-shade.png"); wbPixbufs[toUnderlying(WBEntry::Type::SHADE)] = RTImage::createFromFile ("wb-shade.png");
wbPixbufs[WBT_WATER] = RTImage::createFromFile ("wb-water.png"); wbPixbufs[toUnderlying(WBEntry::Type::WATER)] = RTImage::createFromFile ("wb-water.png");
// wbPixbufs[WBT_WATER2] = RTImage::createFromFile ("wb-water.png"); // wbPixbufs[WBEntry::Type::WATER2] = RTImage::createFromFile ("wb-water.png");
wbPixbufs[WBT_TUNGSTEN] = RTImage::createFromFile ("wb-tungsten.png"); wbPixbufs[toUnderlying(WBEntry::Type::TUNGSTEN)] = RTImage::createFromFile ("wb-tungsten.png");
wbPixbufs[WBT_FLUORESCENT] = RTImage::createFromFile ("wb-fluorescent.png"); wbPixbufs[toUnderlying(WBEntry::Type::FLUORESCENT)] = RTImage::createFromFile ("wb-fluorescent.png");
wbPixbufs[WBT_LAMP] = RTImage::createFromFile ("wb-lamp.png"); wbPixbufs[toUnderlying(WBEntry::Type::LAMP)] = RTImage::createFromFile ("wb-lamp.png");
wbPixbufs[WBT_FLASH] = RTImage::createFromFile ("wb-flash.png"); wbPixbufs[toUnderlying(WBEntry::Type::FLASH)] = RTImage::createFromFile ("wb-flash.png");
wbPixbufs[WBT_LED] = RTImage::createFromFile ("wb-led.png"); wbPixbufs[toUnderlying(WBEntry::Type::LED)] = RTImage::createFromFile ("wb-led.png");
wbPixbufs[WBT_CUSTOM] = RTImage::createFromFile ("wb-custom.png"); wbPixbufs[toUnderlying(WBEntry::Type::CUSTOM)] = RTImage::createFromFile ("wb-custom.png");
} }
void WhiteBalance::cleanup () 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(); wbPixbufs[i].reset();
} }
} }
@ -163,68 +163,68 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, "whitebalance", M("TP_WB
// Assign the model to the Combobox // Assign the model to the Combobox
method->set_model(refTreeModel); method->set_model(refTreeModel);
enum WBTypes oldType = WBParams::wbEntries[0]->type; WBEntry::Type oldType = WBParams::getWbEntries()[0].type;
enum WBTypes currType; WBEntry::Type currType;
Gtk::TreeModel::Row row, childrow; Gtk::TreeModel::Row row, childrow;
for (unsigned int i = 0; i < WBParams::wbEntries.size(); i++) { for (unsigned int i = 0; i < WBParams::getWbEntries().size(); i++) {
if (oldType != (currType = WBParams::wbEntries[i]->type)) { if (oldType != (currType = WBParams::getWbEntries()[i].type)) {
// New entry type // New entry type
if (currType == WBT_FLUORESCENT) { if (currType == WBEntry::Type::FLUORESCENT) {
// Creating the Fluorescent subcategory header // Creating the Fluorescent subcategory header
row = *(refTreeModel->append()); row = *(refTreeModel->append());
row[methodColumns.colIcon] = wbPixbufs[currType]; row[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)];
row[methodColumns.colLabel] = M("TP_WBALANCE_FLUO_HEADER"); row[methodColumns.colLabel] = M("TP_WBALANCE_FLUO_HEADER");
row[methodColumns.colId] = i + 100; row[methodColumns.colId] = i + 100;
} }
if (currType == WBT_WATER) { if (currType == WBEntry::Type::WATER) {
// Creating the under water subcategory header // Creating the under water subcategory header
row = *(refTreeModel->append()); row = *(refTreeModel->append());
row[methodColumns.colIcon] = wbPixbufs[currType]; row[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)];
row[methodColumns.colLabel] = M("TP_WBALANCE_WATER_HEADER"); row[methodColumns.colLabel] = M("TP_WBALANCE_WATER_HEADER");
row[methodColumns.colId] = i + 100; row[methodColumns.colId] = i + 100;
} }
if (currType == WBT_LAMP) { if (currType == WBEntry::Type::LAMP) {
// Creating the Lamp subcategory header // Creating the Lamp subcategory header
row = *(refTreeModel->append()); row = *(refTreeModel->append());
row[methodColumns.colIcon] = wbPixbufs[currType]; row[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)];
row[methodColumns.colLabel] = M("TP_WBALANCE_LAMP_HEADER"); row[methodColumns.colLabel] = M("TP_WBALANCE_LAMP_HEADER");
row[methodColumns.colId] = i + 100; row[methodColumns.colId] = i + 100;
} }
if (currType == WBT_LED) { if (currType == WBEntry::Type::LED) {
// Creating the LED subcategory header // Creating the LED subcategory header
row = *(refTreeModel->append()); row = *(refTreeModel->append());
row[methodColumns.colIcon] = wbPixbufs[currType]; row[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)];
row[methodColumns.colLabel] = M("TP_WBALANCE_LED_HEADER"); row[methodColumns.colLabel] = M("TP_WBALANCE_LED_HEADER");
row[methodColumns.colId] = i + 100; row[methodColumns.colId] = i + 100;
} }
if (currType == WBT_FLASH) { if (currType == WBEntry::Type::FLASH) {
// Creating the Flash subcategory header // Creating the Flash subcategory header
row = *(refTreeModel->append()); row = *(refTreeModel->append());
row[methodColumns.colIcon] = wbPixbufs[currType]; row[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)];
row[methodColumns.colLabel] = M("TP_WBALANCE_FLASH_HEADER"); row[methodColumns.colLabel] = M("TP_WBALANCE_FLASH_HEADER");
row[methodColumns.colId] = i + 100; row[methodColumns.colId] = i + 100;
} }
} }
if (currType == WBT_FLUORESCENT if (currType == WBEntry::Type::FLUORESCENT
|| currType == WBT_LAMP || currType == WBEntry::Type::LAMP
|| currType == WBT_WATER || currType == WBEntry::Type::WATER
|| currType == WBT_FLASH || currType == WBEntry::Type::FLASH
|| currType == WBT_LED || currType == WBEntry::Type::LED
) { ) {
childrow = *(refTreeModel->append(row.children())); childrow = *(refTreeModel->append(row.children()));
childrow[methodColumns.colIcon] = wbPixbufs[currType]; childrow[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)];
childrow[methodColumns.colLabel] = WBParams::wbEntries[i]->GUILabel; childrow[methodColumns.colLabel] = WBParams::getWbEntries()[i].GUILabel;
childrow[methodColumns.colId] = i; childrow[methodColumns.colId] = i;
} else { } else {
row = *(refTreeModel->append()); row = *(refTreeModel->append());
row[methodColumns.colIcon] = wbPixbufs[currType]; row[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)];
row[methodColumns.colLabel] = WBParams::wbEntries[i]->GUILabel; row[methodColumns.colLabel] = WBParams::getWbEntries()[i].GUILabel;
row[methodColumns.colId] = i; row[methodColumns.colId] = i;
} }
@ -362,12 +362,24 @@ void WhiteBalance::adjusterChanged (Adjuster* a, double newval)
} }
Glib::ustring colLabel = row[methodColumns.colLabel]; Glib::ustring colLabel = row[methodColumns.colLabel];
WBEntry* ppMethod = findWBEntry (row[methodColumns.colLabel], WBLT_GUI); const std::pair<bool, const WBEntry&> ppMethod = findWBEntry (row[methodColumns.colLabel], WBLT_GUI);
WBEntry* wbCustom = findWBEntry ("Custom", WBLT_PP); const std::pair<bool, const WBEntry&> 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); methconn.block(true);
opt = setActiveMethod(wbCustom->GUILabel); opt = setActiveMethod(wbCustom.second.GUILabel);
tempBias->set_sensitive(false); tempBias->set_sensitive(false);
cache_customWB (tVal, gVal); cache_customWB (tVal, gVal);
@ -429,12 +441,12 @@ void WhiteBalance::optChanged ()
tempBias->setEditedState (UnEdited); tempBias->setEditedState (UnEdited);
} else { } else {
unsigned int methodId = findWBEntryId (row[methodColumns.colLabel], WBLT_GUI); unsigned int methodId = findWBEntryId (row[methodColumns.colLabel], WBLT_GUI);
WBEntry* currMethod = WBParams::wbEntries[methodId]; const WBEntry& currMethod = WBParams::getWbEntries()[methodId];
tempBias->set_sensitive(currMethod->type == WBT_AUTO); tempBias->set_sensitive(currMethod.type == WBEntry::Type::AUTO);
switch (currMethod->type) { switch (currMethod.type) {
case WBT_CAMERA: case WBEntry::Type::CAMERA:
if (wbp) { if (wbp) {
double ctemp, cgreen; double ctemp, cgreen;
wbp->getCamWB (ctemp, cgreen); wbp->getCamWB (ctemp, cgreen);
@ -451,7 +463,7 @@ void WhiteBalance::optChanged ()
break; break;
case WBT_AUTO: case WBEntry::Type::AUTO:
if (wbp) { if (wbp) {
if (batchMode) { if (batchMode) {
temp->setEditedState (UnEdited); temp->setEditedState (UnEdited);
@ -464,7 +476,7 @@ void WhiteBalance::optChanged ()
break; break;
case WBT_CUSTOM: case WBEntry::Type::CUSTOM:
if (custom_temp > 0) { if (custom_temp > 0) {
temp->setValue (temp->getAddMode() ? 0.0 : custom_temp); temp->setValue (temp->getAddMode() ? 0.0 : custom_temp);
green->setValue (green->getAddMode() ? 0.0 : custom_green); green->setValue (green->getAddMode() ? 0.0 : custom_green);
@ -484,19 +496,19 @@ void WhiteBalance::optChanged ()
break; break;
/* All other solution are the default cases /* All other solution are the default cases
case WBT_DAYLIGHT: case WBEntry::Type::DAYLIGHT:
case WBT_CLOUDY: case WBEntry::Type::CLOUDY:
case WBT_SHADE: case WBEntry::Type::SHADE:
case WBT_TUNGSTEN: case WBEntry::Type::TUNGSTEN:
case WBT_FLUORESCENT: case WBEntry::Type::FLUORESCENT:
case WBT_LAMP: case WBEntry::Type::LAMP:
case WBT_FLASH: case WBEntry::Type::FLASH:
case WBT_LED:*/ case WBEntry::Type::LED:*/
default: default:
// recall custom WB settings if it exists, set to 1.0 otherwise // recall custom WB settings if it exists, set to 1.0 otherwise
temp->setValue ( temp->getAddMode() ? 0.0 : (double)(currMethod->temperature)); temp->setValue ( temp->getAddMode() ? 0.0 : (double)(currMethod.temperature));
green->setValue (green->getAddMode() ? 0.0 : (double)(currMethod->green)); green->setValue (green->getAddMode() ? 0.0 : (double)(currMethod.green));
equal->setValue (equal->getAddMode() ? 0.0 : (double)(currMethod->equal)); equal->setValue (equal->getAddMode() ? 0.0 : (double)(currMethod.equal));
if (batchMode) { if (batchMode) {
temp->setEditedState (Edited); temp->setEditedState (Edited);
@ -551,17 +563,21 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited)
if (pedited && !pedited->wb.method) { if (pedited && !pedited->wb.method) {
opt = setActiveMethod(M("GENERAL_UNCHANGED")); opt = setActiveMethod(M("GENERAL_UNCHANGED"));
} else { } else {
WBEntry* wbValues = findWBEntry(pp->wb.method, WBLT_PP); const WBEntry& wbValues =
[this, pp]() -> const WBEntry&
{
const std::pair<bool, const WBEntry&> res = findWBEntry(pp->wb.method, WBLT_PP);
return
!res.first
? findWBEntry("Camera", WBLT_PP).second
: res.second;
}();
if (!wbValues) { opt = setActiveMethod(wbValues.GUILabel);
wbValues = findWBEntry("Camera", WBLT_PP);
}
opt = setActiveMethod(wbValues->GUILabel);
// temperature is reset to the associated temperature, or 0.0 if addMode is set. // temperature is reset to the associated temperature, or 0.0 if addMode is set.
switch (wbValues->type) { switch (wbValues.type) {
case WBT_CUSTOM: case WBEntry::Type::CUSTOM:
temp->setValue (temp->getAddMode() ? 0.0 : pp->wb.temperature); temp->setValue (temp->getAddMode() ? 0.0 : pp->wb.temperature);
green->setValue (green->getAddMode() ? 0.0 : pp->wb.green); green->setValue (green->getAddMode() ? 0.0 : pp->wb.green);
equal->setValue (equal->getAddMode() ? 0.0 : pp->wb.equal); equal->setValue (equal->getAddMode() ? 0.0 : pp->wb.equal);
@ -578,7 +594,7 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited)
break; break;
case WBT_CAMERA: case WBEntry::Type::CAMERA:
if (wbp) { if (wbp) {
double ctemp = -1.0; double ctemp = -1.0;
double cgreen = -1.0; double cgreen = -1.0;
@ -600,7 +616,7 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited)
break; break;
case WBT_AUTO: case WBEntry::Type::AUTO:
// the equalizer's value is restored for the AutoWB // the equalizer's value is restored for the AutoWB
equal->setValue (equal->getAddMode() ? 0.0 : pp->wb.equal); equal->setValue (equal->getAddMode() ? 0.0 : pp->wb.equal);
tempBias->setValue (tempBias->getAddMode() ? 0.0 : pp->wb.tempBias); 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: All those types are the "default" case:
case WBT_DAYLIGHT: case WBEntry::Type::DAYLIGHT:
case WBT_CLOUDY: case WBEntry::Type::CLOUDY:
case WBT_SHADE: case WBEntry::Type::SHADE:
case WBT_TUNGSTEN: case WBEntry::Type::TUNGSTEN:
case WBT_FLUORESCENT: case WBEntry::Type::FLUORESCENT:
case WBT_LAMP: case WBEntry::Type::LAMP:
case WBT_FLASH: case WBEntry::Type::FLASH:
case WBT_LED: case WBEntry::Type::LED:
*/ */
default: default:
// Set the associated temperature, or 0.0 if in ADD mode // 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 // Set the stored temperature, or 0.0 if in ADD mode
green->setValue(green->getAddMode() ? 0.0 : pp->wb.green); green->setValue(green->getAddMode() ? 0.0 : pp->wb.green);
equal->setValue(equal->getAddMode() ? 0.0 : pp->wb.equal); equal->setValue(equal->getAddMode() ? 0.0 : pp->wb.equal);
@ -648,7 +664,7 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited)
break; break;
} }
tempBias->set_sensitive(wbValues->type == WBT_AUTO); tempBias->set_sensitive(wbValues.type == WBEntry::Type::AUTO);
} }
methconn.block (false); methconn.block (false);
@ -668,10 +684,10 @@ void WhiteBalance::write (ProcParams* pp, ParamsEdited* pedited)
pedited->wb.method = row[methodColumns.colLabel] != M("GENERAL_UNCHANGED"); pedited->wb.method = row[methodColumns.colLabel] != M("GENERAL_UNCHANGED");
} }
WBEntry* ppMethod = findWBEntry (row[methodColumns.colLabel], WBLT_GUI); const std::pair<bool, const WBEntry&> ppMethod = findWBEntry (row[methodColumns.colLabel], WBLT_GUI);
if (ppMethod) { if (ppMethod.first) {
pp->wb.method = ppMethod->ppLabel; pp->wb.method = ppMethod.second.ppLabel;
} }
pp->wb.temperature = temp->getIntValue (); pp->wb.temperature = temp->getIntValue ();
@ -724,7 +740,7 @@ void WhiteBalance::setBatchMode (bool batchMode)
equal->showEditedCB (); equal->showEditedCB ();
tempBias->showEditedCB (); tempBias->showEditedCB ();
Gtk::TreeModel::Row row = *(refTreeModel->append()); Gtk::TreeModel::Row row = *(refTreeModel->append());
row[methodColumns.colId] = WBParams::wbEntries.size(); row[methodColumns.colId] = WBParams::getWbEntries().size();
row[methodColumns.colLabel] = M("GENERAL_UNCHANGED"); row[methodColumns.colLabel] = M("GENERAL_UNCHANGED");
} }
@ -739,10 +755,10 @@ void WhiteBalance::setWB (int vtemp, double vgreen)
{ {
methconn.block(true); methconn.block(true);
WBEntry *wbValues = findWBEntry("Custom", WBLT_PP); const std::pair<bool, const WBEntry&> wbValues = findWBEntry("Custom", WBLT_PP);
temp->setValue (vtemp); temp->setValue (vtemp);
green->setValue (vgreen); 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_customWB (vtemp, vgreen); // sequence in which this call is made is important; must be before "method->set_active (2);"
cache_customEqual(equal->getValue()); cache_customEqual(equal->getValue());
temp->setEditedState (Edited); temp->setEditedState (Edited);
@ -792,10 +808,10 @@ void WhiteBalance::cache_customWB(int temp, double green)
cache_customGreen (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++) { for (unsigned int i = 0; i < WBParams::getWbEntries().size(); i++) {
if (label == (lblType == WBLT_GUI ? WBParams::wbEntries[i]->GUILabel : WBParams::wbEntries[i]->ppLabel)) { if (label == (lblType == WBLT_GUI ? WBParams::getWbEntries()[i].GUILabel : WBParams::getWbEntries()[i].ppLabel)) {
return i; return i;
} }
} }
@ -803,15 +819,15 @@ unsigned int WhiteBalance::findWBEntryId (const Glib::ustring &label, enum WB_La
return 0; // default to camera wb return 0; // default to camera wb
} }
WBEntry* WhiteBalance::findWBEntry (Glib::ustring label, enum WB_LabelType lblType) std::pair<bool, const WBEntry&> WhiteBalance::findWBEntry(const Glib::ustring& label, enum WB_LabelType lblType)
{ {
for (unsigned int i = 0; i < WBParams::wbEntries.size(); i++) { for (unsigned int i = 0; i < WBParams::getWbEntries().size(); ++i) {
if (label == (lblType == WBLT_GUI ? WBParams::wbEntries[i]->GUILabel : WBParams::wbEntries[i]->ppLabel)) { if (label == (lblType == WBLT_GUI ? WBParams::getWbEntries()[i].GUILabel : WBParams::getWbEntries()[i].ppLabel)) {
return WBParams::wbEntries[i]; return {true, WBParams::getWbEntries()[i]};
} }
} }
return nullptr; return {false, WBParams::getWbEntries()[0]};
} }
int WhiteBalance::_setActiveMethod(Glib::ustring &label, Gtk::TreeModel::Children &children) int WhiteBalance::_setActiveMethod(Glib::ustring &label, Gtk::TreeModel::Children &children)

View File

@ -57,7 +57,7 @@ protected:
} }
}; };
static Glib::RefPtr<Gdk::Pixbuf> wbPixbufs[rtengine::procparams::WBT_CUSTOM + 1]; static Glib::RefPtr<Gdk::Pixbuf> wbPixbufs[rtengine::toUnderlying(rtengine::procparams::WBEntry::Type::CUSTOM) + 1];
Glib::RefPtr<Gtk::TreeStore> refTreeModel; Glib::RefPtr<Gtk::TreeStore> refTreeModel;
MethodColumns methodColumns; MethodColumns methodColumns;
MyComboBox* method; MyComboBox* method;
@ -85,9 +85,9 @@ protected:
int setActiveMethod (Glib::ustring label); int setActiveMethod (Glib::ustring label);
int _setActiveMethod (Glib::ustring &label, Gtk::TreeModel::Children &children); int _setActiveMethod (Glib::ustring &label, Gtk::TreeModel::Children &children);
Gtk::TreeModel::Row getActiveMethod (); Gtk::TreeModel::Row getActiveMethod();
unsigned int findWBEntryId (const Glib::ustring &label, enum WB_LabelType lblType = WBLT_GUI); 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); std::pair<bool, const rtengine::procparams::WBEntry&> findWBEntry (const Glib::ustring& label, enum WB_LabelType lblType = WBLT_GUI);
public: public:

View File

@ -29,11 +29,11 @@ XTransProcess::XTransProcess () : FoldableToolPanel(this, "xtransprocess", M("TP
hb1->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4); hb1->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4);
method = Gtk::manage (new MyComboBoxText ()); method = Gtk::manage (new MyComboBoxText ());
for( size_t i = 0; i < procparams::RAWParams::XTransSensor::numMethods; i++) { for (const auto method_string : RAWParams::XTransSensor::getMethodStrings()) {
const std::string langKey = const std::string langKey =
[i]() -> std::string [method_string]() -> std::string
{ {
const std::string str(procparams::RAWParams::XTransSensor::methodstring[i]); const std::string str(method_string);
std::string res; std::string res;
for (const auto& c : str) { for (const auto& c : str) {
@ -83,10 +83,10 @@ void XTransProcess::read(const rtengine::procparams::ProcParams* pp, const Param
disableListener (); disableListener ();
methodconn.block (true); methodconn.block (true);
method->set_active(procparams::RAWParams::XTransSensor::numMethods); method->set_active(std::numeric_limits<int>::max());
for( size_t i = 0; i < procparams::RAWParams::XTransSensor::numMethods; i++) for (size_t i = 0; i < RAWParams::XTransSensor::getMethodStrings().size(); ++i)
if( pp->raw.xtranssensor.method == procparams::RAWParams::XTransSensor::methodstring[i]) { if( pp->raw.xtranssensor.method == RAWParams::XTransSensor::getMethodStrings()[i]) {
method->set_active(i); method->set_active(i);
oldSelection = i; oldSelection = i;
break; break;
@ -96,7 +96,7 @@ void XTransProcess::read(const rtengine::procparams::ProcParams* pp, const Param
ccSteps->setEditedState (pedited->raw.xtranssensor.ccSteps ? Edited : UnEdited); ccSteps->setEditedState (pedited->raw.xtranssensor.ccSteps ? Edited : UnEdited);
if( !pedited->raw.xtranssensor.method ) { if( !pedited->raw.xtranssensor.method ) {
method->set_active(procparams::RAWParams::XTransSensor::numMethods); // No name method->set_active(std::numeric_limits<int>::max()); // No name
} }
} }
@ -113,12 +113,12 @@ void XTransProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* p
int currentRow = method->get_active_row_number(); int currentRow = method->get_active_row_number();
if( currentRow >= 0 && currentRow < procparams::RAWParams::XTransSensor::numMethods) { if (currentRow >= 0 && currentRow < std::numeric_limits<int>::max()) {
pp->raw.xtranssensor.method = procparams::RAWParams::XTransSensor::methodstring[currentRow]; pp->raw.xtranssensor.method = procparams::RAWParams::XTransSensor::getMethodStrings()[currentRow];
} }
if (pedited) { if (pedited) {
pedited->raw.xtranssensor.method = method->get_active_row_number() != procparams::RAWParams::XTransSensor::numMethods; pedited->raw.xtranssensor.method = method->get_active_row_number() != std::numeric_limits<int>::max();
pedited->raw.xtranssensor.ccSteps = ccSteps->getEditedState (); pedited->raw.xtranssensor.ccSteps = ccSteps->getEditedState ();
} }
} }
@ -126,7 +126,7 @@ void XTransProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* p
void XTransProcess::setBatchMode(bool batchMode) void XTransProcess::setBatchMode(bool batchMode)
{ {
method->append (M("GENERAL_UNCHANGED")); method->append (M("GENERAL_UNCHANGED"));
method->set_active(procparams::RAWParams::XTransSensor::numMethods); // No name method->set_active(std::numeric_limits<int>::max()); // No name
ToolPanel::setBatchMode (batchMode); ToolPanel::setBatchMode (batchMode);
ccSteps->showEditedCB (); ccSteps->showEditedCB ();
} }
@ -153,15 +153,16 @@ void XTransProcess::adjusterChanged (Adjuster* a, double newval)
void XTransProcess::methodChanged () void XTransProcess::methodChanged ()
{ {
int curSelection = method->get_active_row_number(); const int curSelection = method->get_active_row_number();
const RAWParams::XTransSensor::Method method = RAWParams::XTransSensor::Method(curSelection);
Glib::ustring methodName = ""; Glib::ustring methodName;
bool ppreq = false; bool ppreq = false;
if( curSelection >= 0 && curSelection < procparams::RAWParams::XTransSensor::numMethods) { if (curSelection >= 0 && curSelection < std::numeric_limits<int>::max()) {
methodName = procparams::RAWParams::XTransSensor::methodstring[curSelection]; methodName = RAWParams::XTransSensor::getMethodStrings()[curSelection];
if (curSelection == procparams::RAWParams::XTransSensor::mono || oldSelection == procparams::RAWParams::XTransSensor::mono) { if (method == RAWParams::XTransSensor::Method::MONO || RAWParams::XTransSensor::Method(oldSelection) == RAWParams::XTransSensor::Method::MONO) {
ppreq = true; ppreq = true;
} }
} }