From b5f4cbd7281fd7bc9c5067dce4b9c1e82e067e54 Mon Sep 17 00:00:00 2001 From: Desmis Date: Tue, 10 Apr 2018 09:24:25 +0200 Subject: [PATCH] Change ACES matrix with Bradford D50 D60 --- rtengine/iccmatrices.h | 42 +- rtengine/iccstore.cc | 474 +++++----- rtengine/procparams.cc | 1954 ++++++++++++++++++++-------------------- rtengine/procparams.h | 30 +- rtengine/settings.h | 6 +- rtgui/icmpanel.cc | 833 ++++++++--------- rtgui/icmpanel.h | 44 +- rtgui/options.cc | 1861 +++++++++++++++++++------------------- rtgui/paramsedited.cc | 46 +- rtgui/paramsedited.h | 21 +- 10 files changed, 2719 insertions(+), 2592 deletions(-) diff --git a/rtengine/iccmatrices.h b/rtengine/iccmatrices.h index aa09a7d82..df1468172 100644 --- a/rtengine/iccmatrices.h +++ b/rtengine/iccmatrices.h @@ -32,6 +32,19 @@ constexpr double d50_d65[3][3] = { { -0.0092345, 0.0150436, 0.7521316} }; +//J.Desmis 04 2018 +constexpr double d50_d60[3][3] = { + { 1.034368, 0.016908, -0.037658}, + {0.021752, 0.992183, -0.012785}, + { -0.006971, 0.011377, 0.812150} +}; + +constexpr double d60_d50[3][3] = { + { 0.96743198, -0.01699717, 0.044590689}, + {-0.02109893, 1.008067172, 0.014890785}, + {0.008598998, -0.01426777, 1.231474467} +}; + // Color space conversion to/from XYZ; color spaces adapted to D65 constexpr double xyz_sRGBd65[3][3] = { {0.4124564, 0.3575761, 0.1804375}, @@ -65,7 +78,7 @@ constexpr double xyz_sRGB[3][3] = { {0.2225045, 0.7168786, 0.0606169}, {0.0139322, 0.0971045, 0.7141733} }; - +/* //from Elle Stone constexpr double xyz_ACESc[3][3] = { {0.68988, 0.14977, 0.12456}, @@ -75,12 +88,12 @@ constexpr double xyz_ACESc[3][3] = { constexpr double ACESc_xyz[3][3] = { {1.592666, -0.351803, -0.222887}, - {-0.675936, 1.639273 , 0.015117}, + {-0.675936, 1.639273, 0.015117}, {0.0199598, -0.022576, 1.2162916} }; -/* -//from LCMS calculation same as ACES.icm + +//Matrix ACESc from LCMS calculation same as ACES.icm constexpr double xyz_ACESc[3][3] = { {0.99089, 0.01224, -0.03893}, {0.36189, 0.72252, -0.08441}, @@ -92,19 +105,22 @@ constexpr double xyz_ACESc[3][3] = { {0.237431, 0.52681, -0.05590}, {0.127169, 0.043493, 0.793903} }; -//with Bradford adaptation D60 D50 +*/ +//with Bradford adaptation D50 D60 J.Desmis 04 2018 +// ACESc_xyz = matrix ACESc * matrix d60 D50 constexpr double ACESc_xyz[3][3] = { - {1.015799, -0.017739, -0.046435}, - {-0.507793, 1.391284 , 0.119201}, - {0.008491, -0.014084, 1.219402} + {0.956674714, 0.334059262, 0.033764461}, + {-0.00914767, 0.719456271 , 0.020585086}, + {-0.03959528, -0.11114562, 1.008891993} }; -constexpr double ACESc_xyz[3][3] = { - {0.897022, -0.79074, 0.088539}, - {-0.103127, 2.76928 , 0.00767}, - {-0.19296, 0.01424, 1.256792} +constexpr double xyz_ACESc[3][3] = { + {1.039605861, -0.48655298, -0.0248649}, + {0.012013027, 1.379948826 , -0.02855804}, + {0.04212411, 0.132928069, 0.987064397} }; -*/ +//end modification ACES matrix + constexpr double sRGB_xyz[3][3] = { {3.1338561, -1.6168667, -0.4906146}, { -0.9787684, 1.9161415, 0.0334540}, diff --git a/rtengine/iccstore.cc b/rtengine/iccstore.cc index 8996611f1..7eaabd79e 100644 --- a/rtengine/iccstore.cc +++ b/rtengine/iccstore.cc @@ -156,6 +156,7 @@ bool loadProfile( if (profileContents) { profileContents->emplace(name, content); } + return true; } } @@ -220,7 +221,8 @@ rtengine::ProfileContent::ProfileContent(const Glib::ustring& fileName) fseek(f, 0, SEEK_END); long length = ftell(f); - if(length > 0) { + + if (length > 0) { char* d = new char[length + 1]; fseek(f, 0, SEEK_SET); length = fread(d, 1, length, f); @@ -230,6 +232,7 @@ rtengine::ProfileContent::ProfileContent(const Glib::ustring& fileName) } else { data.clear(); } + fclose(f); } @@ -254,8 +257,8 @@ cmsHPROFILE rtengine::ProfileContent::toProfile() const return !data.empty() - ? cmsOpenProfileFromMem(data.c_str(), data.size()) - : nullptr; + ? cmsOpenProfileFromMem(data.c_str(), data.size()) + : nullptr; } const std::string& rtengine::ProfileContent::getData() const @@ -290,20 +293,23 @@ public: cmsCloseProfile(p.second); } } + // for (auto &p : wProfilesGamma) { // if (p.second) { // cmsCloseProfile(p.second); // } // } for (auto &p : fileProfiles) { - if(p.second) { + if (p.second) { cmsCloseProfile(p.second); } } - if(srgb) { + + if (srgb) { cmsCloseProfile(srgb); } - if(xyz) { + + if (xyz) { cmsCloseProfile(xyz); } } @@ -321,6 +327,7 @@ public: userICCDir = usrICCDir; fileProfiles.clear(); fileProfileContents.clear(); + if (loadAll) { loadProfiles(profilesDir, &fileProfiles, &fileProfileContents, nullptr, false); loadProfiles(userICCDir, &fileProfiles, &fileProfileContents, nullptr, false); @@ -331,6 +338,7 @@ public: stdProfilesDir = Glib::build_filename(rtICCDir, "input"); fileStdProfiles.clear(); fileStdProfilesFileNames.clear(); + if (loadAll) { loadProfiles(stdProfilesDir, nullptr, nullptr, &fileStdProfilesFileNames, true); } @@ -339,7 +347,7 @@ public: loadWorkingSpaces(rtICCDir); loadWorkingSpaces(userICCDir); - + // initialize the alarm colours for lcms gamut checking -- we use bright green cmsUInt16Number cms_alarm_codes[cmsMAXCHANNELS] = { 0, 65535, 65535 }; cmsSetAlarmCodes(cms_alarm_codes); @@ -351,8 +359,8 @@ public: return r != wProfiles.end() - ? r->second - : wProfiles.find("sRGB")->second; + ? r->second + : wProfiles.find("sRGB")->second; } // cmsHPROFILE workingSpaceGamma(const Glib::ustring& name) const @@ -372,8 +380,8 @@ public: return r != wMatrices.end() - ? r->second - : wMatrices.find("sRGB")->second; + ? r->second + : wMatrices.find("sRGB")->second; } TMatrix workingSpaceInverseMatrix(const Glib::ustring& name) const @@ -383,8 +391,8 @@ public: return r != iwMatrices.end() - ? r->second - : iwMatrices.find("sRGB")->second; + ? r->second + : iwMatrices.find("sRGB")->second; } bool outputProfileExist(const Glib::ustring& name) const @@ -418,7 +426,9 @@ public: if (!loadProfile(name, profilesDir, &fileProfiles, &fileProfileContents)) { loadProfile(name, userICCDir, &fileProfiles, &fileProfileContents); } + const ProfileMap::const_iterator r = fileProfiles.find(name); + if (r != fileProfiles.end()) { return r->second; } @@ -443,7 +453,9 @@ public: if (!loadProfile(name, profilesDir, &fileProfiles, &fileProfileContents)) { loadProfile(name, userICCDir, &fileProfiles, &fileProfileContents); } + const ProfileMap::const_iterator r = fileProfiles.find(name); + if (r != fileProfiles.end()) { return r->second; } @@ -478,8 +490,8 @@ public: return r != fileProfileContents.end() - ? r->second - : ProfileContent(); + ? r->second + : ProfileContent(); } cmsHPROFILE getXYZProfile() const @@ -500,22 +512,22 @@ public: for (const auto profile : fileProfiles) { if ( - ( - type==ICCStore::ProfileType::MONITOR - && cmsGetDeviceClass(profile.second) == cmsSigDisplayClass - && cmsGetColorSpace(profile.second) == cmsSigRgbData - ) - ||( - type==ICCStore::ProfileType::PRINTER - && cmsGetDeviceClass(profile.second) == cmsSigOutputClass - ) - ||( - type==ICCStore::ProfileType::OUTPUT - && (cmsGetDeviceClass(profile.second) == cmsSigDisplayClass - || cmsGetDeviceClass(profile.second) == cmsSigInputClass - || cmsGetDeviceClass(profile.second) == cmsSigOutputClass) - && cmsGetColorSpace(profile.second) == cmsSigRgbData - ) + ( + type == ICCStore::ProfileType::MONITOR + && cmsGetDeviceClass(profile.second) == cmsSigDisplayClass + && cmsGetColorSpace(profile.second) == cmsSigRgbData + ) + || ( + type == ICCStore::ProfileType::PRINTER + && cmsGetDeviceClass(profile.second) == cmsSigOutputClass + ) + || ( + type == ICCStore::ProfileType::OUTPUT + && (cmsGetDeviceClass(profile.second) == cmsSigDisplayClass + || cmsGetDeviceClass(profile.second) == cmsSigInputClass + || cmsGetDeviceClass(profile.second) == cmsSigOutputClass) + && cmsGetColorSpace(profile.second) == cmsSigRgbData + ) ) { res.push_back(profile.first); } @@ -598,7 +610,7 @@ public: for (const auto &p : wProfiles) { res.push_back(p.first); } - + return res; } @@ -616,11 +628,13 @@ private: CMatrix toMatrix() const { CMatrix ret; + for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { ret[i][j] = matrix[i][j]; } } + return ret; } @@ -637,22 +651,28 @@ private: bool computeWorkingSpaceMatrix(const Glib::ustring &path, const Glib::ustring &filename, PMatrix &out) { Glib::ustring fullpath = filename; + if (!Glib::path_is_absolute(fullpath)) { fullpath = Glib::build_filename(path, filename); } + ProfileContent content(fullpath); cmsHPROFILE prof = content.toProfile(); + if (!prof) { return false; } + if (cmsGetColorSpace(prof) != cmsSigRgbData) { cmsCloseProfile(prof); return false; } + if (!cmsIsMatrixShaper(prof)) { cmsCloseProfile(prof); return false; } + cmsCIEXYZ *white = static_cast(cmsReadTag(prof, cmsSigMediaWhitePointTag)); cmsCIEXYZ *red = static_cast(cmsReadTag(prof, cmsSigRedMatrixColumnTag)); cmsCIEXYZ *green = static_cast(cmsReadTag(prof, cmsSigGreenMatrixColumnTag)); @@ -681,23 +701,29 @@ private: CVector srcw = dotProduct(bradford_MA, CVector({ white->X, white->Y, white->Z })); CMatrix m = { - CVector({ bradford_MA_dot_D50[0]/srcw[0], 0.0, 0.0 }), - CVector({ 0.0, bradford_MA_dot_D50[1]/srcw[1], 0.0 }), - CVector({ 0.0, 0.0, bradford_MA_dot_D50[2]/srcw[2] }) + CVector({ bradford_MA_dot_D50[0] / srcw[0], 0.0, 0.0 }), + CVector({ 0.0, bradford_MA_dot_D50[1] / srcw[1], 0.0 }), + CVector({ 0.0, 0.0, bradford_MA_dot_D50[2] / srcw[2] }) }; CMatrix adapt = dotProduct(dotProduct(bradford_MA_inv, m), bradford_MA); - m[0][0] = red->X; m[0][1] = green->X; m[0][2] = blue->X; - m[1][0] = red->Y; m[1][1] = green->Y; m[1][2] = blue->Y; - m[2][0] = red->Z; m[2][1] = green->Z; m[2][2] = blue->Z; + m[0][0] = red->X; + m[0][1] = green->X; + m[0][2] = blue->X; + m[1][0] = red->Y; + m[1][1] = green->Y; + m[1][2] = blue->Y; + m[2][0] = red->Z; + m[2][1] = green->Z; + m[2][2] = blue->Z; m = dotProduct(adapt, m); out.set(m); - + cmsCloseProfile(prof); return true; } - + bool loadWorkingSpaces(const Glib::ustring &path) { Glib::ustring fileName = Glib::build_filename(path, "workingspaces.json"); @@ -706,29 +732,32 @@ private: if (settings->verbose) { std::cout << "trying to load extra working spaces from " << fileName << std::flush; } - + if (!f) { if (settings->verbose) { std::cout << " FAIL" << std::endl; } + return false; } fseek(f, 0, SEEK_END); long length = ftell(f); + if (length <= 0) { if (settings->verbose) { std::cout << " FAIL" << std::endl; } + fclose(f); return false; } - + char *buf = new char[length + 1]; fseek(f, 0, SEEK_SET); length = fread(buf, 1, length, f); buf[length] = 0; - + fclose(f); cJSON_Minify(buf); @@ -738,21 +767,23 @@ private: if (settings->verbose) { std::cout << " FAIL" << std::endl; } + return false; } delete[] buf; cJSON *js = cJSON_GetObjectItem(root, "working_spaces"); + if (!js) { goto parse_error; } - + for (js = js->child; js != nullptr; js = js->next) { cJSON *ji = cJSON_GetObjectItem(js, "name"); std::unique_ptr m(new PMatrix); std::string name; - + if (!ji || ji->type != cJSON_String) { goto parse_error; } @@ -764,19 +795,22 @@ private: } bool found_matrix = false; - + ji = cJSON_GetObjectItem(js, "matrix"); + if (ji) { if (ji->type != cJSON_Array) { goto parse_error; } ji = ji->child; + for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j, ji = ji->next) { if (!ji || ji->type != cJSON_Number) { goto parse_error; } + m->matrix[i][j] = ji->valuedouble; } } @@ -784,12 +818,15 @@ private: if (ji) { goto parse_error; } + found_matrix = true; } else { ji = cJSON_GetObjectItem(js, "file"); + if (!ji || ji->type != cJSON_String) { goto parse_error; } + found_matrix = computeWorkingSpaceMatrix(path, ji->valuestring, *m); } @@ -797,6 +834,7 @@ private: if (settings->verbose) { std::cout << "Could not find suitable matrix for working space: " << name << std::endl; } + continue; } @@ -804,10 +842,12 @@ private: TMatrix w = pMatrices.back()->matrix; CMatrix b = {}; + if (!rtengine::invertMatrix(pMatrices.back()->toMatrix(), b)) { if (settings->verbose) { std::cout << "Matrix for working space: " << name << " is not invertible, skipping" << std::endl; } + pMatrices.pop_back(); } else { wMatrices[name] = w; @@ -819,29 +859,36 @@ private: if (settings->verbose) { std::cout << "Added working space: " << name << std::endl; std::cout << " matrix: ["; + for (int i = 0; i < 3; ++i) { std::cout << " ["; + for (int j = 0; j < 3; ++j) { std::cout << " " << w[i][j]; } + std::cout << "]"; } + std::cout << " ]" << std::endl; } } } cJSON_Delete(root); + if (settings->verbose) { std::cout << " OK" << std::endl; } + return true; - parse_error: +parse_error: + if (settings->verbose) { std::cout << " ERROR in parsing " << fileName << std::endl; } - + cJSON_Delete(root); return false; } @@ -1019,9 +1066,10 @@ std::vector rtengine::ICCStore::getGamma() void rtengine::ICCStore::getGammaArray(const procparams::ColorManagementParams &icm, GammaValues &ga) { const double eps = 0.000000001; // not divide by zero + if (!icm.freegamma) {//if Free gamma not selected // gamma : ga[0],ga[1],ga[2],ga[3],ga[4],ga[5] by calcul - if(icm.gamma == "BT709_g2.2_s4.5") { + if (icm.gamma == "BT709_g2.2_s4.5") { ga[0] = 2.22; //BT709 2.2 4.5 - my preferred as D.Coffin ga[1] = 0.909995; ga[2] = 0.090005; @@ -1057,13 +1105,14 @@ void rtengine::ICCStore::getGammaArray(const procparams::ColorManagementParams & ga[2] = 0.; ga[3] = 1. / eps; ga[4] = 0.; - } else /* if (icm.gamma == "linear_g1.0") */ { + } else { /* if (icm.gamma == "linear_g1.0") */ ga[0] = 1.0; //gamma=1 linear : for high dynamic images(cf : D.Coffin...) ga[1] = 1.; ga[2] = 0.; ga[3] = 1. / eps; ga[4] = 0.; } + ga[5] = 0.0; ga[6] = 0.0; } else { //free gamma selected @@ -1077,12 +1126,12 @@ void rtengine::ICCStore::getGammaArray(const procparams::ColorManagementParams & ga[4] = g_a[3] * ts; //printf("g_a.gamma0=%f g_a.gamma1=%f g_a.gamma2=%f g_a.gamma3=%f g_a.gamma4=%f\n", g_a.gamma0,g_a.gamma1,g_a.gamma2,g_a.gamma3,g_a.gamma4); ga[0] = icm.gampos; - ga[1] = 1. /(1.0 + g_a[4]); - ga[2] = g_a[4] /(1.0 + g_a[4]); + ga[1] = 1. / (1.0 + g_a[4]); + ga[2] = g_a[4] / (1.0 + g_a[4]); ga[3] = 1. / slope; ga[5] = 0.0; ga[6] = 0.0; - // printf("ga[0]=%f ga[1]=%f ga[2]=%f ga[3]=%f ga[4]=%f\n", ga[0],ga[1],ga[2],ga[3],ga[4]); + // printf("ga[0]=%f ga[1]=%f ga[2]=%f ga[3]=%f ga[4]=%f\n", ga[0],ga[1],ga[2],ga[3],ga[4]); } } @@ -1117,7 +1166,7 @@ cmsHPROFILE rtengine::ICCStore::makeStdGammaProfile(cmsHPROFILE iprof) const uint32_t gamma = 0x239; int gamma_size = 14; - int data_size =(gamma_size + 3) & ~3; + int data_size = (gamma_size + 3) & ~3; for (uint32_t i = 0; i < tag_count; i++) { memcpy(&tags[i], p, 12); @@ -1130,7 +1179,7 @@ cmsHPROFILE rtengine::ICCStore::makeStdGammaProfile(cmsHPROFILE iprof) tags[i].sig != 0x67545243 && // gTRC tags[i].sig != 0x72545243 && // rTRC tags[i].sig != 0x6B545243) { // kTRC - data_size +=(tags[i].size + 3) & ~3; + data_size += (tags[i].size + 3) & ~3; } } @@ -1161,7 +1210,7 @@ cmsHPROFILE rtengine::ICCStore::makeStdGammaProfile(cmsHPROFILE iprof) memcpy(&nd[offset + 12], &gm, 2); } - offset +=(gamma_size + 3) & ~3; + offset += (gamma_size + 3) & ~3; } tag.offset = htonl(gamma_offset); @@ -1170,7 +1219,7 @@ cmsHPROFILE rtengine::ICCStore::makeStdGammaProfile(cmsHPROFILE iprof) tag.offset = htonl(offset); tag.size = htonl(tags[i].size); memcpy(&nd[offset], &data[tags[i].offset], tags[i].size); - offset +=(tags[i].size + 3) & ~3; + offset += (tags[i].size + 3) & ~3; } memcpy(&nd[128 + 4 + i * 12], &tag, 12); @@ -1235,9 +1284,9 @@ cmsHPROFILE rtengine::ICCStore::createFromMatrix(const double matrix[3][3], bool // 0x74657874 : text // 0x64657363 : description tag for (unsigned int i = 0; i < pbody[0]; i++) { - oprof[oprof[0] / 4] = i ?(i > 1 ? 0x58595a20 : 0x64657363) : 0x74657874; + oprof[oprof[0] / 4] = i ? (i > 1 ? 0x58595a20 : 0x64657363) : 0x74657874; pbody[i * 3 + 2] = oprof[0]; - oprof[0] +=(pbody[i * 3 + 3] + 3) & -4; + oprof[0] += (pbody[i * 3 + 3] + 3) & -4; } memcpy(oprof + 32, pbody, sizeof(pbody)); @@ -1285,8 +1334,8 @@ cmsHPROFILE rtengine::ICCStore::createGammaProfile(const procparams::ColorManage enum class ColorTemp { D50 = 5003, // for Widegamut, Prophoto Best, Beta -> D50 D65 = 6504, // for sRGB, AdobeRGB, Bruce Rec2020 -> D65 - D60 = 6005 //for ACESc - + D60 = 6005 //for ACESc + }; ColorTemp temp = ColorTemp::D50; @@ -1345,7 +1394,7 @@ cmsHPROFILE rtengine::ICCStore::createGammaProfile(const procparams::ColorManage p[4] = 0.1310; p[5] = 0.0460; temp = ColorTemp::D65; - } else if (icm.wprimari == "ACESc") { + } else if (icm.wprimari == "ACESc") { p[0] = 0.734704; // ACESc primaries p[1] = 0.265298; p[2] = -0.000004; @@ -1361,16 +1410,17 @@ cmsHPROFILE rtengine::ICCStore::createGammaProfile(const procparams::ColorManage p[4] = 0.0366; p[5] = 0.0001; } + //printf("prim p2=%f \n", p[2]); -/* - p[0] = 0.6400; // sRGB primaries - p[1] = 0.3300; - p[2] = 0.3000; - p[3] = 0.6000; - p[4] = 0.1500; - p[5] = 0.0600; - temp = ColorTemp::D65; -*/ + /* + p[0] = 0.6400; // sRGB primaries + p[1] = 0.3300; + p[2] = 0.3000; + p[3] = 0.6000; + p[4] = 0.1500; + p[5] = 0.0600; + temp = ColorTemp::D65; + */ cmsCIExyY xyD; cmsCIExyYTRIPLE Primaries = { {p[0], p[1], 1.0}, // red @@ -1383,15 +1433,15 @@ cmsHPROFILE rtengine::ICCStore::createGammaProfile(const procparams::ColorManage cmsFloat64Number Parameters[7] = { ga[0], ga[1], ga[2], ga[3], ga[4], ga[5], ga[6] } ; //lcmsMutex->lock(); Mutex acquired by the caller - cmsWhitePointFromTemp(&xyD,(double)temp); -// cmsCIExyY d60_aces= {0.32168, 0.33767, 1.0}; - -// xyD = d60_aces; - + cmsWhitePointFromTemp(&xyD, (double)temp); +// cmsCIExyY d60_aces= {0.32168, 0.33767, 1.0}; + +// xyD = d60_aces; + GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildParametricToneCurve(nullptr, 5, Parameters); //5 = smoother than 4 cmsHPROFILE oprofdef = cmsCreateRGBProfile(&xyD, &Primaries, GammaTRC); //oprofdef become Outputprofile - //cmsSetProfileVersion(oprofdef, 4.3); - + //cmsSetProfileVersion(oprofdef, 4.3); + cmsFreeToneCurve(GammaTRC[0]); //lcmsMutex->unlock(); @@ -1405,101 +1455,67 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: Glib::ustring outProfile; cmsHPROFILE outputProfile = nullptr; Glib::ustring outPr; - - + + if (icm.freegamma && icm.gampos < 1.35) { pro = true; //select profil with gammaTRC modified : - } else if (icm.gamma == "linear_g1.0" ||(icm.gamma == "High_g1.3_s3.35")) { + } else if (icm.gamma == "linear_g1.0" || (icm.gamma == "High_g1.3_s3.35")) { pro = true; //pro=0 RT_sRGB || Prophoto } -/* - // Check that output profiles exist, otherwise use LCMS2 - // Use the icc/icm profiles associated to possible working profiles, set in "options" - if (icm.working == "ProPhoto" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.prophoto) && !pro) { - outProfile = options.rtSettings.prophoto; - } else if (icm.working == "Adobe RGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.adobe) ) { - outProfile = options.rtSettings.adobe; - } else if (icm.working == "WideGamut" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.widegamut) ) { - outProfile = options.rtSettings.widegamut; - } else if (icm.working == "Beta RGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.beta) ) { - outProfile = options.rtSettings.beta; - } else if (icm.working == "BestRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.best) ) { - outProfile = options.rtSettings.best; - } else if (icm.working == "BruceRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.bruce) ) { - outProfile = options.rtSettings.bruce; - } else if (icm.working == "sRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.srgb) && !pro) { - outProfile = options.rtSettings.srgb; - } else if (icm.working == "sRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.srgb10) && pro) { - outProfile = options.rtSettings.srgb10; - } else if (icm.working == "ProPhoto" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.prophoto10) && pro) { - outProfile = options.rtSettings.prophoto10; - } else if (icm.working == "Rec2020" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.rec2020) ) { - outProfile = options.rtSettings.rec2020; - } else { - // Should not occurs - if (settings->verbose) { - printf("\"%s\": unknown working profile! - use LCMS2 substitution\n", icm.working.c_str() ); - } - - return nullptr; - } - */ - //outProfile = options.rtSettings.srgb; - + //necessary for V2 profile if (icm.wprimari == "ProPhoto" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.prophoto) && !pro) { - outProfile = options.rtSettings.prophoto; - outPr = "RT_large"; + outProfile = options.rtSettings.prophoto; + outPr = "RT_large"; - } else if (icm.wprimari == "Adobe RGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.adobe) ) { - outProfile = options.rtSettings.adobe; - outPr = "RT_adob"; - } else if (icm.wprimari == "WideGamut" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.widegamut) ) { - outProfile = options.rtSettings.widegamut; - outPr = "RT_wide"; - } else if (icm.wprimari == "Beta RGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.beta) ) { + } else if (icm.wprimari == "Adobe RGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.adobe)) { + outProfile = options.rtSettings.adobe; + outPr = "RT_adob"; + } else if (icm.wprimari == "WideGamut" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.widegamut)) { + outProfile = options.rtSettings.widegamut; + outPr = "RT_wide"; + } else if (icm.wprimari == "Beta RGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.beta)) { outProfile = options.rtSettings.beta; - outPr = "RT_beta"; - } else if (icm.wprimari == "BestRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.best) ) { - outProfile = options.rtSettings.best; - outPr = "RT_best"; - } else if (icm.wprimari == "BruceRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.bruce) ) { - outProfile = options.rtSettings.bruce; - outPr = "RT_bruce"; + outPr = "RT_beta"; + } else if (icm.wprimari == "BestRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.best)) { + outProfile = options.rtSettings.best; + outPr = "RT_best"; + } else if (icm.wprimari == "BruceRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.bruce)) { + outProfile = options.rtSettings.bruce; + outPr = "RT_bruce"; } else if (icm.wprimari == "sRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.srgb) && !pro) { - outProfile = options.rtSettings.srgb; - outPr = "RT_srgb"; + outProfile = options.rtSettings.srgb; + outPr = "RT_srgb"; } else if (icm.wprimari == "sRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.srgb10) && pro) { - outProfile = options.rtSettings.srgb10; - outPr = "RT_srgb"; - + outProfile = options.rtSettings.srgb10; + outPr = "RT_srgb"; + } else if (icm.wprimari == "ProPhoto" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.prophoto10) && pro) { - outProfile = options.rtSettings.prophoto10; - outPr = "RT_large"; - - } else if (icm.wprimari == "Rec2020" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.rec2020) ) { - outProfile = options.rtSettings.rec2020; - outPr = "RT_rec2020"; - - } else if (icm.wprimari == "ACESc" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.ACESc) ) { - outProfile = options.rtSettings.ACESc; - outPr = "RT_acesc"; + outProfile = options.rtSettings.prophoto10; + outPr = "RT_large"; + + } else if (icm.wprimari == "Rec2020" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.rec2020)) { + outProfile = options.rtSettings.rec2020; + outPr = "RT_rec2020"; + + } else if (icm.wprimari == "ACESc" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.ACESc)) { + outProfile = options.rtSettings.ACESc; + outPr = "RT_acesc"; } else { // Should not occurs if (settings->verbose) { - printf("\"%s\": unknown working profile! - use LCMS2 substitution\n", icm.working.c_str() ); + printf("\"%s\": unknown working profile! - use LCMS2 substitution\n", icm.working.c_str()); } return nullptr; } - - // outProfile = options.rtSettings.prophoto; - + + //begin adaptation rTRC gTRC bTRC //"outputProfile" profile has the same characteristics than RGB values, but TRC are adapted... for applying profile if (settings->verbose) { - printf("Output Gamma - profile Primaries as RT profile: \"%s\"\n", outProfile.c_str() ); //c_str() + printf("Output Gamma - profile Primaries as RT profile: \"%s\"\n", outProfile.c_str()); //c_str() } outputProfile = ICCStore::getInstance()->getProfile(outProfile); //get output profile @@ -1509,6 +1525,7 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: if (settings->verbose) { printf("\"%s\" ICC output profile not found!\n", outProfile.c_str()); } + return nullptr; } @@ -1530,7 +1547,7 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: if (!icm.freegamma) { std::wstring gammaStr; - if(icm.gamma == "High_g1.3_s3.35") { + if (icm.gamma == "High_g1.3_s3.35") { gammaStr = std::wstring(L"GammaTRC: High g=1.3 s=3.35"); } else if (icm.gamma == "Low_g2.6_s6.9") { gammaStr = std::wstring(L"GammaTRC: Low g=2.6 s=6.9"); @@ -1548,62 +1565,50 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: cmsMLUsetWide(mlu, "en", "US", gammaStr.c_str()); } else { + /* // create description with gamma + slope + primaries std::wostringstream gammaWs; //std::string gammaWsICC; std::wstring gammaStrICC; - + gammaWs.precision(6); - if(icm.wprofile == "v4") { - outPro = outPr + "_FOIP_V4_"+ std::to_string((float)icm.gampos)+" "+ std::to_string((float)icm.slpos) + ".icc"; - } else if(icm.wprofile == "v2") { - outPro = outPr + "_FOIP_V2_"+ std::to_string((float)icm.gampos)+" "+ std::to_string((float)icm.slpos) + ".icc"; - } - + if(icm.wprofile == "v4") { + outPro = outPr + "_FOIP_V4_"+ std::to_string((float)icm.gampos)+" "+ std::to_string((float)icm.slpos) + ".icc"; + } else if(icm.wprofile == "v2") { + outPro = outPr + "_FOIP_V2_"+ std::to_string((float)icm.gampos)+" "+ std::to_string((float)icm.slpos) + ".icc"; + } + gammaWs << outPro.c_str() <<(float)icm.gampos << " s=" <<(float)icm.slpos; cmsMLUsetWide(mlu, "en", "US", gammaWs.str().c_str()); - cmsMLU *copyright = cmsMLUalloc(NULL, 1); + cmsMLU *copyright = cmsMLUalloc(NULL, 1); - cmsMLUsetASCII(copyright, "en", "US", "No copyright Rawtherapee"); - cmsWriteTag(outputProfile, cmsSigCopyrightTag, copyright); - cmsMLUfree(copyright); - cmsMLU *descrip = cmsMLUalloc(NULL, 1); + cmsMLUsetASCII(copyright, "en", "US", "No copyright Rawtherapee"); + cmsWriteTag(outputProfile, cmsSigCopyrightTag, copyright); + cmsMLUfree(copyright); + cmsMLU *descrip = cmsMLUalloc(NULL, 1); - cmsMLUsetASCII(descrip, "en", "US", "Rawtherapee"); - cmsWriteTag(outputProfile, cmsSigDeviceModelDescTag, descrip); - cmsMLUfree(descrip); - + cmsMLUsetASCII(descrip, "en", "US", "Rawtherapee"); + cmsWriteTag(outputProfile, cmsSigDeviceModelDescTag, descrip); + cmsMLUfree(descrip); + */ } - cmsWriteTag(outputProfile, cmsSigProfileDescriptionTag, mlu);//desc changed - cmsMLUfree(mlu); - - Glib::ustring manufacturer; - - manufacturer="RawTherapee_FOIP"; - cmsMLU *MfgDesc; - MfgDesc = cmsMLUalloc(NULL, 1); - cmsMLUsetASCII(MfgDesc, "en", "US", manufacturer.c_str()); - cmsWriteTag(outputProfile, cmsSigDeviceMfgDescTag, MfgDesc); - cmsMLUfree(MfgDesc); - - //cmsMLUsetASCII(mlu, "en", "US", manufacturer.c_str()); - //cmsWriteTag(outputProfile, cmsSigDeviceMfgDescTag,mlu); } - if(icm.wprofile == "v4") { - cmsSetProfileVersion(outputProfile, 4.3); - } - else { - cmsSetProfileVersion(outputProfile, 2.0); - } -//change + + if (icm.wprofile == "v4") { + cmsSetProfileVersion(outputProfile, 4.3); + } else { + cmsSetProfileVersion(outputProfile, 2.0); + } + +//change enum class ColorTemp { D50 = 5003, // for Widegamut, Prophoto Best, Beta -> D50 D65 = 6504, // for sRGB, AdobeRGB, Bruce Rec2020 -> D65 - D60 = 6005 //for ACESc->D60 + D60 = 6005 //for ACESc->D60 }; ColorTemp temp = ColorTemp::D50; float p[6]; //primaries @@ -1661,14 +1666,14 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: p[4] = 0.1310; p[5] = 0.0460; temp = ColorTemp::D65; - } else if (icm.wprimari == "ACESc") { + } else if (icm.wprimari == "ACESc") { p[0] = 0.734704; // ACESc primaries p[1] = 0.265298; p[2] = -0.000004; p[3] = 0.999993; p[4] = 0.00009989; p[5] = -0.077007; - temp = ColorTemp::D60; + temp = ColorTemp::D60; } else { p[0] = 0.7347; //ProPhoto and default primaries p[1] = 0.2653; @@ -1677,40 +1682,75 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: p[4] = 0.0366; p[5] = 0.0001; } - + cmsCIExyY xyD; cmsCIExyYTRIPLE Primaries = { {p[0], p[1], 1.0}, // red {p[2], p[3], 1.0}, // green {p[4], p[5], 1.0} // blue }; - - cmsWhitePointFromTemp(&xyD,(double)temp); - //cmsCIExyY d60_aces= {0.32168, 0.33767, 1.0}; - - //xyD = d60_aces; + + cmsWhitePointFromTemp(&xyD, (double)temp); cmsToneCurve* GammaTRC[3]; - - + + // Calculate output profile's rTRC gTRC bTRC GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildParametricToneCurve(nullptr, 5, Parameters); - if(icm.wprofile == "v4") { - outputProfile = cmsCreateRGBProfile(&xyD, &Primaries, GammaTRC); - /* - cmsCIEXYZ *red = (cmsCIEXYZ *)cmsReadTag(outputProfile, cmsSigRedColorantTag); - cmsCIEXYZ red_tag = *red; - cmsWriteTag (outputProfile, cmsSigRedColorantTag, &red_tag); - */ - } - cmsWriteTag(outputProfile, cmsSigRedTRCTag,GammaTRC[0] ); - cmsWriteTag(outputProfile, cmsSigGreenTRCTag,GammaTRC[1] ); - cmsWriteTag(outputProfile, cmsSigBlueTRCTag,GammaTRC[2] ); - - - if(icm.wprofile == "v2" || icm.wprofile == "v4") { - cmsSaveProfileToFile(outputProfile, outPro.c_str()); - - } + + if (icm.wprofile == "v4") { + outputProfile = cmsCreateRGBProfile(&xyD, &Primaries, GammaTRC); + } + + cmsWriteTag(outputProfile, cmsSigRedTRCTag, GammaTRC[0]); + cmsWriteTag(outputProfile, cmsSigGreenTRCTag, GammaTRC[1]); + cmsWriteTag(outputProfile, cmsSigBlueTRCTag, GammaTRC[2]); + + if (icm.freegamma) { + // create description with gamma + slope + primaries + std::wostringstream gammaWs; + //std::string gammaWsICC; + std::wstring gammaStrICC; + + gammaWs.precision(6); + + if (icm.wprofile == "v4") { + outPro = outPr + "_FOIP_V4_" + std::to_string((float)icm.gampos) + " " + std::to_string((float)icm.slpos) + ".icc"; + } else if (icm.wprofile == "v2") { + outPro = outPr + "_FOIP_V2_" + std::to_string((float)icm.gampos) + " " + std::to_string((float)icm.slpos) + ".icc"; + } + + gammaWs << outPro.c_str() << (float)icm.gampos << " s=" << (float)icm.slpos; + + cmsMLUsetWide(mlu, "en", "US", gammaWs.str().c_str()); + cmsMLU *copyright = cmsMLUalloc(NULL, 1); + + cmsMLUsetASCII(copyright, "en", "US", "No copyright Rawtherapee"); + cmsWriteTag(outputProfile, cmsSigCopyrightTag, copyright); + cmsMLUfree(copyright); + } + cmsMLU *descrip = cmsMLUalloc(NULL, 1); + cmsMLUsetASCII(descrip, "en", "US", "Rawtherapee"); + cmsWriteTag(outputProfile, cmsSigDeviceModelDescTag, descrip); + cmsMLUfree(descrip); + + cmsWriteTag(outputProfile, cmsSigProfileDescriptionTag, mlu);//desc changed + cmsMLUfree(mlu); + + Glib::ustring manufacturer; + + manufacturer = "RawTherapee_FOIP"; + cmsMLU *MfgDesc; + MfgDesc = cmsMLUalloc(NULL, 1); + cmsMLUsetASCII(MfgDesc, "en", "US", manufacturer.c_str()); + cmsWriteTag(outputProfile, cmsSigDeviceMfgDescTag, MfgDesc); + cmsMLUfree(MfgDesc); + + + if (icm.wprofile == "v2" || icm.wprofile == "v4") { + cmsSaveProfileToFile(outputProfile, outPro.c_str()); + + } + if (GammaTRC) { cmsFreeToneCurve(GammaTRC[0]); } diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index c86976b3a..ae6e2fdc0 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -38,60 +38,60 @@ extern Options options; namespace { -Glib::ustring expandRelativePath (const Glib::ustring &procparams_fname, const Glib::ustring &prefix, Glib::ustring embedded_fname) +Glib::ustring expandRelativePath(const Glib::ustring &procparams_fname, const Glib::ustring &prefix, Glib::ustring embedded_fname) { - if (embedded_fname == "" || !Glib::path_is_absolute (procparams_fname)) { + if (embedded_fname == "" || !Glib::path_is_absolute(procparams_fname)) { return embedded_fname; } if (prefix != "") { - if (embedded_fname.length() < prefix.length() || embedded_fname.substr (0, prefix.length()) != prefix) { + if (embedded_fname.length() < prefix.length() || embedded_fname.substr(0, prefix.length()) != prefix) { return embedded_fname; } - embedded_fname = embedded_fname.substr (prefix.length()); + embedded_fname = embedded_fname.substr(prefix.length()); } - if (Glib::path_is_absolute (embedded_fname)) { + if (Glib::path_is_absolute(embedded_fname)) { return prefix + embedded_fname; } - Glib::ustring absPath = prefix + Glib::path_get_dirname (procparams_fname) + G_DIR_SEPARATOR_S + embedded_fname; + Glib::ustring absPath = prefix + Glib::path_get_dirname(procparams_fname) + G_DIR_SEPARATOR_S + embedded_fname; return absPath; } -Glib::ustring relativePathIfInside (const Glib::ustring &procparams_fname, bool fnameAbsolute, Glib::ustring embedded_fname) +Glib::ustring relativePathIfInside(const Glib::ustring &procparams_fname, bool fnameAbsolute, Glib::ustring embedded_fname) { - if (fnameAbsolute || embedded_fname == "" || !Glib::path_is_absolute (procparams_fname)) { + if (fnameAbsolute || embedded_fname == "" || !Glib::path_is_absolute(procparams_fname)) { return embedded_fname; } Glib::ustring prefix = ""; - if (embedded_fname.length() > 5 && embedded_fname.substr (0, 5) == "file:") { - embedded_fname = embedded_fname.substr (5); + if (embedded_fname.length() > 5 && embedded_fname.substr(0, 5) == "file:") { + embedded_fname = embedded_fname.substr(5); prefix = "file:"; } - if (!Glib::path_is_absolute (embedded_fname)) { + if (!Glib::path_is_absolute(embedded_fname)) { return prefix + embedded_fname; } - Glib::ustring dir1 = Glib::path_get_dirname (procparams_fname) + G_DIR_SEPARATOR_S; - Glib::ustring dir2 = Glib::path_get_dirname (embedded_fname) + G_DIR_SEPARATOR_S; + Glib::ustring dir1 = Glib::path_get_dirname(procparams_fname) + G_DIR_SEPARATOR_S; + Glib::ustring dir2 = Glib::path_get_dirname(embedded_fname) + G_DIR_SEPARATOR_S; - if (dir2.substr (0, dir1.length()) != dir1) { + if (dir2.substr(0, dir1.length()) != dir1) { // it's in a different directory, ie not inside return prefix + embedded_fname; } - return prefix + embedded_fname.substr (dir1.length()); + return prefix + embedded_fname.substr(dir1.length()); } -void avoidEmptyCurve (std::vector &curve) +void avoidEmptyCurve(std::vector &curve) { if (curve.empty()) { - curve.push_back (FCT_Linear); + curve.push_back(FCT_Linear); } } @@ -165,6 +165,7 @@ bool assignFromKeyfile( return true; } + return false; } @@ -197,6 +198,7 @@ bool assignFromKeyfile( return true; } + return false; } @@ -275,6 +277,7 @@ bool saveToKeyfile( putToKeyfile(group_name, key, value, keyfile); return true; } + return false; } @@ -296,6 +299,7 @@ bool saveToKeyfile( return true; } } + return false; } @@ -314,21 +318,21 @@ ToneCurveParams::ToneCurveParams() : method("Blend"), expcomp(0), curve{ - DCT_Linear - }, - curve2{ - DCT_Linear - }, - curveMode(ToneCurveParams::TcMode::STD), - curveMode2(ToneCurveParams::TcMode::STD), - brightness(0), - black(0), - contrast(0), - saturation(0), - shcompr(50), - hlcompr(0), - hlcomprthresh(33), - histmatching(false) + DCT_Linear +}, +curve2{ + DCT_Linear +}, +curveMode(ToneCurveParams::TcMode::STD), + curveMode2(ToneCurveParams::TcMode::STD), + brightness(0), + black(0), + contrast(0), + saturation(0), + shcompr(50), + hlcompr(0), + hlcomprthresh(33), + histmatching(false) { } @@ -362,75 +366,75 @@ bool ToneCurveParams::operator !=(const ToneCurveParams& other) const RetinexParams::RetinexParams() : enabled(false), cdcurve{ - DCT_Linear - }, - cdHcurve{ - DCT_Linear - }, - lhcurve{ - DCT_Linear - }, - transmissionCurve{ - FCT_MinMaxCPoints, - 0.00, - 0.50, - 0.35, - 0.35, - 0.60, - 0.75, - 0.35, - 0.35, - 1.00, - 0.50, - 0.35, - 0.35 - }, - gaintransmissionCurve{ - FCT_MinMaxCPoints, - 0.00, - 0.1, - 0.35, - 0.00, - 0.25, - 0.25, - 0.35, - 0.35, - 0.70, - 0.25, - 0.35, - 0.35, - 1.00, - 0.1, - 0.00, - 0.00 - }, - mapcurve{ - DCT_Linear - }, - str(20), - scal(3), - iter(1), - grad(1), - grads(1), - gam(1.30), - slope(3.), - neigh(80), - offs(0), - highlights(0), - htonalwidth(80), - shadows(0), - stonalwidth(80), - radius(40), - retinexMethod("high"), - retinexcolorspace("Lab"), - gammaretinex("none"), - mapMethod("none"), - viewMethod("none"), - vart(200), - limd(8), - highl(4), - skal(3), - medianmap(false) + DCT_Linear +}, +cdHcurve{ + DCT_Linear +}, +lhcurve{ + DCT_Linear +}, +transmissionCurve{ + FCT_MinMaxCPoints, + 0.00, + 0.50, + 0.35, + 0.35, + 0.60, + 0.75, + 0.35, + 0.35, + 1.00, + 0.50, + 0.35, + 0.35 +}, +gaintransmissionCurve{ + FCT_MinMaxCPoints, + 0.00, + 0.1, + 0.35, + 0.00, + 0.25, + 0.25, + 0.35, + 0.35, + 0.70, + 0.25, + 0.35, + 0.35, + 1.00, + 0.1, + 0.00, + 0.00 +}, +mapcurve{ + DCT_Linear +}, +str(20), +scal(3), +iter(1), +grad(1), +grads(1), +gam(1.30), +slope(3.), +neigh(80), +offs(0), +highlights(0), +htonalwidth(80), +shadows(0), +stonalwidth(80), +radius(40), +retinexMethod("high"), +retinexcolorspace("Lab"), +gammaretinex("none"), +mapMethod("none"), +viewMethod("none"), +vart(200), +limd(8), +highl(4), +skal(3), +medianmap(false) { } @@ -485,38 +489,38 @@ void RetinexParams::getCurves(RetinextransmissionCurve &transmissionCurveLUT, Re LCurveParams::LCurveParams() : enabled(false), lcurve{ - DCT_Linear - }, - acurve{ - DCT_Linear - }, - bcurve{ - DCT_Linear - }, - cccurve{ - DCT_Linear - }, - chcurve{ - FCT_Linear - }, - lhcurve{ - FCT_Linear - }, - hhcurve{ - FCT_Linear - }, - lccurve{ - DCT_Linear - }, - clcurve{ - DCT_Linear - }, - brightness(0), - contrast(0), - chromaticity(0), - avoidcolorshift(false), - rstprotection(0), - lcredsk(true) + DCT_Linear +}, +acurve{ + DCT_Linear +}, +bcurve{ + DCT_Linear +}, +cccurve{ + DCT_Linear +}, +chcurve{ + FCT_Linear +}, +lhcurve{ + FCT_Linear +}, +hhcurve{ + FCT_Linear +}, +lccurve{ + DCT_Linear +}, +clcurve{ + DCT_Linear +}, +brightness(0), +contrast(0), +chromaticity(0), +avoidcolorshift(false), +rstprotection(0), +lcredsk(true) { } @@ -550,14 +554,14 @@ RGBCurvesParams::RGBCurvesParams() : enabled(false), lumamode(false), rcurve{ - DCT_Linear - }, - gcurve{ - DCT_Linear - }, - bcurve{ - DCT_Linear - } + DCT_Linear +}, +gcurve{ + DCT_Linear +}, +bcurve{ + DCT_Linear +} { } @@ -610,77 +614,77 @@ ColorToningParams::ColorToningParams() : enabled(false), autosat(true), opacityCurve{ - FCT_MinMaxCPoints, - 0.00, - 0.3, - 0.35, - 0.00, - 0.25, - 0.8, - 0.35, - 0.35, - 0.70, - 0.8, - 0.35, - 0.35, - 1.00, - 0.3, - 0.00, - 0.00 - }, - colorCurve{ - FCT_MinMaxCPoints, - 0.050, - 0.62, - 0.25, - 0.25, - 0.585, - 0.11, - 0.25, - 0.25 - }, - satProtectionThreshold(30), - saturatedOpacity(80), - strength(50), - balance(0), - hlColSat(60, 80, false), - shadowsColSat (80, 208, false), - clcurve{ - DCT_NURBS, - 0.00, - 0.00, - 0.35, - 0.65, - 1.00, - 1.00 - }, - cl2curve{ - DCT_NURBS, - 0.00, - 0.00, - 0.35, - 0.65, - 1.00, - 1.00 - }, - method("Lab"), - twocolor("Std"), - redlow(0.0), - greenlow(0.0), - bluelow(0.0), - redmed(0.0), - greenmed(0.0), - bluemed(0.0), - redhigh(0.0), - greenhigh(0.0), - bluehigh(0.0), - satlow(0.0), - sathigh(0.0), - lumamode(true), - labgridALow(0.0), - labgridBLow(0.0), - labgridAHigh(0.0), - labgridBHigh(0.0) + FCT_MinMaxCPoints, + 0.00, + 0.3, + 0.35, + 0.00, + 0.25, + 0.8, + 0.35, + 0.35, + 0.70, + 0.8, + 0.35, + 0.35, + 1.00, + 0.3, + 0.00, + 0.00 +}, +colorCurve{ + FCT_MinMaxCPoints, + 0.050, + 0.62, + 0.25, + 0.25, + 0.585, + 0.11, + 0.25, + 0.25 +}, +satProtectionThreshold(30), + saturatedOpacity(80), + strength(50), + balance(0), + hlColSat(60, 80, false), + shadowsColSat(80, 208, false), +clcurve{ + DCT_NURBS, + 0.00, + 0.00, + 0.35, + 0.65, + 1.00, + 1.00 +}, +cl2curve{ + DCT_NURBS, + 0.00, + 0.00, + 0.35, + 0.65, + 1.00, + 1.00 +}, +method("Lab"), +twocolor("Std"), +redlow(0.0), +greenlow(0.0), +bluelow(0.0), +redmed(0.0), +greenmed(0.0), +bluemed(0.0), +redhigh(0.0), +greenhigh(0.0), +bluehigh(0.0), +satlow(0.0), +sathigh(0.0), +lumamode(true), +labgridALow(0.0), +labgridBLow(0.0), +labgridAHigh(0.0), +labgridBHigh(0.0) { } @@ -728,10 +732,10 @@ void ColorToningParams::mixerToCurve(std::vector& colorCurve, std::vecto { // check if non null first if (!redlow && !greenlow && !bluelow && !redmed && !greenmed && !bluemed && !redhigh && !greenhigh && !bluehigh) { - colorCurve.resize (1); - colorCurve.at (0) = FCT_Linear; - opacityCurve.resize (1); - opacityCurve.at (0) = FCT_Linear; + colorCurve.resize(1); + colorCurve.at(0) = FCT_Linear; + opacityCurve.resize(1); + opacityCurve.at(0) = FCT_Linear; return; } @@ -744,9 +748,9 @@ void ColorToningParams::mixerToCurve(std::vector& colorCurve, std::vecto float minTmp, maxTmp; // Fill the shadow mixer values of the Color TOning tool - low[0] = float (redlow ) / 100.f; // [-1. ; +1.] + low[0] = float (redlow) / 100.f; // [-1. ; +1.] low[1] = float (greenlow) / 100.f; // [-1. ; +1.] - low[2] = float (bluelow ) / 100.f; // [-1. ; +1.] + low[2] = float (bluelow) / 100.f; // [-1. ; +1.] minTmp = min (low[0], low[1], low[2]); maxTmp = max (low[0], low[1], low[2]); @@ -786,9 +790,9 @@ void ColorToningParams::mixerToCurve(std::vector& colorCurve, std::vecto } // Fill the mid-tones mixer values of the Color TOning tool - med[0] = float (redmed ) / 100.f; // [-1. ; +1.] + med[0] = float (redmed) / 100.f; // [-1. ; +1.] med[1] = float (greenmed) / 100.f; // [-1. ; +1.] - med[2] = float (bluemed ) / 100.f; // [-1. ; +1.] + med[2] = float (bluemed) / 100.f; // [-1. ; +1.] minTmp = min (med[0], med[1], med[2]); maxTmp = max (med[0], med[1], med[2]); @@ -828,9 +832,9 @@ void ColorToningParams::mixerToCurve(std::vector& colorCurve, std::vecto } // Fill the highlight mixer values of the Color TOning tool - high[0] = float (redhigh ) / 100.f; // [-1. ; +1.] + high[0] = float (redhigh) / 100.f; // [-1. ; +1.] high[1] = float (greenhigh) / 100.f; // [-1. ; +1.] - high[2] = float (bluehigh ) / 100.f; // [-1. ; +1.] + high[2] = float (bluehigh) / 100.f; // [-1. ; +1.] minTmp = min (high[0], high[1], high[2]); maxTmp = max (high[0], high[1], high[2]); @@ -873,97 +877,97 @@ void ColorToningParams::mixerToCurve(std::vector& colorCurve, std::vecto const double xPosMed = 0.4; const double xPosHigh = 0.7; - colorCurve.resize ( medSat != 0.f ? 13 : 9 ); - colorCurve.at (0) = FCT_MinMaxCPoints; - opacityCurve.resize (13); - opacityCurve.at (0) = FCT_MinMaxCPoints; + colorCurve.resize(medSat != 0.f ? 13 : 9); + colorCurve.at(0) = FCT_MinMaxCPoints; + opacityCurve.resize(13); + opacityCurve.at(0) = FCT_MinMaxCPoints; float h, s, l; int idx = 1; if (lowSat == 0.f) { if (medSat != 0.f) { - Color::rgb2hsl (med[0], med[1], med[2], h, s, l); + Color::rgb2hsl(med[0], med[1], med[2], h, s, l); } else { // highSat can't be null if the 2 other ones are! - Color::rgb2hsl (high[0], high[1], high[2], h, s, l); + Color::rgb2hsl(high[0], high[1], high[2], h, s, l); } } else { - Color::rgb2hsl (low[0], low[1], low[2], h, s, l); + Color::rgb2hsl(low[0], low[1], low[2], h, s, l); } - colorCurve.at (idx++) = xPosLow; - colorCurve.at (idx++) = h; - colorCurve.at (idx++) = 0.35; - colorCurve.at (idx++) = 0.35; + colorCurve.at(idx++) = xPosLow; + colorCurve.at(idx++) = h; + colorCurve.at(idx++) = 0.35; + colorCurve.at(idx++) = 0.35; if (medSat != 0.f) { - Color::rgb2hsl (med[0], med[1], med[2], h, s, l); - colorCurve.at (idx++) = xPosMed; - colorCurve.at (idx++) = h; - colorCurve.at (idx++) = 0.35; - colorCurve.at (idx++) = 0.35; + Color::rgb2hsl(med[0], med[1], med[2], h, s, l); + colorCurve.at(idx++) = xPosMed; + colorCurve.at(idx++) = h; + colorCurve.at(idx++) = 0.35; + colorCurve.at(idx++) = 0.35; } if (highSat == 0.f) { if (medSat != 0.f) { - Color::rgb2hsl (med[0], med[1], med[2], h, s, l); + Color::rgb2hsl(med[0], med[1], med[2], h, s, l); } else { // lowSat can't be null if the 2 other ones are! - Color::rgb2hsl (low[0], low[1], low[2], h, s, l); + Color::rgb2hsl(low[0], low[1], low[2], h, s, l); } } else { - Color::rgb2hsl (high[0], high[1], high[2], h, s, l); + Color::rgb2hsl(high[0], high[1], high[2], h, s, l); } - colorCurve.at (idx++) = xPosHigh; - colorCurve.at (idx++) = h; - colorCurve.at (idx++) = 0.35; - colorCurve.at (idx) = 0.35; + colorCurve.at(idx++) = xPosHigh; + colorCurve.at(idx++) = h; + colorCurve.at(idx++) = 0.35; + colorCurve.at(idx) = 0.35; - opacityCurve.at (1) = xPosLow; - opacityCurve.at (2) = double (lowSat); - opacityCurve.at (3) = 0.35; - opacityCurve.at (4) = 0.35; - opacityCurve.at (5) = xPosMed; - opacityCurve.at (6) = double (medSat); - opacityCurve.at (7) = 0.35; - opacityCurve.at (8) = 0.35; - opacityCurve.at (9) = xPosHigh; - opacityCurve.at (10) = double (highSat); - opacityCurve.at (11) = 0.35; - opacityCurve.at (12) = 0.35; + opacityCurve.at(1) = xPosLow; + opacityCurve.at(2) = double (lowSat); + opacityCurve.at(3) = 0.35; + opacityCurve.at(4) = 0.35; + opacityCurve.at(5) = xPosMed; + opacityCurve.at(6) = double (medSat); + opacityCurve.at(7) = 0.35; + opacityCurve.at(8) = 0.35; + opacityCurve.at(9) = xPosHigh; + opacityCurve.at(10) = double (highSat); + opacityCurve.at(11) = 0.35; + opacityCurve.at(12) = 0.35; } void ColorToningParams::slidersToCurve(std::vector& colorCurve, std::vector& opacityCurve) const { if (hlColSat.getBottom() == 0 && shadowsColSat.getBottom() == 0) { // if both opacity are null, set both curves to Linear - colorCurve.resize (1); - colorCurve.at (0) = FCT_Linear; - opacityCurve.resize (1); - opacityCurve.at (0) = FCT_Linear; + colorCurve.resize(1); + colorCurve.at(0) = FCT_Linear; + opacityCurve.resize(1); + opacityCurve.at(0) = FCT_Linear; return; } - colorCurve.resize (9); - colorCurve.at (0) = FCT_MinMaxCPoints; - colorCurve.at (1) = 0.26 + 0.12 * double (balance) / 100.; - colorCurve.at (2) = double (shadowsColSat.getTop()) / 360.; - colorCurve.at (3) = 0.35; - colorCurve.at (4) = 0.35; - colorCurve.at (5) = 0.64 + 0.12 * double (balance) / 100.; - colorCurve.at (6) = double (hlColSat.getTop()) / 360.; - colorCurve.at (7) = 0.35; - colorCurve.at (8) = 0.35; + colorCurve.resize(9); + colorCurve.at(0) = FCT_MinMaxCPoints; + colorCurve.at(1) = 0.26 + 0.12 * double (balance) / 100.; + colorCurve.at(2) = double (shadowsColSat.getTop()) / 360.; + colorCurve.at(3) = 0.35; + colorCurve.at(4) = 0.35; + colorCurve.at(5) = 0.64 + 0.12 * double (balance) / 100.; + colorCurve.at(6) = double (hlColSat.getTop()) / 360.; + colorCurve.at(7) = 0.35; + colorCurve.at(8) = 0.35; - opacityCurve.resize (9); - opacityCurve.at (0) = FCT_MinMaxCPoints; - opacityCurve.at (1) = colorCurve.at (1); - opacityCurve.at (2) = double (shadowsColSat.getBottom()) / 100.; - opacityCurve.at (3) = 0.35; - opacityCurve.at (4) = 0.35; - opacityCurve.at (5) = colorCurve.at (5); - opacityCurve.at (6) = double (hlColSat.getBottom()) / 100.; - opacityCurve.at (7) = 0.35; - opacityCurve.at (8) = 0.35; + opacityCurve.resize(9); + opacityCurve.at(0) = FCT_MinMaxCPoints; + opacityCurve.at(1) = colorCurve.at(1); + opacityCurve.at(2) = double (shadowsColSat.getBottom()) / 100.; + opacityCurve.at(3) = 0.35; + opacityCurve.at(4) = 0.35; + opacityCurve.at(5) = colorCurve.at(5); + opacityCurve.at(6) = double (hlColSat.getBottom()) / 100.; + opacityCurve.at(7) = 0.35; + opacityCurve.at(8) = 0.35; } void ColorToningParams::getCurves(ColorGradientCurve& colorCurveLUT, OpacityCurve& opacityCurveLUT, const double xyz_rgb[3][3], bool& opautili) const @@ -975,9 +979,9 @@ void ColorToningParams::getCurves(ColorGradientCurve& colorCurveLUT, OpacityCurv std::vector cCurve, oCurve; if (method == "RGBSliders" || method == "Splitlr") { - slidersToCurve (cCurve, oCurve); + slidersToCurve(cCurve, oCurve); } else if (method == "Splitco") { - mixerToCurve (cCurve, oCurve); + mixerToCurve(cCurve, oCurve); } else { cCurve = this->colorCurve; oCurve = this->opacityCurve; @@ -992,14 +996,14 @@ void ColorToningParams::getCurves(ColorGradientCurve& colorCurveLUT, OpacityCurv satur = 0.9f; } - colorCurveLUT.SetXYZ (cCurve, xyz_rgb, satur, lumin); - opacityCurveLUT.Set (oCurve, opautili); + colorCurveLUT.SetXYZ(cCurve, xyz_rgb, satur, lumin); + opacityCurveLUT.Set(oCurve, opautili); } else if (method == "Splitlr" || method == "Splitco") { - colorCurveLUT.SetXYZ (cCurve, xyz_rgb, satur, lumin); - opacityCurveLUT.Set (oCurve, opautili); - } else if (method.substr (0, 3) == "RGB") { - colorCurveLUT.SetRGB (cCurve); - opacityCurveLUT.Set (oCurve, opautili); + colorCurveLUT.SetXYZ(cCurve, xyz_rgb, satur, lumin); + opacityCurveLUT.Set(oCurve, opautili); + } else if (method.substr(0, 3) == "RGB") { + colorCurveLUT.SetRGB(cCurve); + opacityCurveLUT.Set(oCurve, opautili); } } @@ -1098,8 +1102,8 @@ VibranceParams::VibranceParams() : avoidcolorshift(true), pastsattog(true), skintonescurve{ - DCT_Linear - } + DCT_Linear +} { } @@ -1183,7 +1187,7 @@ const std::vector& WBParams::getWbEntries() {"Flash 6000K", WBEntry::Type::FLASH, M("TP_WBALANCE_FLASH60"), 6000, 1.f, 1.f, 0.f}, {"Flash 6500K", WBEntry::Type::FLASH, M("TP_WBALANCE_FLASH65"), 6500, 1.f, 1.f, 0.f}, // Should remain the last one - {"Custom", WBEntry::Type::CUSTOM, M ("TP_WBALANCE_CUSTOM"), 0, 1.f, 1.f, 0.f} + {"Custom", WBEntry::Type::CUSTOM, M("TP_WBALANCE_CUSTOM"), 0, 1.f, 1.f, 0.f} }; return wb_entries; @@ -1196,45 +1200,45 @@ ColorAppearanceParams::ColorAppearanceParams() : degreeout(90), autodegreeout(true), curve{ - DCT_Linear - }, - curve2{ - DCT_Linear - }, - curve3{ - DCT_Linear - }, - curveMode(TcMode::LIGHT), - curveMode2(TcMode::LIGHT), - curveMode3(CtcMode::CHROMA), - surround("Average"), - surrsrc("Average"), - adapscen(2000.0), - autoadapscen(true), - ybscen(18), - autoybscen(true), - adaplum(16), - badpixsl(0), - wbmodel("RawT"), - algo("No"), - contrast(0.0), - qcontrast(0.0), - jlight(0.0), - qbright(0.0), - chroma(0.0), - schroma(0.0), - mchroma(0.0), - colorh(0.0), - rstprotection(0.0), - surrsource(false), - gamut(true), - datacie(false), - tonecie(false), - tempout(5000), - ybout(18), - greenout(1.0), - tempsc(5000), - greensc(1.0) + DCT_Linear +}, +curve2{ + DCT_Linear +}, +curve3{ + DCT_Linear +}, +curveMode(TcMode::LIGHT), +curveMode2(TcMode::LIGHT), +curveMode3(CtcMode::CHROMA), +surround("Average"), +surrsrc("Average"), +adapscen(2000.0), +autoadapscen(true), +ybscen(18), +autoybscen(true), +adaplum(16), +badpixsl(0), +wbmodel("RawT"), +algo("No"), +contrast(0.0), +qcontrast(0.0), +jlight(0.0), +qbright(0.0), +chroma(0.0), +schroma(0.0), +mchroma(0.0), +colorh(0.0), +rstprotection(0.0), +surrsource(false), +gamut(true), +datacie(false), +tonecie(false), +tempout(5000), +ybout(18), +greenout(1.0), +tempsc(5000), +greensc(1.0) { } @@ -1292,32 +1296,32 @@ DefringeParams::DefringeParams() : radius(2.0), threshold(13), huecurve{ - FCT_MinMaxCPoints, - 0.166666667, - 0., - 0.35, - 0.35, - 0.347, - 0., - 0.35, - 0.35, - 0.513667426, - 0, - 0.35, - 0.35, - 0.668944571, - 0., - 0.35, - 0.35, - 0.8287775246, - 0.97835991, - 0.35, - 0.35, - 0.9908883827, - 0., - 0.35, - 0.35 - } + FCT_MinMaxCPoints, + 0.166666667, + 0., + 0.35, + 0.35, + 0.347, + 0., + 0.35, + 0.35, + 0.513667426, + 0, + 0.35, + 0.35, + 0.668944571, + 0., + 0.35, + 0.35, + 0.8287775246, + 0.97835991, + 0.35, + 0.35, + 0.9908883827, + 0., + 0.35, + 0.35 +} { } @@ -1355,46 +1359,46 @@ bool ImpulseDenoiseParams::operator !=(const ImpulseDenoiseParams& other) const DirPyrDenoiseParams::DirPyrDenoiseParams() : lcurve{ - FCT_MinMaxCPoints, - 0.05, - 0.15, - 0.35, - 0.35, - 0.55, - 0.04, - 0.35, - 0.35 - }, - cccurve{ - FCT_MinMaxCPoints, - 0.05, - 0.50, - 0.35, - 0.35, - 0.35, - 0.05, - 0.35, - 0.35 - }, - enabled(false), - enhance(false), - median(false), - perform(false), - luma(0), - Ldetail(0), - chroma(15), - redchro(0), - bluechro(0), - gamma(1.7), - dmethod("Lab"), - Lmethod("SLI"), - Cmethod("MAN"), - C2method("AUTO"), - smethod("shal"), - medmethod("soft"), - methodmed("none"), - rgbmethod("soft"), - passes(1) + FCT_MinMaxCPoints, + 0.05, + 0.15, + 0.35, + 0.35, + 0.55, + 0.04, + 0.35, + 0.35 +}, +cccurve{ + FCT_MinMaxCPoints, + 0.05, + 0.50, + 0.35, + 0.35, + 0.35, + 0.05, + 0.35, + 0.35 +}, +enabled(false), +enhance(false), +median(false), +perform(false), +luma(0), +Ldetail(0), +chroma(15), +redchro(0), +bluechro(0), +gamma(1.7), +dmethod("Lab"), +Lmethod("SLI"), +Cmethod("MAN"), +C2method("AUTO"), +smethod("shal"), +medmethod("soft"), +methodmed("none"), +rgbmethod("soft"), +passes(1) { } @@ -1429,7 +1433,7 @@ bool DirPyrDenoiseParams::operator !=(const DirPyrDenoiseParams& other) const return !(*this == other); } -void DirPyrDenoiseParams::getCurves (NoiseCurve &lCurve, NoiseCurve &cCurve) const +void DirPyrDenoiseParams::getCurves(NoiseCurve &lCurve, NoiseCurve &cCurve) const { lCurve.Set(this->lcurve); cCurve.Set(this->cccurve); @@ -1548,10 +1552,10 @@ void CropParams::mapToResized(int resizedWidth, int resizedHeight, int scale, in x1 = 0, x2 = resizedWidth, y1 = 0, y2 = resizedHeight; if (enabled) { - x1 = min(resizedWidth - 1, max (0, x / scale)); - y1 = min(resizedHeight - 1, max (0, y / scale)); - x2 = min(resizedWidth, max (0, (x + w) / scale)); - y2 = min(resizedHeight, max (0, (y + h) / scale)); + x1 = min(resizedWidth - 1, max(0, x / scale)); + y1 = min(resizedHeight - 1, max(0, y / scale)); + x2 = min(resizedWidth, max(0, (x + w) / scale)); + y2 = min(resizedHeight, max(0, (y + h) / scale)); } } @@ -1687,6 +1691,7 @@ LensProfParams::LcMode LensProfParams::getMethodNumber(const Glib::ustring& mode return static_cast(i); } } + return LcMode::NONE; } @@ -1783,20 +1788,20 @@ bool VignettingParams::operator !=(const VignettingParams& other) const ChannelMixerParams::ChannelMixerParams() : enabled(false), red{ - 100, - 0, - 0 - }, - green{ - 0, - 100, - 0 - }, - blue{ - 0, - 0, - 100 - } + 100, + 0, + 0 +}, +green{ + 0, + 100, + 0 +}, +blue{ + 0, + 0, + 100 +} { } @@ -1805,6 +1810,7 @@ bool ChannelMixerParams::operator ==(const ChannelMixerParams& other) const if (enabled != other.enabled) { return false; } + for (unsigned int i = 0; i < 3; ++i) { if ( red[i] != other.red[i] @@ -1814,6 +1820,7 @@ bool ChannelMixerParams::operator ==(const ChannelMixerParams& other) const return false; } } + return true; } @@ -1824,34 +1831,34 @@ bool ChannelMixerParams::operator !=(const ChannelMixerParams& other) const BlackWhiteParams::BlackWhiteParams() : beforeCurve{ - DCT_Linear - }, - beforeCurveMode(BlackWhiteParams::TcMode::STD_BW), - afterCurve{ - DCT_Linear - }, - afterCurveMode(BlackWhiteParams::TcMode::STD_BW), - algo("SP"), - luminanceCurve{ - FCT_Linear - }, - autoc(false), - enabledcc(true), - enabled(false), - filter("None"), - setting("NormalContrast"), - method("Desaturation"), - mixerRed(33), - mixerOrange(33), - mixerYellow(33), - mixerGreen(33), - mixerCyan(33), - mixerBlue(33), - mixerMagenta(33), - mixerPurple(33), - gammaRed(0), - gammaGreen(0), - gammaBlue(0) + DCT_Linear +}, +beforeCurveMode(BlackWhiteParams::TcMode::STD_BW), +afterCurve{ + DCT_Linear +}, +afterCurveMode(BlackWhiteParams::TcMode::STD_BW), +algo("SP"), +luminanceCurve{ + FCT_Linear +}, +autoc(false), +enabledcc(true), +enabled(false), +filter("None"), +setting("NormalContrast"), +method("Desaturation"), +mixerRed(33), +mixerOrange(33), +mixerYellow(33), +mixerGreen(33), +mixerCyan(33), +mixerBlue(33), +mixerMagenta(33), +mixerPurple(33), +gammaRed(0), +gammaGreen(0), +gammaBlue(0) { } @@ -1934,7 +1941,7 @@ bool ResizeParams::operator !=(const ResizeParams& other) const return !(*this == other); } -const Glib::ustring ColorManagementParams::NoICMString = Glib::ustring ("No ICM: sRGB output"); +const Glib::ustring ColorManagementParams::NoICMString = Glib::ustring("No ICM: sRGB output"); ColorManagementParams::ColorManagementParams() : input("(cameraICC)"), @@ -1984,156 +1991,156 @@ bool ColorManagementParams::operator !=(const ColorManagementParams& other) cons WaveletParams::WaveletParams() : ccwcurve{ - static_cast(FCT_MinMaxCPoints), - 0.0, - 0.25, - 0.35, - 0.35, - 0.50, - 0.75, - 0.35, - 0.35, - 0.90, - 0.0, - 0.35, - 0.35 - }, - opacityCurveRG{ - static_cast(FCT_MinMaxCPoints), - 0.0, - 0.50, - 0.35, - 0.35, - 1.00, - 0.50, - 0.35, - 0.35 - }, - opacityCurveBY{ - static_cast(FCT_MinMaxCPoints), - 0.0, - 0.50, - 0.35, - 0.35, - 1.00, - 0.50, - 0.35, - 0.35 - }, - opacityCurveW{ - static_cast(FCT_MinMaxCPoints), - 0.00, - 0.35, - 0.35, - 0.00, - 0.35, - 0.75, - 0.35, - 0.35, - 0.60, - 0.75, - 0.35, - 0.35, - 1.00, - 0.35, - 0.00, - 0.00 - }, - opacityCurveWL{ - static_cast(FCT_MinMaxCPoints), - 0.0, - 0.50, - 0.35, - 0.35, - 1.00, - 0.50, - 0.35, - 0.35 - }, - hhcurve{ - FCT_Linear - }, - Chcurve{ - FCT_Linear - }, - wavclCurve { - DCT_Linear - }, - enabled(false), - median(false), - medianlev(false), - linkedg(true), - cbenab(false), - greenlow(0), - bluelow(0), - greenmed(0), - bluemed(0), - greenhigh(0), - bluehigh(0), - lipst(false), - avoid(false), - tmr(false), - strength(100), - balance(0), - iter(0), - expcontrast(false), - expchroma(false), - c{}, - ch{}, - expedge(false), - expresid(false), - expfinal(false), - exptoning(false), - expnoise(false), - Lmethod(4), - CLmethod("all"), - Backmethod("grey"), - Tilesmethod("full"), - daubcoeffmethod("4_"), - CHmethod("without"), - Medgreinf("less"), - CHSLmethod("SL"), - EDmethod("CU"), - NPmethod("none"), - BAmethod("none"), - TMmethod("cont"), - Dirmethod("all"), - HSmethod("with"), - rescon(0), - resconH(0), - reschro(0), - tmrs(0), - gamma(1), - sup(0), - sky(0.0), - thres(7), - chroma(5), - chro(0), - threshold(5), - threshold2(4), - edgedetect(90), - edgedetectthr(20), - edgedetectthr2(0), - edgesensi(60), - edgeampli(10), - contrast(0), - edgrad(15), - edgval(0), - edgthresh(10), - thr(35), - thrH(65), - skinprotect(0.0), - hueskin(-5, 25, 170, 120, false), - hueskin2(-260, -250, -130, -140, false), - hllev(50, 75, 100, 98, false), - bllev(0, 2, 50, 25, false), - pastlev(0, 2, 30, 20, false), - satlev(30, 45, 130, 100, false), - edgcont(0, 10, 75, 40, false), - level0noise(0, 0, false), - level1noise(0, 0, false), - level2noise(0, 0, false), - level3noise(0, 0, false) + static_cast(FCT_MinMaxCPoints), + 0.0, + 0.25, + 0.35, + 0.35, + 0.50, + 0.75, + 0.35, + 0.35, + 0.90, + 0.0, + 0.35, + 0.35 +}, +opacityCurveRG{ + static_cast(FCT_MinMaxCPoints), + 0.0, + 0.50, + 0.35, + 0.35, + 1.00, + 0.50, + 0.35, + 0.35 +}, +opacityCurveBY{ + static_cast(FCT_MinMaxCPoints), + 0.0, + 0.50, + 0.35, + 0.35, + 1.00, + 0.50, + 0.35, + 0.35 +}, +opacityCurveW{ + static_cast(FCT_MinMaxCPoints), + 0.00, + 0.35, + 0.35, + 0.00, + 0.35, + 0.75, + 0.35, + 0.35, + 0.60, + 0.75, + 0.35, + 0.35, + 1.00, + 0.35, + 0.00, + 0.00 +}, +opacityCurveWL{ + static_cast(FCT_MinMaxCPoints), + 0.0, + 0.50, + 0.35, + 0.35, + 1.00, + 0.50, + 0.35, + 0.35 +}, +hhcurve{ + FCT_Linear +}, +Chcurve{ + FCT_Linear +}, +wavclCurve { + DCT_Linear +}, +enabled(false), + median(false), + medianlev(false), + linkedg(true), + cbenab(false), + greenlow(0), + bluelow(0), + greenmed(0), + bluemed(0), + greenhigh(0), + bluehigh(0), + lipst(false), + avoid(false), + tmr(false), + strength(100), + balance(0), + iter(0), + expcontrast(false), + expchroma(false), + c{}, + ch{}, + expedge(false), + expresid(false), + expfinal(false), + exptoning(false), + expnoise(false), + Lmethod(4), + CLmethod("all"), + Backmethod("grey"), + Tilesmethod("full"), + daubcoeffmethod("4_"), + CHmethod("without"), + Medgreinf("less"), + CHSLmethod("SL"), + EDmethod("CU"), + NPmethod("none"), + BAmethod("none"), + TMmethod("cont"), + Dirmethod("all"), + HSmethod("with"), + rescon(0), + resconH(0), + reschro(0), + tmrs(0), + gamma(1), + sup(0), + sky(0.0), + thres(7), + chroma(5), + chro(0), + threshold(5), + threshold2(4), + edgedetect(90), + edgedetectthr(20), + edgedetectthr2(0), + edgesensi(60), + edgeampli(10), + contrast(0), + edgrad(15), + edgval(0), + edgthresh(10), + thr(35), + thrH(65), + skinprotect(0.0), + hueskin(-5, 25, 170, 120, false), + hueskin2(-260, -250, -130, -140, false), + hllev(50, 75, 100, 98, false), + bllev(0, 2, 50, 25, false), + pastlev(0, 2, 30, 20, false), + satlev(30, 45, 130, 100, false), + edgcont(0, 10, 75, 40, false), + level0noise(0, 0, false), + level1noise(0, 0, false), + level2noise(0, 0, false), + level3noise(0, 0, false) { } @@ -2167,69 +2174,70 @@ bool WaveletParams::operator ==(const WaveletParams& other) const && iter == other.iter && expcontrast == other.expcontrast && expchroma == other.expchroma - && [this, &other]() -> bool - { - for (unsigned int i = 0; i < 9; ++i) { - if (c[i] != other.c[i] || ch[i] != other.ch[i]) { - return false; - } - } - return true; - }() - && expedge == other.expedge - && expresid == other.expresid - && expfinal == other.expfinal - && exptoning == other.exptoning - && expnoise == other.expnoise - && Lmethod == other.Lmethod - && CLmethod == other.CLmethod - && Backmethod == other.Backmethod - && Tilesmethod == other.Tilesmethod - && daubcoeffmethod == other.daubcoeffmethod - && CHmethod == other.CHmethod - && Medgreinf == other.Medgreinf - && CHSLmethod == other.CHSLmethod - && EDmethod == other.EDmethod - && NPmethod == other.NPmethod - && BAmethod == other.BAmethod - && TMmethod == other.TMmethod - && Dirmethod == other.Dirmethod - && HSmethod == other.HSmethod - && rescon == other.rescon - && resconH == other.resconH - && reschro == other.reschro - && tmrs == other.tmrs - && gamma == other.gamma - && sup == other.sup - && sky == other.sky - && thres == other.thres - && chroma == other.chroma - && chro == other.chro - && threshold == other.threshold - && threshold2 == other.threshold2 - && edgedetect == other.edgedetect - && edgedetectthr == other.edgedetectthr - && edgedetectthr2 == other.edgedetectthr2 - && edgesensi == other.edgesensi - && edgeampli == other.edgeampli - && contrast == other.contrast - && edgrad == other.edgrad - && edgval == other.edgval - && edgthresh == other.edgthresh - && thr == other.thr - && thrH == other.thrH - && skinprotect == other.skinprotect - && hueskin == other.hueskin - && hueskin2 == other.hueskin2 - && hllev == other.hllev - && bllev == other.bllev - && pastlev == other.pastlev - && satlev == other.satlev - && edgcont == other.edgcont - && level0noise == other.level0noise - && level1noise == other.level1noise - && level2noise == other.level2noise - && level3noise == other.level3noise; + && [this, &other]() -> bool { + for (unsigned int i = 0; i < 9; ++i) + { + if (c[i] != other.c[i] || ch[i] != other.ch[i]) { + return false; + } + } + + return true; + }() + && expedge == other.expedge + && expresid == other.expresid + && expfinal == other.expfinal + && exptoning == other.exptoning + && expnoise == other.expnoise + && Lmethod == other.Lmethod + && CLmethod == other.CLmethod + && Backmethod == other.Backmethod + && Tilesmethod == other.Tilesmethod + && daubcoeffmethod == other.daubcoeffmethod + && CHmethod == other.CHmethod + && Medgreinf == other.Medgreinf + && CHSLmethod == other.CHSLmethod + && EDmethod == other.EDmethod + && NPmethod == other.NPmethod + && BAmethod == other.BAmethod + && TMmethod == other.TMmethod + && Dirmethod == other.Dirmethod + && HSmethod == other.HSmethod + && rescon == other.rescon + && resconH == other.resconH + && reschro == other.reschro + && tmrs == other.tmrs + && gamma == other.gamma + && sup == other.sup + && sky == other.sky + && thres == other.thres + && chroma == other.chroma + && chro == other.chro + && threshold == other.threshold + && threshold2 == other.threshold2 + && edgedetect == other.edgedetect + && edgedetectthr == other.edgedetectthr + && edgedetectthr2 == other.edgedetectthr2 + && edgesensi == other.edgesensi + && edgeampli == other.edgeampli + && contrast == other.contrast + && edgrad == other.edgrad + && edgval == other.edgval + && edgthresh == other.edgthresh + && thr == other.thr + && thrH == other.thrH + && skinprotect == other.skinprotect + && hueskin == other.hueskin + && hueskin2 == other.hueskin2 + && hllev == other.hllev + && bllev == other.bllev + && pastlev == other.pastlev + && satlev == other.satlev + && edgcont == other.edgcont + && level0noise == other.level0noise + && level1noise == other.level1noise + && level2noise == other.level2noise + && level3noise == other.level3noise; } bool WaveletParams::operator !=(const WaveletParams& other) const @@ -2245,11 +2253,11 @@ void WaveletParams::getCurves( WavOpacityCurveWL& opacityCurveLUTWL ) const { - cCurve.Set (this->ccwcurve); - opacityCurveLUTRG.Set (this->opacityCurveRG); - opacityCurveLUTBY.Set (this->opacityCurveBY); - opacityCurveLUTW.Set (this->opacityCurveW); - opacityCurveLUTWL.Set (this->opacityCurveWL); + cCurve.Set(this->ccwcurve); + opacityCurveLUTRG.Set(this->opacityCurveRG); + opacityCurveLUTBY.Set(this->opacityCurveBY); + opacityCurveLUTW.Set(this->opacityCurveW); + opacityCurveLUTWL.Set(this->opacityCurveWL); } @@ -2257,17 +2265,17 @@ DirPyrEqualizerParams::DirPyrEqualizerParams() : enabled(false), gamutlab(false), mult{ - 1.0, - 1.0, - 1.0, - 1.0, - 1.0, - 1.0 - }, - threshold(0.2), - skinprotect(0.0), - hueskin (-5, 25, 170, 120, false), - cbdlMethod("bef") + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0 +}, +threshold(0.2), +skinprotect(0.0), +hueskin(-5, 25, 170, 120, false), +cbdlMethod("bef") { } @@ -2276,19 +2284,20 @@ bool DirPyrEqualizerParams::operator ==(const DirPyrEqualizerParams& other) cons return enabled == other.enabled && gamutlab == other.gamutlab - && [this, &other]() -> bool - { - for (unsigned int i = 0; i < 6; ++i) { - if (mult[i] != other.mult[i]) { - return false; - } - } - return true; - }() - && threshold == other.threshold - && skinprotect == other.skinprotect - && hueskin == other.hueskin - && cbdlMethod == other.cbdlMethod; + && [this, &other]() -> bool { + for (unsigned int i = 0; i < 6; ++i) + { + if (mult[i] != other.mult[i]) { + return false; + } + } + + return true; + }() + && threshold == other.threshold + && skinprotect == other.skinprotect + && hueskin == other.hueskin + && cbdlMethod == other.cbdlMethod; } bool DirPyrEqualizerParams::operator !=(const DirPyrEqualizerParams& other) const @@ -2299,14 +2308,14 @@ bool DirPyrEqualizerParams::operator !=(const DirPyrEqualizerParams& other) cons HSVEqualizerParams::HSVEqualizerParams() : enabled(false), hcurve{ - FCT_Linear - }, - scurve{ - FCT_Linear - }, - vcurve{ - FCT_Linear - } + FCT_Linear +}, +scurve{ + FCT_Linear +}, +vcurve{ + FCT_Linear +} { } @@ -2627,12 +2636,12 @@ bool MetaDataParams::operator!=(const MetaDataParams &other) const } -ProcParams::ProcParams () +ProcParams::ProcParams() { - setDefaults (); + setDefaults(); } -void ProcParams::setDefaults () +void ProcParams::setDefaults() { toneCurve = ToneCurveParams(); @@ -2716,8 +2725,8 @@ void ProcParams::setDefaults () raw = RAWParams(); metadata = MetaDataParams(); - exif.clear (); - iptc.clear (); + exif.clear(); + iptc.clear(); rank = 0; colorlabel = 0; @@ -2728,7 +2737,7 @@ void ProcParams::setDefaults () int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bool fnameAbsolute, ParamsEdited* pedited) { - if (fname.empty () && fname2.empty ()) { + if (fname.empty() && fname2.empty()) { return 0; } @@ -2738,8 +2747,8 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo Glib::KeyFile keyFile; // Version - keyFile.set_string ("Version", "AppVersion", RTVERSION); - keyFile.set_integer ("Version", "Version", PPVERSION); + keyFile.set_string("Version", "AppVersion", RTVERSION); + keyFile.set_integer("Version", "Version", PPVERSION); saveToKeyfile(!pedited || pedited->general.rank, "General", "Rank", rank, keyFile); saveToKeyfile(!pedited || pedited->general.colorlabel, "General", "ColorLabel", colorlabel, keyFile); @@ -2766,7 +2775,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo {ToneCurveParams::TcMode::STD, "Standard"}, {ToneCurveParams::TcMode::FILMLIKE, "FilmLike"}, {ToneCurveParams::TcMode::SATANDVALBLENDING, "SatAndValueBlending"}, - {ToneCurveParams::TcMode::WEIGHTEDSTD,"WeightedStd"}, + {ToneCurveParams::TcMode::WEIGHTEDSTD, "WeightedStd"}, {ToneCurveParams::TcMode::LUMINANCE, "Luminance"}, {ToneCurveParams::TcMode::PERCEPTUAL, "Perceptual"} }; @@ -2821,19 +2830,20 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo // Channel mixer saveToKeyfile(!pedited || pedited->chmixer.enabled, "Channel Mixer", "Enabled", chmixer.enabled, keyFile); + if (!pedited || pedited->chmixer.red[0] || pedited->chmixer.red[1] || pedited->chmixer.red[2]) { - Glib::ArrayHandle rmix (chmixer.red, 3, Glib::OWNERSHIP_NONE); - keyFile.set_integer_list ("Channel Mixer", "Red", rmix); + Glib::ArrayHandle rmix(chmixer.red, 3, Glib::OWNERSHIP_NONE); + keyFile.set_integer_list("Channel Mixer", "Red", rmix); } if (!pedited || pedited->chmixer.green[0] || pedited->chmixer.green[1] || pedited->chmixer.green[2]) { - Glib::ArrayHandle gmix (chmixer.green, 3, Glib::OWNERSHIP_NONE); - keyFile.set_integer_list ("Channel Mixer", "Green", gmix); + Glib::ArrayHandle gmix(chmixer.green, 3, Glib::OWNERSHIP_NONE); + keyFile.set_integer_list("Channel Mixer", "Green", gmix); } if (!pedited || pedited->chmixer.blue[0] || pedited->chmixer.blue[1] || pedited->chmixer.blue[2]) { - Glib::ArrayHandle bmix (chmixer.blue, 3, Glib::OWNERSHIP_NONE); - keyFile.set_integer_list ("Channel Mixer", "Blue", bmix); + Glib::ArrayHandle bmix(chmixer.blue, 3, Glib::OWNERSHIP_NONE); + keyFile.set_integer_list("Channel Mixer", "Blue", bmix); } // Black & White @@ -2859,28 +2869,26 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile( !pedited || pedited->blackwhite.beforeCurveMode, "Black & White", - "BeforeCurveMode", - { - {BlackWhiteParams::TcMode::STD_BW, "Standard"}, - {BlackWhiteParams::TcMode::FILMLIKE_BW, "FilmLike"}, - {BlackWhiteParams::TcMode::SATANDVALBLENDING_BW, "SatAndValueBlending"}, - {BlackWhiteParams::TcMode::WEIGHTEDSTD_BW, "WeightedStd"} + "BeforeCurveMode", { + {BlackWhiteParams::TcMode::STD_BW, "Standard"}, + {BlackWhiteParams::TcMode::FILMLIKE_BW, "FilmLike"}, + {BlackWhiteParams::TcMode::SATANDVALBLENDING_BW, "SatAndValueBlending"}, + {BlackWhiteParams::TcMode::WEIGHTEDSTD_BW, "WeightedStd"} - }, - blackwhite.beforeCurveMode, - keyFile + }, + blackwhite.beforeCurveMode, + keyFile ); saveToKeyfile( !pedited || pedited->blackwhite.afterCurveMode, "Black & White", - "AfterCurveMode", - { - {BlackWhiteParams::TcMode::STD_BW, "Standard"}, - {BlackWhiteParams::TcMode::WEIGHTEDSTD_BW, "WeightedStd"} + "AfterCurveMode", { + {BlackWhiteParams::TcMode::STD_BW, "Standard"}, + {BlackWhiteParams::TcMode::WEIGHTEDSTD_BW, "WeightedStd"} - }, - blackwhite.afterCurveMode, - keyFile + }, + blackwhite.afterCurveMode, + keyFile ); saveToKeyfile(!pedited || pedited->blackwhite.beforeCurve, "Black & White", "BeforeCurve", blackwhite.beforeCurve, keyFile); saveToKeyfile(!pedited || pedited->blackwhite.afterCurve, "Black & White", "AfterCurve", blackwhite.afterCurve, keyFile); @@ -2994,15 +3002,14 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile( !pedited || pedited->colorappearance.curveMode3, "Color appearance", - "CurveMode3", - { - {ColorAppearanceParams::CtcMode::CHROMA, "Chroma"}, - {ColorAppearanceParams::CtcMode::SATUR, "Saturation"}, - {ColorAppearanceParams::CtcMode::COLORF, "Colorfullness"} + "CurveMode3", { + {ColorAppearanceParams::CtcMode::CHROMA, "Chroma"}, + {ColorAppearanceParams::CtcMode::SATUR, "Saturation"}, + {ColorAppearanceParams::CtcMode::COLORF, "Colorfullness"} - }, - colorappearance.curveMode3, - keyFile + }, + colorappearance.curveMode3, + keyFile ); saveToKeyfile(!pedited || pedited->colorappearance.curve, "Color appearance", "Curve", colorappearance.curve, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.curve2, "Color appearance", "Curve2", colorappearance.curve2, keyFile); @@ -3027,13 +3034,17 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->dirpyrDenoise.chroma, "Directional Pyramid Denoising", "Chroma", dirpyrDenoise.chroma, keyFile); saveToKeyfile(!pedited || pedited->dirpyrDenoise.dmethod, "Directional Pyramid Denoising", "Method", dirpyrDenoise.dmethod, keyFile); saveToKeyfile(!pedited || pedited->dirpyrDenoise.Lmethod, "Directional Pyramid Denoising", "LMethod", dirpyrDenoise.Lmethod, keyFile); + if (dirpyrDenoise.Cmethod == "PRE") { dirpyrDenoise.Cmethod = "MAN"; // Never save 'auto chroma preview mode' to pp3 } + saveToKeyfile(!pedited || pedited->dirpyrDenoise.Cmethod, "Directional Pyramid Denoising", "CMethod", dirpyrDenoise.Cmethod, keyFile); + if (dirpyrDenoise.C2method == "PREV") { dirpyrDenoise.C2method = "MANU"; } + saveToKeyfile(!pedited || pedited->dirpyrDenoise.C2method, "Directional Pyramid Denoising", "C2Method", dirpyrDenoise.C2method, keyFile); saveToKeyfile(!pedited || pedited->dirpyrDenoise.smethod, "Directional Pyramid Denoising", "SMethod", dirpyrDenoise.smethod, keyFile); saveToKeyfile(!pedited || pedited->dirpyrDenoise.medmethod, "Directional Pyramid Denoising", "MedMethod", dirpyrDenoise.medmethod, keyFile); @@ -3095,8 +3106,8 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->distortion.amount, "Distortion", "Amount", distortion.amount, keyFile); // Lens profile - saveToKeyfile(!pedited || pedited->lensProf.lcMode, "LensProfile", "LcMode", lensProf.getMethodString (lensProf.lcMode), keyFile); - saveToKeyfile(!pedited || pedited->lensProf.lcpFile, "LensProfile", "LCPFile", relativePathIfInside (fname, fnameAbsolute, lensProf.lcpFile), keyFile); + saveToKeyfile(!pedited || pedited->lensProf.lcMode, "LensProfile", "LcMode", lensProf.getMethodString(lensProf.lcMode), keyFile); + saveToKeyfile(!pedited || pedited->lensProf.lcpFile, "LensProfile", "LCPFile", relativePathIfInside(fname, fnameAbsolute, lensProf.lcpFile), keyFile); saveToKeyfile(!pedited || pedited->lensProf.useDist, "LensProfile", "UseDistortion", lensProf.useDist, keyFile); saveToKeyfile(!pedited || pedited->lensProf.useVign, "LensProfile", "UseVignette", lensProf.useVign, keyFile); saveToKeyfile(!pedited || pedited->lensProf.useCA, "LensProfile", "UseCA", lensProf.useCA, keyFile); @@ -3159,7 +3170,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->prsharpening.deconviter, "PostResizeSharpening", "DeconvIterations", prsharpening.deconviter, keyFile); // Color management - saveToKeyfile(!pedited || pedited->icm.input, "Color Management", "InputProfile", relativePathIfInside (fname, fnameAbsolute, icm.input), keyFile); + saveToKeyfile(!pedited || pedited->icm.input, "Color Management", "InputProfile", relativePathIfInside(fname, fnameAbsolute, icm.input), keyFile); saveToKeyfile(!pedited || pedited->icm.toneCurve, "Color Management", "ToneCurve", icm.toneCurve, keyFile); saveToKeyfile(!pedited || pedited->icm.applyLookTable, "Color Management", "ApplyLookTable", icm.applyLookTable, keyFile); saveToKeyfile(!pedited || pedited->icm.applyBaselineExposureOffset, "Color Management", "ApplyBaselineExposureOffset", icm.applyBaselineExposureOffset, keyFile); @@ -3170,16 +3181,15 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile( !pedited || pedited->icm.outputIntent, "Color Management", - "OutputProfileIntent", - { - {RI_PERCEPTUAL, "Perceptual"}, - {RI_RELATIVE, "Relative"}, - {RI_SATURATION, "Saturation"}, - {RI_ABSOLUTE, "Absolute"} + "OutputProfileIntent", { + {RI_PERCEPTUAL, "Perceptual"}, + {RI_RELATIVE, "Relative"}, + {RI_SATURATION, "Saturation"}, + {RI_ABSOLUTE, "Absolute"} - }, - icm.outputIntent, - keyFile + }, + icm.outputIntent, + keyFile ); saveToKeyfile(!pedited || pedited->icm.outputBPC, "Color Management", "OutputBPC", icm.outputBPC, keyFile); saveToKeyfile(!pedited || pedited->icm.gamma, "Color Management", "Gammafree", icm.gamma, keyFile); @@ -3353,9 +3363,9 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->colorToning.labgridBHigh, "ColorToning", "LabGridBHigh", colorToning.labgridBHigh, keyFile); // Raw - saveToKeyfile(!pedited || pedited->raw.darkFrame, "RAW", "DarkFrame", relativePathIfInside (fname, fnameAbsolute, raw.dark_frame), keyFile); + saveToKeyfile(!pedited || pedited->raw.darkFrame, "RAW", "DarkFrame", relativePathIfInside(fname, fnameAbsolute, raw.dark_frame), keyFile); saveToKeyfile(!pedited || pedited->raw.df_autoselect, "RAW", "DarkFrameAuto", raw.df_autoselect, keyFile); - saveToKeyfile(!pedited || pedited->raw.ff_file, "RAW", "FlatFieldFile", relativePathIfInside (fname, fnameAbsolute, raw.ff_file), keyFile); + saveToKeyfile(!pedited || pedited->raw.ff_file, "RAW", "FlatFieldFile", relativePathIfInside(fname, fnameAbsolute, raw.ff_file), keyFile); saveToKeyfile(!pedited || pedited->raw.ff_AutoSelect, "RAW", "FlatFieldAutoSelect", raw.ff_AutoSelect, keyFile); saveToKeyfile(!pedited || pedited->raw.ff_BlurRadius, "RAW", "FlatFieldBlurRadius", raw.ff_BlurRadius, keyFile); saveToKeyfile(!pedited || pedited->raw.ff_BlurType, "RAW", "FlatFieldBlurType", raw.ff_BlurType, keyFile); @@ -3429,7 +3439,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo // EXIF change list if (!pedited || pedited->exif) { for (ExifPairs::const_iterator i = exif.begin(); i != exif.end(); ++i) { - keyFile.set_string ("Exif", i->first, i->second); + keyFile.set_string("Exif", i->first, i->second); } } @@ -3437,7 +3447,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo if (!pedited || pedited->iptc) { for (IPTCPairs::const_iterator i = iptc.begin(); i != iptc.end(); ++i) { Glib::ArrayHandle values = i->second; - keyFile.set_string_list ("IPTC", i->first, values); + keyFile.set_string_list("IPTC", i->first, values); } } @@ -3445,16 +3455,16 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo } catch (Glib::KeyFileError&) {} - if (sPParams.empty ()) { + if (sPParams.empty()) { return 1; } int error1, error2; - error1 = write (fname, sPParams); + error1 = write(fname, sPParams); - if (!fname2.empty ()) { + if (!fname2.empty()) { - error2 = write (fname2, sPParams); + error2 = write(fname2, sPParams); // If at least one file has been saved, it's a success return error1 & error2; } else { @@ -3464,7 +3474,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) { - setlocale (LC_NUMERIC, "C"); // to set decimal point to "." + setlocale(LC_NUMERIC, "C"); // to set decimal point to "." if (fname.empty()) { return 1; @@ -3474,39 +3484,40 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) try { if (pedited) { - pedited->set (false); + pedited->set(false); } if (!Glib::file_test(fname, Glib::FILE_TEST_EXISTS) || - !keyFile.load_from_file(fname)) { + !keyFile.load_from_file(fname)) { return 1; } ppVersion = PPVERSION; appVersion = RTVERSION; - if (keyFile.has_group ("Version")) { - if (keyFile.has_key ("Version", "AppVersion")) { - appVersion = keyFile.get_string ("Version", "AppVersion"); + if (keyFile.has_group("Version")) { + if (keyFile.has_key("Version", "AppVersion")) { + appVersion = keyFile.get_string("Version", "AppVersion"); } - if (keyFile.has_key ("Version", "Version")) { - ppVersion = keyFile.get_integer ("Version", "Version"); + if (keyFile.has_key("Version", "Version")) { + ppVersion = keyFile.get_integer("Version", "Version"); } } - if (keyFile.has_group ("General")) { + if (keyFile.has_group("General")) { assignFromKeyfile(keyFile, "General", "Rank", pedited, rank, pedited->general.rank); assignFromKeyfile(keyFile, "General", "ColorLabel", pedited, colorlabel, pedited->general.colorlabel); assignFromKeyfile(keyFile, "General", "InTrash", pedited, inTrash, pedited->general.intrash); } - if (keyFile.has_group ("Exposure")) { + if (keyFile.has_group("Exposure")) { if (ppVersion < PPVERSION_AEXP) { toneCurve.autoexp = false; // prevent execution of autoexp when opening file created with earlier versions of autoexp algorithm } else { assignFromKeyfile(keyFile, "Exposure", "Auto", pedited, toneCurve.autoexp, pedited->toneCurve.autoexp); } + assignFromKeyfile(keyFile, "Exposure", "Clip", pedited, toneCurve.clip, pedited->toneCurve.clip); assignFromKeyfile(keyFile, "Exposure", "Compensation", pedited, toneCurve.expcomp, pedited->toneCurve.expcomp); assignFromKeyfile(keyFile, "Exposure", "Brightness", pedited, toneCurve.brightness, pedited->toneCurve.brightness); @@ -3516,6 +3527,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Exposure", "HighlightCompr", pedited, toneCurve.hlcompr, pedited->toneCurve.hlcompr); assignFromKeyfile(keyFile, "Exposure", "HighlightComprThreshold", pedited, toneCurve.hlcomprthresh, pedited->toneCurve.hlcomprthresh); assignFromKeyfile(keyFile, "Exposure", "ShadowCompr", pedited, toneCurve.shcompr, pedited->toneCurve.shcompr); + if (toneCurve.shcompr > 100) { toneCurve.shcompr = 100; // older pp3 files can have values above 100. } @@ -3536,32 +3548,35 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Exposure", "Curve", pedited, toneCurve.curve, pedited->toneCurve.curve); assignFromKeyfile(keyFile, "Exposure", "Curve2", pedited, toneCurve.curve2, pedited->toneCurve.curve2); } + assignFromKeyfile(keyFile, "Exposure", "HistogramMatching", pedited, toneCurve.histmatching, pedited->toneCurve.histmatching); } - if (keyFile.has_group ("HLRecovery")) { + if (keyFile.has_group("HLRecovery")) { assignFromKeyfile(keyFile, "HLRecovery", "Enabled", pedited, toneCurve.hrenabled, pedited->toneCurve.hrenabled); assignFromKeyfile(keyFile, "HLRecovery", "Method", pedited, toneCurve.method, pedited->toneCurve.method); } - if (keyFile.has_group ("Channel Mixer")) { + if (keyFile.has_group("Channel Mixer")) { if (ppVersion >= 329) { assignFromKeyfile(keyFile, "Channel Mixer", "Enabled", pedited, chmixer.enabled, pedited->chmixer.enabled); } else { chmixer.enabled = true; + if (pedited) { pedited->chmixer.enabled = true; } } - if (keyFile.has_key ("Channel Mixer", "Red") && keyFile.has_key ("Channel Mixer", "Green") && keyFile.has_key ("Channel Mixer", "Blue")) { - const std::vector rmix = keyFile.get_integer_list ("Channel Mixer", "Red"); - const std::vector gmix = keyFile.get_integer_list ("Channel Mixer", "Green"); - const std::vector bmix = keyFile.get_integer_list ("Channel Mixer", "Blue"); + + if (keyFile.has_key("Channel Mixer", "Red") && keyFile.has_key("Channel Mixer", "Green") && keyFile.has_key("Channel Mixer", "Blue")) { + const std::vector rmix = keyFile.get_integer_list("Channel Mixer", "Red"); + const std::vector gmix = keyFile.get_integer_list("Channel Mixer", "Green"); + const std::vector bmix = keyFile.get_integer_list("Channel Mixer", "Blue"); if (rmix.size() == 3 && gmix.size() == 3 && bmix.size() == 3) { - memcpy (chmixer.red, rmix.data(), 3 * sizeof (int)); - memcpy (chmixer.green, gmix.data(), 3 * sizeof (int)); - memcpy (chmixer.blue, bmix.data(), 3 * sizeof (int)); + memcpy(chmixer.red, rmix.data(), 3 * sizeof(int)); + memcpy(chmixer.green, gmix.data(), 3 * sizeof(int)); + memcpy(chmixer.blue, bmix.data(), 3 * sizeof(int)); } if (pedited) { @@ -3572,7 +3587,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } } - if (keyFile.has_group ("Black & White")) { + if (keyFile.has_group("Black & White")) { assignFromKeyfile(keyFile, "Black & White", "Enabled", pedited, blackwhite.enabled, pedited->blackwhite.enabled); assignFromKeyfile(keyFile, "Black & White", "Method", pedited, blackwhite.method, pedited->blackwhite.method); assignFromKeyfile(keyFile, "Black & White", "Auto", pedited, blackwhite.autoc, pedited->blackwhite.autoc); @@ -3599,15 +3614,14 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) keyFile, "Black & White", "BeforeCurveMode", - pedited, - { - {"Standard", BlackWhiteParams::TcMode::STD_BW}, - {"FilmLike", BlackWhiteParams::TcMode::FILMLIKE_BW}, - {"SatAndValueBlending", BlackWhiteParams::TcMode::SATANDVALBLENDING_BW}, - {"WeightedStd", BlackWhiteParams::TcMode::WEIGHTEDSTD_BW} - }, - blackwhite.beforeCurveMode, - pedited->blackwhite.beforeCurveMode + pedited, { + {"Standard", BlackWhiteParams::TcMode::STD_BW}, + {"FilmLike", BlackWhiteParams::TcMode::FILMLIKE_BW}, + {"SatAndValueBlending", BlackWhiteParams::TcMode::SATANDVALBLENDING_BW}, + {"WeightedStd", BlackWhiteParams::TcMode::WEIGHTEDSTD_BW} + }, + blackwhite.beforeCurveMode, + pedited->blackwhite.beforeCurveMode ); assignFromKeyfile(keyFile, "Black & White", "AfterCurve", pedited, blackwhite.afterCurve, pedited->blackwhite.afterCurve); @@ -3615,17 +3629,16 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) keyFile, "Black & White", "AfterCurveMode", - pedited, - { - {"Standard", BlackWhiteParams::TcMode::STD_BW}, - {"WeightedStd", BlackWhiteParams::TcMode::WEIGHTEDSTD_BW} - }, - blackwhite.afterCurveMode, - pedited->blackwhite.afterCurveMode + pedited, { + {"Standard", BlackWhiteParams::TcMode::STD_BW}, + {"WeightedStd", BlackWhiteParams::TcMode::WEIGHTEDSTD_BW} + }, + blackwhite.afterCurveMode, + pedited->blackwhite.afterCurveMode ); } - if (keyFile.has_group ("Retinex")) { + if (keyFile.has_group("Retinex")) { assignFromKeyfile(keyFile, "Retinex", "Median", pedited, retinex.medianmap, pedited->retinex.medianmap); assignFromKeyfile(keyFile, "Retinex", "RetinexMethod", pedited, retinex.retinexMethod, pedited->retinex.retinexMethod); assignFromKeyfile(keyFile, "Retinex", "mapMethod", pedited, retinex.mapMethod, pedited->retinex.mapMethod); @@ -3675,11 +3688,12 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Local Contrast", "Lightness", pedited, localContrast.lightness, pedited->localContrast.lightness); } - if (keyFile.has_group ("Luminance Curve")) { + if (keyFile.has_group("Luminance Curve")) { if (ppVersion >= 329) { assignFromKeyfile(keyFile, "Luminance Curve", "Enabled", pedited, labCurve.enabled, pedited->labCurve.enabled); } else { labCurve.enabled = true; + if (pedited) { pedited->labCurve.enabled = true; } @@ -3695,8 +3709,8 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) // transform AvoidColorClipping into AvoidColorShift assignFromKeyfile(keyFile, "Luminance Curve", "AvoidColorClipping", pedited, labCurve.avoidcolorshift, pedited->labCurve.avoidcolorshift); } else { - if (keyFile.has_key ("Luminance Curve", "Chromaticity")) { - labCurve.chromaticity = keyFile.get_integer ("Luminance Curve", "Chromaticity"); + if (keyFile.has_key("Luminance Curve", "Chromaticity")) { + labCurve.chromaticity = keyFile.get_integer("Luminance Curve", "Chromaticity"); if (ppVersion >= 303 && ppVersion < 314 && labCurve.chromaticity == -100) { blackwhite.enabled = true; @@ -3716,8 +3730,8 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) if (ppVersion < 314) { // Backward compatibility: If BWtoning is true, Chromaticity has to be set to -100, which will produce the same effect // and will enable the b&w toning mode ('a' & 'b' curves) - if (keyFile.has_key ("Luminance Curve", "BWtoning")) { - if ( keyFile.get_boolean ("Luminance Curve", "BWtoning")) { + if (keyFile.has_key("Luminance Curve", "BWtoning")) { + if (keyFile.get_boolean("Luminance Curve", "BWtoning")) { labCurve.chromaticity = -100; if (pedited) { @@ -3738,20 +3752,20 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Luminance Curve", "ClCurve", pedited, labCurve.clcurve, pedited->labCurve.clcurve); } - if (keyFile.has_group ("Sharpening")) { + if (keyFile.has_group("Sharpening")) { assignFromKeyfile(keyFile, "Sharpening", "Enabled", pedited, sharpening.enabled, pedited->sharpening.enabled); assignFromKeyfile(keyFile, "Sharpening", "Radius", pedited, sharpening.radius, pedited->sharpening.radius); assignFromKeyfile(keyFile, "Sharpening", "Amount", pedited, sharpening.amount, pedited->sharpening.amount); - if (keyFile.has_key ("Sharpening", "Threshold")) { + if (keyFile.has_key("Sharpening", "Threshold")) { if (ppVersion < 302) { - int thresh = min (keyFile.get_integer ("Sharpening", "Threshold"), 2000); - sharpening.threshold.setValues (thresh, thresh, 2000, 2000); // TODO: 2000 is the maximum value and is taken of rtgui/sharpening.cc ; should be changed by the tool modularization + int thresh = min(keyFile.get_integer("Sharpening", "Threshold"), 2000); + sharpening.threshold.setValues(thresh, thresh, 2000, 2000); // TODO: 2000 is the maximum value and is taken of rtgui/sharpening.cc ; should be changed by the tool modularization } else { - const std::vector thresh = keyFile.get_integer_list ("Sharpening", "Threshold"); + const std::vector thresh = keyFile.get_integer_list("Sharpening", "Threshold"); if (thresh.size() >= 4) { - sharpening.threshold.setValues (thresh[0], thresh[1], min (thresh[2], 2000), min (thresh[3], 2000)); + sharpening.threshold.setValues(thresh[0], thresh[1], min(thresh[2], 2000), min(thresh[3], 2000)); } } @@ -3772,34 +3786,34 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Sharpening", "DeconvIterations", pedited, sharpening.deconviter, pedited->sharpening.deconviter); } - if (keyFile.has_group ("SharpenEdge")) { + if (keyFile.has_group("SharpenEdge")) { assignFromKeyfile(keyFile, "SharpenEdge", "Enabled", pedited, sharpenEdge.enabled, pedited->sharpenEdge.enabled); assignFromKeyfile(keyFile, "SharpenEdge", "Passes", pedited, sharpenEdge.passes, pedited->sharpenEdge.passes); assignFromKeyfile(keyFile, "SharpenEdge", "Strength", pedited, sharpenEdge.amount, pedited->sharpenEdge.amount); assignFromKeyfile(keyFile, "SharpenEdge", "ThreeChannels", pedited, sharpenEdge.threechannels, pedited->sharpenEdge.threechannels); } - if (keyFile.has_group ("SharpenMicro")) { + if (keyFile.has_group("SharpenMicro")) { assignFromKeyfile(keyFile, "SharpenMicro", "Enabled", pedited, sharpenMicro.enabled, pedited->sharpenMicro.enabled); assignFromKeyfile(keyFile, "SharpenMicro", "Matrix", pedited, sharpenMicro.matrix, pedited->sharpenMicro.matrix); assignFromKeyfile(keyFile, "SharpenMicro", "Strength", pedited, sharpenMicro.amount, pedited->sharpenMicro.amount); assignFromKeyfile(keyFile, "SharpenMicro", "Uniformity", pedited, sharpenMicro.uniformity, pedited->sharpenMicro.uniformity); } - if (keyFile.has_group ("Vibrance")) { + if (keyFile.has_group("Vibrance")) { assignFromKeyfile(keyFile, "Vibrance", "Enabled", pedited, vibrance.enabled, pedited->vibrance.enabled); assignFromKeyfile(keyFile, "Vibrance", "Pastels", pedited, vibrance.pastels, pedited->vibrance.pastels); assignFromKeyfile(keyFile, "Vibrance", "Saturated", pedited, vibrance.saturated, pedited->vibrance.saturated); - if (keyFile.has_key ("Vibrance", "PSThreshold")) { + if (keyFile.has_key("Vibrance", "PSThreshold")) { if (ppVersion < 302) { - int thresh = keyFile.get_integer ("Vibrance", "PSThreshold"); - vibrance.psthreshold.setValues (thresh, thresh); + int thresh = keyFile.get_integer("Vibrance", "PSThreshold"); + vibrance.psthreshold.setValues(thresh, thresh); } else { - const std::vector thresh = keyFile.get_integer_list ("Vibrance", "PSThreshold"); + const std::vector thresh = keyFile.get_integer_list("Vibrance", "PSThreshold"); - if (thresh.size() >= 2 ) { - vibrance.psthreshold.setValues (thresh[0], thresh[1]); + if (thresh.size() >= 2) { + vibrance.psthreshold.setValues(thresh[0], thresh[1]); } } @@ -3814,7 +3828,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Vibrance", "SkinTonesCurve", pedited, vibrance.skintonescurve, pedited->vibrance.skintonescurve); } - if (keyFile.has_group ("White Balance")) { + if (keyFile.has_group("White Balance")) { assignFromKeyfile(keyFile, "White Balance", "Enabled", pedited, wb.enabled, pedited->wb.enabled); assignFromKeyfile(keyFile, "White Balance", "Setting", pedited, wb.method, pedited->wb.method); assignFromKeyfile(keyFile, "White Balance", "Temperature", pedited, wb.temperature, pedited->wb.temperature); @@ -3823,12 +3837,12 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "White Balance", "TemperatureBias", pedited, wb.tempBias, pedited->wb.tempBias); } - if (keyFile.has_group ("Defringing")) { + if (keyFile.has_group("Defringing")) { assignFromKeyfile(keyFile, "Defringing", "Enabled", pedited, defringe.enabled, pedited->defringe.enabled); assignFromKeyfile(keyFile, "Defringing", "Radius", pedited, defringe.radius, pedited->defringe.radius); - if (keyFile.has_key ("Defringing", "Threshold")) { - defringe.threshold = (float)keyFile.get_integer ("Defringing", "Threshold"); + if (keyFile.has_key("Defringing", "Threshold")) { + defringe.threshold = (float)keyFile.get_integer("Defringing", "Threshold"); if (pedited) { pedited->defringe.threshold = true; @@ -3836,13 +3850,13 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } if (ppVersion < 310) { - defringe.threshold = sqrt (defringe.threshold * 33.f / 5.f); + defringe.threshold = sqrt(defringe.threshold * 33.f / 5.f); } assignFromKeyfile(keyFile, "Defringing", "HueCurve", pedited, defringe.huecurve, pedited->defringe.huecurve); } - if (keyFile.has_group ("Color appearance")) { + if (keyFile.has_group("Color appearance")) { assignFromKeyfile(keyFile, "Color appearance", "Enabled", pedited, colorappearance.enabled, pedited->colorappearance.enabled); assignFromKeyfile(keyFile, "Color appearance", "Degree", pedited, colorappearance.degree, pedited->colorappearance.degree); assignFromKeyfile(keyFile, "Color appearance", "AutoDegree", pedited, colorappearance.autodegree, pedited->colorappearance.autodegree); @@ -3890,14 +3904,13 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) keyFile, "Color appearance", "CurveMode3", - pedited, - { - {"Chroma", ColorAppearanceParams::CtcMode::CHROMA}, - {"Saturation", ColorAppearanceParams::CtcMode::SATUR}, - {"Colorfullness", ColorAppearanceParams::CtcMode::COLORF} - }, - colorappearance.curveMode3, - pedited->colorappearance.curveMode3 + pedited, { + {"Chroma", ColorAppearanceParams::CtcMode::CHROMA}, + {"Saturation", ColorAppearanceParams::CtcMode::SATUR}, + {"Colorfullness", ColorAppearanceParams::CtcMode::COLORF} + }, + colorappearance.curveMode3, + pedited->colorappearance.curveMode3 ); if (ppVersion > 200) { @@ -3908,12 +3921,12 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } - if (keyFile.has_group ("Impulse Denoising")) { + if (keyFile.has_group("Impulse Denoising")) { assignFromKeyfile(keyFile, "Impulse Denoising", "Enabled", pedited, impulseDenoise.enabled, pedited->impulseDenoise.enabled); assignFromKeyfile(keyFile, "Impulse Denoising", "Threshold", pedited, impulseDenoise.thresh, pedited->impulseDenoise.thresh); } - if (keyFile.has_group ("Directional Pyramid Denoising")) {//TODO: No longer an accurate description for FT denoise + if (keyFile.has_group("Directional Pyramid Denoising")) { //TODO: No longer an accurate description for FT denoise assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "Enabled", pedited, dirpyrDenoise.enabled, pedited->dirpyrDenoise.enabled); assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "Enhance", pedited, dirpyrDenoise.enhance, pedited->dirpyrDenoise.enhance); assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "Median", pedited, dirpyrDenoise.median, pedited->dirpyrDenoise.median); @@ -3929,6 +3942,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "C2Method", pedited, dirpyrDenoise.C2method, pedited->dirpyrDenoise.C2method); + if (dirpyrDenoise.C2method == "PREV") { dirpyrDenoise.C2method = "MANU"; } @@ -3947,7 +3961,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "Passes", pedited, dirpyrDenoise.passes, pedited->dirpyrDenoise.passes); } - if (keyFile.has_group ("EPD")) { + if (keyFile.has_group("EPD")) { assignFromKeyfile(keyFile, "EPD", "Enabled", pedited, epd.enabled, pedited->epd.enabled); assignFromKeyfile(keyFile, "EPD", "Strength", pedited, epd.strength, pedited->epd.strength); assignFromKeyfile(keyFile, "EPD", "Gamma", pedited, epd.gamma, pedited->epd.gamma); @@ -3956,14 +3970,14 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "EPD", "ReweightingIterates", pedited, epd.reweightingIterates, pedited->epd.reweightingIterates); } - if (keyFile.has_group ("FattalToneMapping")) { + if (keyFile.has_group("FattalToneMapping")) { assignFromKeyfile(keyFile, "FattalToneMapping", "Enabled", pedited, fattal.enabled, pedited->fattal.enabled); assignFromKeyfile(keyFile, "FattalToneMapping", "Threshold", pedited, fattal.threshold, pedited->fattal.threshold); assignFromKeyfile(keyFile, "FattalToneMapping", "Amount", pedited, fattal.amount, pedited->fattal.amount); assignFromKeyfile(keyFile, "FattalToneMapping", "Anchor", pedited, fattal.anchor, pedited->fattal.anchor); } - if (keyFile.has_group ("Shadows & Highlights")) { + if (keyFile.has_group("Shadows & Highlights")) { assignFromKeyfile(keyFile, "Shadows & Highlights", "Enabled", pedited, sh.enabled, pedited->sh.enabled); assignFromKeyfile(keyFile, "Shadows & Highlights", "HighQuality", pedited, sh.hq, pedited->sh.hq); assignFromKeyfile(keyFile, "Shadows & Highlights", "Highlights", pedited, sh.highlights, pedited->sh.highlights); @@ -3971,38 +3985,44 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Shadows & Highlights", "Shadows", pedited, sh.shadows, pedited->sh.shadows); assignFromKeyfile(keyFile, "Shadows & Highlights", "ShadowTonalWidth", pedited, sh.stonalwidth, pedited->sh.stonalwidth); assignFromKeyfile(keyFile, "Shadows & Highlights", "Radius", pedited, sh.radius, pedited->sh.radius); + if (keyFile.has_key("Shadows & Highlights", "LocalContrast") && ppVersion < 329) { int lc = keyFile.get_integer("Shadows & Highlights", "LocalContrast"); localContrast.amount = float(lc) / (sh.hq ? 500.0 : 30.); + if (pedited) { pedited->localContrast.amount = true; } + localContrast.enabled = sh.enabled; + if (pedited) { pedited->localContrast.enabled = true; } + localContrast.radius = sh.radius; + if (pedited) { pedited->localContrast.radius = true; } } } - if (keyFile.has_group ("Crop")) { + if (keyFile.has_group("Crop")) { assignFromKeyfile(keyFile, "Crop", "Enabled", pedited, crop.enabled, pedited->crop.enabled); assignFromKeyfile(keyFile, "Crop", "X", pedited, crop.x, pedited->crop.x); assignFromKeyfile(keyFile, "Crop", "Y", pedited, crop.y, pedited->crop.y); - if (keyFile.has_key ("Crop", "W")) { - crop.w = std::max (keyFile.get_integer ("Crop", "W"), 1); + if (keyFile.has_key("Crop", "W")) { + crop.w = std::max(keyFile.get_integer("Crop", "W"), 1); if (pedited) { pedited->crop.w = true; } } - if (keyFile.has_key ("Crop", "H")) { - crop.h = std::max (keyFile.get_integer ("Crop", "H"), 1); + if (keyFile.has_key("Crop", "H")) { + crop.h = std::max(keyFile.get_integer("Crop", "H"), 1); if (pedited) { pedited->crop.h = true; @@ -4025,39 +4045,40 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) crop.ratio = "11:17 - Tabloid"; } } + assignFromKeyfile(keyFile, "Crop", "Orientation", pedited, crop.orientation, pedited->crop.orientation); assignFromKeyfile(keyFile, "Crop", "Guide", pedited, crop.guide, pedited->crop.guide); } - if (keyFile.has_group ("Coarse Transformation")) { + if (keyFile.has_group("Coarse Transformation")) { assignFromKeyfile(keyFile, "Coarse Transformation", "Rotate", pedited, coarse.rotate, pedited->coarse.rotate); assignFromKeyfile(keyFile, "Coarse Transformation", "HorizontalFlip", pedited, coarse.hflip, pedited->coarse.hflip); assignFromKeyfile(keyFile, "Coarse Transformation", "VerticalFlip", pedited, coarse.vflip, pedited->coarse.vflip); } - if (keyFile.has_group ("Rotation")) { + if (keyFile.has_group("Rotation")) { assignFromKeyfile(keyFile, "Rotation", "Degree", pedited, rotate.degree, pedited->rotate.degree); } - if (keyFile.has_group ("Common Properties for Transformations")) { + if (keyFile.has_group("Common Properties for Transformations")) { assignFromKeyfile(keyFile, "Common Properties for Transformations", "AutoFill", pedited, commonTrans.autofill, pedited->commonTrans.autofill); } - if (keyFile.has_group ("Distortion")) { + if (keyFile.has_group("Distortion")) { assignFromKeyfile(keyFile, "Distortion", "Amount", pedited, distortion.amount, pedited->distortion.amount); } - if (keyFile.has_group ("LensProfile")) { - if (keyFile.has_key ("LensProfile", "LcMode")) { - lensProf.lcMode = lensProf.getMethodNumber (keyFile.get_string ("LensProfile", "LcMode")); + if (keyFile.has_group("LensProfile")) { + if (keyFile.has_key("LensProfile", "LcMode")) { + lensProf.lcMode = lensProf.getMethodNumber(keyFile.get_string("LensProfile", "LcMode")); if (pedited) { pedited->lensProf.lcMode = true; } } - if (keyFile.has_key ("LensProfile", "LCPFile")) { - lensProf.lcpFile = expandRelativePath (fname, "", keyFile.get_string ("LensProfile", "LCPFile")); + if (keyFile.has_key("LensProfile", "LCPFile")) { + lensProf.lcpFile = expandRelativePath(fname, "", keyFile.get_string("LensProfile", "LCPFile")); if (pedited) { pedited->lensProf.lcpFile = true; @@ -4074,6 +4095,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) if (keyFile.has_key("LensProfile", "LFCameraMake")) { lensProf.lfCameraMake = keyFile.get_string("LensProfile", "LFCameraMake"); + if (pedited) { pedited->lensProf.lfCameraMake = true; } @@ -4081,6 +4103,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) if (keyFile.has_key("LensProfile", "LFCameraModel")) { lensProf.lfCameraModel = keyFile.get_string("LensProfile", "LFCameraModel"); + if (pedited) { pedited->lensProf.lfCameraModel = true; } @@ -4088,18 +4111,19 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) if (keyFile.has_key("LensProfile", "LFLens")) { lensProf.lfLens = keyFile.get_string("LensProfile", "LFLens"); + if (pedited) { pedited->lensProf.lfLens = true; } } } - if (keyFile.has_group ("Perspective")) { + if (keyFile.has_group("Perspective")) { assignFromKeyfile(keyFile, "Perspective", "Horizontal", pedited, perspective.horizontal, pedited->perspective.horizontal); assignFromKeyfile(keyFile, "Perspective", "Vertical", pedited, perspective.vertical, pedited->perspective.vertical); } - if (keyFile.has_group ("Gradient")) { + if (keyFile.has_group("Gradient")) { assignFromKeyfile(keyFile, "Gradient", "Enabled", pedited, gradient.enabled, pedited->gradient.enabled); assignFromKeyfile(keyFile, "Gradient", "Degree", pedited, gradient.degree, pedited->gradient.degree); assignFromKeyfile(keyFile, "Gradient", "Feather", pedited, gradient.feather, pedited->gradient.feather); @@ -4108,19 +4132,19 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Gradient", "CenterY", pedited, gradient.centerY, pedited->gradient.centerY); } - if (keyFile.has_group ("PCVignette")) { + if (keyFile.has_group("PCVignette")) { assignFromKeyfile(keyFile, "PCVignette", "Enabled", pedited, pcvignette.enabled, pedited->pcvignette.enabled); assignFromKeyfile(keyFile, "PCVignette", "Strength", pedited, pcvignette.strength, pedited->pcvignette.strength); assignFromKeyfile(keyFile, "PCVignette", "Feather", pedited, pcvignette.feather, pedited->pcvignette.feather); assignFromKeyfile(keyFile, "PCVignette", "Roundness", pedited, pcvignette.roundness, pedited->pcvignette.roundness); } - if (keyFile.has_group ("CACorrection")) { + if (keyFile.has_group("CACorrection")) { assignFromKeyfile(keyFile, "CACorrection", "Red", pedited, cacorrection.red, pedited->cacorrection.red); assignFromKeyfile(keyFile, "CACorrection", "Blue", pedited, cacorrection.blue, pedited->cacorrection.blue); } - if (keyFile.has_group ("Vignetting Correction")) { + if (keyFile.has_group("Vignetting Correction")) { assignFromKeyfile(keyFile, "Vignetting Correction", "Amount", pedited, vignetting.amount, pedited->vignetting.amount); assignFromKeyfile(keyFile, "Vignetting Correction", "Radius", pedited, vignetting.radius, pedited->vignetting.radius); assignFromKeyfile(keyFile, "Vignetting Correction", "Strength", pedited, vignetting.strength, pedited->vignetting.strength); @@ -4128,7 +4152,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Vignetting Correction", "CenterY", pedited, vignetting.centerY, pedited->vignetting.centerY); } - if (keyFile.has_group ("Resize")) { + if (keyFile.has_group("Resize")) { assignFromKeyfile(keyFile, "Resize", "Enabled", pedited, resize.enabled, pedited->resize.enabled); assignFromKeyfile(keyFile, "Resize", "Scale", pedited, resize.scale, pedited->resize.scale); assignFromKeyfile(keyFile, "Resize", "AppliesTo", pedited, resize.appliesTo, pedited->resize.appliesTo); @@ -4138,20 +4162,20 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Resize", "Height", pedited, resize.height, pedited->resize.height); } - if (keyFile.has_group ("PostResizeSharpening")) { + if (keyFile.has_group("PostResizeSharpening")) { assignFromKeyfile(keyFile, "PostResizeSharpening", "Enabled", pedited, prsharpening.enabled, pedited->prsharpening.enabled); assignFromKeyfile(keyFile, "PostResizeSharpening", "Radius", pedited, prsharpening.radius, pedited->prsharpening.radius); assignFromKeyfile(keyFile, "PostResizeSharpening", "Amount", pedited, prsharpening.amount, pedited->prsharpening.amount); - if (keyFile.has_key ("PostResizeSharpening", "Threshold")) { + if (keyFile.has_key("PostResizeSharpening", "Threshold")) { if (ppVersion < 302) { - int thresh = min (keyFile.get_integer ("PostResizeSharpening", "Threshold"), 2000); - prsharpening.threshold.setValues (thresh, thresh, 2000, 2000); // TODO: 2000 is the maximum value and is taken of rtgui/sharpening.cc ; should be changed by the tool modularization + int thresh = min(keyFile.get_integer("PostResizeSharpening", "Threshold"), 2000); + prsharpening.threshold.setValues(thresh, thresh, 2000, 2000); // TODO: 2000 is the maximum value and is taken of rtgui/sharpening.cc ; should be changed by the tool modularization } else { - const std::vector thresh = keyFile.get_integer_list ("PostResizeSharpening", "Threshold"); + const std::vector thresh = keyFile.get_integer_list("PostResizeSharpening", "Threshold"); if (thresh.size() >= 4) { - prsharpening.threshold.setValues (thresh[0], thresh[1], min (thresh[2], 2000), min (thresh[3], 2000)); + prsharpening.threshold.setValues(thresh[0], thresh[1], min(thresh[2], 2000), min(thresh[3], 2000)); } } @@ -4172,9 +4196,9 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "PostResizeSharpening", "DeconvIterations", pedited, prsharpening.deconviter, pedited->prsharpening.deconviter); } - if (keyFile.has_group ("Color Management")) { - if (keyFile.has_key ("Color Management", "InputProfile")) { - icm.input = expandRelativePath (fname, "file:", keyFile.get_string ("Color Management", "InputProfile")); + if (keyFile.has_group("Color Management")) { + if (keyFile.has_key("Color Management", "InputProfile")) { + icm.input = expandRelativePath(fname, "file:", keyFile.get_string("Color Management", "InputProfile")); if (pedited) { pedited->icm.input = true; @@ -4189,8 +4213,8 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Color Management", "WorkingProfile", pedited, icm.working, pedited->icm.working); assignFromKeyfile(keyFile, "Color Management", "OutputProfile", pedited, icm.output, pedited->icm.output); - if (keyFile.has_key ("Color Management", "OutputProfileIntent")) { - Glib::ustring intent = keyFile.get_string ("Color Management", "OutputProfileIntent"); + if (keyFile.has_key("Color Management", "OutputProfileIntent")) { + Glib::ustring intent = keyFile.get_string("Color Management", "OutputProfileIntent"); if (intent == "Perceptual") { icm.outputIntent = RI_PERCEPTUAL; @@ -4216,7 +4240,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Color Management", "GammaProfile", pedited, icm.wprofile, pedited->icm.wprofile); } - if (keyFile.has_group ("Wavelet")) { + if (keyFile.has_group("Wavelet")) { assignFromKeyfile(keyFile, "Wavelet", "Enabled", pedited, wavelet.enabled, pedited->wavelet.enabled); assignFromKeyfile(keyFile, "Wavelet", "Strength", pedited, wavelet.strength, pedited->wavelet.strength); assignFromKeyfile(keyFile, "Wavelet", "Balance", pedited, wavelet.balance, pedited->wavelet.balance); @@ -4234,15 +4258,18 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Wavelet", "Lipst", pedited, wavelet.lipst, pedited->wavelet.lipst); assignFromKeyfile(keyFile, "Wavelet", "AvoidColorShift", pedited, wavelet.avoid, pedited->wavelet.avoid); assignFromKeyfile(keyFile, "Wavelet", "TMr", pedited, wavelet.tmr, pedited->wavelet.tmr); + if (ppVersion < 331) { // wavelet.Lmethod was a string before version 331 Glib::ustring temp; assignFromKeyfile(keyFile, "Wavelet", "LevMethod", pedited, temp, pedited->wavelet.Lmethod); + if (!temp.empty()) { wavelet.Lmethod = std::stoi(temp); } } else { assignFromKeyfile(keyFile, "Wavelet", "LevMethod", pedited, wavelet.Lmethod, pedited->wavelet.Lmethod); } + assignFromKeyfile(keyFile, "Wavelet", "ChoiceLevMethod", pedited, wavelet.CLmethod, pedited->wavelet.CLmethod); assignFromKeyfile(keyFile, "Wavelet", "BackMethod", pedited, wavelet.Backmethod, pedited->wavelet.Backmethod); assignFromKeyfile(keyFile, "Wavelet", "TilesMethod", pedited, wavelet.Tilesmethod, pedited->wavelet.Tilesmethod); @@ -4288,11 +4315,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Wavelet", "CHcurve", pedited, wavelet.Chcurve, pedited->wavelet.Chcurve); assignFromKeyfile(keyFile, "Wavelet", "WavclCurve", pedited, wavelet.wavclCurve, pedited->wavelet.wavclCurve); - if (keyFile.has_key ("Wavelet", "Hueskin")) { - const std::vector thresh = keyFile.get_integer_list ("Wavelet", "Hueskin"); + if (keyFile.has_key("Wavelet", "Hueskin")) { + const std::vector thresh = keyFile.get_integer_list("Wavelet", "Hueskin"); if (thresh.size() >= 4) { - wavelet.hueskin.setValues (thresh[0], thresh[1], min (thresh[2], 300), min (thresh[3], 300)); + wavelet.hueskin.setValues(thresh[0], thresh[1], min(thresh[2], 300), min(thresh[3], 300)); } if (pedited) { @@ -4300,11 +4327,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("Wavelet", "HueRange")) { - const std::vector thresh = keyFile.get_integer_list ("Wavelet", "HueRange"); + if (keyFile.has_key("Wavelet", "HueRange")) { + const std::vector thresh = keyFile.get_integer_list("Wavelet", "HueRange"); if (thresh.size() >= 4) { - wavelet.hueskin2.setValues (thresh[0], thresh[1], min (thresh[2], 300), min (thresh[3], 300)); + wavelet.hueskin2.setValues(thresh[0], thresh[1], min(thresh[2], 300), min(thresh[3], 300)); } if (pedited) { @@ -4312,11 +4339,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("Wavelet", "HLRange")) { - const std::vector thresh = keyFile.get_integer_list ("Wavelet", "HLRange"); + if (keyFile.has_key("Wavelet", "HLRange")) { + const std::vector thresh = keyFile.get_integer_list("Wavelet", "HLRange"); if (thresh.size() >= 4) { - wavelet.hllev.setValues (thresh[0], thresh[1], min (thresh[2], 300), min (thresh[3], 300)); + wavelet.hllev.setValues(thresh[0], thresh[1], min(thresh[2], 300), min(thresh[3], 300)); } if (pedited) { @@ -4324,11 +4351,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("Wavelet", "SHRange")) { - const std::vector thresh = keyFile.get_integer_list ("Wavelet", "SHRange"); + if (keyFile.has_key("Wavelet", "SHRange")) { + const std::vector thresh = keyFile.get_integer_list("Wavelet", "SHRange"); if (thresh.size() >= 4) { - wavelet.bllev.setValues (thresh[0], thresh[1], min (thresh[2], 300), min (thresh[3], 300)); + wavelet.bllev.setValues(thresh[0], thresh[1], min(thresh[2], 300), min(thresh[3], 300)); } if (pedited) { @@ -4336,11 +4363,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("Wavelet", "Edgcont")) { - const std::vector thresh = keyFile.get_integer_list ("Wavelet", "Edgcont"); + if (keyFile.has_key("Wavelet", "Edgcont")) { + const std::vector thresh = keyFile.get_integer_list("Wavelet", "Edgcont"); if (thresh.size() >= 4) { - wavelet.edgcont.setValues (thresh[0], thresh[1], min (thresh[2], 300), min (thresh[3], 300)); + wavelet.edgcont.setValues(thresh[0], thresh[1], min(thresh[2], 300), min(thresh[3], 300)); } if (pedited) { @@ -4348,11 +4375,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("Wavelet", "Level0noise")) { - const std::vector thresh = keyFile.get_double_list ("Wavelet", "Level0noise"); + if (keyFile.has_key("Wavelet", "Level0noise")) { + const std::vector thresh = keyFile.get_double_list("Wavelet", "Level0noise"); if (thresh.size() >= 2) { - wavelet.level0noise.setValues (thresh[0], thresh[1]); + wavelet.level0noise.setValues(thresh[0], thresh[1]); } if (pedited) { @@ -4360,11 +4387,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("Wavelet", "Level1noise")) { - const std::vector thresh = keyFile.get_double_list ("Wavelet", "Level1noise"); + if (keyFile.has_key("Wavelet", "Level1noise")) { + const std::vector thresh = keyFile.get_double_list("Wavelet", "Level1noise"); if (thresh.size() >= 2) { - wavelet.level1noise.setValues (thresh[0], thresh[1]); + wavelet.level1noise.setValues(thresh[0], thresh[1]); } if (pedited) { @@ -4372,11 +4399,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("Wavelet", "Level2noise")) { - const std::vector thresh = keyFile.get_double_list ("Wavelet", "Level2noise"); + if (keyFile.has_key("Wavelet", "Level2noise")) { + const std::vector thresh = keyFile.get_double_list("Wavelet", "Level2noise"); if (thresh.size() >= 2) { - wavelet.level2noise.setValues (thresh[0], thresh[1]); + wavelet.level2noise.setValues(thresh[0], thresh[1]); } if (pedited) { @@ -4384,11 +4411,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("Wavelet", "Level3noise")) { - const std::vector thresh = keyFile.get_double_list ("Wavelet", "Level3noise"); + if (keyFile.has_key("Wavelet", "Level3noise")) { + const std::vector thresh = keyFile.get_double_list("Wavelet", "Level3noise"); if (thresh.size() >= 2) { - wavelet.level3noise.setValues (thresh[0], thresh[1]); + wavelet.level3noise.setValues(thresh[0], thresh[1]); } if (pedited) { @@ -4396,11 +4423,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("Wavelet", "Pastlev")) { - const std::vector thresh = keyFile.get_integer_list ("Wavelet", "Pastlev"); + if (keyFile.has_key("Wavelet", "Pastlev")) { + const std::vector thresh = keyFile.get_integer_list("Wavelet", "Pastlev"); if (thresh.size() >= 4) { - wavelet.pastlev.setValues (thresh[0], thresh[1], min (thresh[2], 300), min (thresh[3], 300)); + wavelet.pastlev.setValues(thresh[0], thresh[1], min(thresh[2], 300), min(thresh[3], 300)); } if (pedited) { @@ -4408,11 +4435,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("Wavelet", "Satlev")) { - const std::vector thresh = keyFile.get_integer_list ("Wavelet", "Satlev"); + if (keyFile.has_key("Wavelet", "Satlev")) { + const std::vector thresh = keyFile.get_integer_list("Wavelet", "Satlev"); if (thresh.size() >= 4) { - wavelet.satlev.setValues (thresh[0], thresh[1], min (thresh[2], 300), min (thresh[3], 300)); + wavelet.satlev.setValues(thresh[0], thresh[1], min(thresh[2], 300), min(thresh[3], 300)); } if (pedited) { @@ -4428,8 +4455,8 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) std::stringstream ss; ss << "Contrast" << (i + 1); - if (keyFile.has_key ("Wavelet", ss.str())) { - wavelet.c[i] = keyFile.get_integer ("Wavelet", ss.str()); + if (keyFile.has_key("Wavelet", ss.str())) { + wavelet.c[i] = keyFile.get_integer("Wavelet", ss.str()); if (pedited) { pedited->wavelet.c[i] = true; @@ -4441,14 +4468,15 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) std::stringstream ss; ss << "Chroma" << (i + 1); - if (keyFile.has_key ("Wavelet", ss.str())) { - wavelet.ch[i] = keyFile.get_integer ("Wavelet", ss.str()); + if (keyFile.has_key("Wavelet", ss.str())) { + wavelet.ch[i] = keyFile.get_integer("Wavelet", ss.str()); if (pedited) { pedited->wavelet.ch[i] = true; } } } + assignFromKeyfile(keyFile, "Wavelet", "Expedge", pedited, wavelet.expedge, pedited->wavelet.expedge); assignFromKeyfile(keyFile, "Wavelet", "Expresid", pedited, wavelet.expresid, pedited->wavelet.expresid); assignFromKeyfile(keyFile, "Wavelet", "Expfinal", pedited, wavelet.expfinal, pedited->wavelet.expfinal); @@ -4456,16 +4484,16 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Wavelet", "Expnoise", pedited, wavelet.expnoise, pedited->wavelet.expnoise); } - if (keyFile.has_group ("Directional Pyramid Equalizer")) { + if (keyFile.has_group("Directional Pyramid Equalizer")) { assignFromKeyfile(keyFile, "Directional Pyramid Equalizer", "Enabled", pedited, dirpyrequalizer.enabled, pedited->dirpyrequalizer.enabled); assignFromKeyfile(keyFile, "Directional Pyramid Equalizer", "Gamutlab", pedited, dirpyrequalizer.gamutlab, pedited->dirpyrequalizer.gamutlab); assignFromKeyfile(keyFile, "Directional Pyramid Equalizer", "cbdlMethod", pedited, dirpyrequalizer.cbdlMethod, pedited->dirpyrequalizer.cbdlMethod); - if (keyFile.has_key ("Directional Pyramid Equalizer", "Hueskin")) { - const std::vector thresh = keyFile.get_integer_list ("Directional Pyramid Equalizer", "Hueskin"); + if (keyFile.has_key("Directional Pyramid Equalizer", "Hueskin")) { + const std::vector thresh = keyFile.get_integer_list("Directional Pyramid Equalizer", "Hueskin"); if (thresh.size() >= 4) { - dirpyrequalizer.hueskin.setValues (thresh[0], thresh[1], min (thresh[2], 300), min (thresh[3], 300)); + dirpyrequalizer.hueskin.setValues(thresh[0], thresh[1], min(thresh[2], 300), min(thresh[3], 300)); } if (pedited) { @@ -4478,15 +4506,15 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) std::stringstream ss; ss << "Mult" << i; - if (keyFile.has_key ("Directional Pyramid Equalizer", ss.str())) { + if (keyFile.has_key("Directional Pyramid Equalizer", ss.str())) { if (i == 4) { - dirpyrequalizer.threshold = keyFile.get_double ("Directional Pyramid Equalizer", ss.str()); + dirpyrequalizer.threshold = keyFile.get_double("Directional Pyramid Equalizer", ss.str()); if (pedited) { pedited->dirpyrequalizer.threshold = true; } } else { - dirpyrequalizer.mult[i] = keyFile.get_double ("Directional Pyramid Equalizer", ss.str()); + dirpyrequalizer.mult[i] = keyFile.get_double("Directional Pyramid Equalizer", ss.str()); if (pedited) { pedited->dirpyrequalizer.mult[i] = true; @@ -4502,8 +4530,8 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) std::stringstream ss; ss << "Mult" << i; - if (keyFile.has_key ("Directional Pyramid Equalizer", ss.str())) { - dirpyrequalizer.mult[i] = keyFile.get_double ("Directional Pyramid Equalizer", ss.str()); + if (keyFile.has_key("Directional Pyramid Equalizer", ss.str())) { + dirpyrequalizer.mult[i] = keyFile.get_double("Directional Pyramid Equalizer", ss.str()); if (pedited) { pedited->dirpyrequalizer.mult[i] = true; @@ -4516,14 +4544,15 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } } - if (keyFile.has_group ("Film Simulation")) { + if (keyFile.has_group("Film Simulation")) { assignFromKeyfile(keyFile, "Film Simulation", "Enabled", pedited, filmSimulation.enabled, pedited->filmSimulation.enabled); assignFromKeyfile(keyFile, "Film Simulation", "ClutFilename", pedited, filmSimulation.clutFilename, pedited->filmSimulation.clutFilename); - if (keyFile.has_key ("Film Simulation", "Strength")) { + + if (keyFile.has_key("Film Simulation", "Strength")) { if (ppVersion < 321) { - filmSimulation.strength = keyFile.get_double ("Film Simulation", "Strength") * 100 + 0.1; + filmSimulation.strength = keyFile.get_double("Film Simulation", "Strength") * 100 + 0.1; } else { - filmSimulation.strength = keyFile.get_integer ("Film Simulation", "Strength"); + filmSimulation.strength = keyFile.get_integer("Film Simulation", "Strength"); } if (pedited) { @@ -4532,15 +4561,17 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } } - if (keyFile.has_group ("HSV Equalizer")) { + if (keyFile.has_group("HSV Equalizer")) { if (ppVersion >= 329) { assignFromKeyfile(keyFile, "HSV Equalizer", "Enabled", pedited, hsvequalizer.enabled, pedited->hsvequalizer.enabled); } else { hsvequalizer.enabled = true; + if (pedited) { pedited->hsvequalizer.enabled = true; } } + if (ppVersion >= 300) { assignFromKeyfile(keyFile, "HSV Equalizer", "HCurve", pedited, hsvequalizer.hcurve, pedited->hsvequalizer.hcurve); assignFromKeyfile(keyFile, "HSV Equalizer", "SCurve", pedited, hsvequalizer.scurve, pedited->hsvequalizer.scurve); @@ -4548,22 +4579,24 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } } - if (keyFile.has_group ("RGB Curves")) { + if (keyFile.has_group("RGB Curves")) { if (ppVersion >= 329) { assignFromKeyfile(keyFile, "RGB Curves", "Enabled", pedited, rgbCurves.enabled, pedited->rgbCurves.enabled); } else { rgbCurves.enabled = true; + if (pedited) { pedited->rgbCurves.enabled = true; } } + assignFromKeyfile(keyFile, "RGB Curves", "LumaMode", pedited, rgbCurves.lumamode, pedited->rgbCurves.lumamode); assignFromKeyfile(keyFile, "RGB Curves", "rCurve", pedited, rgbCurves.rcurve, pedited->rgbCurves.rcurve); assignFromKeyfile(keyFile, "RGB Curves", "gCurve", pedited, rgbCurves.gcurve, pedited->rgbCurves.gcurve); assignFromKeyfile(keyFile, "RGB Curves", "bCurve", pedited, rgbCurves.bcurve, pedited->rgbCurves.bcurve); } - if (keyFile.has_group ("ColorToning")) { + if (keyFile.has_group("ColorToning")) { assignFromKeyfile(keyFile, "ColorToning", "Enabled", pedited, colorToning.enabled, pedited->colorToning.enabled); assignFromKeyfile(keyFile, "ColorToning", "Method", pedited, colorToning.method, pedited->colorToning.method); assignFromKeyfile(keyFile, "ColorToning", "Lumamode", pedited, colorToning.lumamode, pedited->colorToning.lumamode); @@ -4575,11 +4608,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "ColorToning", "SaturatedOpacity", pedited, colorToning.saturatedOpacity, pedited->colorToning.saturatedopacity); assignFromKeyfile(keyFile, "ColorToning", "Strength", pedited, colorToning.strength, pedited->colorToning.strength); - if (keyFile.has_key ("ColorToning", "HighlightsColorSaturation")) { - const std::vector thresh = keyFile.get_integer_list ("ColorToning", "HighlightsColorSaturation"); + if (keyFile.has_key("ColorToning", "HighlightsColorSaturation")) { + const std::vector thresh = keyFile.get_integer_list("ColorToning", "HighlightsColorSaturation"); if (thresh.size() >= 2) { - colorToning.hlColSat.setValues (thresh[0], thresh[1]); + colorToning.hlColSat.setValues(thresh[0], thresh[1]); } if (pedited) { @@ -4587,11 +4620,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("ColorToning", "ShadowsColorSaturation")) { - const std::vector thresh = keyFile.get_integer_list ("ColorToning", "ShadowsColorSaturation"); + if (keyFile.has_key("ColorToning", "ShadowsColorSaturation")) { + const std::vector thresh = keyFile.get_integer_list("ColorToning", "ShadowsColorSaturation"); if (thresh.size() >= 2) { - colorToning.shadowsColSat.setValues (thresh[0], thresh[1]); + colorToning.shadowsColSat.setValues(thresh[0], thresh[1]); } if (pedited) { @@ -4620,9 +4653,9 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "ColorToning", "LabGridBHigh", pedited, colorToning.labgridBHigh, pedited->colorToning.labgridBHigh); } - if (keyFile.has_group ("RAW")) { - if (keyFile.has_key ("RAW", "DarkFrame")) { - raw.dark_frame = expandRelativePath (fname, "", keyFile.get_string ("RAW", "DarkFrame" )); + if (keyFile.has_group("RAW")) { + if (keyFile.has_key("RAW", "DarkFrame")) { + raw.dark_frame = expandRelativePath(fname, "", keyFile.get_string("RAW", "DarkFrame")); if (pedited) { pedited->raw.darkFrame = true; @@ -4631,8 +4664,8 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "RAW", "DarkFrameAuto", pedited, raw.df_autoselect, pedited->raw.df_autoselect); - if (keyFile.has_key ("RAW", "FlatFieldFile")) { - raw.ff_file = expandRelativePath (fname, "", keyFile.get_string ("RAW", "FlatFieldFile" )); + if (keyFile.has_key("RAW", "FlatFieldFile")) { + raw.ff_file = expandRelativePath(fname, "", keyFile.get_string("RAW", "FlatFieldFile")); if (pedited) { pedited->raw.ff_file = true; @@ -4643,6 +4676,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "RAW", "FlatFieldBlurRadius", pedited, raw.ff_BlurRadius, pedited->raw.ff_BlurRadius); assignFromKeyfile(keyFile, "RAW", "FlatFieldBlurType", pedited, raw.ff_BlurType, pedited->raw.ff_BlurType); assignFromKeyfile(keyFile, "RAW", "FlatFieldAutoClipControl", pedited, raw.ff_AutoClipControl, pedited->raw.ff_AutoClipControl); + if (ppVersion < 328) { // With ppversion < 328 this value was stored as a boolean, which is nonsense. // To avoid annoying warnings we skip reading and assume 0. @@ -4650,20 +4684,24 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } else { assignFromKeyfile(keyFile, "RAW", "FlatFieldClipControl", pedited, raw.ff_clipControl, pedited->raw.ff_clipControl); } + assignFromKeyfile(keyFile, "RAW", "CA", pedited, raw.ca_autocorrect, pedited->raw.ca_autocorrect); assignFromKeyfile(keyFile, "RAW", "CARed", pedited, raw.cared, pedited->raw.cared); assignFromKeyfile(keyFile, "RAW", "CABlue", pedited, raw.cablue, pedited->raw.cablue); // For compatibility to elder pp3 versions assignFromKeyfile(keyFile, "RAW", "HotDeadPixels", pedited, raw.hotPixelFilter, pedited->raw.hotPixelFilter); raw.deadPixelFilter = raw.hotPixelFilter; + if (pedited) { pedited->raw.deadPixelFilter = pedited->raw.hotPixelFilter; } + assignFromKeyfile(keyFile, "RAW", "HotPixelFilter", pedited, raw.hotPixelFilter, pedited->raw.hotPixelFilter); assignFromKeyfile(keyFile, "RAW", "DeadPixelFilter", pedited, raw.deadPixelFilter, pedited->raw.deadPixelFilter); assignFromKeyfile(keyFile, "RAW", "HotDeadPixelThresh", pedited, raw.hotdeadpix_thresh, pedited->raw.hotdeadpix_thresh); assignFromKeyfile(keyFile, "RAW", "PreExposure", pedited, raw.expos, pedited->raw.exPos); assignFromKeyfile(keyFile, "RAW", "PrePreserv", pedited, raw.preser, pedited->raw.exPreser); + if (ppVersion < 320) { assignFromKeyfile(keyFile, "RAW", "Method", pedited, raw.bayersensor.method, pedited->raw.bayersensor.method); assignFromKeyfile(keyFile, "RAW", "CcSteps", pedited, raw.bayersensor.ccSteps, pedited->raw.bayersensor.ccSteps); @@ -4680,11 +4718,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } } - if (keyFile.has_group ("RAW Bayer")) { + if (keyFile.has_group("RAW Bayer")) { assignFromKeyfile(keyFile, "RAW Bayer", "Method", pedited, raw.bayersensor.method, pedited->raw.bayersensor.method); - if (keyFile.has_key ("RAW Bayer", "ImageNum")) { - raw.bayersensor.imageNum = keyFile.get_integer ("RAW Bayer", "ImageNum") - 1; + if (keyFile.has_key("RAW Bayer", "ImageNum")) { + raw.bayersensor.imageNum = keyFile.get_integer("RAW Bayer", "ImageNum") - 1; if (pedited) { pedited->raw.bayersensor.imageNum = true; @@ -4698,28 +4736,31 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "RAW Bayer", "PreBlack3", pedited, raw.bayersensor.black3, pedited->raw.bayersensor.exBlack3); assignFromKeyfile(keyFile, "RAW Bayer", "PreTwoGreen", pedited, raw.bayersensor.twogreen, pedited->raw.bayersensor.exTwoGreen); assignFromKeyfile(keyFile, "RAW Bayer", "LineDenoise", pedited, raw.bayersensor.linenoise, pedited->raw.bayersensor.linenoise); + if (keyFile.has_key("RAW Bayer", "LineDenoiseDirection")) { raw.bayersensor.linenoiseDirection = RAWParams::BayerSensor::LineNoiseDirection(keyFile.get_integer("RAW Bayer", "LineDenoiseDirection")); + if (pedited) { pedited->raw.bayersensor.linenoiseDirection = true; } } + assignFromKeyfile(keyFile, "RAW Bayer", "GreenEqThreshold", pedited, raw.bayersensor.greenthresh, pedited->raw.bayersensor.greenEq); assignFromKeyfile(keyFile, "RAW Bayer", "DCBIterations", pedited, raw.bayersensor.dcb_iterations, pedited->raw.bayersensor.dcbIterations); assignFromKeyfile(keyFile, "RAW Bayer", "DCBEnhance", pedited, raw.bayersensor.dcb_enhance, pedited->raw.bayersensor.dcbEnhance); assignFromKeyfile(keyFile, "RAW Bayer", "LMMSEIterations", pedited, raw.bayersensor.lmmse_iterations, pedited->raw.bayersensor.lmmseIterations); assignFromKeyfile(keyFile, "RAW Bayer", "PixelShiftMotion", pedited, raw.bayersensor.pixelShiftMotion, pedited->raw.bayersensor.pixelShiftMotion); - if (keyFile.has_key ("RAW Bayer", "PixelShiftMotionCorrection")) { - raw.bayersensor.pixelShiftMotionCorrection = (RAWParams::BayerSensor::PSMotionCorrection)keyFile.get_integer ("RAW Bayer", "PixelShiftMotionCorrection"); + if (keyFile.has_key("RAW Bayer", "PixelShiftMotionCorrection")) { + raw.bayersensor.pixelShiftMotionCorrection = (RAWParams::BayerSensor::PSMotionCorrection)keyFile.get_integer("RAW Bayer", "PixelShiftMotionCorrection"); if (pedited) { pedited->raw.bayersensor.pixelShiftMotionCorrection = true; } } - if (keyFile.has_key ("RAW Bayer", "PixelShiftMotionCorrectionMethod")) { - raw.bayersensor.pixelShiftMotionCorrectionMethod = (RAWParams::BayerSensor::PSMotionCorrectionMethod)keyFile.get_integer ("RAW Bayer", "PixelShiftMotionCorrectionMethod"); + if (keyFile.has_key("RAW Bayer", "PixelShiftMotionCorrectionMethod")) { + raw.bayersensor.pixelShiftMotionCorrectionMethod = (RAWParams::BayerSensor::PSMotionCorrectionMethod)keyFile.get_integer("RAW Bayer", "PixelShiftMotionCorrectionMethod"); if (pedited) { pedited->raw.bayersensor.pixelShiftMotionCorrectionMethod = true; @@ -4757,7 +4798,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "RAW Bayer", "PDAFLinesFilter", pedited, raw.bayersensor.pdafLinesFilter, pedited->raw.bayersensor.pdafLinesFilter); } - if (keyFile.has_group ("RAW X-Trans")) { + if (keyFile.has_group("RAW X-Trans")) { assignFromKeyfile(keyFile, "RAW X-Trans", "Method", pedited, raw.xtranssensor.method, pedited->raw.xtranssensor.method); assignFromKeyfile(keyFile, "RAW X-Trans", "CcSteps", pedited, raw.xtranssensor.ccSteps, pedited->raw.xtranssensor.ccSteps); assignFromKeyfile(keyFile, "RAW X-Trans", "PreBlackRed", pedited, raw.xtranssensor.blackred, pedited->raw.xtranssensor.exBlackRed); @@ -4768,16 +4809,17 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) if (keyFile.has_group("MetaData")) { int mode = int(MetaDataParams::TUNNEL); assignFromKeyfile(keyFile, "MetaData", "Mode", pedited, mode, pedited->metadata.mode); + if (mode >= int(MetaDataParams::TUNNEL) && mode <= int(MetaDataParams::STRIP)) { metadata.mode = static_cast(mode); } } - if (keyFile.has_group ("Exif")) { - std::vector keys = keyFile.get_keys ("Exif"); + if (keyFile.has_group("Exif")) { + std::vector keys = keyFile.get_keys("Exif"); for (const auto& key : keyFile.get_keys("Exif")) { - exif[key] = keyFile.get_string ("Exif", key); + exif[key] = keyFile.get_string("Exif", key); if (pedited) { pedited->exif = true; @@ -4797,7 +4839,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) * tag content is fully replaced by the new one, * i.e. they don't merge */ - if (keyFile.has_group ("IPTC")) { + if (keyFile.has_group("IPTC")) { for (const auto& key : keyFile.get_keys("IPTC")) { // does this key already exist? const IPTCPairs::iterator element = iptc.find(key); @@ -4808,8 +4850,8 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } // TODO: look out if merging Keywords and SupplementalCategories from the procparams chain would be interesting - for (const auto& currLoadedTagValue : keyFile.get_string_list ("IPTC", key)) { - iptc[key].push_back (currLoadedTagValue); + for (const auto& currLoadedTagValue : keyFile.get_string_list("IPTC", key)) { + iptc[key].push_back(currLoadedTagValue); } if (pedited) { @@ -4820,12 +4862,12 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) return 0; } catch (const Glib::Error& e) { - printf ("-->%s\n", e.what().c_str()); - setDefaults (); + printf("-->%s\n", e.what().c_str()); + setDefaults(); return 1; } catch (...) { - printf ("-->unknown exception!\n"); - setDefaults (); + printf("-->unknown exception!\n"); + setDefaults(); return 1; } @@ -4908,13 +4950,13 @@ int ProcParams::write(const Glib::ustring& fname, const Glib::ustring& content) if (fname.length()) { FILE *f; - f = g_fopen (fname.c_str (), "wt"); + f = g_fopen(fname.c_str(), "wt"); if (f == nullptr) { error = 1; } else { - fprintf (f, "%s", content.c_str()); - fclose (f); + fprintf(f, "%s", content.c_str()); + fclose(f); } } @@ -4925,7 +4967,7 @@ PartialProfile::PartialProfile(bool createInstance, bool paramsEditedValue) { if (createInstance) { pparams = new ProcParams(); - pedited = new ParamsEdited (paramsEditedValue); + pedited = new ParamsEdited(paramsEditedValue); } else { pparams = nullptr; pedited = nullptr; @@ -4935,13 +4977,13 @@ PartialProfile::PartialProfile(bool createInstance, bool paramsEditedValue) PartialProfile::PartialProfile(ProcParams* pp, ParamsEdited* pe, bool fullCopy) { if (fullCopy && pp) { - pparams = new ProcParams (*pp); + pparams = new ProcParams(*pp); } else { pparams = pp; } if (fullCopy && pe) { - pedited = new ParamsEdited (*pe); + pedited = new ParamsEdited(*pe); } else { pedited = pe; } @@ -4950,13 +4992,13 @@ PartialProfile::PartialProfile(ProcParams* pp, ParamsEdited* pe, bool fullCopy) PartialProfile::PartialProfile(const ProcParams* pp, const ParamsEdited* pe) { if (pp) { - pparams = new ProcParams (*pp); + pparams = new ProcParams(*pp); } else { pparams = nullptr; } if (pe) { - pedited = new ParamsEdited (*pe); + pedited = new ParamsEdited(*pe); } else { pedited = nullptr; } @@ -4999,7 +5041,7 @@ int PartialProfile::load(const Glib::ustring& fName) } else if (fName == DEFPROFILE_DYNAMIC) { return -1; // should not happen here } else { - return pparams->load (fName, pedited); + return pparams->load(fName, pedited); } } @@ -5010,14 +5052,14 @@ int PartialProfile::load(const Glib::ustring& fName) void PartialProfile::set(bool v) { if (pedited) { - pedited->set (v); + pedited->set(v); } } void PartialProfile::applyTo(ProcParams* destParams) const { if (destParams && pparams && pedited) { - pedited->combine (*destParams, *pparams, true); + pedited->combine(*destParams, *pparams, true); } } diff --git a/rtengine/procparams.h b/rtengine/procparams.h index c7a91c203..9266271d6 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -76,14 +76,14 @@ public: { if (is_double) { return - std::fabs (bottom_left - rhs.bottom_left) < 1e-10 - && std::fabs (top_left - rhs.top_left) < 1e-10 - && std::fabs (bottom_right - rhs.bottom_right) < 1e-10 - && std::fabs (top_right - rhs.top_right) < 1e-10; + std::fabs(bottom_left - rhs.bottom_left) < 1e-10 + && std::fabs(top_left - rhs.top_left) < 1e-10 + && std::fabs(bottom_right - rhs.bottom_right) < 1e-10 + && std::fabs(top_right - rhs.top_right) < 1e-10; } else { return - std::fabs (bottom_left - rhs.bottom_left) < 1e-10 - && std::fabs (top_left - rhs.top_left) < 1e-10; + std::fabs(bottom_left - rhs.bottom_left) < 1e-10 + && std::fabs(top_left - rhs.top_left) < 1e-10; } } @@ -113,7 +113,7 @@ public: return top_left; } - T getBottomLeft() const + T getBottomLeft() const { return bottom_left; } @@ -123,7 +123,7 @@ public: return top_left; } - T getBottomRight() const + T getBottomRight() const { return bottom_right; } @@ -173,7 +173,7 @@ public: // RV: Type of the value on the X axis // RV2: Type of the maximum value on the Y axis template - RT multiply (RV x, RV2 y_max) const + RT multiply(RV x, RV2 y_max) const { const double val = x; @@ -292,8 +292,7 @@ struct ToneCurveParams { /** * Parameters of Retinex */ -struct RetinexParams -{ +struct RetinexParams { bool enabled; std::vector cdcurve; std::vector cdHcurve; @@ -339,8 +338,7 @@ struct RetinexParams /** * Parameters of the luminance curve */ -struct LCurveParams -{ +struct LCurveParams { bool enabled; std::vector lcurve; std::vector acurve; @@ -367,7 +365,7 @@ struct LCurveParams /** * Parameters for local contrast - */ + */ struct LocalContrastParams { bool enabled; int radius; @@ -1341,7 +1339,7 @@ struct RAWParams { static const std::vector& getMethodStrings(); static Glib::ustring getMethodString(Method method); - }; + }; BayerSensor bayersensor; ///< RAW parameters for Bayer sensors XTransSensor xtranssensor; ///< RAW parameters for X-Trans sensors @@ -1469,7 +1467,7 @@ public: /** Creates a new instance of ProcParams. * @return a pointer to the new ProcParams instance. */ - static ProcParams* create (); + static ProcParams* create(); /** Destroys an instance of ProcParams. * @param pp a pointer to the ProcParams instance to destroy. */ diff --git a/rtengine/settings.h b/rtengine/settings.h index 32eed80bb..48a12e17f 100644 --- a/rtengine/settings.h +++ b/rtengine/settings.h @@ -91,13 +91,13 @@ public: RAW_IF_NOT_JPEG_FULLSIZE }; ThumbnailInspectorMode thumbnail_inspector_mode; - + /** Creates a new instance of Settings. * @return a pointer to the new Settings instance. */ - static Settings* create (); + static Settings* create(); /** Destroys an instance of Settings. * @param s a pointer to the Settings instance to destroy. */ - static void destroy (Settings* s); + static void destroy(Settings* s); }; } diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc index 712d34fb4..78d98ddc4 100644 --- a/rtgui/icmpanel.cc +++ b/rtgui/icmpanel.cc @@ -31,106 +31,106 @@ using namespace rtengine::procparams; extern Options options; -ICMPanel::ICMPanel () : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iunchanged(nullptr), icmplistener(nullptr), lastRefFilename(""), camName("") +ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iunchanged(nullptr), icmplistener(nullptr), lastRefFilename(""), camName("") { auto m = ProcEventMapper::getInstance(); - EvICMprimariMethod = m->newEvent(GAMMA, "HISTORY_MSG_ICMPRIMARI"); - EvICMprofileMethod = m->newEvent(GAMMA, "HISTORY_MSG_ICMPROFILE"); - + EvICMprimariMethod = m->newEvent(GAMMA, "HISTORY_MSG_ICMPRIMARI"); + EvICMprofileMethod = m->newEvent(GAMMA, "HISTORY_MSG_ICMPROFILE"); + isBatchMode = lastToneCurve = lastApplyLookTable = lastApplyBaselineExposureOffset = lastApplyHueSatMap = lastgamfree = false; - ipDialog = Gtk::manage (new MyFileChooserButton (M("TP_ICM_INPUTDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN)); - ipDialog->set_tooltip_text (M("TP_ICM_INPUTCUSTOM_TOOLTIP")); - bindCurrentFolder (*ipDialog, options.lastIccDir); + ipDialog = Gtk::manage(new MyFileChooserButton(M("TP_ICM_INPUTDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN)); + ipDialog->set_tooltip_text(M("TP_ICM_INPUTCUSTOM_TOOLTIP")); + bindCurrentFolder(*ipDialog, options.lastIccDir); // ------------------------------- Input profile - Gtk::Frame *iFrame = Gtk::manage (new Gtk::Frame(M("TP_ICM_INPUTPROFILE")) ); + Gtk::Frame *iFrame = Gtk::manage(new Gtk::Frame(M("TP_ICM_INPUTPROFILE"))); iFrame->set_label_align(0.025, 0.5); - iVBox = Gtk::manage ( new Gtk::VBox()); + iVBox = Gtk::manage(new Gtk::VBox()); iVBox->set_spacing(2); - inone = Gtk::manage (new Gtk::RadioButton (M("TP_ICM_INPUTNONE"))); - inone->set_tooltip_text (M("TP_ICM_INPUTNONE_TOOLTIP")); - iVBox->pack_start (*inone, Gtk::PACK_SHRINK); + inone = Gtk::manage(new Gtk::RadioButton(M("TP_ICM_INPUTNONE"))); + inone->set_tooltip_text(M("TP_ICM_INPUTNONE_TOOLTIP")); + iVBox->pack_start(*inone, Gtk::PACK_SHRINK); - iembedded = Gtk::manage (new Gtk::RadioButton (M("TP_ICM_INPUTEMBEDDED"))); - iembedded->set_tooltip_text (M("TP_ICM_INPUTEMBEDDED_TOOLTIP")); - iVBox->pack_start (*iembedded, Gtk::PACK_SHRINK); + iembedded = Gtk::manage(new Gtk::RadioButton(M("TP_ICM_INPUTEMBEDDED"))); + iembedded->set_tooltip_text(M("TP_ICM_INPUTEMBEDDED_TOOLTIP")); + iVBox->pack_start(*iembedded, Gtk::PACK_SHRINK); - icamera = Gtk::manage (new Gtk::RadioButton (M("TP_ICM_INPUTCAMERA"))); - icamera->set_tooltip_text (M("TP_ICM_INPUTCAMERA_TOOLTIP")); - iVBox->pack_start (*icamera, Gtk::PACK_SHRINK); + icamera = Gtk::manage(new Gtk::RadioButton(M("TP_ICM_INPUTCAMERA"))); + icamera->set_tooltip_text(M("TP_ICM_INPUTCAMERA_TOOLTIP")); + iVBox->pack_start(*icamera, Gtk::PACK_SHRINK); - icameraICC = Gtk::manage (new Gtk::RadioButton (M("TP_ICM_INPUTCAMERAICC"))); - icameraICC->set_tooltip_text (M("TP_ICM_INPUTCAMERAICC_TOOLTIP")); - iVBox->pack_start (*icameraICC, Gtk::PACK_SHRINK); + icameraICC = Gtk::manage(new Gtk::RadioButton(M("TP_ICM_INPUTCAMERAICC"))); + icameraICC->set_tooltip_text(M("TP_ICM_INPUTCAMERAICC_TOOLTIP")); + iVBox->pack_start(*icameraICC, Gtk::PACK_SHRINK); - ifromfile = Gtk::manage (new Gtk::RadioButton (M("TP_ICM_INPUTCUSTOM") + ":")); - Gtk::HBox* ffbox = Gtk::manage (new Gtk::HBox ()); - ifromfile->set_tooltip_text (M("TP_ICM_INPUTCUSTOM_TOOLTIP")); - ffbox->pack_start (*ifromfile, Gtk::PACK_SHRINK); - ffbox->pack_start (*ipDialog); + ifromfile = Gtk::manage(new Gtk::RadioButton(M("TP_ICM_INPUTCUSTOM") + ":")); + Gtk::HBox* ffbox = Gtk::manage(new Gtk::HBox()); + ifromfile->set_tooltip_text(M("TP_ICM_INPUTCUSTOM_TOOLTIP")); + ffbox->pack_start(*ifromfile, Gtk::PACK_SHRINK); + ffbox->pack_start(*ipDialog); - iVBox->pack_start (*ffbox, Gtk::PACK_SHRINK); + iVBox->pack_start(*ffbox, Gtk::PACK_SHRINK); opts = icamera->get_group(); - icameraICC->set_group (opts); - iembedded->set_group (opts); - ifromfile->set_group (opts); - inone->set_group (opts); + icameraICC->set_group(opts); + iembedded->set_group(opts); + ifromfile->set_group(opts); + inone->set_group(opts); - dcpFrame = Gtk::manage (new Gtk::Frame ("DCP")); + dcpFrame = Gtk::manage(new Gtk::Frame("DCP")); - Gtk::Grid* dcpGrid = Gtk::manage ( new Gtk::Grid()); + Gtk::Grid* dcpGrid = Gtk::manage(new Gtk::Grid()); dcpGrid->set_column_homogeneous(false); dcpGrid->set_row_homogeneous(false); dcpGrid->set_column_spacing(2); dcpGrid->set_row_spacing(2); - Gtk::Grid* dcpIllGrid = Gtk::manage ( new Gtk::Grid()); + Gtk::Grid* dcpIllGrid = Gtk::manage(new Gtk::Grid()); dcpIllGrid->set_column_homogeneous(false); dcpIllGrid->set_row_homogeneous(false); dcpIllGrid->set_column_spacing(2); dcpIllGrid->set_row_spacing(2); - dcpIllLabel = Gtk::manage (new Gtk::Label (M("TP_ICM_DCPILLUMINANT") + ":")); + dcpIllLabel = Gtk::manage(new Gtk::Label(M("TP_ICM_DCPILLUMINANT") + ":")); setExpandAlignProperties(dcpIllLabel, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER); - dcpIllLabel->set_tooltip_text (M("TP_ICM_DCPILLUMINANT_TOOLTIP")); - dcpIllLabel->show (); - dcpIll = Gtk::manage (new MyComboBoxText ()); + dcpIllLabel->set_tooltip_text(M("TP_ICM_DCPILLUMINANT_TOOLTIP")); + dcpIllLabel->show(); + dcpIll = Gtk::manage(new MyComboBoxText()); setExpandAlignProperties(dcpIll, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); - dcpIll->set_tooltip_text (M("TP_ICM_DCPILLUMINANT_TOOLTIP")); - dcpIll->append (M("TP_ICM_DCPILLUMINANT_INTERPOLATED")); - dcpIll->append (M("TP_ICM_DCPILLUMINANT") + " 1"); - dcpIll->append (M("TP_ICM_DCPILLUMINANT") + " 2"); - dcpIll->show (); + dcpIll->set_tooltip_text(M("TP_ICM_DCPILLUMINANT_TOOLTIP")); + dcpIll->append(M("TP_ICM_DCPILLUMINANT_INTERPOLATED")); + dcpIll->append(M("TP_ICM_DCPILLUMINANT") + " 1"); + dcpIll->append(M("TP_ICM_DCPILLUMINANT") + " 2"); + dcpIll->show(); dcpTemperatures[0] = 0; dcpTemperatures[1] = 0; dcpIllGrid->attach_next_to(*dcpIllLabel, Gtk::POS_LEFT, 1, 1); dcpIllGrid->attach_next_to(*dcpIll, *dcpIllLabel, Gtk::POS_RIGHT, 1, 1); - ckbToneCurve = Gtk::manage (new Gtk::CheckButton (M("TP_ICM_TONECURVE"))); - ckbToneCurve->set_sensitive (false); - ckbToneCurve->set_tooltip_text (M("TP_ICM_TONECURVE_TOOLTIP")); + ckbToneCurve = Gtk::manage(new Gtk::CheckButton(M("TP_ICM_TONECURVE"))); + ckbToneCurve->set_sensitive(false); + ckbToneCurve->set_tooltip_text(M("TP_ICM_TONECURVE_TOOLTIP")); setExpandAlignProperties(ckbToneCurve, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER); - ckbApplyLookTable = Gtk::manage (new Gtk::CheckButton (M("TP_ICM_APPLYLOOKTABLE"))); - ckbApplyLookTable->set_sensitive (false); - ckbApplyLookTable->set_tooltip_text (M("TP_ICM_APPLYLOOKTABLE_TOOLTIP")); + ckbApplyLookTable = Gtk::manage(new Gtk::CheckButton(M("TP_ICM_APPLYLOOKTABLE"))); + ckbApplyLookTable->set_sensitive(false); + ckbApplyLookTable->set_tooltip_text(M("TP_ICM_APPLYLOOKTABLE_TOOLTIP")); setExpandAlignProperties(ckbApplyLookTable, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER); - ckbApplyHueSatMap = Gtk::manage (new Gtk::CheckButton (M("TP_ICM_APPLYHUESATMAP"))); - ckbApplyHueSatMap->set_sensitive (false); - ckbApplyHueSatMap->set_tooltip_text (M("TP_ICM_APPLYHUESATMAP_TOOLTIP")); + ckbApplyHueSatMap = Gtk::manage(new Gtk::CheckButton(M("TP_ICM_APPLYHUESATMAP"))); + ckbApplyHueSatMap->set_sensitive(false); + ckbApplyHueSatMap->set_tooltip_text(M("TP_ICM_APPLYHUESATMAP_TOOLTIP")); setExpandAlignProperties(ckbApplyHueSatMap, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER); - ckbApplyBaselineExposureOffset = Gtk::manage (new Gtk::CheckButton (M("TP_ICM_APPLYBASELINEEXPOSUREOFFSET"))); - ckbApplyBaselineExposureOffset->set_sensitive (false); - ckbApplyBaselineExposureOffset->set_tooltip_text (M("TP_ICM_APPLYBASELINEEXPOSUREOFFSET_TOOLTIP")); + ckbApplyBaselineExposureOffset = Gtk::manage(new Gtk::CheckButton(M("TP_ICM_APPLYBASELINEEXPOSUREOFFSET"))); + ckbApplyBaselineExposureOffset->set_sensitive(false); + ckbApplyBaselineExposureOffset->set_tooltip_text(M("TP_ICM_APPLYBASELINEEXPOSUREOFFSET_TOOLTIP")); setExpandAlignProperties(ckbApplyBaselineExposureOffset, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER); dcpGrid->attach_next_to(*dcpIllGrid, Gtk::POS_BOTTOM, 1, 1); @@ -141,174 +141,174 @@ ICMPanel::ICMPanel () : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iunch dcpFrame->add(*dcpGrid); dcpFrame->set_sensitive(false); - iVBox->pack_start (*dcpFrame); + iVBox->pack_start(*dcpFrame); - saveRef = Gtk::manage (new Gtk::Button (M("TP_ICM_SAVEREFERENCE"))); - saveRef->set_image (*Gtk::manage (new RTImage ("gtk-save-large.png"))); - saveRef->set_alignment (0.5f, 0.5f); - saveRef->set_tooltip_markup (M("TP_ICM_SAVEREFERENCE_TOOLTIP")); - iVBox->pack_start (*saveRef, Gtk::PACK_SHRINK); + saveRef = Gtk::manage(new Gtk::Button(M("TP_ICM_SAVEREFERENCE"))); + saveRef->set_image(*Gtk::manage(new RTImage("gtk-save-large.png"))); + saveRef->set_alignment(0.5f, 0.5f); + saveRef->set_tooltip_markup(M("TP_ICM_SAVEREFERENCE_TOOLTIP")); + iVBox->pack_start(*saveRef, Gtk::PACK_SHRINK); iFrame->add(*iVBox); - pack_start (*iFrame, Gtk::PACK_EXPAND_WIDGET); + pack_start(*iFrame, Gtk::PACK_EXPAND_WIDGET); // ---------------------------- Working profile - Gtk::Frame *wFrame = Gtk::manage (new Gtk::Frame(M("TP_ICM_WORKINGPROFILE")) ); + Gtk::Frame *wFrame = Gtk::manage(new Gtk::Frame(M("TP_ICM_WORKINGPROFILE"))); wFrame->set_label_align(0.025, 0.5); - Gtk::VBox *wVBox = Gtk::manage ( new Gtk::VBox()); + Gtk::VBox *wVBox = Gtk::manage(new Gtk::VBox()); wVBox->set_spacing(2); - wnames = Gtk::manage (new MyComboBoxText ()); - wVBox->pack_start (*wnames, Gtk::PACK_SHRINK); + wnames = Gtk::manage(new MyComboBoxText()); + wVBox->pack_start(*wnames, Gtk::PACK_SHRINK); std::vector wpnames = rtengine::ICCStore::getInstance()->getWorkingProfiles(); for (size_t i = 0; i < wpnames.size(); i++) { - wnames->append (wpnames[i]); + wnames->append(wpnames[i]); } - wnames->set_active (0); + wnames->set_active(0); wFrame->add(*wVBox); - pack_start (*wFrame, Gtk::PACK_EXPAND_WIDGET); + pack_start(*wFrame, Gtk::PACK_EXPAND_WIDGET); // ---------------------------- Output profile - Gtk::Frame *oFrame = Gtk::manage (new Gtk::Frame(M("TP_ICM_OUTPUTPROFILE")) ); + Gtk::Frame *oFrame = Gtk::manage(new Gtk::Frame(M("TP_ICM_OUTPUTPROFILE"))); oFrame->set_label_align(0.025, 0.5); - Gtk::VBox *oVBox = Gtk::manage ( new Gtk::VBox()); + Gtk::VBox *oVBox = Gtk::manage(new Gtk::VBox()); oVBox->set_spacing(2); - onames = Gtk::manage (new MyComboBoxText ()); - oVBox->pack_start (*onames, Gtk::PACK_SHRINK); + onames = Gtk::manage(new MyComboBoxText()); + oVBox->pack_start(*onames, Gtk::PACK_SHRINK); - onames->append (M("TP_ICM_NOICM")); - onames->set_active (0); + onames->append(M("TP_ICM_NOICM")); + onames->set_active(0); - std::vector opnames = ICCStore::getInstance()->getProfiles (rtengine::ICCStore::ProfileType::OUTPUT); + std::vector opnames = ICCStore::getInstance()->getProfiles(rtengine::ICCStore::ProfileType::OUTPUT); for (size_t i = 0; i < opnames.size(); i++) { - onames->append (opnames[i]); + onames->append(opnames[i]); } - onames->set_active (0); + onames->set_active(0); // Rendering intent - Gtk::HBox *riHBox = Gtk::manage ( new Gtk::HBox()); - Gtk::Label* outputIntentLbl = Gtk::manage (new Gtk::Label(M("TP_ICM_PROFILEINTENT")+":")); - riHBox->pack_start (*outputIntentLbl, Gtk::PACK_SHRINK); - ointent.reset (new PopUpButton ()); + Gtk::HBox *riHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Label* outputIntentLbl = Gtk::manage(new Gtk::Label(M("TP_ICM_PROFILEINTENT") + ":")); + riHBox->pack_start(*outputIntentLbl, Gtk::PACK_SHRINK); + ointent.reset(new PopUpButton()); ointent->addEntry("intent-perceptual.png", M("PREFERENCES_INTENT_PERCEPTUAL")); ointent->addEntry("intent-relative.png", M("PREFERENCES_INTENT_RELATIVE")); ointent->addEntry("intent-saturation.png", M("PREFERENCES_INTENT_SATURATION")); ointent->addEntry("intent-absolute.png", M("PREFERENCES_INTENT_ABSOLUTE")); - ointent->setSelected (1); + ointent->setSelected(1); ointent->show(); - riHBox->pack_start (*ointent->buttonGroup, Gtk::PACK_EXPAND_PADDING); + riHBox->pack_start(*ointent->buttonGroup, Gtk::PACK_EXPAND_PADDING); oVBox->pack_start(*riHBox, Gtk::PACK_SHRINK); // Black Point Compensation obpc = Gtk::manage(new Gtk::CheckButton((M("TP_ICM_BPC")))); - obpc->set_active (true); + obpc->set_active(true); oVBox->pack_start(*obpc, Gtk::PACK_SHRINK); // Output gamma - Gtk::HBox* gaHBox = Gtk::manage (new Gtk::HBox ()); - Gtk::Label* galab = Gtk::manage (new Gtk::Label (M("TP_GAMMA_OUTPUT") + ":")); + Gtk::HBox* gaHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Label* galab = Gtk::manage(new Gtk::Label(M("TP_GAMMA_OUTPUT") + ":")); //galab->set_alignment (0.0, 0.5); - gaHBox->pack_start (*galab, Gtk::PACK_SHRINK); - wgamma = Gtk::manage (new MyComboBoxText ()); - gaHBox->pack_start (*wgamma, Gtk::PACK_EXPAND_WIDGET); + gaHBox->pack_start(*galab, Gtk::PACK_SHRINK); + wgamma = Gtk::manage(new MyComboBoxText()); + gaHBox->pack_start(*wgamma, Gtk::PACK_EXPAND_WIDGET); oVBox->pack_start(*gaHBox, Gtk::PACK_EXPAND_WIDGET); std::vector wpgamma = rtengine::ICCStore::getGamma(); for (size_t i = 0; i < wpgamma.size(); i++) { - wgamma->append (wpgamma[i]); + wgamma->append(wpgamma[i]); } - wgamma->set_active (0); + wgamma->set_active(0); - Gtk::Frame* fgFrame = Gtk::manage (new Gtk::Frame ()); + Gtk::Frame* fgFrame = Gtk::manage(new Gtk::Frame()); - Gtk::VBox *fgVBox = Gtk::manage ( new Gtk::VBox()); + Gtk::VBox *fgVBox = Gtk::manage(new Gtk::VBox()); fgVBox->set_spacing(2); - + freegamma = Gtk::manage(new Gtk::CheckButton((M("TP_GAMMA_FREE")))); - freegamma->set_active (false); + freegamma->set_active(false); fgFrame->set_label_widget(*freegamma); - - Gtk::HBox* priHBox = Gtk::manage (new Gtk::HBox ()); - Gtk::Label* prilab = Gtk::manage (new Gtk::Label (M("TP_GAMMA_PRIM") + ":")); - priHBox->pack_start (*prilab, Gtk::PACK_SHRINK); - wprimari = Gtk::manage (new MyComboBoxText ()); - priHBox->pack_start (*wprimari, Gtk::PACK_EXPAND_WIDGET); + Gtk::HBox* priHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Label* prilab = Gtk::manage(new Gtk::Label(M("TP_GAMMA_PRIM") + ":")); + + priHBox->pack_start(*prilab, Gtk::PACK_SHRINK); + wprimari = Gtk::manage(new MyComboBoxText()); + priHBox->pack_start(*wprimari, Gtk::PACK_EXPAND_WIDGET); fgVBox->pack_start(*priHBox, Gtk::PACK_EXPAND_WIDGET); std::vector wprinames = rtengine::ICCStore::getInstance()->getWorkingProfiles(); for (size_t i = 0; i < wprinames.size(); i++) { - if(i <= 1 || i >= 5 ) { - wprimari->append (wprinames[i]); - } + if (i <= 1 || i >= 5) { + wprimari->append(wprinames[i]); + } } - wprimari->set_active (6); - - gampos = Gtk::manage(new Adjuster (M("TP_GAMMA_CURV"), 1, 3.5, 0.00001, 2.4)); - gampos->setAdjusterListener (this); + wprimari->set_active(6); + + gampos = Gtk::manage(new Adjuster(M("TP_GAMMA_CURV"), 1, 3.5, 0.00001, 2.4)); + gampos->setAdjusterListener(this); if (gampos->delay < options.adjusterMaxDelay) { gampos->delay = options.adjusterMaxDelay; } gampos->show(); - slpos = Gtk::manage(new Adjuster (M("TP_GAMMA_SLOP"), 0, 15, 0.00001, 12.92310)); - slpos->setAdjusterListener (this); + slpos = Gtk::manage(new Adjuster(M("TP_GAMMA_SLOP"), 0, 15, 0.00001, 12.92310)); + slpos->setAdjusterListener(this); if (slpos->delay < options.adjusterMaxDelay) { slpos->delay = options.adjusterMaxDelay; } slpos->show(); - fgVBox->pack_start( *gampos, Gtk::PACK_SHRINK);//gamma - fgVBox->pack_start( *slpos, Gtk::PACK_SHRINK);//slope + fgVBox->pack_start(*gampos, Gtk::PACK_SHRINK); //gamma + fgVBox->pack_start(*slpos, Gtk::PACK_SHRINK); //slope - - Gtk::HBox* profHBox = Gtk::manage (new Gtk::HBox ()); - Gtk::Label* proflab = Gtk::manage (new Gtk::Label (M("TP_GAMMA_PROF") + ":")); - profHBox->pack_start (*proflab, Gtk::PACK_SHRINK); - wprofile = Gtk::manage (new MyComboBoxText ()); - profHBox->pack_start (*wprofile, Gtk::PACK_EXPAND_WIDGET); + Gtk::HBox* profHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Label* proflab = Gtk::manage(new Gtk::Label(M("TP_GAMMA_PROF") + ":")); + + profHBox->pack_start(*proflab, Gtk::PACK_SHRINK); + wprofile = Gtk::manage(new MyComboBoxText()); + profHBox->pack_start(*wprofile, Gtk::PACK_EXPAND_WIDGET); fgVBox->pack_start(*profHBox, Gtk::PACK_EXPAND_WIDGET); - wprofile->append (M("TP_GAMMA_PROF_NONE")); - wprofile->append (M("TP_GAMMA_PROF_V2")); - wprofile->append (M("TP_GAMMA_PROF_V4")); - wprofileconn = wprofile->signal_changed().connect ( sigc::mem_fun(*this, &ICMPanel::wprofileChanged) ); + wprofile->append(M("TP_GAMMA_PROF_NONE")); + wprofile->append(M("TP_GAMMA_PROF_V2")); + wprofile->append(M("TP_GAMMA_PROF_V4")); + wprofileconn = wprofile->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::wprofileChanged)); - wprofile->set_active (0); - + wprofile->set_active(0); + fgFrame->add(*fgVBox); oVBox->pack_start(*fgFrame, Gtk::PACK_EXPAND_WIDGET); oFrame->add(*oVBox); - pack_start (*oFrame, Gtk::PACK_EXPAND_WIDGET); + pack_start(*oFrame, Gtk::PACK_EXPAND_WIDGET); // ---------------------------- Output gamma list entries @@ -336,9 +336,9 @@ ICMPanel::ICMPanel () : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iunch filter_any->set_name(M("FILECHOOSER_FILTER_ANY")); filter_any->add_pattern("*"); - ipDialog->add_filter (filter_icc); - ipDialog->add_filter (filter_iccdng); - ipDialog->add_filter (filter_any); + ipDialog->add_filter(filter_icc); + ipDialog->add_filter(filter_iccdng); + ipDialog->add_filter(filter_any); #ifdef WIN32 ipDialog->set_show_hidden(true); // ProgramData is hidden on Windows #endif @@ -346,33 +346,34 @@ ICMPanel::ICMPanel () : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iunch oldip = ""; - wnamesconn = wnames->signal_changed().connect( sigc::mem_fun(*this, &ICMPanel::wpChanged) ); - onamesconn = onames->signal_changed().connect( sigc::mem_fun(*this, &ICMPanel::opChanged) ); - ointentconn = ointent->signal_changed().connect( sigc::mem_fun(*this, &ICMPanel::oiChanged) ); - wgammaconn = wgamma->signal_changed().connect( sigc::mem_fun(*this, &ICMPanel::gpChanged) ); - dcpillconn = dcpIll->signal_changed().connect( sigc::mem_fun(*this, &ICMPanel::dcpIlluminantChanged) ); - wprimariconn = wprimari->signal_changed().connect( sigc::mem_fun(*this, &ICMPanel::wprimariChanged) ); + wnamesconn = wnames->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::wpChanged)); + onamesconn = onames->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::opChanged)); + ointentconn = ointent->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::oiChanged)); + wgammaconn = wgamma->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::gpChanged)); + dcpillconn = dcpIll->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::dcpIlluminantChanged)); + wprimariconn = wprimari->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::wprimariChanged)); - obpcconn = obpc->signal_toggled().connect( sigc::mem_fun(*this, &ICMPanel::oBPCChanged) ); - gamcsconn = freegamma->signal_toggled().connect ( sigc::mem_fun(*this, &ICMPanel::GamChanged)); - tcurveconn = ckbToneCurve->signal_toggled().connect ( sigc::mem_fun(*this, &ICMPanel::toneCurveChanged)); - ltableconn = ckbApplyLookTable->signal_toggled().connect ( sigc::mem_fun(*this, &ICMPanel::applyLookTableChanged)); - beoconn = ckbApplyBaselineExposureOffset->signal_toggled().connect ( sigc::mem_fun(*this, &ICMPanel::applyBaselineExposureOffsetChanged)); - hsmconn = ckbApplyHueSatMap->signal_toggled().connect ( sigc::mem_fun(*this, &ICMPanel::applyHueSatMapChanged)); + obpcconn = obpc->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::oBPCChanged)); + gamcsconn = freegamma->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::GamChanged)); + tcurveconn = ckbToneCurve->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::toneCurveChanged)); + ltableconn = ckbApplyLookTable->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::applyLookTableChanged)); + beoconn = ckbApplyBaselineExposureOffset->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::applyBaselineExposureOffsetChanged)); + hsmconn = ckbApplyHueSatMap->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::applyHueSatMapChanged)); - icamera->signal_toggled().connect( sigc::mem_fun(*this, &ICMPanel::ipChanged) ); - icameraICC->signal_toggled().connect( sigc::mem_fun(*this, &ICMPanel::ipChanged) ); - iembedded->signal_toggled().connect( sigc::mem_fun(*this, &ICMPanel::ipChanged) ); - ifromfile->signal_toggled().connect( sigc::mem_fun(*this, &ICMPanel::ipChanged) ); + icamera->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::ipChanged)); + icameraICC->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::ipChanged)); + iembedded->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::ipChanged)); + ifromfile->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::ipChanged)); - ipc = ipDialog->signal_selection_changed().connect( sigc::mem_fun(*this, &ICMPanel::ipSelectionChanged) ); - saveRef->signal_pressed().connect( sigc::mem_fun(*this, &ICMPanel::saveReferencePressed) ); + ipc = ipDialog->signal_selection_changed().connect(sigc::mem_fun(*this, &ICMPanel::ipSelectionChanged)); + saveRef->signal_pressed().connect(sigc::mem_fun(*this, &ICMPanel::saveReferencePressed)); - show_all (); + show_all(); } -void ICMPanel::updateRenderingIntent (const Glib::ustring &profile) { - const uint8_t supportedIntents = rtengine::ICCStore::getInstance()->getOutputIntents (profile); +void ICMPanel::updateRenderingIntent(const Glib::ustring &profile) +{ + const uint8_t supportedIntents = rtengine::ICCStore::getInstance()->getOutputIntents(profile); const bool supportsPerceptual = supportedIntents & 1 << INTENT_PERCEPTUAL; const bool supportsRelative = supportedIntents & 1 << INTENT_RELATIVE_COLORIMETRIC; const bool supportsSaturation = supportedIntents & 1 << INTENT_SATURATION; @@ -381,7 +382,7 @@ void ICMPanel::updateRenderingIntent (const Glib::ustring &profile) { //printf("Intents: %d / Perceptual: %d Relative: %d Saturation: %d Absolute: %d\n", supportedIntents, supportsPerceptual, supportsRelative, supportsSaturation, supportsAbsolute); if (!profile.empty() && (supportsPerceptual || supportsRelative || supportsSaturation || supportsAbsolute)) { - ointent->set_sensitive (true); + ointent->set_sensitive(true); ointent->setItemSensitivity(0, supportsPerceptual); ointent->setItemSensitivity(1, supportsRelative); ointent->setItemSensitivity(2, supportsSaturation); @@ -391,34 +392,34 @@ void ICMPanel::updateRenderingIntent (const Glib::ustring &profile) { ointent->setItemSensitivity(1, true); ointent->setItemSensitivity(2, true); ointent->setItemSensitivity(3, true); - ointent->set_sensitive (false); - ointent->setSelected (1); + ointent->set_sensitive(false); + ointent->setSelected(1); } } -void ICMPanel::updateDCP (int dcpIlluminant, Glib::ustring dcp_name) +void ICMPanel::updateDCP(int dcpIlluminant, Glib::ustring dcp_name) { ConnectionBlocker dcpillconn_(dcpillconn); if (isBatchMode) { dcpFrame->set_sensitive(true); - ckbToneCurve->set_sensitive (true); - ckbApplyLookTable->set_sensitive (true); - ckbApplyBaselineExposureOffset->set_sensitive (true); - ckbApplyHueSatMap->set_sensitive (true); - dcpIllLabel->set_sensitive (true); - dcpIll->set_sensitive (true); + ckbToneCurve->set_sensitive(true); + ckbApplyLookTable->set_sensitive(true); + ckbApplyBaselineExposureOffset->set_sensitive(true); + ckbApplyHueSatMap->set_sensitive(true); + dcpIllLabel->set_sensitive(true); + dcpIll->set_sensitive(true); if (dcpTemperatures[0] != 0 || dcpTemperatures[1] != 0) { int curr_active = dcpIll->get_active_row_number(); - dcpIll->remove_all (); - dcpIll->append (M("TP_ICM_DCPILLUMINANT_INTERPOLATED")); - dcpIll->append (M("TP_ICM_DCPILLUMINANT") + " 1"); - dcpIll->append (M("TP_ICM_DCPILLUMINANT") + " 2"); - dcpIll->append (M("GENERAL_UNCHANGED")); + dcpIll->remove_all(); + dcpIll->append(M("TP_ICM_DCPILLUMINANT_INTERPOLATED")); + dcpIll->append(M("TP_ICM_DCPILLUMINANT") + " 1"); + dcpIll->append(M("TP_ICM_DCPILLUMINANT") + " 2"); + dcpIll->append(M("GENERAL_UNCHANGED")); dcpTemperatures[0] = 0; dcpTemperatures[1] = 0; - dcpIll->set_active (curr_active); + dcpIll->set_active(curr_active); } if (dcpIll->get_active_row_number() == -1 && dcpIlluminant == -1) { @@ -427,22 +428,22 @@ void ICMPanel::updateDCP (int dcpIlluminant, Glib::ustring dcp_name) dcpIll->set_active(dcpIlluminant); } - dcpIll->set_sensitive (true); - dcpIllLabel->set_sensitive (true); + dcpIll->set_sensitive(true); + dcpIllLabel->set_sensitive(true); return; } - ckbToneCurve->set_sensitive (false); - ckbApplyLookTable->set_sensitive (false); - ckbApplyBaselineExposureOffset->set_sensitive (false); - ckbApplyHueSatMap->set_sensitive (false); - dcpIllLabel->set_sensitive (false); - dcpIll->set_sensitive (false); + ckbToneCurve->set_sensitive(false); + ckbApplyLookTable->set_sensitive(false); + ckbApplyBaselineExposureOffset->set_sensitive(false); + ckbApplyHueSatMap->set_sensitive(false); + dcpIllLabel->set_sensitive(false); + dcpIll->set_sensitive(false); dcpFrame->set_sensitive(false); DCPProfile* dcp = nullptr; - if(dcp_name == "(cameraICC)") { + if (dcp_name == "(cameraICC)") { dcp = DCPStore::getInstance()->getStdProfile(camName); } else if (ifromfile->get_active() && DCPStore::getInstance()->isValidDCPFileName(dcp_name)) { dcp = DCPStore::getInstance()->getProfile(dcp_name); @@ -452,19 +453,19 @@ void ICMPanel::updateDCP (int dcpIlluminant, Glib::ustring dcp_name) dcpFrame->set_sensitive(true); if (dcp->getHasToneCurve()) { - ckbToneCurve->set_sensitive (true); + ckbToneCurve->set_sensitive(true); } if (dcp->getHasLookTable()) { - ckbApplyLookTable->set_sensitive (true); + ckbApplyLookTable->set_sensitive(true); } if (dcp->getHasBaselineExposureOffset()) { - ckbApplyBaselineExposureOffset->set_sensitive (true); + ckbApplyBaselineExposureOffset->set_sensitive(true); } if (dcp->getHasHueSatMap()) { - ckbApplyHueSatMap->set_sensitive (true); + ckbApplyHueSatMap->set_sensitive(true); } const DCPProfile::Illuminants illuminants = dcp->getIlluminants(); @@ -475,13 +476,13 @@ void ICMPanel::updateDCP (int dcpIlluminant, Glib::ustring dcp_name) sprintf(tempstr1, "%.0fK", illuminants.temperature_1); sprintf(tempstr2, "%.0fK", illuminants.temperature_2); int curr_active = dcpIll->get_active_row_number(); - dcpIll->remove_all (); - dcpIll->append (M("TP_ICM_DCPILLUMINANT_INTERPOLATED")); - dcpIll->append (tempstr1); - dcpIll->append (tempstr2); + dcpIll->remove_all(); + dcpIll->append(M("TP_ICM_DCPILLUMINANT_INTERPOLATED")); + dcpIll->append(tempstr1); + dcpIll->append(tempstr2); dcpTemperatures[0] = illuminants.temperature_1; dcpTemperatures[1] = illuminants.temperature_2; - dcpIll->set_active (curr_active); + dcpIll->set_active(curr_active); } if (dcpIlluminant > 2) { @@ -494,8 +495,8 @@ void ICMPanel::updateDCP (int dcpIlluminant, Glib::ustring dcp_name) dcpIll->set_active(dcpIlluminant); } - dcpIll->set_sensitive (true); - dcpIllLabel->set_sensitive (true); + dcpIll->set_sensitive(true); + dcpIllLabel->set_sensitive(true); } else { if (dcpIll->get_active_row_number() != -1) { dcpIll->set_active(-1); @@ -506,26 +507,26 @@ void ICMPanel::updateDCP (int dcpIlluminant, Glib::ustring dcp_name) if (!dcpIllLabel->get_sensitive() && dcpIll->get_active_row_number() != 0) { if (dcpTemperatures[0] != 0 || dcpTemperatures[1] != 0) { int curr_active = dcpIll->get_active_row_number(); - dcpIll->remove_all (); - dcpIll->append (M("TP_ICM_DCPILLUMINANT_INTERPOLATED")); - dcpIll->append (M("TP_ICM_DCPILLUMINANT") + " 1"); - dcpIll->append (M("TP_ICM_DCPILLUMINANT") + " 2"); + dcpIll->remove_all(); + dcpIll->append(M("TP_ICM_DCPILLUMINANT_INTERPOLATED")); + dcpIll->append(M("TP_ICM_DCPILLUMINANT") + " 1"); + dcpIll->append(M("TP_ICM_DCPILLUMINANT") + " 2"); if (isBatchMode) { - dcpIll->append (M("GENERAL_UNCHANGED")); + dcpIll->append(M("GENERAL_UNCHANGED")); } dcpTemperatures[0] = 0; dcpTemperatures[1] = 0; - dcpIll->set_active (curr_active); + dcpIll->set_active(curr_active); } } } -void ICMPanel::read (const ProcParams* pp, const ParamsEdited* pedited) +void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited) { - disableListener (); + disableListener(); ConnectionBlocker obpcconn_(obpcconn); ConnectionBlocker ipc_(ipc); @@ -542,75 +543,77 @@ void ICMPanel::read (const ProcParams* pp, const ParamsEdited* pedited) ConnectionBlocker wprimariconn_(wprimariconn); ConnectionBlocker wprofileconn_(wprofileconn); - if(pp->icm.input.substr(0, 5) != "file:" && !ipDialog->get_filename().empty()) { + if (pp->icm.input.substr(0, 5) != "file:" && !ipDialog->get_filename().empty()) { ipDialog->set_filename(pp->icm.input); } if (pp->icm.input == "(none)") { - inone->set_active (true); + inone->set_active(true); updateDCP(pp->icm.dcpIlluminant, ""); } else if (pp->icm.input == "(embedded)" || ((pp->icm.input == "(camera)" || pp->icm.input == "") && icamera->get_state() == Gtk::STATE_INSENSITIVE)) { - iembedded->set_active (true); + iembedded->set_active(true); updateDCP(pp->icm.dcpIlluminant, ""); } else if ((pp->icm.input == "(cameraICC)") && icameraICC->get_state() != Gtk::STATE_INSENSITIVE) { - icameraICC->set_active (true); + icameraICC->set_active(true); updateDCP(pp->icm.dcpIlluminant, "(cameraICC)"); } else if ((pp->icm.input == "(cameraICC)") && icamera->get_state() != Gtk::STATE_INSENSITIVE && icameraICC->get_state() == Gtk::STATE_INSENSITIVE) { // this is the case when (cameraICC) is instructed by packaged profiles, but ICC file is not found // therefore falling back UI to explicitly reflect the (camera) option - icamera->set_active (true); + icamera->set_active(true); updateDCP(pp->icm.dcpIlluminant, ""); } else if ((pp->icm.input == "(cameraICC)") && icamera->get_state() == Gtk::STATE_INSENSITIVE && icameraICC->get_state() == Gtk::STATE_INSENSITIVE) { // If neither (camera) nor (cameraICC) are available, as is the case when loading a non-raw, activate (embedded). - iembedded->set_active (true); + iembedded->set_active(true); updateDCP(pp->icm.dcpIlluminant, "(cameraICC)"); } else if ((pp->icm.input == "(camera)" || pp->icm.input == "") && icamera->get_state() != Gtk::STATE_INSENSITIVE) { - icamera->set_active (true); + icamera->set_active(true); updateDCP(pp->icm.dcpIlluminant, ""); } else { - ifromfile->set_active (true); + ifromfile->set_active(true); oldip = pp->icm.input.substr(5); // cut of "file:" - ipDialog->set_filename (pp->icm.input.substr(5)); + ipDialog->set_filename(pp->icm.input.substr(5)); updateDCP(pp->icm.dcpIlluminant, pp->icm.input.substr(5)); } - wnames->set_active_text (pp->icm.working); - wgamma->set_active_text (pp->icm.gamma); - wprimari->set_active_text (pp->icm.wprimari); - // wprofile->set_active_text (pp->icm.wprofile); + wnames->set_active_text(pp->icm.working); + wgamma->set_active_text(pp->icm.gamma); + wprimari->set_active_text(pp->icm.wprimari); +// wprofile->set_active_text (pp->icm.wprofile); + + if (pp->icm.wprofile == "none") { + wprofile->set_active(0); + } else if (pp->icm.wprofile == "v2") { + wprofile->set_active(1); + } else if (pp->icm.wprofile == "v4") { + wprofile->set_active(2); + } + + // wprofileChanged(); - if (pp->icm.wprofile == "none") { - wprofile->set_active (0); - } else if (pp->icm.wprofile == "v2") { - wprofile->set_active (1); - } else if (pp->icm.wprofile == "v4") { - wprofile->set_active (2); - } - // wprofileChanged(); - if (pp->icm.output == ColorManagementParams::NoICMString) { - onames->set_active_text (M("TP_ICM_NOICM")); + onames->set_active_text(M("TP_ICM_NOICM")); } else { - onames->set_active_text (pp->icm.output); + onames->set_active_text(pp->icm.output); } if (onames->get_active_row_number() == -1) { - onames->set_active_text (M("TP_ICM_NOICM")); + onames->set_active_text(M("TP_ICM_NOICM")); } - ointent->setSelected (pp->icm.outputIntent); - obpc->set_active (pp->icm.outputBPC); - ckbToneCurve->set_active (pp->icm.toneCurve); + ointent->setSelected(pp->icm.outputIntent); + + obpc->set_active(pp->icm.outputBPC); + ckbToneCurve->set_active(pp->icm.toneCurve); lastToneCurve = pp->icm.toneCurve; - ckbApplyLookTable->set_active (pp->icm.applyLookTable); + ckbApplyLookTable->set_active(pp->icm.applyLookTable); lastApplyLookTable = pp->icm.applyLookTable; - ckbApplyBaselineExposureOffset->set_active (pp->icm.applyBaselineExposureOffset); + ckbApplyBaselineExposureOffset->set_active(pp->icm.applyBaselineExposureOffset); lastApplyBaselineExposureOffset = pp->icm.applyBaselineExposureOffset; - ckbApplyHueSatMap->set_active (pp->icm.applyHueSatMap); + ckbApplyHueSatMap->set_active(pp->icm.applyHueSatMap); lastApplyHueSatMap = pp->icm.applyHueSatMap; - freegamma->set_active (pp->icm.freegamma); + freegamma->set_active(pp->icm.freegamma); lastgamfree = pp->icm.freegamma; if (!batchMode) { @@ -622,17 +625,17 @@ void ICMPanel::read (const ProcParams* pp, const ParamsEdited* pedited) //wprimari->set_sensitive(!pp->icm.freegamma); } - gampos->setValue (pp->icm.gampos); - slpos->setValue (pp->icm.slpos); + gampos->setValue(pp->icm.gampos); + slpos->setValue(pp->icm.slpos); if (pedited) { - iunchanged->set_active (!pedited->icm.input); + iunchanged->set_active(!pedited->icm.input); obpc->set_inconsistent(!pedited->icm.outputBPC); ckbToneCurve->set_inconsistent(!pedited->icm.toneCurve); ckbApplyLookTable->set_inconsistent(!pedited->icm.applyLookTable); ckbApplyBaselineExposureOffset->set_inconsistent(!pedited->icm.applyBaselineExposureOffset); ckbApplyHueSatMap->set_inconsistent(!pedited->icm.applyHueSatMap); - freegamma->set_inconsistent (!pedited->icm.freegamma); + freegamma->set_inconsistent(!pedited->icm.freegamma); if (!pedited->icm.working) { wnames->set_active_text(M("GENERAL_UNCHANGED")); @@ -643,7 +646,7 @@ void ICMPanel::read (const ProcParams* pp, const ParamsEdited* pedited) } if (!pedited->icm.outputIntent) { - ointent->setSelected (4); + ointent->setSelected(4); } if (!pedited->icm.dcpIlluminant) { @@ -654,47 +657,49 @@ void ICMPanel::read (const ProcParams* pp, const ParamsEdited* pedited) wgamma->set_active_text(M("GENERAL_UNCHANGED")); wgamma->set_active_text(M("GENERAL_UNCHANGED")); } + if (!pedited->icm.wprimari) { wprimari->set_active_text(M("GENERAL_UNCHANGED")); } + if (!pedited->icm.wprofile) { wprofile->set_active_text(M("GENERAL_UNCHANGED")); } - gampos->setEditedState (pedited->icm.gampos ? Edited : UnEdited); - slpos->setEditedState (pedited->icm.slpos ? Edited : UnEdited); + gampos->setEditedState(pedited->icm.gampos ? Edited : UnEdited); + slpos->setEditedState(pedited->icm.slpos ? Edited : UnEdited); } - enableListener (); + enableListener(); } -void ICMPanel::write (ProcParams* pp, ParamsEdited* pedited) +void ICMPanel::write(ProcParams* pp, ParamsEdited* pedited) { if (inone->get_active()) { pp->icm.input = "(none)"; - } else if (iembedded->get_active ()) { + } else if (iembedded->get_active()) { pp->icm.input = "(embedded)"; - } else if (icamera->get_active ()) { + } else if (icamera->get_active()) { pp->icm.input = "(camera)"; - } else if (icameraICC->get_active ()) { + } else if (icameraICC->get_active()) { pp->icm.input = "(cameraICC)"; } else { - if (Glib::file_test (ipDialog->get_filename (), Glib::FILE_TEST_EXISTS) && !Glib::file_test (ipDialog->get_filename (), Glib::FILE_TEST_IS_DIR)) { - pp->icm.input = "file:" + ipDialog->get_filename (); + if (Glib::file_test(ipDialog->get_filename(), Glib::FILE_TEST_EXISTS) && !Glib::file_test(ipDialog->get_filename(), Glib::FILE_TEST_IS_DIR)) { + pp->icm.input = "file:" + ipDialog->get_filename(); } else { pp->icm.input = ""; // just a directory } - Glib::ustring p = Glib::path_get_dirname(ipDialog->get_filename ()); + Glib::ustring p = Glib::path_get_dirname(ipDialog->get_filename()); } - pp->icm.working = wnames->get_active_text (); - pp->icm.gamma = wgamma->get_active_text (); + pp->icm.working = wnames->get_active_text(); + pp->icm.gamma = wgamma->get_active_text(); pp->icm.dcpIlluminant = rtengine::max(dcpIll->get_active_row_number(), 0); - pp->icm.wprimari = wprimari->get_active_text (); - // pp->icm.wprofile = wprofile->get_active_text (); + pp->icm.wprimari = wprimari->get_active_text(); + // pp->icm.wprofile = wprofile->get_active_text (); if (onames->get_active_text() == M("TP_ICM_NOICM")) { pp->icm.output = ColorManagementParams::NoICMString; @@ -702,114 +707,115 @@ void ICMPanel::write (ProcParams* pp, ParamsEdited* pedited) pp->icm.output = onames->get_active_text(); } - int ointentVal = ointent->getSelected (); + int ointentVal = ointent->getSelected(); + if (ointentVal >= 0 && ointentVal < RI__COUNT) { pp->icm.outputIntent = static_cast(ointentVal); } else { pp->icm.outputIntent = rtengine::RI_RELATIVE; } - if (wprofile->get_active_row_number() == 0) { - pp->icm.wprofile = "none"; - } else if (wprofile->get_active_row_number() == 1) { - pp->icm.wprofile = "v2"; - } else if (wprofile->get_active_row_number() == 2) { - pp->icm.wprofile = "v4"; - } - + if (wprofile->get_active_row_number() == 0) { + pp->icm.wprofile = "none"; + } else if (wprofile->get_active_row_number() == 1) { + pp->icm.wprofile = "v2"; + } else if (wprofile->get_active_row_number() == 2) { + pp->icm.wprofile = "v4"; + } + pp->icm.freegamma = freegamma->get_active(); - pp->icm.toneCurve = ckbToneCurve->get_active (); - pp->icm.applyLookTable = ckbApplyLookTable->get_active (); - pp->icm.applyBaselineExposureOffset = ckbApplyBaselineExposureOffset->get_active (); - pp->icm.applyHueSatMap = ckbApplyHueSatMap->get_active (); + pp->icm.toneCurve = ckbToneCurve->get_active(); + pp->icm.applyLookTable = ckbApplyLookTable->get_active(); + pp->icm.applyBaselineExposureOffset = ckbApplyBaselineExposureOffset->get_active(); + pp->icm.applyHueSatMap = ckbApplyHueSatMap->get_active(); pp->icm.gampos = (double) gampos->getValue(); pp->icm.slpos = (double) slpos->getValue(); - pp->icm.outputBPC = obpc->get_active (); + pp->icm.outputBPC = obpc->get_active(); if (pedited) { - pedited->icm.input = !iunchanged->get_active (); + pedited->icm.input = !iunchanged->get_active(); pedited->icm.working = wnames->get_active_text() != M("GENERAL_UNCHANGED"); pedited->icm.output = onames->get_active_text() != M("GENERAL_UNCHANGED"); - pedited->icm.outputIntent = ointent->getSelected () < 4; - pedited->icm.outputBPC = !obpc->get_inconsistent (); + pedited->icm.outputIntent = ointent->getSelected() < 4; + pedited->icm.outputBPC = !obpc->get_inconsistent(); pedited->icm.dcpIlluminant = dcpIll->get_active_text() != M("GENERAL_UNCHANGED"); - pedited->icm.toneCurve = !ckbToneCurve->get_inconsistent (); - pedited->icm.applyLookTable = !ckbApplyLookTable->get_inconsistent (); - pedited->icm.applyBaselineExposureOffset = !ckbApplyBaselineExposureOffset->get_inconsistent (); - pedited->icm.applyHueSatMap = !ckbApplyHueSatMap->get_inconsistent (); + pedited->icm.toneCurve = !ckbToneCurve->get_inconsistent(); + pedited->icm.applyLookTable = !ckbApplyLookTable->get_inconsistent(); + pedited->icm.applyBaselineExposureOffset = !ckbApplyBaselineExposureOffset->get_inconsistent(); + pedited->icm.applyHueSatMap = !ckbApplyHueSatMap->get_inconsistent(); pedited->icm.gamma = wgamma->get_active_text() != M("GENERAL_UNCHANGED"); pedited->icm.freegamma = !freegamma->get_inconsistent(); - pedited->icm.gampos = gampos->getEditedState (); - pedited->icm.slpos = slpos->getEditedState (); + pedited->icm.gampos = gampos->getEditedState(); + pedited->icm.slpos = slpos->getEditedState(); pedited->icm.wprimari = wprimari->get_active_text() != M("GENERAL_UNCHANGED"); pedited->icm.wprofile = wprofile->get_active_text() != M("GENERAL_UNCHANGED"); } } -void ICMPanel::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) +void ICMPanel::setDefaults(const ProcParams* defParams, const ParamsEdited* pedited) { - gampos->setDefault (defParams->icm.gampos); - slpos->setDefault (defParams->icm.slpos); + gampos->setDefault(defParams->icm.gampos); + slpos->setDefault(defParams->icm.slpos); if (pedited) { - gampos->setDefaultEditedState (pedited->icm.gampos ? Edited : UnEdited); - slpos->setDefaultEditedState (pedited->icm.slpos ? Edited : UnEdited); + gampos->setDefaultEditedState(pedited->icm.gampos ? Edited : UnEdited); + slpos->setDefaultEditedState(pedited->icm.slpos ? Edited : UnEdited); } else { - gampos->setDefaultEditedState (Irrelevant); - slpos->setDefaultEditedState (Irrelevant); + gampos->setDefaultEditedState(Irrelevant); + slpos->setDefaultEditedState(Irrelevant); } } -void ICMPanel::setAdjusterBehavior (bool gammaadd, bool slopeadd) +void ICMPanel::setAdjusterBehavior(bool gammaadd, bool slopeadd) { - gampos->setAddMode (gammaadd); - slpos->setAddMode (slopeadd); + gampos->setAddMode(gammaadd); + slpos->setAddMode(slopeadd); } -void ICMPanel::adjusterChanged (Adjuster* a, double newval) +void ICMPanel::adjusterChanged(Adjuster* a, double newval) { if (listener && (freegamma->get_active() || batchMode)) { - Glib::ustring costr = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), newval); + Glib::ustring costr = Glib::ustring::format(std::setw(3), std::fixed, std::setprecision(2), newval); if (a == gampos) { - listener->panelChanged (EvGAMPOS, costr); + listener->panelChanged(EvGAMPOS, costr); } else if (a == slpos) { - listener->panelChanged (EvSLPOS, costr); + listener->panelChanged(EvSLPOS, costr); } } } -void ICMPanel::wpChanged () +void ICMPanel::wpChanged() { if (listener) { - listener->panelChanged (EvWProfile, wnames->get_active_text ()); + listener->panelChanged(EvWProfile, wnames->get_active_text()); } } -void ICMPanel::wprimariChanged () +void ICMPanel::wprimariChanged() { if (listener) { - listener->panelChanged (EvICMprimariMethod, wprimari->get_active_text ()); + listener->panelChanged(EvICMprimariMethod, wprimari->get_active_text()); } } -void ICMPanel::wprofileChanged () +void ICMPanel::wprofileChanged() { if (listener) { - listener->panelChanged (EvICMprofileMethod, wprofile->get_active_text ()); + listener->panelChanged(EvICMprofileMethod, wprofile->get_active_text()); } } -void ICMPanel::gpChanged () +void ICMPanel::gpChanged() { if (listener) { - listener->panelChanged (EvGAMMA, wgamma->get_active_text ()); + listener->panelChanged(EvGAMMA, wgamma->get_active_text()); onames->set_sensitive(wgamma->get_active_row_number() == 0); //"default" } } @@ -817,7 +823,7 @@ void ICMPanel::gpChanged () void ICMPanel::dcpIlluminantChanged() { if (listener) { - listener->panelChanged (EvDCPIlluminant, dcpIll->get_active_text ()); + listener->panelChanged(EvDCPIlluminant, dcpIll->get_active_text()); } } @@ -825,24 +831,24 @@ void ICMPanel::toneCurveChanged() { if (multiImage) { if (ckbToneCurve->get_inconsistent()) { - ckbToneCurve->set_inconsistent (false); - tcurveconn.block (true); - ckbToneCurve->set_active (false); - tcurveconn.block (false); + ckbToneCurve->set_inconsistent(false); + tcurveconn.block(true); + ckbToneCurve->set_active(false); + tcurveconn.block(false); } else if (lastToneCurve) { - ckbToneCurve->set_inconsistent (true); + ckbToneCurve->set_inconsistent(true); } - lastToneCurve = ckbToneCurve->get_active (); + lastToneCurve = ckbToneCurve->get_active(); } if (listener) { if (ckbToneCurve->get_inconsistent()) { - listener->panelChanged (EvDCPToneCurve, M("GENERAL_UNCHANGED")); + listener->panelChanged(EvDCPToneCurve, M("GENERAL_UNCHANGED")); } else if (ckbToneCurve->get_active()) { - listener->panelChanged (EvDCPToneCurve, M("GENERAL_ENABLED")); + listener->panelChanged(EvDCPToneCurve, M("GENERAL_ENABLED")); } else { - listener->panelChanged (EvDCPToneCurve, M("GENERAL_DISABLED")); + listener->panelChanged(EvDCPToneCurve, M("GENERAL_DISABLED")); } } } @@ -851,24 +857,24 @@ void ICMPanel::applyLookTableChanged() { if (multiImage) { if (ckbApplyLookTable->get_inconsistent()) { - ckbApplyLookTable->set_inconsistent (false); - ltableconn.block (true); - ckbApplyLookTable->set_active (false); - ltableconn.block (false); + ckbApplyLookTable->set_inconsistent(false); + ltableconn.block(true); + ckbApplyLookTable->set_active(false); + ltableconn.block(false); } else if (lastApplyLookTable) { - ckbApplyLookTable->set_inconsistent (true); + ckbApplyLookTable->set_inconsistent(true); } - lastApplyLookTable = ckbApplyLookTable->get_active (); + lastApplyLookTable = ckbApplyLookTable->get_active(); } if (listener) { if (ckbApplyLookTable->get_inconsistent()) { - listener->panelChanged (EvDCPApplyLookTable, M("GENERAL_UNCHANGED")); + listener->panelChanged(EvDCPApplyLookTable, M("GENERAL_UNCHANGED")); } else if (ckbApplyLookTable->get_active()) { - listener->panelChanged (EvDCPApplyLookTable, M("GENERAL_ENABLED")); + listener->panelChanged(EvDCPApplyLookTable, M("GENERAL_ENABLED")); } else { - listener->panelChanged (EvDCPApplyLookTable, M("GENERAL_DISABLED")); + listener->panelChanged(EvDCPApplyLookTable, M("GENERAL_DISABLED")); } } } @@ -877,24 +883,24 @@ void ICMPanel::applyBaselineExposureOffsetChanged() { if (multiImage) { if (ckbApplyBaselineExposureOffset->get_inconsistent()) { - ckbApplyBaselineExposureOffset->set_inconsistent (false); - beoconn.block (true); - ckbApplyBaselineExposureOffset->set_active (false); - beoconn.block (false); + ckbApplyBaselineExposureOffset->set_inconsistent(false); + beoconn.block(true); + ckbApplyBaselineExposureOffset->set_active(false); + beoconn.block(false); } else if (lastApplyBaselineExposureOffset) { - ckbApplyBaselineExposureOffset->set_inconsistent (true); + ckbApplyBaselineExposureOffset->set_inconsistent(true); } - lastApplyBaselineExposureOffset = ckbApplyBaselineExposureOffset->get_active (); + lastApplyBaselineExposureOffset = ckbApplyBaselineExposureOffset->get_active(); } if (listener) { if (ckbApplyBaselineExposureOffset->get_inconsistent()) { - listener->panelChanged (EvDCPApplyBaselineExposureOffset, M("GENERAL_UNCHANGED")); + listener->panelChanged(EvDCPApplyBaselineExposureOffset, M("GENERAL_UNCHANGED")); } else if (ckbApplyBaselineExposureOffset->get_active()) { - listener->panelChanged (EvDCPApplyBaselineExposureOffset, M("GENERAL_ENABLED")); + listener->panelChanged(EvDCPApplyBaselineExposureOffset, M("GENERAL_ENABLED")); } else { - listener->panelChanged (EvDCPApplyBaselineExposureOffset, M("GENERAL_DISABLED")); + listener->panelChanged(EvDCPApplyBaselineExposureOffset, M("GENERAL_DISABLED")); } } } @@ -903,49 +909,49 @@ void ICMPanel::applyHueSatMapChanged() { if (multiImage) { if (ckbApplyHueSatMap->get_inconsistent()) { - ckbApplyHueSatMap->set_inconsistent (false); - hsmconn.block (true); - ckbApplyHueSatMap->set_active (false); - hsmconn.block (false); + ckbApplyHueSatMap->set_inconsistent(false); + hsmconn.block(true); + ckbApplyHueSatMap->set_active(false); + hsmconn.block(false); } else if (lastApplyHueSatMap) { - ckbApplyHueSatMap->set_inconsistent (true); + ckbApplyHueSatMap->set_inconsistent(true); } - lastApplyHueSatMap = ckbApplyHueSatMap->get_active (); + lastApplyHueSatMap = ckbApplyHueSatMap->get_active(); } if (listener) { if (ckbApplyHueSatMap->get_inconsistent()) { - listener->panelChanged (EvDCPApplyHueSatMap, M("GENERAL_UNCHANGED")); + listener->panelChanged(EvDCPApplyHueSatMap, M("GENERAL_UNCHANGED")); } else if (ckbApplyHueSatMap->get_active()) { - listener->panelChanged (EvDCPApplyHueSatMap, M("GENERAL_ENABLED")); + listener->panelChanged(EvDCPApplyHueSatMap, M("GENERAL_ENABLED")); } else { - listener->panelChanged (EvDCPApplyHueSatMap, M("GENERAL_DISABLED")); + listener->panelChanged(EvDCPApplyHueSatMap, M("GENERAL_DISABLED")); } } } -void ICMPanel::ipChanged () +void ICMPanel::ipChanged() { Glib::ustring profname; if (inone->get_active()) { profname = "(none)"; - } else if (iembedded->get_active ()) { + } else if (iembedded->get_active()) { profname = "(embedded)"; - } else if (icamera->get_active ()) { + } else if (icamera->get_active()) { profname = "(camera)"; - } else if (icameraICC->get_active ()) { + } else if (icameraICC->get_active()) { profname = "(cameraICC)"; } else { - profname = ipDialog->get_filename (); + profname = ipDialog->get_filename(); } updateDCP(-1, profname); if (listener && profname != oldip) { - listener->panelChanged (EvIProfile, profname); + listener->panelChanged(EvIProfile, profname); } oldip = profname; @@ -955,123 +961,130 @@ void ICMPanel::GamChanged() { if (multiImage) { if (freegamma->get_inconsistent()) { - freegamma->set_inconsistent (false); - gamcsconn.block (true); - freegamma->set_active (false); - gamcsconn.block (false); + freegamma->set_inconsistent(false); + gamcsconn.block(true); + freegamma->set_active(false); + gamcsconn.block(false); } else if (lastgamfree) { - freegamma->set_inconsistent (true); + freegamma->set_inconsistent(true); } - lastgamfree = freegamma->get_active (); + lastgamfree = freegamma->get_active(); } if (listener) { if (freegamma->get_inconsistent()) { - listener->panelChanged (EvGAMFREE, M("GENERAL_UNCHANGED")); - } - else if (freegamma->get_active()) { - listener->panelChanged (EvGAMFREE, M("GENERAL_ENABLED")); + listener->panelChanged(EvGAMFREE, M("GENERAL_UNCHANGED")); + } else if (freegamma->get_active()) { + listener->panelChanged(EvGAMFREE, M("GENERAL_ENABLED")); + if (!batchMode) { onames->set_sensitive(false);//disabled choice wgamma->set_sensitive(false); gampos->set_sensitive(true); slpos->set_sensitive(true); - wprimari->set_sensitive(true); - wprofile->set_sensitive(true); - + wprimari->set_sensitive(true); + wprofile->set_sensitive(true); + } } else { - listener->panelChanged (EvGAMFREE, M("GENERAL_DISABLED")); + listener->panelChanged(EvGAMFREE, M("GENERAL_DISABLED")); + if (!batchMode) { onames->set_sensitive(wgamma->get_active_row_number() == 0); wgamma->set_sensitive(true); gampos->set_sensitive(false); slpos->set_sensitive(false); - wprimari->set_sensitive(false); - wprofile->set_sensitive(false); + wprimari->set_sensitive(false); + wprofile->set_sensitive(false); } } } } -void ICMPanel::opChanged () +void ICMPanel::opChanged() { if (!batchMode) { updateRenderingIntent(onames->get_active_text()); } if (listener) { - listener->panelChanged (EvOProfile, onames->get_active_text()); + listener->panelChanged(EvOProfile, onames->get_active_text()); } } -void ICMPanel::oiChanged (int n) +void ICMPanel::oiChanged(int n) { if (listener) { Glib::ustring str; + switch (n) { - case 0: - str = M("PREFERENCES_INTENT_PERCEPTUAL"); - break; - case 1: - str = M("PREFERENCES_INTENT_RELATIVE"); - break; - case 2: - str = M("PREFERENCES_INTENT_SATURATION"); - break; - case 3: - str = M("PREFERENCES_INTENT_ABSOLUTE"); - break; - case 4: - default: - str = M("GENERAL_UNCHANGED"); - break; + case 0: + str = M("PREFERENCES_INTENT_PERCEPTUAL"); + break; + + case 1: + str = M("PREFERENCES_INTENT_RELATIVE"); + break; + + case 2: + str = M("PREFERENCES_INTENT_SATURATION"); + break; + + case 3: + str = M("PREFERENCES_INTENT_ABSOLUTE"); + break; + + case 4: + default: + str = M("GENERAL_UNCHANGED"); + break; } - listener->panelChanged (EvOIntent, str); + + listener->panelChanged(EvOIntent, str); } } -void ICMPanel::oBPCChanged () +void ICMPanel::oBPCChanged() { if (multiImage) { if (obpc->get_inconsistent()) { - obpc->set_inconsistent (false); - obpcconn.block (true); - obpc->set_active (false); - obpcconn.block (false); + obpc->set_inconsistent(false); + obpcconn.block(true); + obpc->set_active(false); + obpcconn.block(false); } else if (lastobpc) { - obpc->set_inconsistent (true); + obpc->set_inconsistent(true); } - lastobpc = obpc->get_active (); + lastobpc = obpc->get_active(); } if (listener) { if (obpc->get_inconsistent()) { - listener->panelChanged (EvOBPCompens, M("GENERAL_UNCHANGED")); + listener->panelChanged(EvOBPCompens, M("GENERAL_UNCHANGED")); } else if (obpc->get_active()) { - listener->panelChanged (EvOBPCompens, M("GENERAL_ENABLED")); + listener->panelChanged(EvOBPCompens, M("GENERAL_ENABLED")); } else { - listener->panelChanged (EvOBPCompens, M("GENERAL_DISABLED")); + listener->panelChanged(EvOBPCompens, M("GENERAL_DISABLED")); } } } -void ICMPanel::setRawMeta (bool raw, const rtengine::FramesData* pMeta) +void ICMPanel::setRawMeta(bool raw, const rtengine::FramesData* pMeta) { - disableListener (); + disableListener(); - icamera->set_active (raw); - iembedded->set_active (!raw); - icamera->set_sensitive (raw); + icamera->set_active(raw); + iembedded->set_active(!raw); + icamera->set_sensitive(raw); camName = pMeta->getCamera(); - icameraICC->set_sensitive (raw && (ICCStore::getInstance()->getStdProfile(pMeta->getCamera()) != nullptr || DCPStore::getInstance()->getStdProfile(pMeta->getCamera()) != nullptr)); - iembedded->set_sensitive (!raw); + icameraICC->set_sensitive(raw && (ICCStore::getInstance()->getStdProfile(pMeta->getCamera()) != nullptr || DCPStore::getInstance()->getStdProfile(pMeta->getCamera()) != nullptr)); + iembedded->set_sensitive(!raw); - enableListener (); + enableListener(); } void ICMPanel::ipSelectionChanged() @@ -1084,23 +1097,23 @@ void ICMPanel::ipSelectionChanged() ipChanged(); } -void ICMPanel::saveReferencePressed () +void ICMPanel::saveReferencePressed() { if (!icmplistener) { return; } - Gtk::FileChooserDialog dialog (getToplevelWindow (this), M("TP_ICM_SAVEREFERENCE"), Gtk::FILE_CHOOSER_ACTION_SAVE); - bindCurrentFolder (dialog, options.lastProfilingReferenceDir); - dialog.set_current_name (lastRefFilename); + Gtk::FileChooserDialog dialog(getToplevelWindow(this), M("TP_ICM_SAVEREFERENCE"), Gtk::FILE_CHOOSER_ACTION_SAVE); + bindCurrentFolder(dialog, options.lastProfilingReferenceDir); + dialog.set_current_name(lastRefFilename); dialog.add_button(M("GENERAL_CANCEL"), Gtk::RESPONSE_CANCEL); dialog.add_button(M("GENERAL_SAVE"), Gtk::RESPONSE_OK); Gtk::CheckButton applyWB(M("TP_ICM_SAVEREFERENCE_APPLYWB")); - applyWB.set_tooltip_text (M("TP_ICM_SAVEREFERENCE_APPLYWB_TOOLTIP")); - Gtk::HBox* hbox = Gtk::manage( new Gtk::HBox() ); + applyWB.set_tooltip_text(M("TP_ICM_SAVEREFERENCE_APPLYWB_TOOLTIP")); + Gtk::HBox* hbox = Gtk::manage(new Gtk::HBox()); hbox->pack_end(applyWB, Gtk::PACK_SHRINK, 2); Gtk::Box *box = dialog.get_content_area(); box->pack_end(*hbox, Gtk::PACK_SHRINK, 2); @@ -1135,8 +1148,8 @@ void ICMPanel::saveReferencePressed () } if (confirmOverwrite(dialog, fname)) { - icmplistener->saveInputICCReference (fname, applyWB.get_active()); - lastRefFilename = Glib::path_get_basename (fname); + icmplistener->saveInputICCReference(fname, applyWB.get_active()); + lastRefFilename = Glib::path_get_basename(fname); done = true; } } @@ -1145,25 +1158,25 @@ void ICMPanel::saveReferencePressed () return; } -void ICMPanel::setBatchMode (bool batchMode) +void ICMPanel::setBatchMode(bool batchMode) { isBatchMode = true; - ToolPanel::setBatchMode (batchMode); - iunchanged = Gtk::manage (new Gtk::RadioButton (M("GENERAL_UNCHANGED"))); - iunchanged->set_group (opts); - iVBox->pack_start (*iunchanged, Gtk::PACK_SHRINK, 4); - iVBox->reorder_child (*iunchanged, 5); - removeIfThere (this, saveRef); - onames->append (M("GENERAL_UNCHANGED")); + ToolPanel::setBatchMode(batchMode); + iunchanged = Gtk::manage(new Gtk::RadioButton(M("GENERAL_UNCHANGED"))); + iunchanged->set_group(opts); + iVBox->pack_start(*iunchanged, Gtk::PACK_SHRINK, 4); + iVBox->reorder_child(*iunchanged, 5); + removeIfThere(this, saveRef); + onames->append(M("GENERAL_UNCHANGED")); ointent->addEntry("unchanged-22.png", M("GENERAL_UNCHANGED")); ointent->show(); - wnames->append (M("GENERAL_UNCHANGED")); - wgamma->append (M("GENERAL_UNCHANGED")); - wprimari->append (M("GENERAL_UNCHANGED")); - wprofile->append (M("GENERAL_UNCHANGED")); - dcpIll->append (M("GENERAL_UNCHANGED")); - gampos->showEditedCB (); - slpos->showEditedCB (); + wnames->append(M("GENERAL_UNCHANGED")); + wgamma->append(M("GENERAL_UNCHANGED")); + wprimari->append(M("GENERAL_UNCHANGED")); + wprofile->append(M("GENERAL_UNCHANGED")); + dcpIll->append(M("GENERAL_UNCHANGED")); + gampos->showEditedCB(); + slpos->showEditedCB(); } diff --git a/rtgui/icmpanel.h b/rtgui/icmpanel.h index 80ca02571..f1640bd0d 100644 --- a/rtgui/icmpanel.h +++ b/rtgui/icmpanel.h @@ -33,7 +33,7 @@ class ICMPanelListener public: virtual ~ICMPanelListener() {} - virtual void saveInputICCReference (Glib::ustring fname, bool apply_wb) {} + virtual void saveInputICCReference(Glib::ustring fname, bool apply_wb) {} }; class ICMPanel : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel @@ -104,37 +104,37 @@ private: Glib::ustring lastRefFilename; Glib::ustring camName; void updateDCP(int dcpIlluminant, Glib::ustring dcp_name); - void updateRenderingIntent (const Glib::ustring &profile); + void updateRenderingIntent(const Glib::ustring &profile); public: - ICMPanel (); + ICMPanel(); - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr); - void setBatchMode (bool batchMode); - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr); - void adjusterChanged (Adjuster* a, double newval); - void setAdjusterBehavior (bool gammaadd, bool slopeadd); + void read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr); + void write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr); + void setBatchMode(bool batchMode); + void setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr); + void adjusterChanged(Adjuster* a, double newval); + void setAdjusterBehavior(bool gammaadd, bool slopeadd); - void wpChanged (); - void wprimariChanged (); - void wprofileChanged (); - void opChanged (); - void oiChanged (int n); - void oBPCChanged (); - void ipChanged (); - void gpChanged (); - void GamChanged (); - void ipSelectionChanged (); + void wpChanged(); + void wprimariChanged(); + void wprofileChanged(); + void opChanged(); + void oiChanged(int n); + void oBPCChanged(); + void ipChanged(); + void gpChanged(); + void GamChanged(); + void ipSelectionChanged(); void dcpIlluminantChanged(); void toneCurveChanged(); void applyLookTableChanged(); void applyBaselineExposureOffsetChanged(); void applyHueSatMapChanged(); - void setRawMeta (bool raw, const rtengine::FramesData* pMeta); - void saveReferencePressed (); + void setRawMeta(bool raw, const rtengine::FramesData* pMeta); + void saveReferencePressed(); - void setICMPanelListener (ICMPanelListener* ipl) + void setICMPanelListener(ICMPanelListener* ipl) { icmplistener = ipl; } diff --git a/rtgui/options.cc b/rtgui/options.cc index adb5fe9d9..cf4018e67 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -49,16 +49,16 @@ Options options; Glib::ustring versionString = RTVERSION; Glib::ustring paramFileExtension = ".pp3"; -Options::Options () +Options::Options() { defProfError = 0; - setDefaults (); + setDefaults(); } const char *DefaultLanguage = "English (US)"; -inline bool Options::checkProfilePath (Glib::ustring &path) +inline bool Options::checkProfilePath(Glib::ustring &path) { if (path.empty()) { return false; @@ -66,18 +66,18 @@ inline bool Options::checkProfilePath (Glib::ustring &path) Glib::ustring p = getUserProfilePath(); - if (!p.empty() && Glib::file_test (path + paramFileExtension, Glib::FILE_TEST_EXISTS)) { + if (!p.empty() && Glib::file_test(path + paramFileExtension, Glib::FILE_TEST_EXISTS)) { return true; } p = getGlobalProfilePath(); - return !p.empty() && Glib::file_test (path + paramFileExtension, Glib::FILE_TEST_EXISTS); + return !p.empty() && Glib::file_test(path + paramFileExtension, Glib::FILE_TEST_EXISTS); } -bool Options::checkDirPath (Glib::ustring &path, Glib::ustring errString) +bool Options::checkDirPath(Glib::ustring &path, Glib::ustring errString) { - if (Glib::file_test (path, Glib::FILE_TEST_EXISTS) && Glib::file_test (path, Glib::FILE_TEST_IS_DIR)) { + if (Glib::file_test(path, Glib::FILE_TEST_EXISTS) && Glib::file_test(path, Glib::FILE_TEST_IS_DIR)) { return true; } else { if (!errString.empty()) { @@ -96,53 +96,53 @@ void Options::updatePaths() userProfilePath = ""; globalProfilePath = ""; - if (Glib::path_is_absolute (profilePath)) { + if (Glib::path_is_absolute(profilePath)) { // absolute path - if (!checkDirPath (profilePath, "")) { - g_mkdir_with_parents (profilePath.c_str (), 511); + if (!checkDirPath(profilePath, "")) { + g_mkdir_with_parents(profilePath.c_str(), 511); - if (!checkDirPath (profilePath, "")) { // had problems with mkdir_with_parents return value on OS X, just check dir again - Glib::ustring msg = Glib::ustring::compose ("Creation of the user's processing profile directory \"%1\" failed!\n", profilePath); - throw Error (msg); + if (!checkDirPath(profilePath, "")) { // had problems with mkdir_with_parents return value on OS X, just check dir again + Glib::ustring msg = Glib::ustring::compose("Creation of the user's processing profile directory \"%1\" failed!\n", profilePath); + throw Error(msg); } } - if (checkDirPath (profilePath, "Error: the user's processing profile path doesn't point to a directory or doesn't exist!\n")) { + if (checkDirPath(profilePath, "Error: the user's processing profile path doesn't point to a directory or doesn't exist!\n")) { userProfilePath = profilePath; - tmpPath = Glib::build_filename (argv0, "profiles"); + tmpPath = Glib::build_filename(argv0, "profiles"); - if (checkDirPath (tmpPath, "Error: the global's processing profile path doesn't point to a directory or doesn't exist!\n")) { + if (checkDirPath(tmpPath, "Error: the global's processing profile path doesn't point to a directory or doesn't exist!\n")) { if (userProfilePath != tmpPath) { globalProfilePath = tmpPath; } } } else { - tmpPath = Glib::build_filename (argv0, "profiles"); + tmpPath = Glib::build_filename(argv0, "profiles"); - if (checkDirPath (tmpPath, "Error: the global's processing profile path doesn't point to a directory or doesn't exist!\n")) { + if (checkDirPath(tmpPath, "Error: the global's processing profile path doesn't point to a directory or doesn't exist!\n")) { globalProfilePath = tmpPath; } } } else { // relative paths - tmpPath = Glib::build_filename (rtdir, profilePath); + tmpPath = Glib::build_filename(rtdir, profilePath); - if (!checkDirPath (tmpPath, "")) { - g_mkdir_with_parents (tmpPath.c_str (), 511); + if (!checkDirPath(tmpPath, "")) { + g_mkdir_with_parents(tmpPath.c_str(), 511); - if (!checkDirPath (tmpPath, "")) { - Glib::ustring msg = Glib::ustring::compose ("Creation of the user's processing profile directory \"%1\" failed!\n", tmpPath.c_str()); - throw Error (msg); + if (!checkDirPath(tmpPath, "")) { + Glib::ustring msg = Glib::ustring::compose("Creation of the user's processing profile directory \"%1\" failed!\n", tmpPath.c_str()); + throw Error(msg); } } - if (checkDirPath (tmpPath, "Error: the user's processing profile path doesn't point to a directory!\n")) { + if (checkDirPath(tmpPath, "Error: the user's processing profile path doesn't point to a directory!\n")) { userProfilePath = tmpPath; } - tmpPath = Glib::build_filename (argv0, "profiles"); + tmpPath = Glib::build_filename(argv0, "profiles"); - if (checkDirPath (tmpPath, "Error: the user's processing profile path doesn't point to a directory or doesn't exist!\n")) { + if (checkDirPath(tmpPath, "Error: the user's processing profile path doesn't point to a directory or doesn't exist!\n")) { globalProfilePath = tmpPath; } } @@ -150,51 +150,51 @@ void Options::updatePaths() Glib::ustring preferredPath = getPreferredProfilePath(); // Paths are updated only if the user or global profile path is set - if (lastRgbCurvesDir.empty() || !Glib::file_test (lastRgbCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastRgbCurvesDir, Glib::FILE_TEST_IS_DIR)) { + if (lastRgbCurvesDir.empty() || !Glib::file_test(lastRgbCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test(lastRgbCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastRgbCurvesDir = preferredPath; } - if (lastLabCurvesDir.empty() || !Glib::file_test (lastLabCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastLabCurvesDir, Glib::FILE_TEST_IS_DIR)) { + if (lastLabCurvesDir.empty() || !Glib::file_test(lastLabCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test(lastLabCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastLabCurvesDir = preferredPath; } - if (lastRetinexDir.empty() || !Glib::file_test (lastRetinexDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastLabCurvesDir, Glib::FILE_TEST_IS_DIR)) { + if (lastRetinexDir.empty() || !Glib::file_test(lastRetinexDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test(lastLabCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastRetinexDir = preferredPath; } - if (lastDenoiseCurvesDir.empty() || !Glib::file_test (lastDenoiseCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastDenoiseCurvesDir, Glib::FILE_TEST_IS_DIR)) { + if (lastDenoiseCurvesDir.empty() || !Glib::file_test(lastDenoiseCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test(lastDenoiseCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastDenoiseCurvesDir = preferredPath; } - if (lastWaveletCurvesDir.empty() || !Glib::file_test (lastWaveletCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastWaveletCurvesDir, Glib::FILE_TEST_IS_DIR)) { + if (lastWaveletCurvesDir.empty() || !Glib::file_test(lastWaveletCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test(lastWaveletCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastWaveletCurvesDir = preferredPath; } - if (lastPFCurvesDir.empty() || !Glib::file_test (lastPFCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastPFCurvesDir, Glib::FILE_TEST_IS_DIR)) { + if (lastPFCurvesDir.empty() || !Glib::file_test(lastPFCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test(lastPFCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastPFCurvesDir = preferredPath; } - if (lastHsvCurvesDir.empty() || !Glib::file_test (lastHsvCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastHsvCurvesDir, Glib::FILE_TEST_IS_DIR)) { + if (lastHsvCurvesDir.empty() || !Glib::file_test(lastHsvCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test(lastHsvCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastHsvCurvesDir = preferredPath; } - if (lastToneCurvesDir.empty() || !Glib::file_test (lastToneCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastToneCurvesDir, Glib::FILE_TEST_IS_DIR)) { + if (lastToneCurvesDir.empty() || !Glib::file_test(lastToneCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test(lastToneCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastToneCurvesDir = preferredPath; } - if (lastProfilingReferenceDir.empty() || !Glib::file_test (lastProfilingReferenceDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastProfilingReferenceDir, Glib::FILE_TEST_IS_DIR)) { + if (lastProfilingReferenceDir.empty() || !Glib::file_test(lastProfilingReferenceDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test(lastProfilingReferenceDir, Glib::FILE_TEST_IS_DIR)) { lastProfilingReferenceDir = preferredPath; } - if (lastVibranceCurvesDir.empty() || !Glib::file_test (lastVibranceCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastVibranceCurvesDir, Glib::FILE_TEST_IS_DIR)) { + if (lastVibranceCurvesDir.empty() || !Glib::file_test(lastVibranceCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test(lastVibranceCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastVibranceCurvesDir = preferredPath; } - if (loadSaveProfilePath.empty() || !Glib::file_test (loadSaveProfilePath, Glib::FILE_TEST_EXISTS) || !Glib::file_test (loadSaveProfilePath, Glib::FILE_TEST_IS_DIR)) { + if (loadSaveProfilePath.empty() || !Glib::file_test(loadSaveProfilePath, Glib::FILE_TEST_EXISTS) || !Glib::file_test(loadSaveProfilePath, Glib::FILE_TEST_IS_DIR)) { loadSaveProfilePath = preferredPath; } - if (lastBWCurvesDir.empty() || !Glib::file_test (lastBWCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastBWCurvesDir, Glib::FILE_TEST_IS_DIR)) { + if (lastBWCurvesDir.empty() || !Glib::file_test(lastBWCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test(lastBWCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastBWCurvesDir = preferredPath; } @@ -218,7 +218,7 @@ Glib::ustring Options::getPreferredProfilePath() *@return Send back the absolute path of the given filename or "Neutral" if "Neutral" has been set to profName. Implementor will have * to test for this particular value. If the absolute path is invalid (e.g. the file doesn't exist), it will return an empty string. */ -Glib::ustring Options::findProfilePath (Glib::ustring &profName) +Glib::ustring Options::findProfilePath(Glib::ustring &profName) { if (profName.empty()) { return ""; @@ -232,41 +232,41 @@ Glib::ustring Options::findProfilePath (Glib::ustring &profName) return profName; } - Glib::ustring p = profName.substr (0, 4); + Glib::ustring p = profName.substr(0, 4); if (p == "${U}") { // the path starts by the User virtual path p = getUserProfilePath(); - Glib::ustring fullPath = Glib::build_filename (p, profName.substr (5) + paramFileExtension); + Glib::ustring fullPath = Glib::build_filename(p, profName.substr(5) + paramFileExtension); - if (!p.empty() && Glib::file_test (fullPath, Glib::FILE_TEST_EXISTS)) { - return Glib::path_get_dirname (fullPath); + if (!p.empty() && Glib::file_test(fullPath, Glib::FILE_TEST_EXISTS)) { + return Glib::path_get_dirname(fullPath); } } else if (p == "${G}") { // the path starts by the User virtual path p = getGlobalProfilePath(); - Glib::ustring fullPath = Glib::build_filename (p, profName.substr (5) + paramFileExtension); + Glib::ustring fullPath = Glib::build_filename(p, profName.substr(5) + paramFileExtension); - if (!p.empty() && Glib::file_test (fullPath, Glib::FILE_TEST_EXISTS)) { - return Glib::path_get_dirname (fullPath); + if (!p.empty() && Glib::file_test(fullPath, Glib::FILE_TEST_EXISTS)) { + return Glib::path_get_dirname(fullPath); } } else { // compatibility case -> convert the path to the new format p = getUserProfilePath(); - Glib::ustring fullPath = Glib::build_filename (p, profName + paramFileExtension); + Glib::ustring fullPath = Glib::build_filename(p, profName + paramFileExtension); - if (!p.empty() && Glib::file_test (fullPath, Glib::FILE_TEST_EXISTS)) { + if (!p.empty() && Glib::file_test(fullPath, Glib::FILE_TEST_EXISTS)) { // update the profile path - profName = Glib::build_filename ("${U}", profName); - return Glib::path_get_dirname (fullPath); + profName = Glib::build_filename("${U}", profName); + return Glib::path_get_dirname(fullPath); } p = getGlobalProfilePath(); - fullPath = Glib::build_filename (p, profName + paramFileExtension); + fullPath = Glib::build_filename(p, profName + paramFileExtension); - if (!p.empty() && Glib::file_test (fullPath, Glib::FILE_TEST_EXISTS)) { - profName = Glib::build_filename ("${G}", profName); - return Glib::path_get_dirname (fullPath); + if (!p.empty() && Glib::file_test(fullPath, Glib::FILE_TEST_EXISTS)) { + profName = Glib::build_filename("${G}", profName); + return Glib::path_get_dirname(fullPath); } } @@ -274,7 +274,7 @@ Glib::ustring Options::findProfilePath (Glib::ustring &profName) } -void Options::setDefaults () +void Options::setDefaults() { windowWidth = 1200; @@ -390,21 +390,21 @@ void Options::setDefaults () CPBKeys = CPBKT_TID; editorToSendTo = 1; favoriteDirs.clear(); - tpOpen.clear (); + tpOpen.clear(); autoSaveTpOpen = true; //crvOpen.clear (); - parseExtensions.clear (); - parseExtensionsEnabled.clear (); - parsedExtensions.clear (); + parseExtensions.clear(); + parseExtensionsEnabled.clear(); + parsedExtensions.clear(); renameUseTemplates = false; - renameTemplates.clear (); - thumbnailZoomRatios.clear (); - thumbnailZoomRatios.push_back (0.2); - thumbnailZoomRatios.push_back (0.3); - thumbnailZoomRatios.push_back (0.45); - thumbnailZoomRatios.push_back (0.6); - thumbnailZoomRatios.push_back (0.8); - thumbnailZoomRatios.push_back (1.0); + renameTemplates.clear(); + thumbnailZoomRatios.clear(); + thumbnailZoomRatios.push_back(0.2); + thumbnailZoomRatios.push_back(0.3); + thumbnailZoomRatios.push_back(0.45); + thumbnailZoomRatios.push_back(0.6); + thumbnailZoomRatios.push_back(0.8); + thumbnailZoomRatios.push_back(1.0); overlayedFileNames = false; filmStripOverlayedFileNames = false; internalThumbIfUntouched = true; // if TRUE, only fast, internal preview images are taken if the image is not edited yet @@ -502,10 +502,10 @@ void Options::setDefaults () rtSettings.darkFramesPath = ""; rtSettings.flatFieldsPath = ""; #ifdef WIN32 - const gchar* sysRoot = g_getenv ("SystemRoot"); // Returns e.g. "c:\Windows" + const gchar* sysRoot = g_getenv("SystemRoot"); // Returns e.g. "c:\Windows" if (sysRoot != NULL) { - rtSettings.iccDirectory = Glib::ustring (sysRoot) + Glib::ustring ("\\System32\\spool\\drivers\\color"); + rtSettings.iccDirectory = Glib::ustring(sysRoot) + Glib::ustring("\\System32\\spool\\drivers\\color"); } else { rtSettings.iccDirectory = "C:\\WINDOWS\\System32\\spool\\drivers\\color"; } @@ -598,480 +598,480 @@ void Options::setDefaults () rtSettings.thumbnail_inspector_mode = rtengine::Settings::ThumbnailInspectorMode::JPEG; } -Options* Options::copyFrom (Options* other) +Options* Options::copyFrom(Options* other) { *this = *other; return this; } -void Options::filterOutParsedExtensions () +void Options::filterOutParsedExtensions() { parsedExtensions.clear(); for (unsigned int i = 0; i < parseExtensions.size(); i++) if (parseExtensionsEnabled[i]) { - parsedExtensions.push_back (parseExtensions[i].lowercase()); + parsedExtensions.push_back(parseExtensions[i].lowercase()); } } -void Options::readFromFile (Glib::ustring fname) +void Options::readFromFile(Glib::ustring fname) { - setlocale (LC_NUMERIC, "C"); // to set decimal point to "." + setlocale(LC_NUMERIC, "C"); // to set decimal point to "." Glib::KeyFile keyFile; - if ( !Glib::file_test (fname, Glib::FILE_TEST_EXISTS)) { - Glib::ustring msg = Glib::ustring::compose ("Options file %1 does not exist", fname); - throw Error (msg); + if (!Glib::file_test(fname, Glib::FILE_TEST_EXISTS)) { + Glib::ustring msg = Glib::ustring::compose("Options file %1 does not exist", fname); + throw Error(msg); } try { - if (keyFile.load_from_file (fname)) { + if (keyFile.load_from_file(fname)) { // -------------------------------------------------------------------------------------------------------- - if (keyFile.has_group ("General")) { - if (keyFile.has_key ("General", "TabbedEditor")) { - tabbedUI = keyFile.get_boolean ("General", "TabbedEditor"); + if (keyFile.has_group("General")) { + if (keyFile.has_key("General", "TabbedEditor")) { + tabbedUI = keyFile.get_boolean("General", "TabbedEditor"); } - if (keyFile.has_key ("General", "StartupDirectory")) { - if ( keyFile.get_string ("General", "StartupDirectory") == "home") { + if (keyFile.has_key("General", "StartupDirectory")) { + if (keyFile.get_string("General", "StartupDirectory") == "home") { startupDir = STARTUPDIR_HOME; - } else if ( keyFile.get_string ("General", "StartupDirectory") == "current") { + } else if (keyFile.get_string("General", "StartupDirectory") == "current") { startupDir = STARTUPDIR_CURRENT; - } else if ( keyFile.get_string ("General", "StartupDirectory") == "last") { + } else if (keyFile.get_string("General", "StartupDirectory") == "last") { startupDir = STARTUPDIR_LAST; - } else if ( keyFile.get_string ("General", "StartupDirectory") == "custom") { + } else if (keyFile.get_string("General", "StartupDirectory") == "custom") { startupDir = STARTUPDIR_CUSTOM; } } - if (keyFile.has_key ("General", "StartupPath")) { - startupPath = keyFile.get_string ("General", "StartupPath"); + if (keyFile.has_key("General", "StartupPath")) { + startupPath = keyFile.get_string("General", "StartupPath"); } - if (keyFile.has_key ("General", "DateFormat")) { - dateFormat = keyFile.get_string ("General", "DateFormat"); + if (keyFile.has_key("General", "DateFormat")) { + dateFormat = keyFile.get_string("General", "DateFormat"); } - if (keyFile.has_key ("General", "AdjusterMinDelay")) { - adjusterMinDelay = keyFile.get_integer ("General", "AdjusterMinDelay"); + if (keyFile.has_key("General", "AdjusterMinDelay")) { + adjusterMinDelay = keyFile.get_integer("General", "AdjusterMinDelay"); } - if (keyFile.has_key ("General", "AdjusterMaxDelay")) { - adjusterMaxDelay = keyFile.get_integer ("General", "AdjusterMaxDelay"); + if (keyFile.has_key("General", "AdjusterMaxDelay")) { + adjusterMaxDelay = keyFile.get_integer("General", "AdjusterMaxDelay"); } - if (keyFile.has_key ("General", "StoreLastProfile")) { - savesParamsAtExit = keyFile.get_boolean ("General", "StoreLastProfile"); + if (keyFile.has_key("General", "StoreLastProfile")) { + savesParamsAtExit = keyFile.get_boolean("General", "StoreLastProfile"); } - if (keyFile.has_key ("General", "MultiUser")) { - multiUser = keyFile.get_boolean ("General", "MultiUser"); + if (keyFile.has_key("General", "MultiUser")) { + multiUser = keyFile.get_boolean("General", "MultiUser"); } - if (keyFile.has_key ("General", "Version")) { - version = keyFile.get_string ("General", "Version"); + if (keyFile.has_key("General", "Version")) { + version = keyFile.get_string("General", "Version"); } - if (keyFile.has_key ("General", "Language")) { - language = keyFile.get_string ("General", "Language"); + if (keyFile.has_key("General", "Language")) { + language = keyFile.get_string("General", "Language"); } - if (keyFile.has_key ("General", "LanguageAutoDetect")) { - languageAutoDetect = keyFile.get_boolean ("General", "LanguageAutoDetect"); + if (keyFile.has_key("General", "LanguageAutoDetect")) { + languageAutoDetect = keyFile.get_boolean("General", "LanguageAutoDetect"); } - if (keyFile.has_key ("General", "Theme")) { - theme = keyFile.get_string ("General", "Theme"); + if (keyFile.has_key("General", "Theme")) { + theme = keyFile.get_string("General", "Theme"); } - if ( keyFile.has_key ("General", "DarkFramesPath")) { - rtSettings.darkFramesPath = keyFile.get_string ("General", "DarkFramesPath"); + if (keyFile.has_key("General", "DarkFramesPath")) { + rtSettings.darkFramesPath = keyFile.get_string("General", "DarkFramesPath"); } - if ( keyFile.has_key ("General", "FlatFieldsPath")) { - rtSettings.flatFieldsPath = keyFile.get_string ("General", "FlatFieldsPath"); + if (keyFile.has_key("General", "FlatFieldsPath")) { + rtSettings.flatFieldsPath = keyFile.get_string("General", "FlatFieldsPath"); } - if ( keyFile.has_key ("General", "Verbose")) { - rtSettings.verbose = keyFile.get_boolean ( "General", "Verbose"); + if (keyFile.has_key("General", "Verbose")) { + rtSettings.verbose = keyFile.get_boolean("General", "Verbose"); } } - if (keyFile.has_group ("External Editor")) { - if (keyFile.has_key ("External Editor", "EditorKind")) { - editorToSendTo = keyFile.get_integer ("External Editor", "EditorKind"); + if (keyFile.has_group("External Editor")) { + if (keyFile.has_key("External Editor", "EditorKind")) { + editorToSendTo = keyFile.get_integer("External Editor", "EditorKind"); } - if (keyFile.has_key ("External Editor", "GimpDir")) { - gimpDir = keyFile.get_string ("External Editor", "GimpDir"); + if (keyFile.has_key("External Editor", "GimpDir")) { + gimpDir = keyFile.get_string("External Editor", "GimpDir"); } - if (keyFile.has_key ("External Editor", "PhotoshopDir")) { - psDir = keyFile.get_string ("External Editor", "PhotoshopDir"); + if (keyFile.has_key("External Editor", "PhotoshopDir")) { + psDir = keyFile.get_string("External Editor", "PhotoshopDir"); } - if (keyFile.has_key ("External Editor", "CustomEditor")) { - customEditorProg = keyFile.get_string ("External Editor", "CustomEditor"); + if (keyFile.has_key("External Editor", "CustomEditor")) { + customEditorProg = keyFile.get_string("External Editor", "CustomEditor"); } } - if (keyFile.has_group ("Output")) { - if (keyFile.has_key ("Output", "Format")) { - saveFormat.format = keyFile.get_string ("Output", "Format"); + if (keyFile.has_group("Output")) { + if (keyFile.has_key("Output", "Format")) { + saveFormat.format = keyFile.get_string("Output", "Format"); } - if (keyFile.has_key ("Output", "JpegQuality")) { - saveFormat.jpegQuality = keyFile.get_integer ("Output", "JpegQuality"); + if (keyFile.has_key("Output", "JpegQuality")) { + saveFormat.jpegQuality = keyFile.get_integer("Output", "JpegQuality"); } - if (keyFile.has_key ("Output", "JpegSubSamp")) { - saveFormat.jpegSubSamp = keyFile.get_integer ("Output", "JpegSubSamp"); + if (keyFile.has_key("Output", "JpegSubSamp")) { + saveFormat.jpegSubSamp = keyFile.get_integer("Output", "JpegSubSamp"); } - if (keyFile.has_key ("Output", "PngBps")) { - saveFormat.pngBits = keyFile.get_integer ("Output", "PngBps"); + if (keyFile.has_key("Output", "PngBps")) { + saveFormat.pngBits = keyFile.get_integer("Output", "PngBps"); } - if (keyFile.has_key ("Output", "TiffBps")) { - saveFormat.tiffBits = keyFile.get_integer ("Output", "TiffBps"); + if (keyFile.has_key("Output", "TiffBps")) { + saveFormat.tiffBits = keyFile.get_integer("Output", "TiffBps"); } - if (keyFile.has_key ("Output", "TiffUncompressed")) { - saveFormat.tiffUncompressed = keyFile.get_boolean ("Output", "TiffUncompressed"); + if (keyFile.has_key("Output", "TiffUncompressed")) { + saveFormat.tiffUncompressed = keyFile.get_boolean("Output", "TiffUncompressed"); } - if (keyFile.has_key ("Output", "SaveProcParams")) { - saveFormat.saveParams = keyFile.get_boolean ("Output", "SaveProcParams"); + if (keyFile.has_key("Output", "SaveProcParams")) { + saveFormat.saveParams = keyFile.get_boolean("Output", "SaveProcParams"); } - if (keyFile.has_key ("Output", "FormatBatch")) { - saveFormatBatch.format = keyFile.get_string ("Output", "FormatBatch"); + if (keyFile.has_key("Output", "FormatBatch")) { + saveFormatBatch.format = keyFile.get_string("Output", "FormatBatch"); } - if (keyFile.has_key ("Output", "JpegQualityBatch")) { - saveFormatBatch.jpegQuality = keyFile.get_integer ("Output", "JpegQualityBatch"); + if (keyFile.has_key("Output", "JpegQualityBatch")) { + saveFormatBatch.jpegQuality = keyFile.get_integer("Output", "JpegQualityBatch"); } - if (keyFile.has_key ("Output", "JpegSubSampBatch")) { - saveFormatBatch.jpegSubSamp = keyFile.get_integer ("Output", "JpegSubSampBatch"); + if (keyFile.has_key("Output", "JpegSubSampBatch")) { + saveFormatBatch.jpegSubSamp = keyFile.get_integer("Output", "JpegSubSampBatch"); } - if (keyFile.has_key ("Output", "PngBpsBatch")) { - saveFormatBatch.pngBits = keyFile.get_integer ("Output", "PngBpsBatch"); + if (keyFile.has_key("Output", "PngBpsBatch")) { + saveFormatBatch.pngBits = keyFile.get_integer("Output", "PngBpsBatch"); } - if (keyFile.has_key ("Output", "TiffBpsBatch")) { - saveFormatBatch.tiffBits = keyFile.get_integer ("Output", "TiffBpsBatch"); + if (keyFile.has_key("Output", "TiffBpsBatch")) { + saveFormatBatch.tiffBits = keyFile.get_integer("Output", "TiffBpsBatch"); } - if (keyFile.has_key ("Output", "TiffUncompressedBatch")) { - saveFormatBatch.tiffUncompressed = keyFile.get_boolean ("Output", "TiffUncompressedBatch"); + if (keyFile.has_key("Output", "TiffUncompressedBatch")) { + saveFormatBatch.tiffUncompressed = keyFile.get_boolean("Output", "TiffUncompressedBatch"); } - if (keyFile.has_key ("Output", "SaveProcParamsBatch")) { - saveFormatBatch.saveParams = keyFile.get_boolean ("Output", "SaveProcParamsBatch"); + if (keyFile.has_key("Output", "SaveProcParamsBatch")) { + saveFormatBatch.saveParams = keyFile.get_boolean("Output", "SaveProcParamsBatch"); } - if (keyFile.has_key ("Output", "Path")) { - savePathTemplate = keyFile.get_string ("Output", "Path"); + if (keyFile.has_key("Output", "Path")) { + savePathTemplate = keyFile.get_string("Output", "Path"); } - if (keyFile.has_key ("Output", "PathTemplate")) { - savePathTemplate = keyFile.get_string ("Output", "PathTemplate"); + if (keyFile.has_key("Output", "PathTemplate")) { + savePathTemplate = keyFile.get_string("Output", "PathTemplate"); } - if (keyFile.has_key ("Output", "PathFolder")) { - savePathFolder = keyFile.get_string ("Output", "PathFolder"); + if (keyFile.has_key("Output", "PathFolder")) { + savePathFolder = keyFile.get_string("Output", "PathFolder"); } - if (keyFile.has_key ("Output", "AutoSuffix")) { - autoSuffix = keyFile.get_boolean ("Output", "AutoSuffix"); + if (keyFile.has_key("Output", "AutoSuffix")) { + autoSuffix = keyFile.get_boolean("Output", "AutoSuffix"); } - if (keyFile.has_key ("Output", "ForceFormatOpts")) { - forceFormatOpts = keyFile.get_boolean ("Output", "ForceFormatOpts"); + if (keyFile.has_key("Output", "ForceFormatOpts")) { + forceFormatOpts = keyFile.get_boolean("Output", "ForceFormatOpts"); } - if (keyFile.has_key ("Output", "SaveMethodNum")) { - saveMethodNum = keyFile.get_integer ("Output", "SaveMethodNum"); + if (keyFile.has_key("Output", "SaveMethodNum")) { + saveMethodNum = keyFile.get_integer("Output", "SaveMethodNum"); } - if (keyFile.has_key ("Output", "UsePathTemplate")) { - saveUsePathTemplate = keyFile.get_boolean ("Output", "UsePathTemplate"); + if (keyFile.has_key("Output", "UsePathTemplate")) { + saveUsePathTemplate = keyFile.get_boolean("Output", "UsePathTemplate"); } - if (keyFile.has_key ("Output", "LastSaveAsPath")) { - lastSaveAsPath = keyFile.get_string ("Output", "LastSaveAsPath"); + if (keyFile.has_key("Output", "LastSaveAsPath")) { + lastSaveAsPath = keyFile.get_string("Output", "LastSaveAsPath"); } - if (keyFile.has_key ("Output", "OverwriteOutputFile")) { - overwriteOutputFile = keyFile.get_boolean ("Output", "OverwriteOutputFile"); + if (keyFile.has_key("Output", "OverwriteOutputFile")) { + overwriteOutputFile = keyFile.get_boolean("Output", "OverwriteOutputFile"); } } - if (keyFile.has_group ("Profiles")) { - if (keyFile.has_key ("Profiles", "Directory")) { - profilePath = keyFile.get_string ("Profiles", "Directory"); + if (keyFile.has_group("Profiles")) { + if (keyFile.has_key("Profiles", "Directory")) { + profilePath = keyFile.get_string("Profiles", "Directory"); } - if (keyFile.has_key ("Profiles", "UseBundledProfiles")) { - useBundledProfiles = keyFile.get_boolean ("Profiles", "UseBundledProfiles"); + if (keyFile.has_key("Profiles", "UseBundledProfiles")) { + useBundledProfiles = keyFile.get_boolean("Profiles", "UseBundledProfiles"); } - if (keyFile.has_key ("Profiles", "LoadSaveProfilePath")) { - loadSaveProfilePath = keyFile.get_string ("Profiles", "LoadSaveProfilePath"); + if (keyFile.has_key("Profiles", "LoadSaveProfilePath")) { + loadSaveProfilePath = keyFile.get_string("Profiles", "LoadSaveProfilePath"); } - if (keyFile.has_key ("Profiles", "RawDefault")) { - defProfRaw = keyFile.get_string ("Profiles", "RawDefault"); + if (keyFile.has_key("Profiles", "RawDefault")) { + defProfRaw = keyFile.get_string("Profiles", "RawDefault"); } - if (keyFile.has_key ("Profiles", "ImgDefault")) { - defProfImg = keyFile.get_string ("Profiles", "ImgDefault"); + if (keyFile.has_key("Profiles", "ImgDefault")) { + defProfImg = keyFile.get_string("Profiles", "ImgDefault"); } - if (keyFile.has_key ("Profiles", "FilledProfile")) { - filledProfile = keyFile.get_boolean ("Profiles", "FilledProfile"); + if (keyFile.has_key("Profiles", "FilledProfile")) { + filledProfile = keyFile.get_boolean("Profiles", "FilledProfile"); } - if (keyFile.has_key ("Profiles", "SaveParamsWithFile")) { - saveParamsFile = keyFile.get_boolean ("Profiles", "SaveParamsWithFile"); + if (keyFile.has_key("Profiles", "SaveParamsWithFile")) { + saveParamsFile = keyFile.get_boolean("Profiles", "SaveParamsWithFile"); } - if (keyFile.has_key ("Profiles", "SaveParamsToCache")) { - saveParamsCache = keyFile.get_boolean ("Profiles", "SaveParamsToCache"); + if (keyFile.has_key("Profiles", "SaveParamsToCache")) { + saveParamsCache = keyFile.get_boolean("Profiles", "SaveParamsToCache"); } - if (keyFile.has_key ("Profiles", "LoadParamsFromLocation")) { - paramsLoadLocation = (PPLoadLocation)keyFile.get_integer ("Profiles", "LoadParamsFromLocation"); + if (keyFile.has_key("Profiles", "LoadParamsFromLocation")) { + paramsLoadLocation = (PPLoadLocation)keyFile.get_integer("Profiles", "LoadParamsFromLocation"); } - if (keyFile.has_key ("Profiles", "CustomProfileBuilder")) { - CPBPath = keyFile.get_string ("Profiles", "CustomProfileBuilder"); // for backward compatibility only + if (keyFile.has_key("Profiles", "CustomProfileBuilder")) { + CPBPath = keyFile.get_string("Profiles", "CustomProfileBuilder"); // for backward compatibility only } - if (keyFile.has_key ("Profiles", "CustomProfileBuilderPath")) { - CPBPath = keyFile.get_string ("Profiles", "CustomProfileBuilderPath"); + if (keyFile.has_key("Profiles", "CustomProfileBuilderPath")) { + CPBPath = keyFile.get_string("Profiles", "CustomProfileBuilderPath"); } - if (keyFile.has_key ("Profiles", "CustomProfileBuilderKeys")) { - CPBKeys = (CPBKeyType)keyFile.get_integer ("Profiles", "CustomProfileBuilderKeys"); + if (keyFile.has_key("Profiles", "CustomProfileBuilderKeys")) { + CPBKeys = (CPBKeyType)keyFile.get_integer("Profiles", "CustomProfileBuilderKeys"); } } - if (keyFile.has_group ("File Browser")) { - if (keyFile.has_key ("File Browser", "ThumbnailSize")) { - thumbSize = keyFile.get_integer ("File Browser", "ThumbnailSize"); + if (keyFile.has_group("File Browser")) { + if (keyFile.has_key("File Browser", "ThumbnailSize")) { + thumbSize = keyFile.get_integer("File Browser", "ThumbnailSize"); } - if (keyFile.has_key ("File Browser", "ThumbnailSizeTab")) { - thumbSizeTab = keyFile.get_integer ("File Browser", "ThumbnailSizeTab"); + if (keyFile.has_key("File Browser", "ThumbnailSizeTab")) { + thumbSizeTab = keyFile.get_integer("File Browser", "ThumbnailSizeTab"); } - if (keyFile.has_key ("File Browser", "ThumbnailSizeQueue")) { - thumbSizeQueue = keyFile.get_integer ("File Browser", "ThumbnailSizeQueue"); + if (keyFile.has_key("File Browser", "ThumbnailSizeQueue")) { + thumbSizeQueue = keyFile.get_integer("File Browser", "ThumbnailSizeQueue"); } - if (keyFile.has_key ("File Browser", "SameThumbSize")) { - sameThumbSize = keyFile.get_integer ("File Browser", "SameThumbSize"); + if (keyFile.has_key("File Browser", "SameThumbSize")) { + sameThumbSize = keyFile.get_integer("File Browser", "SameThumbSize"); } - if (keyFile.has_key ("File Browser", "BrowseOnlyRaw")) { - fbOnlyRaw = keyFile.get_boolean ("File Browser", "BrowseOnlyRaw"); + if (keyFile.has_key("File Browser", "BrowseOnlyRaw")) { + fbOnlyRaw = keyFile.get_boolean("File Browser", "BrowseOnlyRaw"); } - if (keyFile.has_key ("File Browser", "BrowserShowsDate")) { - fbShowDateTime = keyFile.get_boolean ("File Browser", "BrowserShowsDate"); + if (keyFile.has_key("File Browser", "BrowserShowsDate")) { + fbShowDateTime = keyFile.get_boolean("File Browser", "BrowserShowsDate"); } - if (keyFile.has_key ("File Browser", "BrowserShowsExif")) { - fbShowBasicExif = keyFile.get_boolean ("File Browser", "BrowserShowsExif"); + if (keyFile.has_key("File Browser", "BrowserShowsExif")) { + fbShowBasicExif = keyFile.get_boolean("File Browser", "BrowserShowsExif"); } - if (keyFile.has_key ("File Browser", "BrowserShowsExpComp")) { - fbShowExpComp = keyFile.get_boolean ("File Browser", "BrowserShowsExpComp"); + if (keyFile.has_key("File Browser", "BrowserShowsExpComp")) { + fbShowExpComp = keyFile.get_boolean("File Browser", "BrowserShowsExpComp"); } - if (keyFile.has_key ("File Browser", "BrowserShowsHidden")) { - fbShowHidden = keyFile.get_boolean ("File Browser", "BrowserShowsHidden"); + if (keyFile.has_key("File Browser", "BrowserShowsHidden")) { + fbShowHidden = keyFile.get_boolean("File Browser", "BrowserShowsHidden"); } - if (keyFile.has_key ("File Browser", "MaxPreviewHeight")) { - maxThumbnailHeight = keyFile.get_integer ("File Browser", "MaxPreviewHeight"); + if (keyFile.has_key("File Browser", "MaxPreviewHeight")) { + maxThumbnailHeight = keyFile.get_integer("File Browser", "MaxPreviewHeight"); } - if (keyFile.has_key ("File Browser", "MaxCacheEntries")) { - maxCacheEntries = keyFile.get_integer ("File Browser", "MaxCacheEntries"); + if (keyFile.has_key("File Browser", "MaxCacheEntries")) { + maxCacheEntries = keyFile.get_integer("File Browser", "MaxCacheEntries"); } - if (keyFile.has_key ("File Browser", "ParseExtensions")) { - parseExtensions = keyFile.get_string_list ("File Browser", "ParseExtensions"); + if (keyFile.has_key("File Browser", "ParseExtensions")) { + parseExtensions = keyFile.get_string_list("File Browser", "ParseExtensions"); } - if (keyFile.has_key ("File Browser", "ParseExtensionsEnabled")) { - parseExtensionsEnabled = keyFile.get_integer_list ("File Browser", "ParseExtensionsEnabled"); + if (keyFile.has_key("File Browser", "ParseExtensionsEnabled")) { + parseExtensionsEnabled = keyFile.get_integer_list("File Browser", "ParseExtensionsEnabled"); } - if (keyFile.has_key ("File Browser", "ThumbnailArrangement")) { - fbArrangement = keyFile.get_integer ("File Browser", "ThumbnailArrangement"); + if (keyFile.has_key("File Browser", "ThumbnailArrangement")) { + fbArrangement = keyFile.get_integer("File Browser", "ThumbnailArrangement"); } - if (keyFile.has_key ("File Browser", "ThumbnailInterpolation")) { - thumbInterp = keyFile.get_integer ("File Browser", "ThumbnailInterpolation"); + if (keyFile.has_key("File Browser", "ThumbnailInterpolation")) { + thumbInterp = keyFile.get_integer("File Browser", "ThumbnailInterpolation"); } - if (keyFile.has_key ("File Browser", "FavoriteDirs")) { - favoriteDirs = keyFile.get_string_list ("File Browser", "FavoriteDirs"); + if (keyFile.has_key("File Browser", "FavoriteDirs")) { + favoriteDirs = keyFile.get_string_list("File Browser", "FavoriteDirs"); } - if (keyFile.has_key ("File Browser", "RenameTemplates")) { - renameTemplates = keyFile.get_string_list ("File Browser", "RenameTemplates"); + if (keyFile.has_key("File Browser", "RenameTemplates")) { + renameTemplates = keyFile.get_string_list("File Browser", "RenameTemplates"); } - if (keyFile.has_key ("File Browser", "RenameUseTemplates")) { - renameUseTemplates = keyFile.get_boolean ("File Browser", "RenameUseTemplates"); + if (keyFile.has_key("File Browser", "RenameUseTemplates")) { + renameUseTemplates = keyFile.get_boolean("File Browser", "RenameUseTemplates"); } - if (keyFile.has_key ("File Browser", "ThumbnailZoomRatios")) { - thumbnailZoomRatios = keyFile.get_double_list ("File Browser", "ThumbnailZoomRatios"); + if (keyFile.has_key("File Browser", "ThumbnailZoomRatios")) { + thumbnailZoomRatios = keyFile.get_double_list("File Browser", "ThumbnailZoomRatios"); } - if (keyFile.has_key ("File Browser", "OverlayedFileNames")) { - overlayedFileNames = keyFile.get_boolean ("File Browser", "OverlayedFileNames"); + if (keyFile.has_key("File Browser", "OverlayedFileNames")) { + overlayedFileNames = keyFile.get_boolean("File Browser", "OverlayedFileNames"); } - if (keyFile.has_key ("File Browser", "FilmStripOverlayedFileNames")) { - filmStripOverlayedFileNames = keyFile.get_boolean ("File Browser", "FilmStripOverlayedFileNames"); + if (keyFile.has_key("File Browser", "FilmStripOverlayedFileNames")) { + filmStripOverlayedFileNames = keyFile.get_boolean("File Browser", "FilmStripOverlayedFileNames"); } - if (keyFile.has_key ("File Browser", "ShowFileNames")) { - showFileNames = keyFile.get_boolean ("File Browser", "ShowFileNames"); + if (keyFile.has_key("File Browser", "ShowFileNames")) { + showFileNames = keyFile.get_boolean("File Browser", "ShowFileNames"); } - if (keyFile.has_key ("File Browser", "FilmStripShowFileNames")) { - filmStripShowFileNames = keyFile.get_boolean ("File Browser", "FilmStripShowFileNames"); + if (keyFile.has_key("File Browser", "FilmStripShowFileNames")) { + filmStripShowFileNames = keyFile.get_boolean("File Browser", "FilmStripShowFileNames"); } - if (keyFile.has_key ("File Browser", "InternalThumbIfUntouched")) { - internalThumbIfUntouched = keyFile.get_boolean ("File Browser", "InternalThumbIfUntouched"); + if (keyFile.has_key("File Browser", "InternalThumbIfUntouched")) { + internalThumbIfUntouched = keyFile.get_boolean("File Browser", "InternalThumbIfUntouched"); } - if (keyFile.has_key ("File Browser", "menuGroupRank")) { - menuGroupRank = keyFile.get_boolean ("File Browser", "menuGroupRank"); + if (keyFile.has_key("File Browser", "menuGroupRank")) { + menuGroupRank = keyFile.get_boolean("File Browser", "menuGroupRank"); } - if (keyFile.has_key ("File Browser", "menuGroupLabel")) { - menuGroupLabel = keyFile.get_boolean ("File Browser", "menuGroupLabel"); + if (keyFile.has_key("File Browser", "menuGroupLabel")) { + menuGroupLabel = keyFile.get_boolean("File Browser", "menuGroupLabel"); } - if (keyFile.has_key ("File Browser", "menuGroupFileOperations")) { - menuGroupFileOperations = keyFile.get_boolean ("File Browser", "menuGroupFileOperations"); + if (keyFile.has_key("File Browser", "menuGroupFileOperations")) { + menuGroupFileOperations = keyFile.get_boolean("File Browser", "menuGroupFileOperations"); } - if (keyFile.has_key ("File Browser", "menuGroupProfileOperations")) { - menuGroupProfileOperations = keyFile.get_boolean ("File Browser", "menuGroupProfileOperations"); + if (keyFile.has_key("File Browser", "menuGroupProfileOperations")) { + menuGroupProfileOperations = keyFile.get_boolean("File Browser", "menuGroupProfileOperations"); } - if (keyFile.has_key ("File Browser", "menuGroupExtProg")) { - menuGroupExtProg = keyFile.get_boolean ("File Browser", "menuGroupExtProg"); + if (keyFile.has_key("File Browser", "menuGroupExtProg")) { + menuGroupExtProg = keyFile.get_boolean("File Browser", "menuGroupExtProg"); } - if (keyFile.has_key ("File Browser", "MaxRecentFolders")) { - maxRecentFolders = keyFile.get_integer ("File Browser", "MaxRecentFolders"); + if (keyFile.has_key("File Browser", "MaxRecentFolders")) { + maxRecentFolders = keyFile.get_integer("File Browser", "MaxRecentFolders"); } - recentFolders.reserve (maxRecentFolders + 10); // reserve some more than maxRecentFolders, because at runtime it stores more than that + recentFolders.reserve(maxRecentFolders + 10); // reserve some more than maxRecentFolders, because at runtime it stores more than that - if (keyFile.has_key ("File Browser", "RecentFolders")) { - recentFolders = keyFile.get_string_list ("File Browser", "RecentFolders"); + if (keyFile.has_key("File Browser", "RecentFolders")) { + recentFolders = keyFile.get_string_list("File Browser", "RecentFolders"); } } - if (keyFile.has_group ("Clipping Indication")) { - if (keyFile.has_key ("Clipping Indication", "HighlightThreshold")) { - highlightThreshold = keyFile.get_integer ("Clipping Indication", "HighlightThreshold"); + if (keyFile.has_group("Clipping Indication")) { + if (keyFile.has_key("Clipping Indication", "HighlightThreshold")) { + highlightThreshold = keyFile.get_integer("Clipping Indication", "HighlightThreshold"); } - if (keyFile.has_key ("Clipping Indication", "ShadowThreshold")) { - shadowThreshold = keyFile.get_integer ("Clipping Indication", "ShadowThreshold"); + if (keyFile.has_key("Clipping Indication", "ShadowThreshold")) { + shadowThreshold = keyFile.get_integer("Clipping Indication", "ShadowThreshold"); } - if (keyFile.has_key ("Clipping Indication", "BlinkClipped")) { - blinkClipped = keyFile.get_boolean ("Clipping Indication", "BlinkClipped"); + if (keyFile.has_key("Clipping Indication", "BlinkClipped")) { + blinkClipped = keyFile.get_boolean("Clipping Indication", "BlinkClipped"); } } - if (keyFile.has_group ("Performance")) { - if (keyFile.has_key ("Performance", "RgbDenoiseThreadLimit")) { - rgbDenoiseThreadLimit = keyFile.get_integer ("Performance", "RgbDenoiseThreadLimit"); + if (keyFile.has_group("Performance")) { + if (keyFile.has_key("Performance", "RgbDenoiseThreadLimit")) { + rgbDenoiseThreadLimit = keyFile.get_integer("Performance", "RgbDenoiseThreadLimit"); } - if ( keyFile.has_key ("Performance", "NRauto")) { - rtSettings.nrauto = keyFile.get_double ("Performance", "NRauto"); + if (keyFile.has_key("Performance", "NRauto")) { + rtSettings.nrauto = keyFile.get_double("Performance", "NRauto"); } - if ( keyFile.has_key ("Performance", "NRautomax")) { - rtSettings.nrautomax = keyFile.get_double ("Performance", "NRautomax"); + if (keyFile.has_key("Performance", "NRautomax")) { + rtSettings.nrautomax = keyFile.get_double("Performance", "NRautomax"); } - if ( keyFile.has_key ("Performance", "NRhigh")) { - rtSettings.nrhigh = keyFile.get_double ("Performance", "NRhigh"); + if (keyFile.has_key("Performance", "NRhigh")) { + rtSettings.nrhigh = keyFile.get_double("Performance", "NRhigh"); } if (rtSettings.nrhigh == 0.0) { //avoid crash by division by zero in noise reduction rtSettings.nrhigh = 0.45; } - if ( keyFile.has_key ("Performance", "NRWavlevel")) { - rtSettings.nrwavlevel = keyFile.get_integer ("Performance", "NRWavlevel"); + if (keyFile.has_key("Performance", "NRWavlevel")) { + rtSettings.nrwavlevel = keyFile.get_integer("Performance", "NRWavlevel"); } - if (keyFile.has_key ("Performance", "LevNR")) { - rtSettings.leveldnv = keyFile.get_integer ("Performance", "LevNR"); + if (keyFile.has_key("Performance", "LevNR")) { + rtSettings.leveldnv = keyFile.get_integer("Performance", "LevNR"); } - if (keyFile.has_key ("Performance", "LevNRTI")) { - rtSettings.leveldnti = keyFile.get_integer ("Performance", "LevNRTI"); + if (keyFile.has_key("Performance", "LevNRTI")) { + rtSettings.leveldnti = keyFile.get_integer("Performance", "LevNRTI"); } - if (keyFile.has_key ("Performance", "LevNRAUT")) { - rtSettings.leveldnaut = keyFile.get_integer ("Performance", "LevNRAUT"); + if (keyFile.has_key("Performance", "LevNRAUT")) { + rtSettings.leveldnaut = keyFile.get_integer("Performance", "LevNRAUT"); } - if (keyFile.has_key ("Performance", "LevNRLISS")) { - rtSettings.leveldnliss = keyFile.get_integer ("Performance", "LevNRLISS"); + if (keyFile.has_key("Performance", "LevNRLISS")) { + rtSettings.leveldnliss = keyFile.get_integer("Performance", "LevNRLISS"); } - if (keyFile.has_key ("Performance", "SIMPLNRAUT")) { - rtSettings.leveldnautsimpl = keyFile.get_integer ("Performance", "SIMPLNRAUT"); + if (keyFile.has_key("Performance", "SIMPLNRAUT")) { + rtSettings.leveldnautsimpl = keyFile.get_integer("Performance", "SIMPLNRAUT"); } - if (keyFile.has_key ("Performance", "ClutCacheSize")) { - clutCacheSize = keyFile.get_integer ("Performance", "ClutCacheSize"); + if (keyFile.has_key("Performance", "ClutCacheSize")) { + clutCacheSize = keyFile.get_integer("Performance", "ClutCacheSize"); } - if (keyFile.has_key ("Performance", "MaxInspectorBuffers")) { - maxInspectorBuffers = keyFile.get_integer ("Performance", "MaxInspectorBuffers"); + if (keyFile.has_key("Performance", "MaxInspectorBuffers")) { + maxInspectorBuffers = keyFile.get_integer("Performance", "MaxInspectorBuffers"); } - if (keyFile.has_key ("Performance", "InspectorDelay")) { + if (keyFile.has_key("Performance", "InspectorDelay")) { inspectorDelay = keyFile.get_integer("Performance", "InspectorDelay"); } - if (keyFile.has_key ("Performance", "PreviewDemosaicFromSidecar")) { - prevdemo = (prevdemo_t)keyFile.get_integer ("Performance", "PreviewDemosaicFromSidecar"); + if (keyFile.has_key("Performance", "PreviewDemosaicFromSidecar")) { + prevdemo = (prevdemo_t)keyFile.get_integer("Performance", "PreviewDemosaicFromSidecar"); } - if (keyFile.has_key ("Performance", "Daubechies")) { - rtSettings.daubech = keyFile.get_boolean ("Performance", "Daubechies"); + if (keyFile.has_key("Performance", "Daubechies")) { + rtSettings.daubech = keyFile.get_boolean("Performance", "Daubechies"); } - if (keyFile.has_key ("Performance", "SerializeTiffRead")) { - serializeTiffRead = keyFile.get_boolean ("Performance", "SerializeTiffRead"); + if (keyFile.has_key("Performance", "SerializeTiffRead")) { + serializeTiffRead = keyFile.get_boolean("Performance", "SerializeTiffRead"); } if (keyFile.has_key("Performance", "ThumbnailInspectorMode")) { @@ -1079,320 +1079,325 @@ void Options::readFromFile (Glib::ustring fname) } } - if (keyFile.has_group ("GUI")) { - if (keyFile.has_key ("GUI", "WindowWidth")) { - windowWidth = keyFile.get_integer ("GUI", "WindowWidth"); + if (keyFile.has_group("GUI")) { + if (keyFile.has_key("GUI", "WindowWidth")) { + windowWidth = keyFile.get_integer("GUI", "WindowWidth"); } - if (keyFile.has_key ("GUI", "WindowHeight")) { - windowHeight = keyFile.get_integer ("GUI", "WindowHeight"); + if (keyFile.has_key("GUI", "WindowHeight")) { + windowHeight = keyFile.get_integer("GUI", "WindowHeight"); } - if (keyFile.has_key ("GUI", "WindowX")) { - windowX = keyFile.get_integer ("GUI", "WindowX"); + if (keyFile.has_key("GUI", "WindowX")) { + windowX = keyFile.get_integer("GUI", "WindowX"); } - if (keyFile.has_key ("GUI", "WindowY")) { - windowY = keyFile.get_integer ("GUI", "WindowY"); + if (keyFile.has_key("GUI", "WindowY")) { + windowY = keyFile.get_integer("GUI", "WindowY"); } - if (keyFile.has_key ("GUI", "WindowMonitor")) { - windowMonitor = keyFile.get_integer ("GUI", "WindowMonitor"); + if (keyFile.has_key("GUI", "WindowMonitor")) { + windowMonitor = keyFile.get_integer("GUI", "WindowMonitor"); } - if (keyFile.has_key ("GUI", "MeowMonitor")) { - meowMonitor = keyFile.get_integer ("GUI", "MeowMonitor"); + if (keyFile.has_key("GUI", "MeowMonitor")) { + meowMonitor = keyFile.get_integer("GUI", "MeowMonitor"); } - if (keyFile.has_key ("GUI", "MeowFullScreen")) { - meowFullScreen = keyFile.get_boolean ("GUI", "MeowFullScreen"); + if (keyFile.has_key("GUI", "MeowFullScreen")) { + meowFullScreen = keyFile.get_boolean("GUI", "MeowFullScreen"); } - if (keyFile.has_key ("GUI", "MeowMaximized")) { - meowMaximized = keyFile.get_boolean ("GUI", "MeowMaximized"); + if (keyFile.has_key("GUI", "MeowMaximized")) { + meowMaximized = keyFile.get_boolean("GUI", "MeowMaximized"); } - if (keyFile.has_key ("GUI", "MeowWidth")) { - meowWidth = keyFile.get_integer ("GUI", "MeowWidth"); + if (keyFile.has_key("GUI", "MeowWidth")) { + meowWidth = keyFile.get_integer("GUI", "MeowWidth"); } - if (keyFile.has_key ("GUI", "MeowHeight")) { - meowHeight = keyFile.get_integer ("GUI", "MeowHeight"); + if (keyFile.has_key("GUI", "MeowHeight")) { + meowHeight = keyFile.get_integer("GUI", "MeowHeight"); } - if (keyFile.has_key ("GUI", "MeowX")) { - meowX = keyFile.get_integer ("GUI", "MeowX"); + if (keyFile.has_key("GUI", "MeowX")) { + meowX = keyFile.get_integer("GUI", "MeowX"); } - if (keyFile.has_key ("GUI", "MeowY")) { - meowY = keyFile.get_integer ("GUI", "MeowY"); + if (keyFile.has_key("GUI", "MeowY")) { + meowY = keyFile.get_integer("GUI", "MeowY"); } - if (keyFile.has_key ("GUI", "WindowMaximized")) { - windowMaximized = keyFile.get_boolean ("GUI", "WindowMaximized"); + if (keyFile.has_key("GUI", "WindowMaximized")) { + windowMaximized = keyFile.get_boolean("GUI", "WindowMaximized"); } - if (keyFile.has_key ("GUI", "DetailWindowWidth")) { - detailWindowWidth = keyFile.get_integer ("GUI", "DetailWindowWidth"); + if (keyFile.has_key("GUI", "DetailWindowWidth")) { + detailWindowWidth = keyFile.get_integer("GUI", "DetailWindowWidth"); } - if (keyFile.has_key ("GUI", "DetailWindowHeight")) { - detailWindowHeight = keyFile.get_integer ("GUI", "DetailWindowHeight"); + if (keyFile.has_key("GUI", "DetailWindowHeight")) { + detailWindowHeight = keyFile.get_integer("GUI", "DetailWindowHeight"); } - if (keyFile.has_key ("GUI", "DirBrowserWidth")) { - dirBrowserWidth = keyFile.get_integer ("GUI", "DirBrowserWidth"); + if (keyFile.has_key("GUI", "DirBrowserWidth")) { + dirBrowserWidth = keyFile.get_integer("GUI", "DirBrowserWidth"); } - if (keyFile.has_key ("GUI", "DirBrowserHeight")) { - dirBrowserHeight = keyFile.get_integer ("GUI", "DirBrowserHeight"); + if (keyFile.has_key("GUI", "DirBrowserHeight")) { + dirBrowserHeight = keyFile.get_integer("GUI", "DirBrowserHeight"); } - if (keyFile.has_key ("GUI", "SortType")) { - dirBrowserSortType = static_cast (keyFile.get_integer ("GUI", "SortType")); + if (keyFile.has_key("GUI", "SortType")) { + dirBrowserSortType = static_cast(keyFile.get_integer("GUI", "SortType")); } - if (keyFile.has_key ("GUI", "PreferencesWidth")) { - preferencesWidth = keyFile.get_integer ("GUI", "PreferencesWidth"); + if (keyFile.has_key("GUI", "PreferencesWidth")) { + preferencesWidth = keyFile.get_integer("GUI", "PreferencesWidth"); } - if (keyFile.has_key ("GUI", "PreferencesHeight")) { - preferencesHeight = keyFile.get_integer ("GUI", "PreferencesHeight"); + if (keyFile.has_key("GUI", "PreferencesHeight")) { + preferencesHeight = keyFile.get_integer("GUI", "PreferencesHeight"); } - if (keyFile.has_key ("GUI", "SaveAsDialogWidth")) { - saveAsDialogWidth = keyFile.get_integer ("GUI", "SaveAsDialogWidth"); + if (keyFile.has_key("GUI", "SaveAsDialogWidth")) { + saveAsDialogWidth = keyFile.get_integer("GUI", "SaveAsDialogWidth"); } - if (keyFile.has_key ("GUI", "SaveAsDialogHeight")) { - saveAsDialogHeight = keyFile.get_integer ("GUI", "SaveAsDialogHeight"); + if (keyFile.has_key("GUI", "SaveAsDialogHeight")) { + saveAsDialogHeight = keyFile.get_integer("GUI", "SaveAsDialogHeight"); } - if (keyFile.has_key ("GUI", "ToolPanelWidth")) { - toolPanelWidth = keyFile.get_integer ("GUI", "ToolPanelWidth"); + if (keyFile.has_key("GUI", "ToolPanelWidth")) { + toolPanelWidth = keyFile.get_integer("GUI", "ToolPanelWidth"); } - if (keyFile.has_key ("GUI", "BrowserToolPanelWidth")) { - browserToolPanelWidth = keyFile.get_integer ("GUI", "BrowserToolPanelWidth"); + if (keyFile.has_key("GUI", "BrowserToolPanelWidth")) { + browserToolPanelWidth = keyFile.get_integer("GUI", "BrowserToolPanelWidth"); } - if (keyFile.has_key ("GUI", "BrowserToolPanelHeight")) { - browserToolPanelHeight = keyFile.get_integer ("GUI", "BrowserToolPanelHeight"); + if (keyFile.has_key("GUI", "BrowserToolPanelHeight")) { + browserToolPanelHeight = keyFile.get_integer("GUI", "BrowserToolPanelHeight"); } - if (keyFile.has_key ("GUI", "BrowserToolPanelOpened")) { - browserToolPanelOpened = keyFile.get_boolean ("GUI", "BrowserToolPanelOpened"); + if (keyFile.has_key("GUI", "BrowserToolPanelOpened")) { + browserToolPanelOpened = keyFile.get_boolean("GUI", "BrowserToolPanelOpened"); } - if (keyFile.has_key ("GUI", "BrowserDirPanelOpened")) { - browserDirPanelOpened = keyFile.get_boolean ("GUI", "BrowserDirPanelOpened"); + if (keyFile.has_key("GUI", "BrowserDirPanelOpened")) { + browserDirPanelOpened = keyFile.get_boolean("GUI", "BrowserDirPanelOpened"); } - if (keyFile.has_key ("GUI", "EditorFilmStripOpened")) { - editorFilmStripOpened = keyFile.get_boolean ("GUI", "EditorFilmStripOpened"); + if (keyFile.has_key("GUI", "EditorFilmStripOpened")) { + editorFilmStripOpened = keyFile.get_boolean("GUI", "EditorFilmStripOpened"); } - if (keyFile.has_key ("GUI", "HistoryPanelWidth")) { - historyPanelWidth = keyFile.get_integer ("GUI", "HistoryPanelWidth"); + if (keyFile.has_key("GUI", "HistoryPanelWidth")) { + historyPanelWidth = keyFile.get_integer("GUI", "HistoryPanelWidth"); } - if (keyFile.has_key ("GUI", "FontFamily")) { - fontFamily = keyFile.get_string ("GUI", "FontFamily"); + if (keyFile.has_key("GUI", "FontFamily")) { + fontFamily = keyFile.get_string("GUI", "FontFamily"); } - if (keyFile.has_key ("GUI", "FontSize")) { - fontSize = keyFile.get_integer ("GUI", "FontSize"); + if (keyFile.has_key("GUI", "FontSize")) { + fontSize = keyFile.get_integer("GUI", "FontSize"); } - if (keyFile.has_key ("GUI", "CPFontFamily")) { - CPFontFamily = keyFile.get_string ("GUI", "CPFontFamily"); + if (keyFile.has_key("GUI", "CPFontFamily")) { + CPFontFamily = keyFile.get_string("GUI", "CPFontFamily"); } - if (keyFile.has_key ("GUI", "CPFontSize")) { - CPFontSize = keyFile.get_integer ("GUI", "CPFontSize"); + if (keyFile.has_key("GUI", "CPFontSize")) { + CPFontSize = keyFile.get_integer("GUI", "CPFontSize"); } - if (keyFile.has_key ("GUI", "LastPreviewScale")) { - lastScale = keyFile.get_integer ("GUI", "LastPreviewScale"); + if (keyFile.has_key("GUI", "LastPreviewScale")) { + lastScale = keyFile.get_integer("GUI", "LastPreviewScale"); } - if (keyFile.has_key ("GUI", "LastShowAllExif")) { - lastShowAllExif = keyFile.get_boolean ("GUI", "LastShowAllExif"); + if (keyFile.has_key("GUI", "LastShowAllExif")) { + lastShowAllExif = keyFile.get_boolean("GUI", "LastShowAllExif"); } - if (keyFile.has_key ("GUI", "PanAccelFactor")) { - panAccelFactor = keyFile.get_integer ("GUI", "PanAccelFactor"); + if (keyFile.has_key("GUI", "PanAccelFactor")) { + panAccelFactor = keyFile.get_integer("GUI", "PanAccelFactor"); } - if (keyFile.has_key ("GUI", "RememberZoomAndPan")) { - rememberZoomAndPan = keyFile.get_boolean ("GUI", "RememberZoomAndPan"); + if (keyFile.has_key("GUI", "RememberZoomAndPan")) { + rememberZoomAndPan = keyFile.get_boolean("GUI", "RememberZoomAndPan"); } - if (keyFile.has_key ("GUI", "LastCropSize")) { - lastCropSize = keyFile.get_integer ("GUI", "LastCropSize"); + if (keyFile.has_key("GUI", "LastCropSize")) { + lastCropSize = keyFile.get_integer("GUI", "LastCropSize"); } - if (keyFile.has_key ("GUI", "ShowHistory")) { - showHistory = keyFile.get_boolean ("GUI", "ShowHistory"); + if (keyFile.has_key("GUI", "ShowHistory")) { + showHistory = keyFile.get_boolean("GUI", "ShowHistory"); } - if (keyFile.has_key ("GUI", "ShowFilePanelState")) { - showFilePanelState = keyFile.get_integer ("GUI", "ShowFilePanelState"); + if (keyFile.has_key("GUI", "ShowFilePanelState")) { + showFilePanelState = keyFile.get_integer("GUI", "ShowFilePanelState"); } - if (keyFile.has_key ("GUI", "ShowInfo")) { - showInfo = keyFile.get_boolean ("GUI", "ShowInfo"); + if (keyFile.has_key("GUI", "ShowInfo")) { + showInfo = keyFile.get_boolean("GUI", "ShowInfo"); } - if (keyFile.has_key ("GUI", "MainNBVertical")) { - mainNBVertical = keyFile.get_boolean ("GUI", "MainNBVertical"); + if (keyFile.has_key("GUI", "MainNBVertical")) { + mainNBVertical = keyFile.get_boolean("GUI", "MainNBVertical"); } - if (keyFile.has_key ("GUI", "ShowClippedHighlights")) { - showClippedHighlights = keyFile.get_boolean ("GUI", "ShowClippedHighlights"); + if (keyFile.has_key("GUI", "ShowClippedHighlights")) { + showClippedHighlights = keyFile.get_boolean("GUI", "ShowClippedHighlights"); } - if (keyFile.has_key ("GUI", "ShowClippedShadows")) { - showClippedShadows = keyFile.get_boolean ("GUI", "ShowClippedShadows"); + if (keyFile.has_key("GUI", "ShowClippedShadows")) { + showClippedShadows = keyFile.get_boolean("GUI", "ShowClippedShadows"); } - if (keyFile.has_key ("GUI", "FrameColor")) { - bgcolor = keyFile.get_integer ("GUI", "FrameColor"); + if (keyFile.has_key("GUI", "FrameColor")) { + bgcolor = keyFile.get_integer("GUI", "FrameColor"); } - if (keyFile.has_key ("GUI", "ProcessingQueueEnbled")) { - procQueueEnabled = keyFile.get_boolean ("GUI", "ProcessingQueueEnbled"); + if (keyFile.has_key("GUI", "ProcessingQueueEnbled")) { + procQueueEnabled = keyFile.get_boolean("GUI", "ProcessingQueueEnbled"); } - if (keyFile.has_key ("GUI", "ToolPanelsExpanded")) { - tpOpen = keyFile.get_integer_list ("GUI", "ToolPanelsExpanded"); + if (keyFile.has_key("GUI", "ToolPanelsExpanded")) { + tpOpen = keyFile.get_integer_list("GUI", "ToolPanelsExpanded"); } - if (keyFile.has_key ("GUI", "ToolPanelsExpandedAutoSave")) { - autoSaveTpOpen = keyFile.get_boolean ("GUI", "ToolPanelsExpandedAutoSave"); + if (keyFile.has_key("GUI", "ToolPanelsExpandedAutoSave")) { + autoSaveTpOpen = keyFile.get_boolean("GUI", "ToolPanelsExpandedAutoSave"); } - if (keyFile.has_key ("GUI", "MultiDisplayMode")) { - multiDisplayMode = keyFile.get_integer ("GUI", "MultiDisplayMode"); + if (keyFile.has_key("GUI", "MultiDisplayMode")) { + multiDisplayMode = keyFile.get_integer("GUI", "MultiDisplayMode"); } //if (keyFile.has_key ("GUI", "CurvePanelsExpanded")) crvOpen = keyFile.get_integer_list ("GUI", "CurvePanelsExpanded"); - if (keyFile.has_key ("GUI", "CutOverlayBrush")) { - cutOverlayBrush = keyFile.get_double_list ("GUI", "CutOverlayBrush"); + if (keyFile.has_key("GUI", "CutOverlayBrush")) { + cutOverlayBrush = keyFile.get_double_list("GUI", "CutOverlayBrush"); } - if (keyFile.has_key ("GUI", "NavGuideBrush")) { - navGuideBrush = keyFile.get_double_list ("GUI", "NavGuideBrush"); + if (keyFile.has_key("GUI", "NavGuideBrush")) { + navGuideBrush = keyFile.get_double_list("GUI", "NavGuideBrush"); } - if (keyFile.has_key ("GUI", "HistogramPosition")) { - histogramPosition = keyFile.get_integer ("GUI", "HistogramPosition"); + if (keyFile.has_key("GUI", "HistogramPosition")) { + histogramPosition = keyFile.get_integer("GUI", "HistogramPosition"); } - if (keyFile.has_key ("GUI", "HistogramBar")) { - histogramBar = keyFile.get_boolean ("GUI", "HistogramBar"); + if (keyFile.has_key("GUI", "HistogramBar")) { + histogramBar = keyFile.get_boolean("GUI", "HistogramBar"); } - if (keyFile.has_key ("GUI", "HistogramFullMode")) { - histogramFullMode = keyFile.get_boolean ("GUI", "HistogramFullMode"); + if (keyFile.has_key("GUI", "HistogramFullMode")) { + histogramFullMode = keyFile.get_boolean("GUI", "HistogramFullMode"); } - if (keyFile.has_key ("GUI", "NavigatorRGBUnit")) { - navRGBUnit = (NavigatorUnit)keyFile.get_integer ("GUI", "NavigatorRGBUnit"); + if (keyFile.has_key("GUI", "NavigatorRGBUnit")) { + navRGBUnit = (NavigatorUnit)keyFile.get_integer("GUI", "NavigatorRGBUnit"); } - if (keyFile.has_key ("GUI", "NavigatorHSVUnit")) { - navHSVUnit = (NavigatorUnit)keyFile.get_integer ("GUI", "NavigatorHSVUnit"); + if (keyFile.has_key("GUI", "NavigatorHSVUnit")) { + navHSVUnit = (NavigatorUnit)keyFile.get_integer("GUI", "NavigatorHSVUnit"); } - if (keyFile.has_key ("GUI", "ShowFilmStripToolBar")) { - showFilmStripToolBar = keyFile.get_boolean ("GUI", "ShowFilmStripToolBar"); + if (keyFile.has_key("GUI", "ShowFilmStripToolBar")) { + showFilmStripToolBar = keyFile.get_boolean("GUI", "ShowFilmStripToolBar"); } - if (keyFile.has_key ("GUI", "FileBrowserToolbarSingleRow")) { - FileBrowserToolbarSingleRow = keyFile.get_boolean ("GUI", "FileBrowserToolbarSingleRow"); + if (keyFile.has_key("GUI", "FileBrowserToolbarSingleRow")) { + FileBrowserToolbarSingleRow = keyFile.get_boolean("GUI", "FileBrowserToolbarSingleRow"); } #if defined(__linux__) && ((GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION > 18) || GTK_MAJOR_VERSION > 3) // Cannot scroll toolbox with mousewheel when HideTPVScrollbar=true #3413 hideTPVScrollbar = false; #else - if (keyFile.has_key ("GUI", "HideTPVScrollbar")) { - hideTPVScrollbar = keyFile.get_boolean ("GUI", "HideTPVScrollbar"); + + if (keyFile.has_key("GUI", "HideTPVScrollbar")) { + hideTPVScrollbar = keyFile.get_boolean("GUI", "HideTPVScrollbar"); } + #endif - if (keyFile.has_key ("GUI", "UseIconNoText")) { - UseIconNoText = keyFile.get_boolean ("GUI", "UseIconNoText"); + + if (keyFile.has_key("GUI", "UseIconNoText")) { + UseIconNoText = keyFile.get_boolean("GUI", "UseIconNoText"); } - if (keyFile.has_key ("GUI", "HistogramWorking")) { - rtSettings.HistogramWorking = keyFile.get_boolean ("GUI", "HistogramWorking"); + if (keyFile.has_key("GUI", "HistogramWorking")) { + rtSettings.HistogramWorking = keyFile.get_boolean("GUI", "HistogramWorking"); } - if (keyFile.has_key ("GUI", "CurveBBoxPosition")) { - curvebboxpos = keyFile.get_integer ("GUI", "CurveBBoxPosition"); + if (keyFile.has_key("GUI", "CurveBBoxPosition")) { + curvebboxpos = keyFile.get_integer("GUI", "CurveBBoxPosition"); } } - if (keyFile.has_group ("Crop Settings")) { - if (keyFile.has_key ("Crop Settings", "PPI")) { - cropPPI = keyFile.get_integer ("Crop Settings", "PPI"); + if (keyFile.has_group("Crop Settings")) { + if (keyFile.has_key("Crop Settings", "PPI")) { + cropPPI = keyFile.get_integer("Crop Settings", "PPI"); } + if (keyFile.has_key("Crop Settings", "GuidesMode")) { cropGuides = CropGuidesMode(std::max(int(CROP_GUIDE_NONE), std::min(keyFile.get_integer("Crop Settings", "GuidesMode"), int(CROP_GUIDE_FULL)))); } + if (keyFile.has_key("Crop Settings", "AutoFit")) { cropAutoFit = keyFile.get_boolean("Crop Settings", "AutoFit"); } } - if (keyFile.has_group ("Color Management")) { - if (keyFile.has_key ("Color Management", "ICCDirectory")) { - rtSettings.iccDirectory = keyFile.get_string ("Color Management", "ICCDirectory"); + if (keyFile.has_group("Color Management")) { + if (keyFile.has_key("Color Management", "ICCDirectory")) { + rtSettings.iccDirectory = keyFile.get_string("Color Management", "ICCDirectory"); } - if (keyFile.has_key ("Color Management", "PrinterIntent")) { - rtSettings.printerIntent = static_cast (keyFile.get_integer ("Color Management", "PrinterIntent")); + if (keyFile.has_key("Color Management", "PrinterIntent")) { + rtSettings.printerIntent = static_cast(keyFile.get_integer("Color Management", "PrinterIntent")); } - if (keyFile.has_key ("Color Management", "PrinterBPC")) { - rtSettings.printerBPC = keyFile.get_boolean ("Color Management", "PrinterBPC"); + if (keyFile.has_key("Color Management", "PrinterBPC")) { + rtSettings.printerBPC = keyFile.get_boolean("Color Management", "PrinterBPC"); } - if (keyFile.has_key ("Color Management", "PrinterProfile")) { - rtSettings.printerProfile = keyFile.get_string ("Color Management", "PrinterProfile"); + if (keyFile.has_key("Color Management", "PrinterProfile")) { + rtSettings.printerProfile = keyFile.get_string("Color Management", "PrinterProfile"); } - if (keyFile.has_key ("Color Management", "MonitorProfile")) { - rtSettings.monitorProfile = keyFile.get_string ("Color Management", "MonitorProfile"); + if (keyFile.has_key("Color Management", "MonitorProfile")) { + rtSettings.monitorProfile = keyFile.get_string("Color Management", "MonitorProfile"); } - if (keyFile.has_key ("Color Management", "AutoMonitorProfile")) { - rtSettings.autoMonitorProfile = keyFile.get_boolean ("Color Management", "AutoMonitorProfile"); + if (keyFile.has_key("Color Management", "AutoMonitorProfile")) { + rtSettings.autoMonitorProfile = keyFile.get_boolean("Color Management", "AutoMonitorProfile"); } - if (keyFile.has_key ("Color Management", "Autocielab")) { - rtSettings.autocielab = keyFile.get_boolean ("Color Management", "Autocielab"); + if (keyFile.has_key("Color Management", "Autocielab")) { + rtSettings.autocielab = keyFile.get_boolean("Color Management", "Autocielab"); } - if (keyFile.has_key ("Color Management", "RGBcurvesLumamode_Gamut")) { - rtSettings.rgbcurveslumamode_gamut = keyFile.get_boolean ("Color Management", "RGBcurvesLumamode_Gamut"); + if (keyFile.has_key("Color Management", "RGBcurvesLumamode_Gamut")) { + rtSettings.rgbcurveslumamode_gamut = keyFile.get_boolean("Color Management", "RGBcurvesLumamode_Gamut"); } - if (keyFile.has_key ("Color Management", "Intent")) { - rtSettings.monitorIntent = static_cast (keyFile.get_integer ("Color Management", "Intent")); + if (keyFile.has_key("Color Management", "Intent")) { + rtSettings.monitorIntent = static_cast(keyFile.get_integer("Color Management", "Intent")); } - if (keyFile.has_key ("Color Management", "MonitorBPC")) { - rtSettings.monitorBPC = keyFile.get_boolean ("Color Management", "MonitorBPC"); + if (keyFile.has_key("Color Management", "MonitorBPC")) { + rtSettings.monitorBPC = keyFile.get_boolean("Color Management", "MonitorBPC"); } - if (keyFile.has_key ("Color Management", "CRI")) { - rtSettings.CRI_color = keyFile.get_integer ("Color Management", "CRI"); + if (keyFile.has_key("Color Management", "CRI")) { + rtSettings.CRI_color = keyFile.get_integer("Color Management", "CRI"); } - if (keyFile.has_key ("Color Management", "DenoiseLabgamma")) { - rtSettings.denoiselabgamma = keyFile.get_integer ("Color Management", "DenoiseLabgamma"); + if (keyFile.has_key("Color Management", "DenoiseLabgamma")) { + rtSettings.denoiselabgamma = keyFile.get_integer("Color Management", "DenoiseLabgamma"); } /* @@ -1410,341 +1415,341 @@ void Options::readFromFile (Glib::ustring fname) } */ - if (keyFile.has_key ("Color Management", "CBDLlevel0")) { - rtSettings.level0_cbdl = keyFile.get_double ("Color Management", "CBDLlevel0"); + if (keyFile.has_key("Color Management", "CBDLlevel0")) { + rtSettings.level0_cbdl = keyFile.get_double("Color Management", "CBDLlevel0"); } - if (keyFile.has_key ("Color Management", "CBDLlevel123")) { - rtSettings.level123_cbdl = keyFile.get_double ("Color Management", "CBDLlevel123"); + if (keyFile.has_key("Color Management", "CBDLlevel123")) { + rtSettings.level123_cbdl = keyFile.get_double("Color Management", "CBDLlevel123"); } //if (keyFile.has_key ("Color Management", "Colortoningab")) rtSettings.colortoningab = keyFile.get_double("Color Management", "Colortoningab"); //if (keyFile.has_key ("Color Management", "Decaction")) rtSettings.decaction = keyFile.get_double("Color Management", "Decaction"); - if (keyFile.has_key ("Color Management", "WhiteBalanceSpotSize")) { - whiteBalanceSpotSize = keyFile.get_integer ("Color Management", "WhiteBalanceSpotSize"); + if (keyFile.has_key("Color Management", "WhiteBalanceSpotSize")) { + whiteBalanceSpotSize = keyFile.get_integer("Color Management", "WhiteBalanceSpotSize"); } - if ( keyFile.has_key ("Color Management", "GamutICC")) { - rtSettings.gamutICC = keyFile.get_boolean ("Color Management", "GamutICC"); + if (keyFile.has_key("Color Management", "GamutICC")) { + rtSettings.gamutICC = keyFile.get_boolean("Color Management", "GamutICC"); } //if ( keyFile.has_key ("Color Management", "BWcomplement")) rtSettings.bw_complementary = keyFile.get_boolean("Color Management", "BWcomplement"); - if ( keyFile.has_key ("Color Management", "Ciecamfloat")) { - rtSettings.ciecamfloat = keyFile.get_boolean ("Color Management", "Ciecamfloat"); + if (keyFile.has_key("Color Management", "Ciecamfloat")) { + rtSettings.ciecamfloat = keyFile.get_boolean("Color Management", "Ciecamfloat"); } - if ( keyFile.has_key ("Color Management", "AdobeRGB")) { - rtSettings.adobe = keyFile.get_string ("Color Management", "AdobeRGB"); + if (keyFile.has_key("Color Management", "AdobeRGB")) { + rtSettings.adobe = keyFile.get_string("Color Management", "AdobeRGB"); } - if ( keyFile.has_key ("Color Management", "ProPhoto")) { - rtSettings.prophoto = keyFile.get_string ("Color Management", "ProPhoto"); + if (keyFile.has_key("Color Management", "ProPhoto")) { + rtSettings.prophoto = keyFile.get_string("Color Management", "ProPhoto"); } - if ( keyFile.has_key ("Color Management", "ProPhoto10")) { - rtSettings.prophoto10 = keyFile.get_string ("Color Management", "ProPhoto10"); + if (keyFile.has_key("Color Management", "ProPhoto10")) { + rtSettings.prophoto10 = keyFile.get_string("Color Management", "ProPhoto10"); } - if ( keyFile.has_key ("Color Management", "WideGamut")) { - rtSettings.widegamut = keyFile.get_string ("Color Management", "WideGamut"); + if (keyFile.has_key("Color Management", "WideGamut")) { + rtSettings.widegamut = keyFile.get_string("Color Management", "WideGamut"); } - if ( keyFile.has_key ("Color Management", "sRGB")) { - rtSettings.srgb = keyFile.get_string ("Color Management", "sRGB"); + if (keyFile.has_key("Color Management", "sRGB")) { + rtSettings.srgb = keyFile.get_string("Color Management", "sRGB"); } - if ( keyFile.has_key ("Color Management", "sRGB10")) { - rtSettings.srgb10 = keyFile.get_string ("Color Management", "sRGB10"); + if (keyFile.has_key("Color Management", "sRGB10")) { + rtSettings.srgb10 = keyFile.get_string("Color Management", "sRGB10"); } - if ( keyFile.has_key ("Color Management", "Beta")) { - rtSettings.beta = keyFile.get_string ("Color Management", "Beta"); + if (keyFile.has_key("Color Management", "Beta")) { + rtSettings.beta = keyFile.get_string("Color Management", "Beta"); } - if ( keyFile.has_key ("Color Management", "Best")) { - rtSettings.best = keyFile.get_string ("Color Management", "Best"); + if (keyFile.has_key("Color Management", "Best")) { + rtSettings.best = keyFile.get_string("Color Management", "Best"); } - if ( keyFile.has_key ("Color Management", "Rec2020")) { - rtSettings.rec2020 = keyFile.get_string ("Color Management", "Rec2020"); + if (keyFile.has_key("Color Management", "Rec2020")) { + rtSettings.rec2020 = keyFile.get_string("Color Management", "Rec2020"); } - if ( keyFile.has_key ("Color Management", "Bruce")) { - rtSettings.bruce = keyFile.get_string ("Color Management", "Bruce"); + if (keyFile.has_key("Color Management", "Bruce")) { + rtSettings.bruce = keyFile.get_string("Color Management", "Bruce"); } - if ( keyFile.has_key ("Color Management", "GamutLch")) { - rtSettings.gamutLch = keyFile.get_boolean ("Color Management", "GamutLch"); + if (keyFile.has_key("Color Management", "GamutLch")) { + rtSettings.gamutLch = keyFile.get_boolean("Color Management", "GamutLch"); } - if ( keyFile.has_key ("Color Management", "ProtectRed")) { - rtSettings.protectred = keyFile.get_integer ("Color Management", "ProtectRed"); + if (keyFile.has_key("Color Management", "ProtectRed")) { + rtSettings.protectred = keyFile.get_integer("Color Management", "ProtectRed"); } - if ( keyFile.has_key ("Color Management", "ProtectRedH")) { - rtSettings.protectredh = keyFile.get_double ("Color Management", "ProtectRedH"); + if (keyFile.has_key("Color Management", "ProtectRedH")) { + rtSettings.protectredh = keyFile.get_double("Color Management", "ProtectRedH"); } - if ( keyFile.has_key ("Color Management", "Amountchroma")) { - rtSettings.amchroma = keyFile.get_integer ("Color Management", "Amountchroma"); + if (keyFile.has_key("Color Management", "Amountchroma")) { + rtSettings.amchroma = keyFile.get_integer("Color Management", "Amountchroma"); } - if ( keyFile.has_key ("Color Management", "ClutsDirectory")) { - clutsDir = keyFile.get_string ("Color Management", "ClutsDirectory"); + if (keyFile.has_key("Color Management", "ClutsDirectory")) { + clutsDir = keyFile.get_string("Color Management", "ClutsDirectory"); } //if( keyFile.has_key ("Color Management", "Ciebadpixgauss")) rtSettings.ciebadpixgauss = keyFile.get_boolean("Color Management", "Ciebadpixgauss"); } - if (keyFile.has_group ("Batch Processing")) { - if (keyFile.has_key ("Batch Processing", "AdjusterBehavior")) { - baBehav = keyFile.get_integer_list ("Batch Processing", "AdjusterBehavior"); + if (keyFile.has_group("Batch Processing")) { + if (keyFile.has_key("Batch Processing", "AdjusterBehavior")) { + baBehav = keyFile.get_integer_list("Batch Processing", "AdjusterBehavior"); } } - if (keyFile.has_group ("Sounds")) { - if (keyFile.has_key ("Sounds", "Enable")) { - sndEnable = keyFile.get_boolean ("Sounds", "Enable"); + if (keyFile.has_group("Sounds")) { + if (keyFile.has_key("Sounds", "Enable")) { + sndEnable = keyFile.get_boolean("Sounds", "Enable"); } - if (keyFile.has_key ("Sounds", "BatchQueueDone")) { - sndBatchQueueDone = keyFile.get_string ("Sounds", "BatchQueueDone"); + if (keyFile.has_key("Sounds", "BatchQueueDone")) { + sndBatchQueueDone = keyFile.get_string("Sounds", "BatchQueueDone"); } - if (keyFile.has_key ("Sounds", "LngEditProcDone")) { - sndLngEditProcDone = keyFile.get_string ("Sounds", "LngEditProcDone"); + if (keyFile.has_key("Sounds", "LngEditProcDone")) { + sndLngEditProcDone = keyFile.get_string("Sounds", "LngEditProcDone"); } - if (keyFile.has_key ("Sounds", "LngEditProcDoneSecs")) { - sndLngEditProcDoneSecs = keyFile.get_double ("Sounds", "LngEditProcDoneSecs"); + if (keyFile.has_key("Sounds", "LngEditProcDoneSecs")) { + sndLngEditProcDoneSecs = keyFile.get_double("Sounds", "LngEditProcDoneSecs"); } } - if (keyFile.has_group ("Fast Export")) { - if (keyFile.has_key ("Fast Export", "fastexport_bypass_sharpening" )) { - fastexport_bypass_sharpening = keyFile.get_boolean ("Fast Export", "fastexport_bypass_sharpening" ); + if (keyFile.has_group("Fast Export")) { + if (keyFile.has_key("Fast Export", "fastexport_bypass_sharpening")) { + fastexport_bypass_sharpening = keyFile.get_boolean("Fast Export", "fastexport_bypass_sharpening"); } - if (keyFile.has_key ("Fast Export", "fastexport_bypass_sharpenEdge" )) { - fastexport_bypass_sharpenEdge = keyFile.get_boolean ("Fast Export", "fastexport_bypass_sharpenEdge" ); + if (keyFile.has_key("Fast Export", "fastexport_bypass_sharpenEdge")) { + fastexport_bypass_sharpenEdge = keyFile.get_boolean("Fast Export", "fastexport_bypass_sharpenEdge"); } - if (keyFile.has_key ("Fast Export", "fastexport_bypass_sharpenMicro" )) { - fastexport_bypass_sharpenMicro = keyFile.get_boolean ("Fast Export", "fastexport_bypass_sharpenMicro" ); + if (keyFile.has_key("Fast Export", "fastexport_bypass_sharpenMicro")) { + fastexport_bypass_sharpenMicro = keyFile.get_boolean("Fast Export", "fastexport_bypass_sharpenMicro"); } //if (keyFile.has_key ("Fast Export", "fastexport_bypass_lumaDenoise" )) fastexport_bypass_lumaDenoise = keyFile.get_boolean ("Fast Export", "fastexport_bypass_lumaDenoise" ); //if (keyFile.has_key ("Fast Export", "fastexport_bypass_colorDenoise" )) fastexport_bypass_colorDenoise = keyFile.get_boolean ("Fast Export", "fastexport_bypass_colorDenoise" ); - if (keyFile.has_key ("Fast Export", "fastexport_bypass_defringe" )) { - fastexport_bypass_defringe = keyFile.get_boolean ("Fast Export", "fastexport_bypass_defringe" ); + if (keyFile.has_key("Fast Export", "fastexport_bypass_defringe")) { + fastexport_bypass_defringe = keyFile.get_boolean("Fast Export", "fastexport_bypass_defringe"); } - if (keyFile.has_key ("Fast Export", "fastexport_bypass_dirpyrDenoise" )) { - fastexport_bypass_dirpyrDenoise = keyFile.get_boolean ("Fast Export", "fastexport_bypass_dirpyrDenoise" ); + if (keyFile.has_key("Fast Export", "fastexport_bypass_dirpyrDenoise")) { + fastexport_bypass_dirpyrDenoise = keyFile.get_boolean("Fast Export", "fastexport_bypass_dirpyrDenoise"); } - if (keyFile.has_key ("Fast Export", "fastexport_bypass_sh_hq" )) { - fastexport_bypass_sh_hq = keyFile.get_boolean ("Fast Export", "fastexport_bypass_sh_hq" ); + if (keyFile.has_key("Fast Export", "fastexport_bypass_sh_hq")) { + fastexport_bypass_sh_hq = keyFile.get_boolean("Fast Export", "fastexport_bypass_sh_hq"); } - if (keyFile.has_key ("Fast Export", "fastexport_bypass_dirpyrequalizer" )) { - fastexport_bypass_dirpyrequalizer = keyFile.get_boolean ("Fast Export", "fastexport_bypass_dirpyrequalizer" ); + if (keyFile.has_key("Fast Export", "fastexport_bypass_dirpyrequalizer")) { + fastexport_bypass_dirpyrequalizer = keyFile.get_boolean("Fast Export", "fastexport_bypass_dirpyrequalizer"); } - if (keyFile.has_key ("Fast Export", "fastexport_bypass_wavelet" )) { - fastexport_bypass_wavelet = keyFile.get_boolean ("Fast Export", "fastexport_bypass_wavelet" ); + if (keyFile.has_key("Fast Export", "fastexport_bypass_wavelet")) { + fastexport_bypass_wavelet = keyFile.get_boolean("Fast Export", "fastexport_bypass_wavelet"); } - if (keyFile.has_key ("Fast Export", "fastexport_raw_dmethod" )) { - fastexport_raw_bayer_method = keyFile.get_string ("Fast Export", "fastexport_raw_dmethod" ); + if (keyFile.has_key("Fast Export", "fastexport_raw_dmethod")) { + fastexport_raw_bayer_method = keyFile.get_string("Fast Export", "fastexport_raw_dmethod"); } - if (keyFile.has_key ("Fast Export", "fastexport_raw_bayer_method" )) { - fastexport_raw_bayer_method = keyFile.get_string ("Fast Export", "fastexport_raw_bayer_method" ); + if (keyFile.has_key("Fast Export", "fastexport_raw_bayer_method")) { + fastexport_raw_bayer_method = keyFile.get_string("Fast Export", "fastexport_raw_bayer_method"); } //if (keyFile.has_key ("Fast Export", "fastexport_bypass_raw_bayer_all_enhance" )) fastexport_bypass_raw_bayer_all_enhance = keyFile.get_boolean ("Fast Export", "fastexport_bypass_raw_all_enhance" ); - if (keyFile.has_key ("Fast Export", "fastexport_bypass_raw_dcb_iterations" )) { - fastexport_bypass_raw_bayer_dcb_iterations = keyFile.get_boolean ("Fast Export", "fastexport_bypass_raw_dcb_iterations" ); + if (keyFile.has_key("Fast Export", "fastexport_bypass_raw_dcb_iterations")) { + fastexport_bypass_raw_bayer_dcb_iterations = keyFile.get_boolean("Fast Export", "fastexport_bypass_raw_dcb_iterations"); } - if (keyFile.has_key ("Fast Export", "fastexport_bypass_raw_bayer_dcb_iterations" )) { - fastexport_bypass_raw_bayer_dcb_iterations = keyFile.get_boolean ("Fast Export", "fastexport_bypass_raw_bayer_dcb_iterations" ); + if (keyFile.has_key("Fast Export", "fastexport_bypass_raw_bayer_dcb_iterations")) { + fastexport_bypass_raw_bayer_dcb_iterations = keyFile.get_boolean("Fast Export", "fastexport_bypass_raw_bayer_dcb_iterations"); } - if (keyFile.has_key ("Fast Export", "fastexport_bypass_raw_dcb_enhance" )) { - fastexport_bypass_raw_bayer_dcb_enhance = keyFile.get_boolean ("Fast Export", "fastexport_bypass_raw_dcb_enhance" ); + if (keyFile.has_key("Fast Export", "fastexport_bypass_raw_dcb_enhance")) { + fastexport_bypass_raw_bayer_dcb_enhance = keyFile.get_boolean("Fast Export", "fastexport_bypass_raw_dcb_enhance"); } - if (keyFile.has_key ("Fast Export", "fastexport_bypass_raw_bayer_dcb_enhance" )) { - fastexport_bypass_raw_bayer_dcb_enhance = keyFile.get_boolean ("Fast Export", "fastexport_bypass_raw_bayer_dcb_enhance" ); + if (keyFile.has_key("Fast Export", "fastexport_bypass_raw_bayer_dcb_enhance")) { + fastexport_bypass_raw_bayer_dcb_enhance = keyFile.get_boolean("Fast Export", "fastexport_bypass_raw_bayer_dcb_enhance"); } - if (keyFile.has_key ("Fast Export", "fastexport_bypass_raw_lmmse_iterations" )) { - fastexport_bypass_raw_bayer_lmmse_iterations = keyFile.get_boolean ("Fast Export", "fastexport_bypass_raw_lmmse_iterations" ); + if (keyFile.has_key("Fast Export", "fastexport_bypass_raw_lmmse_iterations")) { + fastexport_bypass_raw_bayer_lmmse_iterations = keyFile.get_boolean("Fast Export", "fastexport_bypass_raw_lmmse_iterations"); } - if (keyFile.has_key ("Fast Export", "fastexport_bypass_raw_bayer_lmmse_iterations")) { - fastexport_bypass_raw_bayer_lmmse_iterations = keyFile.get_boolean ("Fast Export", "fastexport_bypass_raw_bayer_lmmse_iterations"); + if (keyFile.has_key("Fast Export", "fastexport_bypass_raw_bayer_lmmse_iterations")) { + fastexport_bypass_raw_bayer_lmmse_iterations = keyFile.get_boolean("Fast Export", "fastexport_bypass_raw_bayer_lmmse_iterations"); } - if (keyFile.has_key ("Fast Export", "fastexport_bypass_raw_linenoise" )) { - fastexport_bypass_raw_bayer_linenoise = keyFile.get_boolean ("Fast Export", "fastexport_bypass_raw_linenoise" ); + if (keyFile.has_key("Fast Export", "fastexport_bypass_raw_linenoise")) { + fastexport_bypass_raw_bayer_linenoise = keyFile.get_boolean("Fast Export", "fastexport_bypass_raw_linenoise"); } - if (keyFile.has_key ("Fast Export", "fastexport_bypass_raw_bayer_linenoise" )) { - fastexport_bypass_raw_bayer_linenoise = keyFile.get_boolean ("Fast Export", "fastexport_bypass_raw_bayer_linenoise" ); + if (keyFile.has_key("Fast Export", "fastexport_bypass_raw_bayer_linenoise")) { + fastexport_bypass_raw_bayer_linenoise = keyFile.get_boolean("Fast Export", "fastexport_bypass_raw_bayer_linenoise"); } - if (keyFile.has_key ("Fast Export", "fastexport_bypass_raw_greenthresh" )) { - fastexport_bypass_raw_bayer_greenthresh = keyFile.get_boolean ("Fast Export", "fastexport_bypass_raw_greenthresh" ); + if (keyFile.has_key("Fast Export", "fastexport_bypass_raw_greenthresh")) { + fastexport_bypass_raw_bayer_greenthresh = keyFile.get_boolean("Fast Export", "fastexport_bypass_raw_greenthresh"); } - if (keyFile.has_key ("Fast Export", "fastexport_bypass_raw_bayer_greenthresh" )) { - fastexport_bypass_raw_bayer_greenthresh = keyFile.get_boolean ("Fast Export", "fastexport_bypass_raw_bayer_greenthresh" ); + if (keyFile.has_key("Fast Export", "fastexport_bypass_raw_bayer_greenthresh")) { + fastexport_bypass_raw_bayer_greenthresh = keyFile.get_boolean("Fast Export", "fastexport_bypass_raw_bayer_greenthresh"); } - if (keyFile.has_key ("Fast Export", "fastexport_raw_xtrans_method" )) { - fastexport_raw_xtrans_method = keyFile.get_string ("Fast Export", "fastexport_raw_xtrans_method" ); + if (keyFile.has_key("Fast Export", "fastexport_raw_xtrans_method")) { + fastexport_raw_xtrans_method = keyFile.get_string("Fast Export", "fastexport_raw_xtrans_method"); } - if (keyFile.has_key ("Fast Export", "fastexport_bypass_raw_ccSteps" )) { - fastexport_bypass_raw_ccSteps = keyFile.get_boolean ("Fast Export", "fastexport_bypass_raw_ccSteps" ); + if (keyFile.has_key("Fast Export", "fastexport_bypass_raw_ccSteps")) { + fastexport_bypass_raw_ccSteps = keyFile.get_boolean("Fast Export", "fastexport_bypass_raw_ccSteps"); } - if (keyFile.has_key ("Fast Export", "fastexport_bypass_raw_ca" )) { - fastexport_bypass_raw_ca = keyFile.get_boolean ("Fast Export", "fastexport_bypass_raw_ca" ); + if (keyFile.has_key("Fast Export", "fastexport_bypass_raw_ca")) { + fastexport_bypass_raw_ca = keyFile.get_boolean("Fast Export", "fastexport_bypass_raw_ca"); } - if (keyFile.has_key ("Fast Export", "fastexport_bypass_raw_df" )) { - fastexport_bypass_raw_df = keyFile.get_boolean ("Fast Export", "fastexport_bypass_raw_df" ); + if (keyFile.has_key("Fast Export", "fastexport_bypass_raw_df")) { + fastexport_bypass_raw_df = keyFile.get_boolean("Fast Export", "fastexport_bypass_raw_df"); } - if (keyFile.has_key ("Fast Export", "fastexport_bypass_raw_ff" )) { - fastexport_bypass_raw_ff = keyFile.get_boolean ("Fast Export", "fastexport_bypass_raw_ff" ); + if (keyFile.has_key("Fast Export", "fastexport_bypass_raw_ff")) { + fastexport_bypass_raw_ff = keyFile.get_boolean("Fast Export", "fastexport_bypass_raw_ff"); } - if (keyFile.has_key ("Fast Export", "fastexport_icm_input" )) { - fastexport_icm_input = keyFile.get_string ("Fast Export", "fastexport_icm_input" ); + if (keyFile.has_key("Fast Export", "fastexport_icm_input")) { + fastexport_icm_input = keyFile.get_string("Fast Export", "fastexport_icm_input"); } - if (keyFile.has_key ("Fast Export", "fastexport_icm_working" )) { - fastexport_icm_working = keyFile.get_string ("Fast Export", "fastexport_icm_working" ); + if (keyFile.has_key("Fast Export", "fastexport_icm_working")) { + fastexport_icm_working = keyFile.get_string("Fast Export", "fastexport_icm_working"); } - if (keyFile.has_key ("Fast Export", "fastexport_icm_output" )) { - fastexport_icm_output = keyFile.get_string ("Fast Export", "fastexport_icm_output" ); + if (keyFile.has_key("Fast Export", "fastexport_icm_output")) { + fastexport_icm_output = keyFile.get_string("Fast Export", "fastexport_icm_output"); } - if (keyFile.has_key ("Fast Export", "fastexport_icm_output_intent" )) { - fastexport_icm_outputIntent = static_cast (keyFile.get_integer ("Fast Export", "fastexport_icm_output_intent" )); + if (keyFile.has_key("Fast Export", "fastexport_icm_output_intent")) { + fastexport_icm_outputIntent = static_cast(keyFile.get_integer("Fast Export", "fastexport_icm_output_intent")); } - if (keyFile.has_key ("Fast Export", "fastexport_icm_output_bpc" )) { - fastexport_icm_outputBPC = keyFile.get_boolean ("Fast Export", "fastexport_icm_output_bpc" ); + if (keyFile.has_key("Fast Export", "fastexport_icm_output_bpc")) { + fastexport_icm_outputBPC = keyFile.get_boolean("Fast Export", "fastexport_icm_output_bpc"); } - if (keyFile.has_key ("Fast Export", "fastexport_icm_gamma" )) { - fastexport_icm_gamma = keyFile.get_string ("Fast Export", "fastexport_icm_gamma" ); + if (keyFile.has_key("Fast Export", "fastexport_icm_gamma")) { + fastexport_icm_gamma = keyFile.get_string("Fast Export", "fastexport_icm_gamma"); } - if (keyFile.has_key ("Fast Export", "fastexport_resize_enabled" )) { - fastexport_resize_enabled = keyFile.get_boolean ("Fast Export", "fastexport_resize_enabled" ); + if (keyFile.has_key("Fast Export", "fastexport_resize_enabled")) { + fastexport_resize_enabled = keyFile.get_boolean("Fast Export", "fastexport_resize_enabled"); } - if (keyFile.has_key ("Fast Export", "fastexport_resize_scale" )) { - fastexport_resize_scale = keyFile.get_double ("Fast Export", "fastexport_resize_scale" ); + if (keyFile.has_key("Fast Export", "fastexport_resize_scale")) { + fastexport_resize_scale = keyFile.get_double("Fast Export", "fastexport_resize_scale"); } - if (keyFile.has_key ("Fast Export", "fastexport_resize_appliesTo" )) { - fastexport_resize_appliesTo = keyFile.get_string ("Fast Export", "fastexport_resize_appliesTo" ); + if (keyFile.has_key("Fast Export", "fastexport_resize_appliesTo")) { + fastexport_resize_appliesTo = keyFile.get_string("Fast Export", "fastexport_resize_appliesTo"); } - if (keyFile.has_key ("Fast Export", "fastexport_resize_method" )) { - fastexport_resize_method = keyFile.get_string ("Fast Export", "fastexport_resize_method" ); + if (keyFile.has_key("Fast Export", "fastexport_resize_method")) { + fastexport_resize_method = keyFile.get_string("Fast Export", "fastexport_resize_method"); } - if (keyFile.has_key ("Fast Export", "fastexport_resize_dataspec" )) { - fastexport_resize_dataspec = keyFile.get_integer ("Fast Export", "fastexport_resize_dataspec" ); + if (keyFile.has_key("Fast Export", "fastexport_resize_dataspec")) { + fastexport_resize_dataspec = keyFile.get_integer("Fast Export", "fastexport_resize_dataspec"); } - if (keyFile.has_key ("Fast Export", "fastexport_resize_width" )) { - fastexport_resize_width = keyFile.get_integer ("Fast Export", "fastexport_resize_width" ); + if (keyFile.has_key("Fast Export", "fastexport_resize_width")) { + fastexport_resize_width = keyFile.get_integer("Fast Export", "fastexport_resize_width"); } - if (keyFile.has_key ("Fast Export", "fastexport_resize_height" )) { - fastexport_resize_height = keyFile.get_integer ("Fast Export", "fastexport_resize_height" ); + if (keyFile.has_key("Fast Export", "fastexport_resize_height")) { + fastexport_resize_height = keyFile.get_integer("Fast Export", "fastexport_resize_height"); } - if (keyFile.has_key ("Fast Export", "fastexport_use_fast_pipeline" )) { - fastexport_use_fast_pipeline = keyFile.get_integer ("Fast Export", "fastexport_use_fast_pipeline" ); + if (keyFile.has_key("Fast Export", "fastexport_use_fast_pipeline")) { + fastexport_use_fast_pipeline = keyFile.get_integer("Fast Export", "fastexport_use_fast_pipeline"); } } - if (keyFile.has_group ("Dialogs")) { - safeDirGet (keyFile, "Dialogs", "LastIccDir", lastIccDir); - safeDirGet (keyFile, "Dialogs", "LastDarkframeDir", lastDarkframeDir); - safeDirGet (keyFile, "Dialogs", "LastFlatfieldDir", lastFlatfieldDir); - safeDirGet (keyFile, "Dialogs", "LastRgbCurvesDir", lastRgbCurvesDir); - safeDirGet (keyFile, "Dialogs", "LastLabCurvesDir", lastLabCurvesDir); - safeDirGet (keyFile, "Dialogs", "LastRetinexDir", lastRetinexDir); - safeDirGet (keyFile, "Dialogs", "LastDenoiseCurvesDir", lastDenoiseCurvesDir); - safeDirGet (keyFile, "Dialogs", "LastWaveletCurvesDir", lastWaveletCurvesDir); - safeDirGet (keyFile, "Dialogs", "LastPFCurvesDir", lastPFCurvesDir); - safeDirGet (keyFile, "Dialogs", "LastHsvCurvesDir", lastHsvCurvesDir); - safeDirGet (keyFile, "Dialogs", "LastBWCurvesDir", lastBWCurvesDir); + if (keyFile.has_group("Dialogs")) { + safeDirGet(keyFile, "Dialogs", "LastIccDir", lastIccDir); + safeDirGet(keyFile, "Dialogs", "LastDarkframeDir", lastDarkframeDir); + safeDirGet(keyFile, "Dialogs", "LastFlatfieldDir", lastFlatfieldDir); + safeDirGet(keyFile, "Dialogs", "LastRgbCurvesDir", lastRgbCurvesDir); + safeDirGet(keyFile, "Dialogs", "LastLabCurvesDir", lastLabCurvesDir); + safeDirGet(keyFile, "Dialogs", "LastRetinexDir", lastRetinexDir); + safeDirGet(keyFile, "Dialogs", "LastDenoiseCurvesDir", lastDenoiseCurvesDir); + safeDirGet(keyFile, "Dialogs", "LastWaveletCurvesDir", lastWaveletCurvesDir); + safeDirGet(keyFile, "Dialogs", "LastPFCurvesDir", lastPFCurvesDir); + safeDirGet(keyFile, "Dialogs", "LastHsvCurvesDir", lastHsvCurvesDir); + safeDirGet(keyFile, "Dialogs", "LastBWCurvesDir", lastBWCurvesDir); - safeDirGet (keyFile, "Dialogs", "LastToneCurvesDir", lastToneCurvesDir); - safeDirGet (keyFile, "Dialogs", "LastVibranceCurvesDir", lastVibranceCurvesDir); - safeDirGet (keyFile, "Dialogs", "LastProfilingReferenceDir", lastProfilingReferenceDir); - safeDirGet (keyFile, "Dialogs", "LastLensProfileDir", lastLensProfileDir); + safeDirGet(keyFile, "Dialogs", "LastToneCurvesDir", lastToneCurvesDir); + safeDirGet(keyFile, "Dialogs", "LastVibranceCurvesDir", lastVibranceCurvesDir); + safeDirGet(keyFile, "Dialogs", "LastProfilingReferenceDir", lastProfilingReferenceDir); + safeDirGet(keyFile, "Dialogs", "LastLensProfileDir", lastLensProfileDir); - if (keyFile.has_key ("Dialogs", "GimpPluginShowInfoDialog")) { - gimpPluginShowInfoDialog = keyFile.get_boolean ("Dialogs", "GimpPluginShowInfoDialog"); + if (keyFile.has_key("Dialogs", "GimpPluginShowInfoDialog")) { + gimpPluginShowInfoDialog = keyFile.get_boolean("Dialogs", "GimpPluginShowInfoDialog"); } } - if (keyFile.has_group ("Lensfun")) { - if (keyFile.has_key ("Lensfun", "DBDirectory")) { - rtSettings.lensfunDbDirectory = keyFile.get_string ("Lensfun", "DBDirectory"); + if (keyFile.has_group("Lensfun")) { + if (keyFile.has_key("Lensfun", "DBDirectory")) { + rtSettings.lensfunDbDirectory = keyFile.get_string("Lensfun", "DBDirectory"); } } // -------------------------------------------------------------------------------------------------------- - filterOutParsedExtensions (); + filterOutParsedExtensions(); return; } } catch (Glib::Error &err) { - Glib::ustring msg = Glib::ustring::compose ("Options::readFromFile / Error code %1 while reading values from \"%2\":\n%3", err.code(), fname, err.what()); + Glib::ustring msg = Glib::ustring::compose("Options::readFromFile / Error code %1 while reading values from \"%2\":\n%3", err.code(), fname, err.what()); if (options.rtSettings.verbose) { - printf ("%s\n", msg.c_str()); + printf("%s\n", msg.c_str()); } - throw Error (msg); + throw Error(msg); } catch (...) { - Glib::ustring msg = Glib::ustring::compose ("Options::readFromFile / Unknown exception while trying to load \"%1\"!", fname); + Glib::ustring msg = Glib::ustring::compose("Options::readFromFile / Unknown exception while trying to load \"%1\"!", fname); if (options.rtSettings.verbose) { - printf ("%s\n", msg.c_str()); + printf("%s\n", msg.c_str()); } - throw Error (msg); + throw Error(msg); } } -bool Options::safeDirGet (const Glib::KeyFile& keyFile, const Glib::ustring& section, - const Glib::ustring& entryName, Glib::ustring& destination) +bool Options::safeDirGet(const Glib::KeyFile& keyFile, const Glib::ustring& section, + const Glib::ustring& entryName, Glib::ustring& destination) { try { - if (keyFile.has_key (section, entryName) && !keyFile.get_string (section, entryName).empty ()) { - destination = keyFile.get_string (section, entryName); + if (keyFile.has_key(section, entryName) && !keyFile.get_string(section, entryName).empty()) { + destination = keyFile.get_string(section, entryName); return true; } @@ -1753,7 +1758,7 @@ bool Options::safeDirGet (const Glib::KeyFile& keyFile, const Glib::ustring& sec return false; } -void Options::saveToFile (Glib::ustring fname) +void Options::saveToFile(Glib::ustring fname) { Glib::ustring keyData; @@ -1762,338 +1767,338 @@ void Options::saveToFile (Glib::ustring fname) Glib::KeyFile keyFile; - keyFile.set_boolean ("General", "TabbedEditor", tabbedUI); - keyFile.set_boolean ("General", "StoreLastProfile", savesParamsAtExit); + keyFile.set_boolean("General", "TabbedEditor", tabbedUI); + keyFile.set_boolean("General", "StoreLastProfile", savesParamsAtExit); if (startupDir == STARTUPDIR_HOME) { - keyFile.set_string ("General", "StartupDirectory", "home"); + keyFile.set_string("General", "StartupDirectory", "home"); } else if (startupDir == STARTUPDIR_CURRENT) { - keyFile.set_string ("General", "StartupDirectory", "current"); + keyFile.set_string("General", "StartupDirectory", "current"); } else if (startupDir == STARTUPDIR_CUSTOM) { - keyFile.set_string ("General", "StartupDirectory", "custom"); + keyFile.set_string("General", "StartupDirectory", "custom"); } else if (startupDir == STARTUPDIR_LAST) { - keyFile.set_string ("General", "StartupDirectory", "last"); + keyFile.set_string("General", "StartupDirectory", "last"); } - keyFile.set_string ("General", "StartupPath", startupPath); - keyFile.set_string ("General", "DateFormat", dateFormat); - keyFile.set_integer ("General", "AdjusterMinDelay", adjusterMinDelay); - keyFile.set_integer ("General", "AdjusterMaxDelay", adjusterMaxDelay); - keyFile.set_boolean ("General", "MultiUser", multiUser); - keyFile.set_string ("General", "Language", language); - keyFile.set_boolean ("General", "LanguageAutoDetect", languageAutoDetect); - keyFile.set_string ("General", "Theme", theme); - keyFile.set_string ("General", "Version", RTVERSION); - keyFile.set_string ("General", "DarkFramesPath", rtSettings.darkFramesPath); - keyFile.set_string ("General", "FlatFieldsPath", rtSettings.flatFieldsPath); - keyFile.set_boolean ("General", "Verbose", rtSettings.verbose); - keyFile.set_integer ("External Editor", "EditorKind", editorToSendTo); - keyFile.set_string ("External Editor", "GimpDir", gimpDir); - keyFile.set_string ("External Editor", "PhotoshopDir", psDir); - keyFile.set_string ("External Editor", "CustomEditor", customEditorProg); + keyFile.set_string("General", "StartupPath", startupPath); + keyFile.set_string("General", "DateFormat", dateFormat); + keyFile.set_integer("General", "AdjusterMinDelay", adjusterMinDelay); + keyFile.set_integer("General", "AdjusterMaxDelay", adjusterMaxDelay); + keyFile.set_boolean("General", "MultiUser", multiUser); + keyFile.set_string("General", "Language", language); + keyFile.set_boolean("General", "LanguageAutoDetect", languageAutoDetect); + keyFile.set_string("General", "Theme", theme); + keyFile.set_string("General", "Version", RTVERSION); + keyFile.set_string("General", "DarkFramesPath", rtSettings.darkFramesPath); + keyFile.set_string("General", "FlatFieldsPath", rtSettings.flatFieldsPath); + keyFile.set_boolean("General", "Verbose", rtSettings.verbose); + keyFile.set_integer("External Editor", "EditorKind", editorToSendTo); + keyFile.set_string("External Editor", "GimpDir", gimpDir); + keyFile.set_string("External Editor", "PhotoshopDir", psDir); + keyFile.set_string("External Editor", "CustomEditor", customEditorProg); - keyFile.set_boolean ("File Browser", "BrowseOnlyRaw", fbOnlyRaw); - keyFile.set_boolean ("File Browser", "BrowserShowsDate", fbShowDateTime); - keyFile.set_boolean ("File Browser", "BrowserShowsExif", fbShowBasicExif); - keyFile.set_boolean ("File Browser", "BrowserShowsExpComp", fbShowExpComp); - keyFile.set_boolean ("File Browser", "BrowserShowsHidden", fbShowHidden); - keyFile.set_integer ("File Browser", "ThumbnailSize", thumbSize); - keyFile.set_integer ("File Browser", "ThumbnailSizeTab", thumbSizeTab); - keyFile.set_integer ("File Browser", "ThumbnailSizeQueue", thumbSizeQueue); - keyFile.set_integer ("File Browser", "SameThumbSize", sameThumbSize); - keyFile.set_integer ("File Browser", "MaxPreviewHeight", maxThumbnailHeight); - keyFile.set_integer ("File Browser", "MaxCacheEntries", maxCacheEntries); + keyFile.set_boolean("File Browser", "BrowseOnlyRaw", fbOnlyRaw); + keyFile.set_boolean("File Browser", "BrowserShowsDate", fbShowDateTime); + keyFile.set_boolean("File Browser", "BrowserShowsExif", fbShowBasicExif); + keyFile.set_boolean("File Browser", "BrowserShowsExpComp", fbShowExpComp); + keyFile.set_boolean("File Browser", "BrowserShowsHidden", fbShowHidden); + keyFile.set_integer("File Browser", "ThumbnailSize", thumbSize); + keyFile.set_integer("File Browser", "ThumbnailSizeTab", thumbSizeTab); + keyFile.set_integer("File Browser", "ThumbnailSizeQueue", thumbSizeQueue); + keyFile.set_integer("File Browser", "SameThumbSize", sameThumbSize); + keyFile.set_integer("File Browser", "MaxPreviewHeight", maxThumbnailHeight); + keyFile.set_integer("File Browser", "MaxCacheEntries", maxCacheEntries); Glib::ArrayHandle pext = parseExtensions; - keyFile.set_string_list ("File Browser", "ParseExtensions", pext); + keyFile.set_string_list("File Browser", "ParseExtensions", pext); Glib::ArrayHandle pextena = parseExtensionsEnabled; - keyFile.set_integer_list ("File Browser", "ParseExtensionsEnabled", pextena); - keyFile.set_integer ("File Browser", "ThumbnailArrangement", fbArrangement); - keyFile.set_integer ("File Browser", "ThumbnailInterpolation", thumbInterp); + keyFile.set_integer_list("File Browser", "ParseExtensionsEnabled", pextena); + keyFile.set_integer("File Browser", "ThumbnailArrangement", fbArrangement); + keyFile.set_integer("File Browser", "ThumbnailInterpolation", thumbInterp); Glib::ArrayHandle pfav = favoriteDirs; - keyFile.set_string_list ("File Browser", "FavoriteDirs", pfav); + keyFile.set_string_list("File Browser", "FavoriteDirs", pfav); Glib::ArrayHandle pren = renameTemplates; - keyFile.set_string_list ("File Browser", "RenameTemplates", pren); - keyFile.set_boolean ("File Browser", "RenameUseTemplates", renameUseTemplates); + keyFile.set_string_list("File Browser", "RenameTemplates", pren); + keyFile.set_boolean("File Browser", "RenameUseTemplates", renameUseTemplates); Glib::ArrayHandle ptzoom = thumbnailZoomRatios; - keyFile.set_double_list ("File Browser", "ThumbnailZoomRatios", ptzoom); - keyFile.set_boolean ("File Browser", "OverlayedFileNames", overlayedFileNames); - keyFile.set_boolean ("File Browser", "FilmStripOverlayedFileNames", filmStripOverlayedFileNames); - keyFile.set_boolean ("File Browser", "ShowFileNames", showFileNames ); - keyFile.set_boolean ("File Browser", "FilmStripShowFileNames", filmStripShowFileNames ); - keyFile.set_boolean ("File Browser", "InternalThumbIfUntouched", internalThumbIfUntouched ); - keyFile.set_boolean ("File Browser", "menuGroupRank", menuGroupRank); - keyFile.set_boolean ("File Browser", "menuGroupLabel", menuGroupLabel); - keyFile.set_boolean ("File Browser", "menuGroupFileOperations", menuGroupFileOperations); - keyFile.set_boolean ("File Browser", "menuGroupProfileOperations", menuGroupProfileOperations); - keyFile.set_boolean ("File Browser", "menuGroupExtProg", menuGroupExtProg); - keyFile.set_integer ("File Browser", "MaxRecentFolders", maxRecentFolders); + keyFile.set_double_list("File Browser", "ThumbnailZoomRatios", ptzoom); + keyFile.set_boolean("File Browser", "OverlayedFileNames", overlayedFileNames); + keyFile.set_boolean("File Browser", "FilmStripOverlayedFileNames", filmStripOverlayedFileNames); + keyFile.set_boolean("File Browser", "ShowFileNames", showFileNames); + keyFile.set_boolean("File Browser", "FilmStripShowFileNames", filmStripShowFileNames); + keyFile.set_boolean("File Browser", "InternalThumbIfUntouched", internalThumbIfUntouched); + keyFile.set_boolean("File Browser", "menuGroupRank", menuGroupRank); + keyFile.set_boolean("File Browser", "menuGroupLabel", menuGroupLabel); + keyFile.set_boolean("File Browser", "menuGroupFileOperations", menuGroupFileOperations); + keyFile.set_boolean("File Browser", "menuGroupProfileOperations", menuGroupProfileOperations); + keyFile.set_boolean("File Browser", "menuGroupExtProg", menuGroupExtProg); + keyFile.set_integer("File Browser", "MaxRecentFolders", maxRecentFolders); { std::vector temp; - temp.reserve (maxRecentFolders); + temp.reserve(maxRecentFolders); - for (unsigned int i = 0; i < std::min (recentFolders.size(), maxRecentFolders); i++) { - temp.push_back (recentFolders[i]); + for (unsigned int i = 0; i < std::min(recentFolders.size(), maxRecentFolders); i++) { + temp.push_back(recentFolders[i]); } - keyFile.set_string_list ("File Browser", "RecentFolders", temp); + keyFile.set_string_list("File Browser", "RecentFolders", temp); } - keyFile.set_integer ("Clipping Indication", "HighlightThreshold", highlightThreshold); - keyFile.set_integer ("Clipping Indication", "ShadowThreshold", shadowThreshold); - keyFile.set_boolean ("Clipping Indication", "BlinkClipped", blinkClipped); + keyFile.set_integer("Clipping Indication", "HighlightThreshold", highlightThreshold); + keyFile.set_integer("Clipping Indication", "ShadowThreshold", shadowThreshold); + keyFile.set_boolean("Clipping Indication", "BlinkClipped", blinkClipped); - keyFile.set_integer ("Performance", "RgbDenoiseThreadLimit", rgbDenoiseThreadLimit); - keyFile.set_double ("Performance", "NRauto", rtSettings.nrauto); - keyFile.set_double ("Performance", "NRautomax", rtSettings.nrautomax); - keyFile.set_double ("Performance", "NRhigh", rtSettings.nrhigh); - keyFile.set_integer ("Performance", "NRWavlevel", rtSettings.nrwavlevel); - keyFile.set_integer ("Performance", "LevNR", rtSettings.leveldnv); - keyFile.set_integer ("Performance", "LevNRTI", rtSettings.leveldnti); - keyFile.set_integer ("Performance", "LevNRAUT", rtSettings.leveldnaut); - keyFile.set_integer ("Performance", "LevNRLISS", rtSettings.leveldnliss); - keyFile.set_integer ("Performance", "SIMPLNRAUT", rtSettings.leveldnautsimpl); - keyFile.set_integer ("Performance", "ClutCacheSize", clutCacheSize); - keyFile.set_integer ("Performance", "MaxInspectorBuffers", maxInspectorBuffers); - keyFile.set_integer ("Performance", "InspectorDelay", inspectorDelay); - keyFile.set_integer ("Performance", "PreviewDemosaicFromSidecar", prevdemo); - keyFile.set_boolean ("Performance", "Daubechies", rtSettings.daubech); - keyFile.set_boolean ("Performance", "SerializeTiffRead", serializeTiffRead); + keyFile.set_integer("Performance", "RgbDenoiseThreadLimit", rgbDenoiseThreadLimit); + keyFile.set_double("Performance", "NRauto", rtSettings.nrauto); + keyFile.set_double("Performance", "NRautomax", rtSettings.nrautomax); + keyFile.set_double("Performance", "NRhigh", rtSettings.nrhigh); + keyFile.set_integer("Performance", "NRWavlevel", rtSettings.nrwavlevel); + keyFile.set_integer("Performance", "LevNR", rtSettings.leveldnv); + keyFile.set_integer("Performance", "LevNRTI", rtSettings.leveldnti); + keyFile.set_integer("Performance", "LevNRAUT", rtSettings.leveldnaut); + keyFile.set_integer("Performance", "LevNRLISS", rtSettings.leveldnliss); + keyFile.set_integer("Performance", "SIMPLNRAUT", rtSettings.leveldnautsimpl); + keyFile.set_integer("Performance", "ClutCacheSize", clutCacheSize); + keyFile.set_integer("Performance", "MaxInspectorBuffers", maxInspectorBuffers); + keyFile.set_integer("Performance", "InspectorDelay", inspectorDelay); + keyFile.set_integer("Performance", "PreviewDemosaicFromSidecar", prevdemo); + keyFile.set_boolean("Performance", "Daubechies", rtSettings.daubech); + keyFile.set_boolean("Performance", "SerializeTiffRead", serializeTiffRead); keyFile.set_integer("Performance", "ThumbnailInspectorMode", int(rtSettings.thumbnail_inspector_mode)); - keyFile.set_string ("Output", "Format", saveFormat.format); - keyFile.set_integer ("Output", "JpegQuality", saveFormat.jpegQuality); - keyFile.set_integer ("Output", "JpegSubSamp", saveFormat.jpegSubSamp); - keyFile.set_integer ("Output", "PngBps", saveFormat.pngBits); - keyFile.set_integer ("Output", "TiffBps", saveFormat.tiffBits); - keyFile.set_boolean ("Output", "TiffUncompressed", saveFormat.tiffUncompressed); - keyFile.set_boolean ("Output", "SaveProcParams", saveFormat.saveParams); + keyFile.set_string("Output", "Format", saveFormat.format); + keyFile.set_integer("Output", "JpegQuality", saveFormat.jpegQuality); + keyFile.set_integer("Output", "JpegSubSamp", saveFormat.jpegSubSamp); + keyFile.set_integer("Output", "PngBps", saveFormat.pngBits); + keyFile.set_integer("Output", "TiffBps", saveFormat.tiffBits); + keyFile.set_boolean("Output", "TiffUncompressed", saveFormat.tiffUncompressed); + keyFile.set_boolean("Output", "SaveProcParams", saveFormat.saveParams); - keyFile.set_string ("Output", "FormatBatch", saveFormatBatch.format); - keyFile.set_integer ("Output", "JpegQualityBatch", saveFormatBatch.jpegQuality); - keyFile.set_integer ("Output", "JpegSubSampBatch", saveFormatBatch.jpegSubSamp); - keyFile.set_integer ("Output", "PngBpsBatch", saveFormatBatch.pngBits); - keyFile.set_integer ("Output", "TiffBpsBatch", saveFormatBatch.tiffBits); - keyFile.set_boolean ("Output", "TiffUncompressedBatch", saveFormatBatch.tiffUncompressed); - keyFile.set_boolean ("Output", "SaveProcParamsBatch", saveFormatBatch.saveParams); + keyFile.set_string("Output", "FormatBatch", saveFormatBatch.format); + keyFile.set_integer("Output", "JpegQualityBatch", saveFormatBatch.jpegQuality); + keyFile.set_integer("Output", "JpegSubSampBatch", saveFormatBatch.jpegSubSamp); + keyFile.set_integer("Output", "PngBpsBatch", saveFormatBatch.pngBits); + keyFile.set_integer("Output", "TiffBpsBatch", saveFormatBatch.tiffBits); + keyFile.set_boolean("Output", "TiffUncompressedBatch", saveFormatBatch.tiffUncompressed); + keyFile.set_boolean("Output", "SaveProcParamsBatch", saveFormatBatch.saveParams); - keyFile.set_string ("Output", "PathTemplate", savePathTemplate); - keyFile.set_string ("Output", "PathFolder", savePathFolder); - keyFile.set_boolean ("Output", "AutoSuffix", autoSuffix); - keyFile.set_boolean ("Output", "ForceFormatOpts", forceFormatOpts); - keyFile.set_integer ("Output", "SaveMethodNum", saveMethodNum); - keyFile.set_boolean ("Output", "UsePathTemplate", saveUsePathTemplate); - keyFile.set_string ("Output", "LastSaveAsPath", lastSaveAsPath); - keyFile.set_boolean ("Output", "OverwriteOutputFile", overwriteOutputFile); + keyFile.set_string("Output", "PathTemplate", savePathTemplate); + keyFile.set_string("Output", "PathFolder", savePathFolder); + keyFile.set_boolean("Output", "AutoSuffix", autoSuffix); + keyFile.set_boolean("Output", "ForceFormatOpts", forceFormatOpts); + keyFile.set_integer("Output", "SaveMethodNum", saveMethodNum); + keyFile.set_boolean("Output", "UsePathTemplate", saveUsePathTemplate); + keyFile.set_string("Output", "LastSaveAsPath", lastSaveAsPath); + keyFile.set_boolean("Output", "OverwriteOutputFile", overwriteOutputFile); - keyFile.set_string ("Profiles", "Directory", profilePath); - keyFile.set_boolean ("Profiles", "UseBundledProfiles", useBundledProfiles); - keyFile.set_string ("Profiles", "LoadSaveProfilePath", loadSaveProfilePath); - keyFile.set_string ("Profiles", "RawDefault", defProfRaw); - keyFile.set_string ("Profiles", "ImgDefault", defProfImg); - keyFile.set_boolean ("Profiles", "FilledProfile", filledProfile); - keyFile.set_boolean ("Profiles", "SaveParamsWithFile", saveParamsFile); - keyFile.set_boolean ("Profiles", "SaveParamsToCache", saveParamsCache); - keyFile.set_integer ("Profiles", "LoadParamsFromLocation", paramsLoadLocation); - keyFile.set_string ("Profiles", "CustomProfileBuilderPath", CPBPath); - keyFile.set_integer ("Profiles", "CustomProfileBuilderKeys", CPBKeys); + keyFile.set_string("Profiles", "Directory", profilePath); + keyFile.set_boolean("Profiles", "UseBundledProfiles", useBundledProfiles); + keyFile.set_string("Profiles", "LoadSaveProfilePath", loadSaveProfilePath); + keyFile.set_string("Profiles", "RawDefault", defProfRaw); + keyFile.set_string("Profiles", "ImgDefault", defProfImg); + keyFile.set_boolean("Profiles", "FilledProfile", filledProfile); + keyFile.set_boolean("Profiles", "SaveParamsWithFile", saveParamsFile); + keyFile.set_boolean("Profiles", "SaveParamsToCache", saveParamsCache); + keyFile.set_integer("Profiles", "LoadParamsFromLocation", paramsLoadLocation); + keyFile.set_string("Profiles", "CustomProfileBuilderPath", CPBPath); + keyFile.set_integer("Profiles", "CustomProfileBuilderKeys", CPBKeys); - keyFile.set_integer ("GUI", "WindowWidth", windowWidth); - keyFile.set_integer ("GUI", "WindowHeight", windowHeight); - keyFile.set_integer ("GUI", "WindowX", windowX); - keyFile.set_integer ("GUI", "WindowY", windowY); - keyFile.set_integer ("GUI", "WindowMonitor", windowMonitor); - keyFile.set_integer ("GUI", "MeowMonitor", meowMonitor); - keyFile.set_boolean ("GUI", "MeowFullScreen", meowFullScreen); - keyFile.set_boolean ("GUI", "MeowMaximized", meowMaximized); - keyFile.set_integer ("GUI", "MeowWidth", meowWidth); - keyFile.set_integer ("GUI", "MeowHeight", meowHeight); - keyFile.set_integer ("GUI", "MeowX", meowX); - keyFile.set_integer ("GUI", "MeowY", meowY); - keyFile.set_boolean ("GUI", "WindowMaximized", windowMaximized); - keyFile.set_integer ("GUI", "DetailWindowWidth", detailWindowWidth); - keyFile.set_integer ("GUI", "DetailWindowHeight", detailWindowHeight); - keyFile.set_integer ("GUI", "DirBrowserWidth", dirBrowserWidth); - keyFile.set_integer ("GUI", "DirBrowserHeight", dirBrowserHeight); - keyFile.set_integer ("GUI", "SortType", dirBrowserSortType); - keyFile.set_integer ("GUI", "PreferencesWidth", preferencesWidth); - keyFile.set_integer ("GUI", "PreferencesHeight", preferencesHeight); - keyFile.set_integer ("GUI", "SaveAsDialogWidth", saveAsDialogWidth); - keyFile.set_integer ("GUI", "SaveAsDialogHeight", saveAsDialogHeight); - keyFile.set_integer ("GUI", "ToolPanelWidth", toolPanelWidth); - keyFile.set_integer ("GUI", "BrowserToolPanelWidth", browserToolPanelWidth); - keyFile.set_integer ("GUI", "BrowserToolPanelHeight", browserToolPanelHeight); - keyFile.set_boolean ("GUI", "BrowserToolPanelOpened", browserToolPanelOpened); - keyFile.set_boolean ("GUI", "EditorFilmStripOpened", editorFilmStripOpened); - keyFile.set_boolean ("GUI", "BrowserDirPanelOpened", browserDirPanelOpened); - keyFile.set_integer ("GUI", "HistoryPanelWidth", historyPanelWidth); - keyFile.set_string ("GUI", "FontFamily", fontFamily); - keyFile.set_integer ("GUI", "FontSize", fontSize); - keyFile.set_string ("GUI", "CPFontFamily", CPFontFamily); - keyFile.set_integer ("GUI", "CPFontSize", CPFontSize); - keyFile.set_integer ("GUI", "LastPreviewScale", lastScale); - keyFile.set_boolean ("GUI", "LastShowAllExif", lastShowAllExif); - keyFile.set_integer ("GUI", "PanAccelFactor", panAccelFactor); - keyFile.set_boolean ("GUI", "RememberZoomAndPan", rememberZoomAndPan); - keyFile.set_integer ("GUI", "LastCropSize", lastCropSize); - keyFile.set_boolean ("GUI", "ShowHistory", showHistory); - keyFile.set_integer ("GUI", "ShowFilePanelState", showFilePanelState); - keyFile.set_boolean ("GUI", "ShowInfo", showInfo); - keyFile.set_boolean ("GUI", "MainNBVertical", mainNBVertical); - keyFile.set_boolean ("GUI", "ShowClippedHighlights", showClippedHighlights); - keyFile.set_boolean ("GUI", "ShowClippedShadows", showClippedShadows); - keyFile.set_integer ("GUI", "FrameColor", bgcolor); - keyFile.set_boolean ("GUI", "ProcessingQueueEnbled", procQueueEnabled); + keyFile.set_integer("GUI", "WindowWidth", windowWidth); + keyFile.set_integer("GUI", "WindowHeight", windowHeight); + keyFile.set_integer("GUI", "WindowX", windowX); + keyFile.set_integer("GUI", "WindowY", windowY); + keyFile.set_integer("GUI", "WindowMonitor", windowMonitor); + keyFile.set_integer("GUI", "MeowMonitor", meowMonitor); + keyFile.set_boolean("GUI", "MeowFullScreen", meowFullScreen); + keyFile.set_boolean("GUI", "MeowMaximized", meowMaximized); + keyFile.set_integer("GUI", "MeowWidth", meowWidth); + keyFile.set_integer("GUI", "MeowHeight", meowHeight); + keyFile.set_integer("GUI", "MeowX", meowX); + keyFile.set_integer("GUI", "MeowY", meowY); + keyFile.set_boolean("GUI", "WindowMaximized", windowMaximized); + keyFile.set_integer("GUI", "DetailWindowWidth", detailWindowWidth); + keyFile.set_integer("GUI", "DetailWindowHeight", detailWindowHeight); + keyFile.set_integer("GUI", "DirBrowserWidth", dirBrowserWidth); + keyFile.set_integer("GUI", "DirBrowserHeight", dirBrowserHeight); + keyFile.set_integer("GUI", "SortType", dirBrowserSortType); + keyFile.set_integer("GUI", "PreferencesWidth", preferencesWidth); + keyFile.set_integer("GUI", "PreferencesHeight", preferencesHeight); + keyFile.set_integer("GUI", "SaveAsDialogWidth", saveAsDialogWidth); + keyFile.set_integer("GUI", "SaveAsDialogHeight", saveAsDialogHeight); + keyFile.set_integer("GUI", "ToolPanelWidth", toolPanelWidth); + keyFile.set_integer("GUI", "BrowserToolPanelWidth", browserToolPanelWidth); + keyFile.set_integer("GUI", "BrowserToolPanelHeight", browserToolPanelHeight); + keyFile.set_boolean("GUI", "BrowserToolPanelOpened", browserToolPanelOpened); + keyFile.set_boolean("GUI", "EditorFilmStripOpened", editorFilmStripOpened); + keyFile.set_boolean("GUI", "BrowserDirPanelOpened", browserDirPanelOpened); + keyFile.set_integer("GUI", "HistoryPanelWidth", historyPanelWidth); + keyFile.set_string("GUI", "FontFamily", fontFamily); + keyFile.set_integer("GUI", "FontSize", fontSize); + keyFile.set_string("GUI", "CPFontFamily", CPFontFamily); + keyFile.set_integer("GUI", "CPFontSize", CPFontSize); + keyFile.set_integer("GUI", "LastPreviewScale", lastScale); + keyFile.set_boolean("GUI", "LastShowAllExif", lastShowAllExif); + keyFile.set_integer("GUI", "PanAccelFactor", panAccelFactor); + keyFile.set_boolean("GUI", "RememberZoomAndPan", rememberZoomAndPan); + keyFile.set_integer("GUI", "LastCropSize", lastCropSize); + keyFile.set_boolean("GUI", "ShowHistory", showHistory); + keyFile.set_integer("GUI", "ShowFilePanelState", showFilePanelState); + keyFile.set_boolean("GUI", "ShowInfo", showInfo); + keyFile.set_boolean("GUI", "MainNBVertical", mainNBVertical); + keyFile.set_boolean("GUI", "ShowClippedHighlights", showClippedHighlights); + keyFile.set_boolean("GUI", "ShowClippedShadows", showClippedShadows); + keyFile.set_integer("GUI", "FrameColor", bgcolor); + keyFile.set_boolean("GUI", "ProcessingQueueEnbled", procQueueEnabled); Glib::ArrayHandle tpopen = tpOpen; - keyFile.set_integer_list ("GUI", "ToolPanelsExpanded", tpopen); - keyFile.set_boolean ("GUI", "ToolPanelsExpandedAutoSave", autoSaveTpOpen); - keyFile.set_integer ("GUI", "MultiDisplayMode", multiDisplayMode); - keyFile.set_double_list ("GUI", "CutOverlayBrush", cutOverlayBrush); - keyFile.set_double_list ("GUI", "NavGuideBrush", navGuideBrush); - keyFile.set_integer ("GUI", "HistogramPosition", histogramPosition); - keyFile.set_boolean ("GUI", "HistogramBar", histogramBar); - keyFile.set_boolean ("GUI", "HistogramFullMode", histogramFullMode); - keyFile.set_integer ("GUI", "NavigatorRGBUnit", (int)navRGBUnit); - keyFile.set_integer ("GUI", "NavigatorHSVUnit", (int)navHSVUnit); - keyFile.set_boolean ("GUI", "ShowFilmStripToolBar", showFilmStripToolBar); - keyFile.set_boolean ("GUI", "FileBrowserToolbarSingleRow", FileBrowserToolbarSingleRow); - keyFile.set_boolean ("GUI", "HideTPVScrollbar", hideTPVScrollbar); - keyFile.set_boolean ("GUI", "UseIconNoText", UseIconNoText); - keyFile.set_boolean ("GUI", "HistogramWorking", rtSettings.HistogramWorking); - keyFile.set_integer ("GUI", "CurveBBoxPosition", curvebboxpos); + keyFile.set_integer_list("GUI", "ToolPanelsExpanded", tpopen); + keyFile.set_boolean("GUI", "ToolPanelsExpandedAutoSave", autoSaveTpOpen); + keyFile.set_integer("GUI", "MultiDisplayMode", multiDisplayMode); + keyFile.set_double_list("GUI", "CutOverlayBrush", cutOverlayBrush); + keyFile.set_double_list("GUI", "NavGuideBrush", navGuideBrush); + keyFile.set_integer("GUI", "HistogramPosition", histogramPosition); + keyFile.set_boolean("GUI", "HistogramBar", histogramBar); + keyFile.set_boolean("GUI", "HistogramFullMode", histogramFullMode); + keyFile.set_integer("GUI", "NavigatorRGBUnit", (int)navRGBUnit); + keyFile.set_integer("GUI", "NavigatorHSVUnit", (int)navHSVUnit); + keyFile.set_boolean("GUI", "ShowFilmStripToolBar", showFilmStripToolBar); + keyFile.set_boolean("GUI", "FileBrowserToolbarSingleRow", FileBrowserToolbarSingleRow); + keyFile.set_boolean("GUI", "HideTPVScrollbar", hideTPVScrollbar); + keyFile.set_boolean("GUI", "UseIconNoText", UseIconNoText); + keyFile.set_boolean("GUI", "HistogramWorking", rtSettings.HistogramWorking); + keyFile.set_integer("GUI", "CurveBBoxPosition", curvebboxpos); //Glib::ArrayHandle crvopen = crvOpen; //keyFile.set_integer_list ("GUI", "CurvePanelsExpanded", crvopen); - keyFile.set_integer ("Crop Settings", "PPI", cropPPI); + keyFile.set_integer("Crop Settings", "PPI", cropPPI); keyFile.set_integer("Crop Settings", "GuidesMode", cropGuides); keyFile.set_boolean("Crop Settings", "AutoFit", cropAutoFit); - keyFile.set_string ("Color Management", "PrinterProfile", rtSettings.printerProfile); - keyFile.set_integer ("Color Management", "PrinterIntent", rtSettings.printerIntent); - keyFile.set_boolean ("Color Management", "PrinterBPC", rtSettings.printerBPC); + keyFile.set_string("Color Management", "PrinterProfile", rtSettings.printerProfile); + keyFile.set_integer("Color Management", "PrinterIntent", rtSettings.printerIntent); + keyFile.set_boolean("Color Management", "PrinterBPC", rtSettings.printerBPC); - keyFile.set_string ("Color Management", "ICCDirectory", rtSettings.iccDirectory); - keyFile.set_string ("Color Management", "MonitorProfile", rtSettings.monitorProfile); - keyFile.set_boolean ("Color Management", "AutoMonitorProfile", rtSettings.autoMonitorProfile); - keyFile.set_boolean ("Color Management", "Autocielab", rtSettings.autocielab); - keyFile.set_boolean ("Color Management", "RGBcurvesLumamode_Gamut", rtSettings.rgbcurveslumamode_gamut); - keyFile.set_integer ("Color Management", "Intent", rtSettings.monitorIntent); - keyFile.set_boolean ("Color Management", "MonitorBPC", rtSettings.monitorBPC); + keyFile.set_string("Color Management", "ICCDirectory", rtSettings.iccDirectory); + keyFile.set_string("Color Management", "MonitorProfile", rtSettings.monitorProfile); + keyFile.set_boolean("Color Management", "AutoMonitorProfile", rtSettings.autoMonitorProfile); + keyFile.set_boolean("Color Management", "Autocielab", rtSettings.autocielab); + keyFile.set_boolean("Color Management", "RGBcurvesLumamode_Gamut", rtSettings.rgbcurveslumamode_gamut); + keyFile.set_integer("Color Management", "Intent", rtSettings.monitorIntent); + keyFile.set_boolean("Color Management", "MonitorBPC", rtSettings.monitorBPC); //keyFile.set_integer ("Color Management", "view", rtSettings.viewingdevice); //keyFile.set_integer ("Color Management", "grey", rtSettings.viewingdevicegrey); // keyFile.set_integer ("Color Management", "greySc", rtSettings.viewinggreySc); - keyFile.set_string ("Color Management", "AdobeRGB", rtSettings.adobe); - keyFile.set_string ("Color Management", "ProPhoto", rtSettings.prophoto); - keyFile.set_string ("Color Management", "ProPhoto10", rtSettings.prophoto10); - keyFile.set_string ("Color Management", "WideGamut", rtSettings.widegamut); - keyFile.set_string ("Color Management", "sRGB", rtSettings.srgb); - keyFile.set_string ("Color Management", "sRGB10", rtSettings.srgb10); - keyFile.set_string ("Color Management", "Beta", rtSettings.beta); - keyFile.set_string ("Color Management", "Best", rtSettings.best); - keyFile.set_string ("Color Management", "Rec2020", rtSettings.rec2020); - keyFile.set_string ("Color Management", "Bruce", rtSettings.bruce); - keyFile.set_integer ("Color Management", "WhiteBalanceSpotSize", whiteBalanceSpotSize); - keyFile.set_boolean ("Color Management", "GamutICC", rtSettings.gamutICC); + keyFile.set_string("Color Management", "AdobeRGB", rtSettings.adobe); + keyFile.set_string("Color Management", "ProPhoto", rtSettings.prophoto); + keyFile.set_string("Color Management", "ProPhoto10", rtSettings.prophoto10); + keyFile.set_string("Color Management", "WideGamut", rtSettings.widegamut); + keyFile.set_string("Color Management", "sRGB", rtSettings.srgb); + keyFile.set_string("Color Management", "sRGB10", rtSettings.srgb10); + keyFile.set_string("Color Management", "Beta", rtSettings.beta); + keyFile.set_string("Color Management", "Best", rtSettings.best); + keyFile.set_string("Color Management", "Rec2020", rtSettings.rec2020); + keyFile.set_string("Color Management", "Bruce", rtSettings.bruce); + keyFile.set_integer("Color Management", "WhiteBalanceSpotSize", whiteBalanceSpotSize); + keyFile.set_boolean("Color Management", "GamutICC", rtSettings.gamutICC); //keyFile.set_boolean ("Color Management", "BWcomplement", rtSettings.bw_complementary); - keyFile.set_boolean ("Color Management", "Ciecamfloat", rtSettings.ciecamfloat); - keyFile.set_boolean ("Color Management", "GamutLch", rtSettings.gamutLch); - keyFile.set_integer ("Color Management", "ProtectRed", rtSettings.protectred); - keyFile.set_integer ("Color Management", "Amountchroma", rtSettings.amchroma); - keyFile.set_double ("Color Management", "ProtectRedH", rtSettings.protectredh); - keyFile.set_integer ("Color Management", "CRI", rtSettings.CRI_color); - keyFile.set_integer ("Color Management", "DenoiseLabgamma", rtSettings.denoiselabgamma); + keyFile.set_boolean("Color Management", "Ciecamfloat", rtSettings.ciecamfloat); + keyFile.set_boolean("Color Management", "GamutLch", rtSettings.gamutLch); + keyFile.set_integer("Color Management", "ProtectRed", rtSettings.protectred); + keyFile.set_integer("Color Management", "Amountchroma", rtSettings.amchroma); + keyFile.set_double("Color Management", "ProtectRedH", rtSettings.protectredh); + keyFile.set_integer("Color Management", "CRI", rtSettings.CRI_color); + keyFile.set_integer("Color Management", "DenoiseLabgamma", rtSettings.denoiselabgamma); //keyFile.set_boolean ("Color Management", "Ciebadpixgauss", rtSettings.ciebadpixgauss); - keyFile.set_double ("Color Management", "CBDLlevel0", rtSettings.level0_cbdl); - keyFile.set_double ("Color Management", "CBDLlevel123", rtSettings.level123_cbdl); + keyFile.set_double("Color Management", "CBDLlevel0", rtSettings.level0_cbdl); + keyFile.set_double("Color Management", "CBDLlevel123", rtSettings.level123_cbdl); //keyFile.set_double ("Color Management", "Colortoningab", rtSettings.colortoningab); //keyFile.set_double ("Color Management", "Decaction", rtSettings.decaction); - keyFile.set_string ("Color Management", "ClutsDirectory", clutsDir); + keyFile.set_string("Color Management", "ClutsDirectory", clutsDir); Glib::ArrayHandle bab = baBehav; - keyFile.set_integer_list ("Batch Processing", "AdjusterBehavior", bab); + keyFile.set_integer_list("Batch Processing", "AdjusterBehavior", bab); - keyFile.set_boolean ("Sounds", "Enable", sndEnable); - keyFile.set_string ("Sounds", "BatchQueueDone", sndBatchQueueDone); - keyFile.set_string ("Sounds", "LngEditProcDone", sndLngEditProcDone); - keyFile.set_double ("Sounds", "LngEditProcDoneSecs", sndLngEditProcDoneSecs); + keyFile.set_boolean("Sounds", "Enable", sndEnable); + keyFile.set_string("Sounds", "BatchQueueDone", sndBatchQueueDone); + keyFile.set_string("Sounds", "LngEditProcDone", sndLngEditProcDone); + keyFile.set_double("Sounds", "LngEditProcDoneSecs", sndLngEditProcDoneSecs); - keyFile.set_boolean ("Fast Export", "fastexport_bypass_sharpening", fastexport_bypass_sharpening); - keyFile.set_boolean ("Fast Export", "fastexport_bypass_sharpenEdge", fastexport_bypass_sharpenEdge); - keyFile.set_boolean ("Fast Export", "fastexport_bypass_sharpenMicro", fastexport_bypass_sharpenMicro); + keyFile.set_boolean("Fast Export", "fastexport_bypass_sharpening", fastexport_bypass_sharpening); + keyFile.set_boolean("Fast Export", "fastexport_bypass_sharpenEdge", fastexport_bypass_sharpenEdge); + keyFile.set_boolean("Fast Export", "fastexport_bypass_sharpenMicro", fastexport_bypass_sharpenMicro); //keyFile.set_boolean ("Fast Export", "fastexport_bypass_lumaDenoise" , fastexport_bypass_lumaDenoise); //keyFile.set_boolean ("Fast Export", "fastexport_bypass_colorDenoise" , fastexport_bypass_colorDenoise); - keyFile.set_boolean ("Fast Export", "fastexport_bypass_defringe", fastexport_bypass_defringe); - keyFile.set_boolean ("Fast Export", "fastexport_bypass_dirpyrDenoise", fastexport_bypass_dirpyrDenoise); - keyFile.set_boolean ("Fast Export", "fastexport_bypass_sh_hq", fastexport_bypass_sh_hq); - keyFile.set_boolean ("Fast Export", "fastexport_bypass_dirpyrequalizer", fastexport_bypass_dirpyrequalizer); - keyFile.set_boolean ("Fast Export", "fastexport_bypass_wavelet", fastexport_bypass_wavelet); - keyFile.set_string ("Fast Export", "fastexport_raw_bayer_method", fastexport_raw_bayer_method); + keyFile.set_boolean("Fast Export", "fastexport_bypass_defringe", fastexport_bypass_defringe); + keyFile.set_boolean("Fast Export", "fastexport_bypass_dirpyrDenoise", fastexport_bypass_dirpyrDenoise); + keyFile.set_boolean("Fast Export", "fastexport_bypass_sh_hq", fastexport_bypass_sh_hq); + keyFile.set_boolean("Fast Export", "fastexport_bypass_dirpyrequalizer", fastexport_bypass_dirpyrequalizer); + keyFile.set_boolean("Fast Export", "fastexport_bypass_wavelet", fastexport_bypass_wavelet); + keyFile.set_string("Fast Export", "fastexport_raw_bayer_method", fastexport_raw_bayer_method); //keyFile.set_boolean ("Fast Export", "fastexport_bypass_bayer_raw_all_enhance" , fastexport_bypass_raw_bayer_all_enhance); - keyFile.set_boolean ("Fast Export", "fastexport_bypass_raw_bayer_dcb_iterations", fastexport_bypass_raw_bayer_dcb_iterations); - keyFile.set_boolean ("Fast Export", "fastexport_bypass_raw_bayer_dcb_enhance", fastexport_bypass_raw_bayer_dcb_enhance); - keyFile.set_boolean ("Fast Export", "fastexport_bypass_raw_bayer_lmmse_iterations", fastexport_bypass_raw_bayer_lmmse_iterations); - keyFile.set_boolean ("Fast Export", "fastexport_bypass_raw_bayer_linenoise", fastexport_bypass_raw_bayer_linenoise); - keyFile.set_boolean ("Fast Export", "fastexport_bypass_raw_bayer_greenthresh", fastexport_bypass_raw_bayer_greenthresh); - keyFile.set_string ("Fast Export", "fastexport_raw_xtrans_method", fastexport_raw_xtrans_method); - keyFile.set_boolean ("Fast Export", "fastexport_bypass_raw_ccSteps", fastexport_bypass_raw_ccSteps); - keyFile.set_boolean ("Fast Export", "fastexport_bypass_raw_ca", fastexport_bypass_raw_ca); - keyFile.set_boolean ("Fast Export", "fastexport_bypass_raw_df", fastexport_bypass_raw_df); - keyFile.set_boolean ("Fast Export", "fastexport_bypass_raw_ff", fastexport_bypass_raw_ff); - keyFile.set_string ("Fast Export", "fastexport_icm_input", fastexport_icm_input); - keyFile.set_string ("Fast Export", "fastexport_icm_working", fastexport_icm_working); - keyFile.set_string ("Fast Export", "fastexport_icm_output", fastexport_icm_output); - keyFile.set_integer ("Fast Export", "fastexport_icm_output_intent", fastexport_icm_outputIntent); - keyFile.set_boolean ("Fast Export", "fastexport_icm_output_bpc", fastexport_icm_outputBPC); - keyFile.set_string ("Fast Export", "fastexport_icm_gamma", fastexport_icm_gamma); - keyFile.set_boolean ("Fast Export", "fastexport_resize_enabled", fastexport_resize_enabled); - keyFile.set_double ("Fast Export", "fastexport_resize_scale", fastexport_resize_scale); - keyFile.set_string ("Fast Export", "fastexport_resize_appliesTo", fastexport_resize_appliesTo); - keyFile.set_string ("Fast Export", "fastexport_resize_method", fastexport_resize_method); - keyFile.set_integer ("Fast Export", "fastexport_resize_dataspec", fastexport_resize_dataspec); - keyFile.set_integer ("Fast Export", "fastexport_resize_width", fastexport_resize_width); - keyFile.set_integer ("Fast Export", "fastexport_resize_height", fastexport_resize_height); - keyFile.set_integer ("Fast Export", "fastexport_use_fast_pipeline", fastexport_use_fast_pipeline); + keyFile.set_boolean("Fast Export", "fastexport_bypass_raw_bayer_dcb_iterations", fastexport_bypass_raw_bayer_dcb_iterations); + keyFile.set_boolean("Fast Export", "fastexport_bypass_raw_bayer_dcb_enhance", fastexport_bypass_raw_bayer_dcb_enhance); + keyFile.set_boolean("Fast Export", "fastexport_bypass_raw_bayer_lmmse_iterations", fastexport_bypass_raw_bayer_lmmse_iterations); + keyFile.set_boolean("Fast Export", "fastexport_bypass_raw_bayer_linenoise", fastexport_bypass_raw_bayer_linenoise); + keyFile.set_boolean("Fast Export", "fastexport_bypass_raw_bayer_greenthresh", fastexport_bypass_raw_bayer_greenthresh); + keyFile.set_string("Fast Export", "fastexport_raw_xtrans_method", fastexport_raw_xtrans_method); + keyFile.set_boolean("Fast Export", "fastexport_bypass_raw_ccSteps", fastexport_bypass_raw_ccSteps); + keyFile.set_boolean("Fast Export", "fastexport_bypass_raw_ca", fastexport_bypass_raw_ca); + keyFile.set_boolean("Fast Export", "fastexport_bypass_raw_df", fastexport_bypass_raw_df); + keyFile.set_boolean("Fast Export", "fastexport_bypass_raw_ff", fastexport_bypass_raw_ff); + keyFile.set_string("Fast Export", "fastexport_icm_input", fastexport_icm_input); + keyFile.set_string("Fast Export", "fastexport_icm_working", fastexport_icm_working); + keyFile.set_string("Fast Export", "fastexport_icm_output", fastexport_icm_output); + keyFile.set_integer("Fast Export", "fastexport_icm_output_intent", fastexport_icm_outputIntent); + keyFile.set_boolean("Fast Export", "fastexport_icm_output_bpc", fastexport_icm_outputBPC); + keyFile.set_string("Fast Export", "fastexport_icm_gamma", fastexport_icm_gamma); + keyFile.set_boolean("Fast Export", "fastexport_resize_enabled", fastexport_resize_enabled); + keyFile.set_double("Fast Export", "fastexport_resize_scale", fastexport_resize_scale); + keyFile.set_string("Fast Export", "fastexport_resize_appliesTo", fastexport_resize_appliesTo); + keyFile.set_string("Fast Export", "fastexport_resize_method", fastexport_resize_method); + keyFile.set_integer("Fast Export", "fastexport_resize_dataspec", fastexport_resize_dataspec); + keyFile.set_integer("Fast Export", "fastexport_resize_width", fastexport_resize_width); + keyFile.set_integer("Fast Export", "fastexport_resize_height", fastexport_resize_height); + keyFile.set_integer("Fast Export", "fastexport_use_fast_pipeline", fastexport_use_fast_pipeline); - keyFile.set_string ("Dialogs", "LastIccDir", lastIccDir); - keyFile.set_string ("Dialogs", "LastDarkframeDir", lastDarkframeDir); - keyFile.set_string ("Dialogs", "LastFlatfieldDir", lastFlatfieldDir); - keyFile.set_string ("Dialogs", "LastRgbCurvesDir", lastRgbCurvesDir); - keyFile.set_string ("Dialogs", "LastLabCurvesDir", lastLabCurvesDir); - keyFile.set_string ("Dialogs", "LastRetinexDir", lastRetinexDir); - keyFile.set_string ("Dialogs", "LastDenoiseCurvesDir", lastDenoiseCurvesDir); - keyFile.set_string ("Dialogs", "LastWaveletCurvesDir", lastWaveletCurvesDir); - keyFile.set_string ("Dialogs", "LastPFCurvesDir", lastPFCurvesDir); - keyFile.set_string ("Dialogs", "LastHsvCurvesDir", lastHsvCurvesDir); - keyFile.set_string ("Dialogs", "LastBWCurvesDir", lastBWCurvesDir); - keyFile.set_string ("Dialogs", "LastToneCurvesDir", lastToneCurvesDir); - keyFile.set_string ("Dialogs", "LastVibranceCurvesDir", lastVibranceCurvesDir); - keyFile.set_string ("Dialogs", "LastProfilingReferenceDir", lastProfilingReferenceDir); - keyFile.set_string ("Dialogs", "LastLensProfileDir", lastLensProfileDir); - keyFile.set_boolean ("Dialogs", "GimpPluginShowInfoDialog", gimpPluginShowInfoDialog); + keyFile.set_string("Dialogs", "LastIccDir", lastIccDir); + keyFile.set_string("Dialogs", "LastDarkframeDir", lastDarkframeDir); + keyFile.set_string("Dialogs", "LastFlatfieldDir", lastFlatfieldDir); + keyFile.set_string("Dialogs", "LastRgbCurvesDir", lastRgbCurvesDir); + keyFile.set_string("Dialogs", "LastLabCurvesDir", lastLabCurvesDir); + keyFile.set_string("Dialogs", "LastRetinexDir", lastRetinexDir); + keyFile.set_string("Dialogs", "LastDenoiseCurvesDir", lastDenoiseCurvesDir); + keyFile.set_string("Dialogs", "LastWaveletCurvesDir", lastWaveletCurvesDir); + keyFile.set_string("Dialogs", "LastPFCurvesDir", lastPFCurvesDir); + keyFile.set_string("Dialogs", "LastHsvCurvesDir", lastHsvCurvesDir); + keyFile.set_string("Dialogs", "LastBWCurvesDir", lastBWCurvesDir); + keyFile.set_string("Dialogs", "LastToneCurvesDir", lastToneCurvesDir); + keyFile.set_string("Dialogs", "LastVibranceCurvesDir", lastVibranceCurvesDir); + keyFile.set_string("Dialogs", "LastProfilingReferenceDir", lastProfilingReferenceDir); + keyFile.set_string("Dialogs", "LastLensProfileDir", lastLensProfileDir); + keyFile.set_boolean("Dialogs", "GimpPluginShowInfoDialog", gimpPluginShowInfoDialog); - keyFile.set_string ("Lensfun", "DBDirectory", rtSettings.lensfunDbDirectory); + keyFile.set_string("Lensfun", "DBDirectory", rtSettings.lensfunDbDirectory); - keyData = keyFile.to_data (); + keyData = keyFile.to_data(); } catch (Glib::KeyFileError &e) { - throw Error (e.what()); + throw Error(e.what()); } - FILE *f = g_fopen (fname.c_str (), "wt"); + FILE *f = g_fopen(fname.c_str(), "wt"); if (f == nullptr) { std::cout << "Warning! Unable to save your preferences to: " << fname << std::endl; - Glib::ustring msg_ = Glib::ustring::compose (M ("MAIN_MSG_WRITEFAILED"), fname.c_str()); - throw Error (msg_); + Glib::ustring msg_ = Glib::ustring::compose(M("MAIN_MSG_WRITEFAILED"), fname.c_str()); + throw Error(msg_); } else { - fprintf (f, "%s", keyData.c_str ()); - fclose (f); + fprintf(f, "%s", keyData.c_str()); + fclose(f); } } -void Options::load (bool lightweight) +void Options::load(bool lightweight) { // Find the application data path @@ -2101,89 +2106,91 @@ void Options::load (bool lightweight) const gchar* path; Glib::ustring dPath; - path = g_getenv ("RT_SETTINGS"); + path = g_getenv("RT_SETTINGS"); if (path != nullptr) { - rtdir = Glib::ustring (path); + rtdir = Glib::ustring(path); - if (!Glib::path_is_absolute (rtdir)) { - Glib::ustring msg = Glib::ustring::compose ("Settings path %1 is not absolute", rtdir); - throw Error (msg); + if (!Glib::path_is_absolute(rtdir)) { + Glib::ustring msg = Glib::ustring::compose("Settings path %1 is not absolute", rtdir); + throw Error(msg); } } else { #ifdef WIN32 WCHAR pathW[MAX_PATH] = {0}; - if (SHGetSpecialFolderPathW (NULL, pathW, CSIDL_LOCAL_APPDATA, false)) { + if (SHGetSpecialFolderPathW(NULL, pathW, CSIDL_LOCAL_APPDATA, false)) { char pathA[MAX_PATH]; - WideCharToMultiByte (CP_UTF8, 0, pathW, -1, pathA, MAX_PATH, 0, 0); - rtdir = Glib::build_filename (Glib::ustring (pathA), Glib::ustring (CACHEFOLDERNAME)); + WideCharToMultiByte(CP_UTF8, 0, pathW, -1, pathA, MAX_PATH, 0, 0); + rtdir = Glib::build_filename(Glib::ustring(pathA), Glib::ustring(CACHEFOLDERNAME)); } #else - rtdir = Glib::build_filename (Glib::ustring (g_get_user_config_dir ()), Glib::ustring (CACHEFOLDERNAME)); + rtdir = Glib::build_filename(Glib::ustring(g_get_user_config_dir()), Glib::ustring(CACHEFOLDERNAME)); #endif } if (options.rtSettings.verbose) { - printf ("Settings directory (rtdir) = %s\n", rtdir.c_str()); + printf("Settings directory (rtdir) = %s\n", rtdir.c_str()); } // Set the cache folder in RT's base folder - cacheBaseDir = Glib::build_filename (argv0, "mycache"); + cacheBaseDir = Glib::build_filename(argv0, "mycache"); // Read the global option file (the one located in the application's base folder) try { - options.readFromFile (Glib::build_filename (argv0, "options")); + options.readFromFile(Glib::build_filename(argv0, "options")); } catch (Options::Error &) { // ignore errors here } if (!options.multiUser && path == nullptr) { - rtdir = Glib::build_filename (argv0, "mysettings"); + rtdir = Glib::build_filename(argv0, "mysettings"); } // Modify the path of the cache folder to the one provided in RT_CACHE environment variable - path = g_getenv ("RT_CACHE"); + path = g_getenv("RT_CACHE"); if (path != nullptr) { - cacheBaseDir = Glib::ustring (path); + cacheBaseDir = Glib::ustring(path); - if (!Glib::path_is_absolute (cacheBaseDir)) { - Glib::ustring msg = Glib::ustring::compose ("Cache base dir %1 is not absolute", cacheBaseDir); - throw Error (msg); + if (!Glib::path_is_absolute(cacheBaseDir)) { + Glib::ustring msg = Glib::ustring::compose("Cache base dir %1 is not absolute", cacheBaseDir); + throw Error(msg); } } // No environment variable provided, so falling back to the multi user mode, if enabled else if (options.multiUser) { #ifdef WIN32 - cacheBaseDir = Glib::build_filename (rtdir, "cache"); + cacheBaseDir = Glib::build_filename(rtdir, "cache"); #else - cacheBaseDir = Glib::build_filename (Glib::ustring (g_get_user_cache_dir()), Glib::ustring (CACHEFOLDERNAME)); + cacheBaseDir = Glib::build_filename(Glib::ustring(g_get_user_cache_dir()), Glib::ustring(CACHEFOLDERNAME)); #endif } // Read the user option file (the one located somewhere in the user's home folder) // Those values supersets those of the global option file try { - options.readFromFile (Glib::build_filename (rtdir, "options")); + options.readFromFile(Glib::build_filename(rtdir, "options")); } catch (Options::Error &) { // If the local option file does not exist or is broken, and the local cache folder does not exist, recreate it - if (!g_mkdir_with_parents (rtdir.c_str (), 511)) { + if (!g_mkdir_with_parents(rtdir.c_str(), 511)) { // Save the option file - options.saveToFile (Glib::build_filename (rtdir, "options")); + options.saveToFile(Glib::build_filename(rtdir, "options")); } } #ifdef __APPLE__ + if (options.multiUser) { // make sure .local/share exists on OS X so we don't get problems with recently-used.xbel - g_mkdir_with_parents (g_get_user_data_dir(), 511); + g_mkdir_with_parents(g_get_user_data_dir(), 511); } + #endif if (options.rtSettings.verbose) { - printf ("Cache directory (cacheBaseDir) = %s\n", cacheBaseDir.c_str()); + printf("Cache directory (cacheBaseDir) = %s\n", cacheBaseDir.c_str()); } // Update profile's path and recreate it if necessary @@ -2193,7 +2200,7 @@ void Options::load (bool lightweight) if (options.defProfRaw.empty()) { options.defProfRaw = DEFPROFILE_RAW; } else { - if (!options.findProfilePath (options.defProfRaw).empty()) { + if (!options.findProfilePath(options.defProfRaw).empty()) { if (options.rtSettings.verbose) { std::cout << "Default profile for raw images \"" << options.defProfRaw << "\" found" << std::endl; } @@ -2202,7 +2209,8 @@ void Options::load (bool lightweight) options.setDefProfRawMissing(true); Glib::ustring dpr(DEFPROFILE_RAW); - if (options.findProfilePath (dpr).empty()) { + + if (options.findProfilePath(dpr).empty()) { options.setBundledDefProfRawMissing(true); } } else { @@ -2214,7 +2222,7 @@ void Options::load (bool lightweight) if (options.defProfImg.empty()) { options.defProfImg = DEFPROFILE_IMG; } else { - if (!options.findProfilePath (options.defProfImg).empty()) { + if (!options.findProfilePath(options.defProfImg).empty()) { if (options.rtSettings.verbose) { std::cout << "Default profile for non-raw images \"" << options.defProfImg << "\" found" << std::endl; } @@ -2223,7 +2231,8 @@ void Options::load (bool lightweight) options.setDefProfImgMissing(true); Glib::ustring dpi(DEFPROFILE_IMG); - if (options.findProfilePath (dpi).empty()) { + + if (options.findProfilePath(dpi).empty()) { options.setBundledDefProfImgMissing(true); } } else { @@ -2247,7 +2256,7 @@ void Options::load (bool lightweight) // out which are the parent translations. Furthermore, there must be a file for each locale () -- you cannot have // 'French (CA)' unless there is a file 'French'. - Glib::ustring defaultTranslation = Glib::build_filename (argv0, "languages", "default"); + Glib::ustring defaultTranslation = Glib::build_filename(argv0, "languages", "default"); Glib::ustring languageTranslation = ""; Glib::ustring localeTranslation = ""; @@ -2256,34 +2265,34 @@ void Options::load (bool lightweight) } if (!options.language.empty()) { - std::vector langPortions = Glib::Regex::split_simple (" ", options.language); + std::vector langPortions = Glib::Regex::split_simple(" ", options.language); if (langPortions.size() >= 1) { - languageTranslation = Glib::build_filename (argv0, "languages", langPortions.at (0)); + languageTranslation = Glib::build_filename(argv0, "languages", langPortions.at(0)); } if (langPortions.size() >= 2) { - localeTranslation = Glib::build_filename (argv0, "languages", options.language); + localeTranslation = Glib::build_filename(argv0, "languages", options.language); } } - langMgr.load (options.language, {localeTranslation, languageTranslation, defaultTranslation}); + langMgr.load(options.language, {localeTranslation, languageTranslation, defaultTranslation}); - rtengine::init (&options.rtSettings, argv0, rtdir, !lightweight); + rtengine::init(&options.rtSettings, argv0, rtdir, !lightweight); } -void Options::save () +void Options::save() { - options.saveToFile (Glib::build_filename (rtdir, "options")); + options.saveToFile(Glib::build_filename(rtdir, "options")); } /* * return true if ext is a parsed extension (retained or not) */ -bool Options::is_parse_extention (Glib::ustring fname) +bool Options::is_parse_extention(Glib::ustring fname) { - Glib::ustring ext = getExtension (fname).lowercase(); + Glib::ustring ext = getExtension(fname).lowercase(); if (!ext.empty()) { // there is an extension to the filename @@ -2302,10 +2311,10 @@ bool Options::is_parse_extention (Glib::ustring fname) /* * return true if fname ends with one of the retained image file extensions */ -bool Options::has_retained_extention (Glib::ustring fname) +bool Options::has_retained_extention(Glib::ustring fname) { - Glib::ustring ext = getExtension (fname).lowercase(); + Glib::ustring ext = getExtension(fname).lowercase(); if (!ext.empty()) { // there is an extension to the filename @@ -2324,7 +2333,7 @@ bool Options::has_retained_extention (Glib::ustring fname) /* * return true if ext is an enabled extension */ -bool Options::is_extention_enabled (Glib::ustring ext) +bool Options::is_extention_enabled(Glib::ustring ext) { for (int j = 0; j < (int)parseExtensions.size(); j++) if (parseExtensions[j].casefold() == ext.casefold()) { @@ -2352,7 +2361,7 @@ bool Options::is_defProfImgMissing() { return defProfError & rtengine::toUnderlying(DefProfError::defProfImgMissing); } -void Options::setDefProfRawMissing (bool value) +void Options::setDefProfRawMissing(bool value) { if (value) { defProfError |= rtengine::toUnderlying(DefProfError::defProfRawMissing); @@ -2360,7 +2369,7 @@ void Options::setDefProfRawMissing (bool value) defProfError &= ~rtengine::toUnderlying(DefProfError::defProfRawMissing); } } -void Options::setDefProfImgMissing (bool value) +void Options::setDefProfImgMissing(bool value) { if (value) { defProfError |= rtengine::toUnderlying(DefProfError::defProfImgMissing); @@ -2376,7 +2385,7 @@ bool Options::is_bundledDefProfImgMissing() { return defProfError & rtengine::toUnderlying(DefProfError::bundledDefProfImgMissing); } -void Options::setBundledDefProfRawMissing (bool value) +void Options::setBundledDefProfRawMissing(bool value) { if (value) { defProfError |= rtengine::toUnderlying(DefProfError::bundledDefProfRawMissing); @@ -2384,7 +2393,7 @@ void Options::setBundledDefProfRawMissing (bool value) defProfError &= ~rtengine::toUnderlying(DefProfError::bundledDefProfRawMissing); } } -void Options::setBundledDefProfImgMissing (bool value) +void Options::setBundledDefProfImgMissing(bool value) { if (value) { defProfError |= rtengine::toUnderlying(DefProfError::bundledDefProfImgMissing); diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 32ef215b2..93a873a32 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -21,13 +21,13 @@ #include "options.h" #include "addsetids.h" -ParamsEdited::ParamsEdited (bool value) +ParamsEdited::ParamsEdited(bool value) { - set (value); + set(value); } -void ParamsEdited::set (bool v) +void ParamsEdited::set(bool v) { general.rank = v; @@ -582,10 +582,10 @@ void ParamsEdited::set (bool v) using namespace rtengine; using namespace rtengine::procparams; -void ParamsEdited::initFrom (const std::vector& src) +void ParamsEdited::initFrom(const std::vector& src) { - set (true); + set(true); if (src.empty()) { return; @@ -661,12 +661,12 @@ void ParamsEdited::initFrom (const std::vector labCurve.rstprotection = labCurve.rstprotection && p.labCurve.rstprotection == other.labCurve.rstprotection; labCurve.lcredsk = labCurve.lcredsk && p.labCurve.lcredsk == other.labCurve.lcredsk; - localContrast.enabled = localContrast.enabled && p.localContrast.enabled == other.localContrast.enabled; + localContrast.enabled = localContrast.enabled && p.localContrast.enabled == other.localContrast.enabled; localContrast.radius = localContrast.radius && p.localContrast.radius == other.localContrast.radius; localContrast.amount = localContrast.amount && p.localContrast.amount == other.localContrast.amount; localContrast.darkness = localContrast.darkness && p.localContrast.darkness == other.localContrast.darkness; localContrast.lightness = localContrast.lightness && p.localContrast.lightness == other.localContrast.lightness; - + rgbCurves.enabled = rgbCurves.enabled && p.rgbCurves.enabled == other.rgbCurves.enabled; rgbCurves.lumamode = rgbCurves.lumamode && p.rgbCurves.lumamode == other.rgbCurves.lumamode; rgbCurves.rcurve = rgbCurves.rcurve && p.rgbCurves.rcurve == other.rgbCurves.rcurve; @@ -847,7 +847,7 @@ void ParamsEdited::initFrom (const std::vector fattal.threshold = fattal.threshold && p.fattal.threshold == other.fattal.threshold; fattal.amount = fattal.amount && p.fattal.amount == other.fattal.amount; fattal.anchor = fattal.anchor && p.fattal.anchor == other.fattal.anchor; - + sh.enabled = sh.enabled && p.sh.enabled == other.sh.enabled; sh.hq = sh.hq && p.sh.hq == other.sh.hq; sh.highlights = sh.highlights && p.sh.highlights == other.sh.highlights; @@ -1126,7 +1126,7 @@ void ParamsEdited::initFrom (const std::vector dirpyrequalizer.skinprotect = dirpyrequalizer.skinprotect && p.dirpyrequalizer.skinprotect == other.dirpyrequalizer.skinprotect; // dirpyrequalizer.algo = dirpyrequalizer.algo && p.dirpyrequalizer.algo == other.dirpyrequalizer.algo; dirpyrequalizer.hueskin = dirpyrequalizer.hueskin && p.dirpyrequalizer.hueskin == other.dirpyrequalizer.hueskin; - hsvequalizer.enabled = hsvequalizer.enabled && p.hsvequalizer.enabled == other.hsvequalizer.enabled; + hsvequalizer.enabled = hsvequalizer.enabled && p.hsvequalizer.enabled == other.hsvequalizer.enabled; hsvequalizer.hcurve = hsvequalizer.hcurve && p.hsvequalizer.hcurve == other.hsvequalizer.hcurve; hsvequalizer.scurve = hsvequalizer.scurve && p.hsvequalizer.scurve == other.hsvequalizer.scurve; hsvequalizer.vcurve = hsvequalizer.vcurve && p.hsvequalizer.vcurve == other.hsvequalizer.vcurve; @@ -1141,7 +1141,7 @@ void ParamsEdited::initFrom (const std::vector } } -void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rtengine::procparams::ProcParams& mods, bool forceSet) +void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rtengine::procparams::ProcParams& mods, bool forceSet) { bool dontforceSet = !forceSet; @@ -1347,7 +1347,7 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten if (labCurve.enabled) { toEdit.labCurve.enabled = mods.labCurve.enabled; } - + if (labCurve.lcurve) { toEdit.labCurve.lcurve = mods.labCurve.lcurve; } @@ -1560,12 +1560,15 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten if (colorToning.labgridALow) { toEdit.colorToning.labgridALow = mods.colorToning.labgridALow; } + if (colorToning.labgridBLow) { toEdit.colorToning.labgridBLow = mods.colorToning.labgridBLow; } + if (colorToning.labgridAHigh) { toEdit.colorToning.labgridAHigh = mods.colorToning.labgridAHigh; } + if (colorToning.labgridBHigh) { toEdit.colorToning.labgridBHigh = mods.colorToning.labgridBHigh; } @@ -1623,7 +1626,7 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten } if (sharpening.edges_radius) { - toEdit.sharpening.edges_radius = dontforceSet && options.baBehav[ADDSET_SHARP_RADIUS] ? toEdit.sharpening.edges_radius + mods.sharpening.edges_radius: mods.sharpening.edges_radius; + toEdit.sharpening.edges_radius = dontforceSet && options.baBehav[ADDSET_SHARP_RADIUS] ? toEdit.sharpening.edges_radius + mods.sharpening.edges_radius : mods.sharpening.edges_radius; } if (sharpening.edges_tolerance) { @@ -1753,7 +1756,7 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten if (wb.enabled) { toEdit.wb.enabled = mods.wb.enabled; } - + if (wb.method) { toEdit.wb.method = mods.wb.method; } @@ -2072,15 +2075,18 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten if (fattal.enabled) { toEdit.fattal.enabled = mods.fattal.enabled; } + if (fattal.threshold) { toEdit.fattal.threshold = mods.fattal.threshold; } + if (fattal.amount) { toEdit.fattal.amount = mods.fattal.amount; - } + } + if (fattal.anchor) { toEdit.fattal.anchor = mods.fattal.anchor; - } + } if (sh.enabled) { toEdit.sh.enabled = mods.sh.enabled; @@ -2281,7 +2287,7 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten if (chmixer.enabled) { toEdit.chmixer.enabled = mods.chmixer.enabled; } - + for (int i = 0; i < 3; i++) { if (chmixer.red[i]) { toEdit.chmixer.red[i] = dontforceSet && options.baBehav[ADDSET_CHMIXER] ? toEdit.chmixer.red[i] + mods.chmixer.red[i] : mods.chmixer.red[i]; @@ -2467,7 +2473,7 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten if (icm.gamma) { toEdit.icm.gamma = mods.icm.gamma; } - + if (icm.wprimari) { toEdit.icm.wprimari = mods.icm.wprimari; } @@ -2475,7 +2481,7 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten if (icm.wprofile) { toEdit.icm.wprofile = mods.icm.wprofile; } - + if (icm.freegamma) { toEdit.icm.freegamma = mods.icm.freegamma; } @@ -2659,7 +2665,7 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten if (raw.bayersensor.linenoiseDirection) { toEdit.raw.bayersensor.linenoiseDirection = mods.raw.bayersensor.linenoiseDirection; } - + if (raw.bayersensor.pdafLinesFilter) { toEdit.raw.bayersensor.pdafLinesFilter = mods.raw.bayersensor.pdafLinesFilter; } @@ -3124,7 +3130,7 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten if (hsvequalizer.enabled) { toEdit.hsvequalizer.enabled = mods.hsvequalizer.enabled; } - + if (hsvequalizer.hcurve) { toEdit.hsvequalizer.hcurve = mods.hsvequalizer.hcurve; } diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index a85337f00..db5c43e5d 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -120,7 +120,8 @@ public: }; -class LocalContrastParamsEdited { +class LocalContrastParamsEdited +{ public: bool enabled; bool radius; @@ -382,7 +383,8 @@ public: }; -class FattalToneMappingParamsEdited { +class FattalToneMappingParamsEdited +{ public: bool enabled; bool threshold; @@ -586,8 +588,8 @@ public: bool gampos; bool slpos; bool freegamma; - bool wprimari; - bool wprofile; + bool wprimari; + bool wprofile; }; class WaveletParamsEdited { @@ -808,7 +810,8 @@ public: }; -class MetaDataParamsEdited { +class MetaDataParamsEdited +{ public: bool mode; }; @@ -866,10 +869,10 @@ public: bool exif; bool iptc; - explicit ParamsEdited (bool value = false); + explicit ParamsEdited(bool value = false); - void set (bool v); - void initFrom (const std::vector& src); - void combine (rtengine::procparams::ProcParams& toEdit, const rtengine::procparams::ProcParams& mods, bool forceSet); + void set(bool v); + void initFrom(const std::vector& src); + void combine(rtengine::procparams::ProcParams& toEdit, const rtengine::procparams::ProcParams& mods, bool forceSet); }; #endif