diff --git a/rtdata/languages/default b/rtdata/languages/default index fba5f56f3..4e6c52882 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1599,6 +1599,13 @@ TP_GAMMA_PROF_NONE;none TP_GAMMA_PROF_V2;ICC V2 TP_GAMMA_PROF_V4;ICC V4 TP_GAMMA_SLOP;Slope (linear) +TP_GAMMA_PRIM_ACESP0;AcesP0 +TP_GAMMA_PRIM_ACESP1;AcesP1 +TP_GAMMA_PRIM_ADOBE;Adobe +TP_GAMMA_PRIM_PROPH;Prophoto +TP_GAMMA_PRIM_REC2020;Rec2020 +TP_GAMMA_PRIM_SRGB;sRGB +TP_GAMMA_PRIM_WIDEG;Widegamut TP_GENERAL_11SCALE_TOOLTIP;The effects of this tool are only visible or only accurate at a preview scale of 1:1. TP_GRADIENT_CENTER;Center TP_GRADIENT_CENTER_X;Center X diff --git a/rtengine/iccmatrices.h b/rtengine/iccmatrices.h index a798164c3..c109c9f76 100644 --- a/rtengine/iccmatrices.h +++ b/rtengine/iccmatrices.h @@ -79,18 +79,31 @@ constexpr double xyz_sRGB[3][3] = { {0.0139322, 0.0971045, 0.7141733} }; -constexpr double xyz_ACESc[3][3] = { +constexpr double xyz_ACESp0[3][3] = { {0.9525523959, 0.0, 0.0000936786}, {0.3439664498, 0.7281660966 , -0.0721325464}, {0.0, -0.0, 1.0088251844} }; -constexpr double ACESc_xyz[3][3] = { +constexpr double ACESp0_xyz[3][3] = { {1.0498110175, 0.0, -0.0000974845}, {-0.4959030231, 1.3733130458 , 0.0982400361}, {0.0, 0.0, 0.9912520182} }; +constexpr double xyz_ACESp1[3][3] = { + {0.68970, 0.14995, 0.12456}, + {0.28445, 0.67175 , 0.04379}, + {-0.00604, 0.00999, 0.82094} +}; + +constexpr double ACESp1_xyz[3][3] = { + {1.593266, -0.352338, -0.222949}, + {-0.675963, 1.639314 , 0.0151197}, + {0.0199481, -0.022541, 1.216291} +}; + + 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 aad613d7d..a6b914dc3 100644 --- a/rtengine/iccstore.cc +++ b/rtengine/iccstore.cc @@ -196,9 +196,9 @@ cmsHPROFILE createXYZProfile() return rtengine::ICCStore::createFromMatrix(mat, false, "XYZ"); } -const double(*wprofiles[])[3] = {xyz_sRGB, xyz_adobe, xyz_prophoto, xyz_widegamut, xyz_bruce, xyz_beta, xyz_best, xyz_rec2020, xyz_ACESc};// -const double(*iwprofiles[])[3] = {sRGB_xyz, adobe_xyz, prophoto_xyz, widegamut_xyz, bruce_xyz, beta_xyz, best_xyz, rec2020_xyz, ACESc_xyz};// -const char* wpnames[] = {"sRGB", "Adobe RGB", "ProPhoto", "WideGamut", "BruceRGB", "Beta RGB", "BestRGB", "Rec2020", "ACESc"};// +const double(*wprofiles[])[3] = {xyz_sRGB, xyz_adobe, xyz_prophoto, xyz_widegamut, xyz_bruce, xyz_beta, xyz_best, xyz_rec2020, xyz_ACESp0, xyz_ACESp1};// +const double(*iwprofiles[])[3] = {sRGB_xyz, adobe_xyz, prophoto_xyz, widegamut_xyz, bruce_xyz, beta_xyz, best_xyz, rec2020_xyz, ACESp0_xyz, ACESp1_xyz};// +const char* wpnames[] = {"sRGB", "Adobe RGB", "ProPhoto", "WideGamut", "BruceRGB", "Beta RGB", "BestRGB", "Rec2020", "ACESp0", "ACESp1"};// const char* wpgamma[] = {"Free", "BT709_g2.2_s4.5", "sRGB_g2.4_s12.92", "linear_g1.0", "standard_g2.2", "standard_g1.8", "High_g1.3_s3.35", "Low_g2.6_s6.9", "Lab_g3.0s9.03296"}; //gamma free //default = gamma inside profile //BT709 g=2.22 s=4.5 sRGB g=2.4 s=12.92 @@ -1324,14 +1324,14 @@ cmsHPROFILE rtengine::ICCStore::createGammaProfile(const procparams::ColorManage //primaries for 7 working profiles ==> output profiles // eventually to adapt primaries if RT used special profiles ! - if (icm.wprimari == "WideGamut") { + if (icm.wprimari == "wideg") { p[0] = 0.7350; //Widegamut primaries p[1] = 0.2650; p[2] = 0.1150; p[3] = 0.8260; p[4] = 0.1570; p[5] = 0.0180; - } else if (icm.wprimari == "Adobe RGB") { + } else if (icm.wprimari == "adob") { p[0] = 0.6400; //Adobe primaries p[1] = 0.3300; p[2] = 0.2100; @@ -1339,7 +1339,7 @@ cmsHPROFILE rtengine::ICCStore::createGammaProfile(const procparams::ColorManage p[4] = 0.1500; p[5] = 0.0600; temp = ColorTemp::D65; - } else if (icm.wprimari == "sRGB") { + } else if (icm.wprimari == "srgb") { p[0] = 0.6400; // sRGB primaries p[1] = 0.3300; p[2] = 0.3000; @@ -1369,7 +1369,7 @@ cmsHPROFILE rtengine::ICCStore::createGammaProfile(const procparams::ColorManage p[3] = 0.7750; p[4] = 0.1300; p[5] = 0.0350; - } else if (icm.wprimari == "Rec2020") { + } else if (icm.wprimari == "rec2020") { p[0] = 0.7080; // Rec2020 primaries p[1] = 0.2920; p[2] = 0.1700; @@ -1377,14 +1377,29 @@ cmsHPROFILE rtengine::ICCStore::createGammaProfile(const procparams::ColorManage p[4] = 0.1310; p[5] = 0.0460; temp = ColorTemp::D65; - } else if (icm.wprimari == "ACESc") { - p[0] = 0.7347; // ACESc primaries + } else if (icm.wprimari == "acesp0") { + p[0] = 0.7347; // ACES P0 primaries p[1] = 0.2653; p[2] = 0.0000; p[3] = 1.0; p[4] = 0.0001; p[5] = -0.0770; temp = ColorTemp::D60; + } else if (icm.wprimari == "acesp1") { + p[0] = 0.713; // ACES P1 primaries + p[1] = 0.293; + p[2] = 0.165; + p[3] = 0.830; + p[4] = 0.128; + p[5] = 0.044; + temp = ColorTemp::D60; + } else if (icm.wprimari == "proph") { + p[0] = 0.7347; //ProPhoto and default primaries + p[1] = 0.2653; + p[2] = 0.1596; + p[3] = 0.8404; + p[4] = 0.0366; + p[5] = 0.0001; } else { p[0] = 0.7347; //ProPhoto and default primaries p[1] = 0.2653; @@ -1448,14 +1463,14 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: } //necessary for V2 profile - if (icm.wprimari == "ProPhoto" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.prophoto) && !pro) { + if (icm.wprimari == "proph" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.prophoto) && !pro) { outProfile = options.rtSettings.prophoto; outPr = "RT_large"; - } else if (icm.wprimari == "Adobe RGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.adobe)) { + } else if (icm.wprimari == "adob" && 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)) { + } else if (icm.wprimari == "wideg" && 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)) { @@ -1467,22 +1482,25 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: } 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) { + } else if (icm.wprimari == "srgb" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.srgb) && !pro) { 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"; - } else if (icm.wprimari == "ProPhoto" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.prophoto10) && pro) { + } else if (icm.wprimari == "proph" && 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)) { + } 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)) { + } else if (icm.wprimari == "acesp0" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.ACESc)) { + outProfile = options.rtSettings.ACESc; + outPr = "RT_acesc"; + } else if (icm.wprimari == "acesp1" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.ACESc)) { outProfile = options.rtSettings.ACESc; outPr = "RT_acesc"; @@ -1617,14 +1635,14 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: ColorTemp temp = ColorTemp::D50; float p[6]; //primaries - if (icm.wprimari == "WideGamut") { + if (icm.wprimari == "wideg") { p[0] = 0.7350; //Widegamut primaries p[1] = 0.2650; p[2] = 0.1150; p[3] = 0.8260; p[4] = 0.1570; p[5] = 0.0180; - } else if (icm.wprimari == "Adobe RGB") { + } else if (icm.wprimari == "adob") { p[0] = 0.6400; //Adobe primaries p[1] = 0.3300; p[2] = 0.2100; @@ -1632,7 +1650,7 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: p[4] = 0.1500; p[5] = 0.0600; temp = ColorTemp::D65; - } else if (icm.wprimari == "sRGB") { + } else if (icm.wprimari == "srgb") { p[0] = 0.6400; // sRGB primaries p[1] = 0.3300; p[2] = 0.3000; @@ -1662,7 +1680,7 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: p[3] = 0.7750; p[4] = 0.1300; p[5] = 0.0350; - } else if (icm.wprimari == "Rec2020") { + } else if (icm.wprimari == "rec2020") { p[0] = 0.7080; // Rec2020 primaries p[1] = 0.2920; p[2] = 0.1700; @@ -1670,13 +1688,29 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams: p[4] = 0.1310; p[5] = 0.0460; temp = ColorTemp::D65; - } else if (icm.wprimari == "ACESc") { - p[0] = 0.7347; // ACESc primaries + } else if (icm.wprimari == "acesp0") { + p[0] = 0.7347; // ACES P0 primaries p[1] = 0.2653; p[2] = 0.0000; p[3] = 1.0; p[4] = 0.0001; p[5] = -0.0770; + temp = ColorTemp::D60; + } else if (icm.wprimari == "acesp1") { + p[0] = 0.713; // ACES P1 primaries + p[1] = 0.293; + p[2] = 0.165; + p[3] = 0.830; + p[4] = 0.128; + p[5] = 0.044; + temp = ColorTemp::D60; + } else if (icm.wprimari == "proph") { + p[0] = 0.7347; //ProPhoto and default primaries + p[1] = 0.2653; + p[2] = 0.1596; + p[3] = 0.8404; + p[4] = 0.0366; + p[5] = 0.0001; } else { p[0] = 0.7347; //ProPhoto and default primaries p[1] = 0.2653; diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc index ff36ca7cf..46ea3e6ce 100644 --- a/rtgui/icmpanel.cc +++ b/rtgui/icmpanel.cc @@ -257,16 +257,23 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha wprimari = Gtk::manage(new MyComboBoxText()); priHBox->pack_start(*wprimari, Gtk::PACK_EXPAND_WIDGET); fgVBox->pack_start(*priHBox, Gtk::PACK_EXPAND_WIDGET); - + wprimari->append(M("TP_GAMMA_PRIM_ACESP0")); + wprimari->append(M("TP_GAMMA_PRIM_ACESP1")); + wprimari->append(M("TP_GAMMA_PRIM_ADOBE")); + wprimari->append(M("TP_GAMMA_PRIM_PROPH")); + wprimari->append(M("TP_GAMMA_PRIM_REC2020")); + wprimari->append(M("TP_GAMMA_PRIM_SRGB")); + wprimari->append(M("TP_GAMMA_PRIM_WIDEG")); +/* std::vector wprinames = rtengine::ICCStore::getInstance()->getWorkingProfiles(); for (size_t i = 0; i < wprinames.size(); i++) { - if (i <= 1 || i >= 5) { + if (i <= 2 || i >= 6) { wprimari->append(wprinames[i]); } } - - wprimari->set_active(6); +*/ + wprimari->set_active(5); fgVBox->pack_start(*gaHBox, Gtk::PACK_EXPAND_WIDGET); gampos = Gtk::manage(new Adjuster(M("TP_GAMMA_CURV"), 1, 3.5, 0.00001, 2.4)); @@ -277,6 +284,8 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha } gampos->show(); + // slpos = Gtk::manage(new Adjuster(M("TP_GAMMA_SLOP"), 5800, 6200, 0.00001, 6000.)); + slpos = Gtk::manage(new Adjuster(M("TP_GAMMA_SLOP"), 0, 15, 0.00001, 12.92310)); slpos->setAdjusterListener(this); @@ -578,9 +587,27 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited) wnames->set_active_text(pp->icm.working); wgamma->set_active_text(pp->icm.gamma); - wprimari->set_active_text(pp->icm.wprimari); +// wprimari->set_active_text(pp->icm.wprimari); // wprofile->set_active_text (pp->icm.wprofile); + if (pp->icm.wprimari == "acesp0") { + wprimari->set_active(0); + } else if (pp->icm.wprimari == "acesp1") { + wprimari->set_active(1); + } else if (pp->icm.wprimari == "adob") { + wprimari->set_active(2); + } else if (pp->icm.wprimari == "proph") { + wprimari->set_active(3); + } else if (pp->icm.wprimari == "rec2020") { + wprimari->set_active(4); + } else if (pp->icm.wprimari == "srgb") { + wprimari->set_active(5); + } else if (pp->icm.wprimari == "wideg") { + wprimari->set_active(6); + } + + + if (pp->icm.wprofile == "none") { wprofile->set_active(0); } else if (pp->icm.wprofile == "v2") { @@ -724,6 +751,23 @@ void ICMPanel::write(ProcParams* pp, ParamsEdited* pedited) pp->icm.wprofile = "v4"; } + if (wprimari->get_active_row_number() == 0) { + pp->icm.wprimari = "acesp0"; + } else if (wprimari->get_active_row_number() == 1) { + pp->icm.wprimari = "acesp1"; + } else if (wprimari->get_active_row_number() == 2) { + pp->icm.wprimari = "adob"; + } else if (wprimari->get_active_row_number() == 3) { + pp->icm.wprimari = "proph"; + } else if (wprimari->get_active_row_number() == 4) { + pp->icm.wprimari = "rec2020"; + } else if (wprimari->get_active_row_number() == 5) { + pp->icm.wprimari = "srgb"; + } else if (wprimari->get_active_row_number() == 6) { + pp->icm.wprimari = "wideg"; + } + + pp->icm.freegamma = freegamma->get_active(); pp->icm.toneCurve = ckbToneCurve->get_active(); pp->icm.applyLookTable = ckbApplyLookTable->get_active();