Taking care of backward compatibility for new output profiles

see #4478
This commit is contained in:
Hombre 2018-07-05 23:32:46 +02:00
parent 97ea1cd0db
commit f2b339fc66
12 changed files with 222 additions and 185 deletions

View File

@ -393,7 +393,7 @@ void Color::rgb2lab01 (const Glib::ustring &profile, const Glib::ustring &profil
r = pow_F(r, 1.8f);
g = pow_F(g, 1.8f);
b = pow_F(b, 1.8f);
} else if (profile == "Rec2020") {
} else if (profileW == "Rec2020") {
if (r > 0.0795f) {
r = pow_F(((r + 0.0954f) / 1.0954f), 2.2f);
} else {
@ -417,17 +417,17 @@ void Color::rgb2lab01 (const Glib::ustring &profile, const Glib::ustring &profil
b = pow_F(b, 2.2f);
}
} else { //display output profile
if (profile == "RT_sRGB" || profile == "RT_sRGB_gBT709" || profile == "RT_sRGB_g10") {
if (profile == settings->srgb) {
// use default "sRGB"
} else if (profile == "ProPhoto" || profile == "RT_Large_gBT709" || profile == "RT_Large_g10" || profile == "RT_Large_gsRGB") {
} else if (profile == "ProPhoto" || profile == settings->prophoto) {
profileCalc = "ProPhoto";
} else if (profile == "AdobeRGB1998" || profile == "RT_Medium_gsRGB") {
} else if (profile == "AdobeRGB1998" || profile == settings->adobe) {
profileCalc = "Adobe RGB";
} else if (profile == "WideGamutRGB") {
} else if (profile == settings->widegamut) {
profileCalc = "WideGamut";
}
if (profile == "RT_sRGB" || profile == "RT_Large_gsRGB" || profile == "RT_Medium_gsRGB") { //apply sRGB inverse gamma
if (profile == settings->srgb || profile == settings->adobe) { //apply sRGB inverse gamma
if (r > 0.04045f) {
r = pow_F(((r + 0.055f) / 1.055f), rtengine::Color::sRGBGammaCurve);
} else {
@ -445,7 +445,7 @@ void Color::rgb2lab01 (const Glib::ustring &profile, const Glib::ustring &profil
} else {
b /= 12.92f;
}
} else if (profile == "RT_sRGB_gBT709" || profile == "RT_Large_gBT709" || profile == "Rec2020") {
} else if (profile == settings->prophoto || profile == settings->rec2020) {
if (r > 0.0795f) {
r = pow_F(((r + 0.0954f) / 1.0954f), 2.2f);
} else {
@ -469,9 +469,6 @@ void Color::rgb2lab01 (const Glib::ustring &profile, const Glib::ustring &profil
r = pow_F(r, 1.8f);
g = pow_F(g, 1.8f);
b = pow_F(b, 1.8f);
} else if (profile == "RT_sRGB_g10" || profile == "RT_Large_g10") {
// gamma 1.0, do nothing
} else {// apply inverse gamma 2.2
r = pow_F(r, 2.2f);

View File

@ -34,7 +34,7 @@ GamutWarning::GamutWarning(cmsHPROFILE iprof, cmsHPROFILE gamutprof, RenderingIn
softproof2ref(nullptr)
{
if (cmsIsMatrixShaper(gamutprof) && !cmsIsCLUT(gamutprof, intent, LCMS_USED_AS_OUTPUT)) {
cmsHPROFILE aces = ICCStore::getInstance()->getProfile("ACES");
cmsHPROFILE aces = ICCStore::getInstance()->getProfile("RTv4_ACES-AP0");
if (aces) {
lab2ref = cmsCreateTransform(iprof, TYPE_Lab_FLT, aces, TYPE_RGB_FLT, INTENT_ABSOLUTE_COLORIMETRIC, cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE);
lab2softproof = cmsCreateTransform(iprof, TYPE_Lab_FLT, gamutprof, TYPE_RGB_FLT, INTENT_ABSOLUTE_COLORIMETRIC, cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE);

View File

@ -296,7 +296,7 @@ void ImProcFunctions::updateColorProfiles (const Glib::ustring& monitorProfile,
#if !defined(__APPLE__) // No support for monitor profiles on OS X, all data is sRGB
monitor = ICCStore::getInstance()->getProfile (monitorProfile);
#else
monitor = ICCStore::getInstance()->getProfile ("RT_sRGB");
monitor = ICCStore::getInstance()->getProfile (options.rtSettings.srgb);
#endif
}

View File

@ -1958,7 +1958,7 @@ ColorManagementParams::ColorManagementParams() :
workingTRC("none"),
workingTRCGamma(2.4),
workingTRCSlope(12.92310),
outputProfile("RT_sRGB"),
outputProfile(options.rtSettings.srgb),
outputIntent(RI_RELATIVE),
outputBPC(true)
{
@ -4204,6 +4204,27 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Color Management", "WorkingTRCSlope", pedited, icm.workingTRCSlope, pedited->icm.workingTRCSlope);
assignFromKeyfile(keyFile, "Color Management", "OutputProfile", pedited, icm.outputProfile, pedited->icm.outputProfile);
if (ppVersion < 339) {
if (icm.outputProfile == "RT_Medium_gsRGB") {
icm.outputProfile = "RTv4_Medium";
} else if (icm.outputProfile == "RT_Large_gBT709" || icm.outputProfile == "RT_Large_g10" || icm.outputProfile == "RT_Large_gsRGB") {
icm.outputProfile = "RTv4_Large";
} else if (icm.outputProfile == "WideGamutRGB") {
icm.outputProfile = "RTv4_Wide";
} else if (icm.outputProfile == "RT_sRGB_gBT709" || icm.outputProfile == "RT_sRGB_g10" || icm.outputProfile == "RT_sRGB") {
icm.outputProfile = "RTv4_sRGB";
} else if (icm.outputProfile == "BetaRGB") { // Have we ever provided this profile ? Should we convert this filename ?
icm.outputProfile = "RTv4_Beta";
} else if (icm.outputProfile == "BestRGB") { // Have we ever provided this profile ? Should we convert this filename ?
icm.outputProfile = "RTv4_Best";
} else if (icm.outputProfile == "Rec2020") {
icm.outputProfile = "RTv4_Rec2020";
} else if (icm.outputProfile == "Bruce") { // Have we ever provided this profile ? Should we convert this filename ?
icm.outputProfile = "RTv4_Bruce";
} else if (icm.outputProfile == "ACES") {
icm.outputProfile = "RTv4_ACES-AP0";
}
}
if (keyFile.has_key("Color Management", "OutputProfileIntent")) {
Glib::ustring intent = keyFile.get_string("Color Management", "OutputProfileIntent");

View File

@ -286,7 +286,7 @@ Image8 *load_inspector_mode(const Glib::ustring &fname, RawMetaDataLocation &rml
neutral.raw.bayersensor.method = RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::FAST);
neutral.raw.xtranssensor.method = RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::FAST);
neutral.icm.inputProfile = "(camera)";
neutral.icm.workingProfile = "RT_sRGB";
neutral.icm.workingProfile = options.rtSettings.srgb;
src.preprocess(neutral.raw, neutral.lensProf, neutral.coarse, false);
double thresholdDummy = 0.f;

View File

@ -50,19 +50,17 @@ public:
bool verbose;
Glib::ustring darkFramesPath; ///< The default directory for dark frames
Glib::ustring flatFieldsPath; ///< The default directory for flat fields
Glib::ustring adobe; // default name of AdobeRGB1998
Glib::ustring prophoto; // default name of Prophoto
Glib::ustring prophoto10; // default name of Prophoto
Glib::ustring widegamut; //default name of WidegamutRGB
Glib::ustring beta; // default name of BetaRGB
Glib::ustring best; // default name of BestRGB
Glib::ustring bruce; // default name of Bruce
Glib::ustring srgb; // default name of SRGB space profile
Glib::ustring srgb10; // default name of SRGB space profile
Glib::ustring rec2020; // default name of rec2020
Glib::ustring ACESp0; // default name of ACES P0
Glib::ustring ACESp1; // default name of ACES P1
Glib::ustring adobe; // filename of AdobeRGB1998 profile (default to the bundled one)
Glib::ustring prophoto; // filename of Prophoto profile (default to the bundled one)
Glib::ustring widegamut; // filename of WidegamutRGB profile (default to the bundled one)
Glib::ustring beta; // filename of BetaRGB profile (default to the bundled one)
Glib::ustring best; // filename of BestRGB profile (default to the bundled one)
Glib::ustring bruce; // filename of BruceRGB profile (default to the bundled one)
Glib::ustring srgb; // filename of sRGB profile (default to the bundled one)
Glib::ustring rec2020; // filename of Rec2020 profile (default to the bundled one)
Glib::ustring ACESp0; // filename of ACES P0 profile (default to the bundled one)
Glib::ustring ACESp1; // filename of ACES P1 profile (default to the bundled one)
bool gamutICC; // no longer used
bool gamutLch;

View File

@ -1014,7 +1014,7 @@ void CropWindow::pointerMoved (int bstate, int x, int y)
/* Glib::ustring outputProfile;
outputProfile =cropHandler.colorParams.output ;
printf("Using \"%s\" output\n", outputProfile.c_str());
if(outputProfile=="RT_sRGB") printf("OK SRGB2");
if(outputProfile==options.rtSettings.srgb) printf("OK SRGB2");
*/
pmlistener->pointerMoved (false, cropHandler.colorParams.outputProfile, cropHandler.colorParams.workingProfile, mx, my, -1, -1, -1);

View File

@ -272,7 +272,7 @@ private:
}
#else
profile = "RT_sRGB";
profile = options.rtSettings.srgb;
#endif
#if !defined(__APPLE__) // monitor profile not supported on apple

View File

@ -51,7 +51,7 @@ protected:
/* icm_input = "(camera)";
icm_working = "sRGB";
icm_output = "RT_sRGB";
icm_output = options.rtSettings.srgb;
icm_gamma = "default";
*/
Gtk::CheckButton* bypass_dirpyrequalizer; // also could leave untouched but disable only small radius adjustments

View File

@ -322,10 +322,17 @@ void ICCProfileCreator::updateICCVersion()
void ICCProfileCreator::primariesChanged()
{
if (primaries->get_active_text() == M("ICCPROFCREATOR_CUSTOM")) {
primariesGrid->set_sensitive(true);
} else {
primariesGrid->set_sensitive(false);
if (primaries->get_active_text() != M("ICCPROFCREATOR_CUSTOM")) {
float p[6];
ColorTemp temp;
Glib::ustring primPresetName(getPrimariesPresetName(primaries->get_active_text()));
getPrimaries(primPresetName, p, temp);
aPrimariesRedX->setValue(p[0]);
aPrimariesRedY->setValue(p[1]);
aPrimariesGreenX->setValue(p[2]);
aPrimariesGreenY->setValue(p[3]);
aPrimariesBlueX->setValue(p[4]);
aPrimariesBlueY->setValue(p[5]);
}
updateICCVersion();
}
@ -379,30 +386,7 @@ void ICCProfileCreator::storeValues()
options.ICCPC_illuminant = illuminant = "stdA";
}
if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_ACESP0")) {
options.ICCPC_primariesPreset = primariesPreset = "ACES-AP0";
} else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_ACESP1")) {
options.ICCPC_primariesPreset = primariesPreset = "ACES-AP1";
} else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_ADOBE")) {
options.ICCPC_primariesPreset = primariesPreset = "Adobe";
} else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_PROPH")) {
options.ICCPC_primariesPreset = primariesPreset = "ProPhoto";
} else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_REC2020")) {
options.ICCPC_primariesPreset = primariesPreset = "Rec2020";
} else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_SRGB")) {
options.ICCPC_primariesPreset = primariesPreset = "sRGB";
} else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_WIDEG")) {
options.ICCPC_primariesPreset = primariesPreset = "Widegamut";
} else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_BEST")) {
options.ICCPC_primariesPreset = primariesPreset = "BestRGB";
} else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_BETA")) {
options.ICCPC_primariesPreset = primariesPreset = "BetaRGB";
} else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_BRUCE")) {
options.ICCPC_primariesPreset = primariesPreset = "BruceRGB";
} else if (primaries->get_active_text() == M("ICCPROFCREATOR_CUSTOM")) {
options.ICCPC_primariesPreset = primariesPreset = "custom";
}
options.ICCPC_primariesPreset = primariesPreset = getPrimariesPresetName(primaries->get_active_text());
options.ICCPC_gamma = gamma = aGamma->getValue();
options.ICCPC_slope = slope = aSlope->getValue();
options.ICCPC_redPrimaryX = redPrimaryX = aPrimariesRedX->getValue();
@ -414,11 +398,137 @@ void ICCProfileCreator::storeValues()
}
Glib::ustring ICCProfileCreator::getPrimariesPresetName(const Glib::ustring &preset)
{
if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_ACESP0")) {
return Glib::ustring("ACES-AP0");
} else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_ACESP1")) {
return Glib::ustring("ACES-AP1");
} else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_ADOBE")) {
return Glib::ustring("Adobe");
} else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_PROPH")) {
return Glib::ustring("ProPhoto");
} else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_REC2020")) {
return Glib::ustring("Rec2020");
} else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_SRGB")) {
return Glib::ustring("sRGB");
} else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_WIDEG")) {
return Glib::ustring("Widegamut");
} else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_BEST")) {
return Glib::ustring("BestRGB");
} else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_BETA")) {
return Glib::ustring("BetaRGB");
} else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_BRUCE")) {
return Glib::ustring("BruceRGB");
} else if (primaries->get_active_text() == M("ICCPROFCREATOR_CUSTOM")) {
return Glib::ustring("custom");
} else {
return Glib::ustring();
}
}
void ICCProfileCreator::getPrimaries(Glib::ustring preset, float *p, ColorTemp &temp)
{
temp = ColorTemp::D50;
if (primariesPreset == "Widegamut") {
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 (primariesPreset == "Adobe") {
p[0] = 0.6400; //Adobe primaries
p[1] = 0.3300;
p[2] = 0.2100;
p[3] = 0.7100;
p[4] = 0.1500;
p[5] = 0.0600;
temp = ColorTemp::D65;
} else if (primariesPreset == "sRGB") {
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;
} else if (primariesPreset == "BruceRGB") {
p[0] = 0.6400; // Bruce primaries
p[1] = 0.3300;
p[2] = 0.2800;
p[3] = 0.6500;
p[4] = 0.1500;
p[5] = 0.0600;
temp = ColorTemp::D65;
} else if (primariesPreset == "BetaRGB") {
p[0] = 0.6888; // Beta primaries
p[1] = 0.3112;
p[2] = 0.1986;
p[3] = 0.7551;
p[4] = 0.1265;
p[5] = 0.0352;
} else if (primariesPreset == "BestRGB") {
p[0] = 0.7347; // Best primaries
p[1] = 0.2653;
p[2] = 0.2150;
p[3] = 0.7750;
p[4] = 0.1300;
p[5] = 0.0350;
} else if (primariesPreset == "Rec2020") {
p[0] = 0.7080; // Rec2020 primaries
p[1] = 0.2920;
p[2] = 0.1700;
p[3] = 0.7970;
p[4] = 0.1310;
p[5] = 0.0460;
temp = ColorTemp::D65;
} else if (primariesPreset == "ACES-AP0") {
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 (primariesPreset == "ACES-AP1") {
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 (primariesPreset == "ProPhoto") {
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 if (primariesPreset == "custom") {
p[0] = redPrimaryX;
p[1] = redPrimaryY;
p[2] = greenPrimaryX;
p[3] = greenPrimaryY;
p[4] = bluePrimaryX;
p[5] = bluePrimaryY;
} else {
p[0] = 0.7347; //default primaries
p[1] = 0.2653;
p[2] = 0.1596;
p[3] = 0.8404;
p[4] = 0.0366;
p[5] = 0.0001;
}
}
// Copyright (c) 2018 Jacques DESMIS <jdesmis@gmail.com>
// WARNING: the caller must lock lcmsMutex
void ICCProfileCreator::savePressed()
{
bool pro = false;
cmsHPROFILE newProfile = nullptr;
Glib::ustring sNewProfile;
Glib::ustring sPrimariesPreset;
@ -426,11 +536,7 @@ void ICCProfileCreator::savePressed()
storeValues();
// -------------------------------------------- Compute de default file name
if (gammaPreset == "linear_g1.0" || (gammaPreset == "High_g1.3_s3.35")) {
pro = true; //pro=0 RT_sRGB || Prophoto
}
// -------------------------------------------- Compute the default file name
//necessary for V2 profile
if (primariesPreset == "ACES-AP0" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.ACESp0)) {
@ -442,21 +548,15 @@ void ICCProfileCreator::savePressed()
} else if (primariesPreset == "Adobe" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.adobe)) {
sNewProfile = options.rtSettings.adobe;
sPrimariesPreset = "Medium_";
} else if (primariesPreset == "ProPhoto" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.prophoto) && !pro) {
} else if (primariesPreset == "ProPhoto" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.prophoto)) {
sNewProfile = options.rtSettings.prophoto;
sPrimariesPreset = "Large_";
} else if (primariesPreset == "ProPhoto" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.prophoto10) && pro) {
sNewProfile = options.rtSettings.prophoto10;
sPrimariesPreset = "Large_";
} else if (primariesPreset == "Rec2020" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.rec2020)) {
sNewProfile = options.rtSettings.rec2020;
sPrimariesPreset = "Rec2020_";
} else if (primariesPreset == "sRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.srgb) && !pro) {
} else if (primariesPreset == "sRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.srgb)) {
sNewProfile = options.rtSettings.srgb;
sPrimariesPreset = "sRGB_";
} else if (primariesPreset == "sRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.srgb10) && pro) {
sNewProfile = options.rtSettings.srgb10;
sPrimariesPreset = "sRGB_";
} else if (primariesPreset == "Widegamut" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.widegamut)) {
sNewProfile = options.rtSettings.widegamut;
sPrimariesPreset = "Wide_";
@ -714,106 +814,8 @@ void ICCProfileCreator::savePressed()
float p[6]; //primaries
ga[6] = 0.0;
enum class ColorTemp {
D50 = 5003, // for Widegamut, Prophoto Best, Beta -> D50
D65 = 6504, // for sRGB, AdobeRGB, Bruce Rec2020 -> D65
D60 = 6005 //for ACESc->D60
};
ColorTemp temp = ColorTemp::D50;
if (primariesPreset == "Widegamut") {
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 (primariesPreset == "Adobe") {
p[0] = 0.6400; //Adobe primaries
p[1] = 0.3300;
p[2] = 0.2100;
p[3] = 0.7100;
p[4] = 0.1500;
p[5] = 0.0600;
temp = ColorTemp::D65;
} else if (primariesPreset == "sRGB") {
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;
} else if (primariesPreset == "BruceRGB") {
p[0] = 0.6400; // Bruce primaries
p[1] = 0.3300;
p[2] = 0.2800;
p[3] = 0.6500;
p[4] = 0.1500;
p[5] = 0.0600;
temp = ColorTemp::D65;
} else if (primariesPreset == "BetaRGB") {
p[0] = 0.6888; // Beta primaries
p[1] = 0.3112;
p[2] = 0.1986;
p[3] = 0.7551;
p[4] = 0.1265;
p[5] = 0.0352;
} else if (primariesPreset == "BestRGB") {
p[0] = 0.7347; // Best primaries
p[1] = 0.2653;
p[2] = 0.2150;
p[3] = 0.7750;
p[4] = 0.1300;
p[5] = 0.0350;
} else if (primariesPreset == "Rec2020") {
p[0] = 0.7080; // Rec2020 primaries
p[1] = 0.2920;
p[2] = 0.1700;
p[3] = 0.7970;
p[4] = 0.1310;
p[5] = 0.0460;
temp = ColorTemp::D65;
} else if (primariesPreset == "ACES-AP0") {
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 (primariesPreset == "ACES-AP1") {
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 (primariesPreset == "ProPhoto") {
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 if (primariesPreset == "custom") {
p[0] = redPrimaryX;
p[1] = redPrimaryY;
p[2] = greenPrimaryX;
p[3] = greenPrimaryY;
p[4] = bluePrimaryX;
p[5] = bluePrimaryY;
} else {
p[0] = 0.7347; //default primaries
p[1] = 0.2653;
p[2] = 0.1596;
p[3] = 0.8404;
p[4] = 0.0366;
p[5] = 0.0001;
}
ColorTemp temp;
getPrimaries(primariesPreset, p, temp);
cmsCIExyY xyD;
cmsCIExyYTRIPLE Primaries = {

View File

@ -30,6 +30,12 @@ class ICCProfileCreator : public Gtk::Dialog, public AdjusterListener
private:
enum class ColorTemp {
D50 = 5003, // for Widegamut, Prophoto Best, Beta -> D50
D60 = 6005, // for ACESc -> D60
D65 = 6504 // for sRGB, AdobeRGB, Bruce Rec2020 -> D65
};
cmsFloat64Number ga[7]; // 7 parameters for smoother curves
//------------------------ Params -----------------------
@ -79,7 +85,8 @@ private:
void illuminantChanged();
void trcPresetsChanged();
static std::vector<Glib::ustring> getGamma();
void getGammaArray();
Glib::ustring getPrimariesPresetName(const Glib::ustring &preset);
void getPrimaries(Glib::ustring preset, float *p, ColorTemp &temp);
void savePressed();
void closePressed();

View File

@ -479,7 +479,7 @@ void Options::setDefaults()
fastexport_bypass_raw_ff = true;
fastexport_icm_input_profile = "(camera)";
fastexport_icm_working_profile = "ProPhoto";
fastexport_icm_output_profile = "RT_sRGB";
fastexport_icm_output_profile = options.rtSettings.srgb;
fastexport_icm_outputIntent = rtengine::RI_RELATIVE;
fastexport_icm_outputBPC = true;
fastexport_resize_enabled = true;
@ -547,8 +547,6 @@ void Options::setDefaults()
rtSettings.autoMonitorProfile = false;
rtSettings.adobe = "RTv4_Medium"; // put the name of yours profiles (here windows)
rtSettings.prophoto = "RTv4_Large"; // these names appear in the menu "output profile"
rtSettings.prophoto10 = "RTv4_Large"; // these names appear in the menu "output profile"
rtSettings.srgb10 = "RTv4_sRGB";
rtSettings.widegamut = "RTv4_Wide";
rtSettings.srgb = "RTv4_sRGB";
rtSettings.bruce = "RTv4_Bruce";
@ -1451,42 +1449,58 @@ void Options::readFromFile(Glib::ustring fname)
if (keyFile.has_key("Color Management", "AdobeRGB")) {
rtSettings.adobe = keyFile.get_string("Color Management", "AdobeRGB");
if (rtSettings.adobe == "RT_Medium_gsRGB") {
rtSettings.adobe = "RTv4_Medium";
}
}
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 (rtSettings.prophoto == "RT_Large_gBT709") {
rtSettings.prophoto = "RTv4_Large";
}
}
if (keyFile.has_key("Color Management", "WideGamut")) {
rtSettings.widegamut = keyFile.get_string("Color Management", "WideGamut");
if (rtSettings.widegamut == "WideGamutRGB") {
rtSettings.widegamut = "RTv4_Wide";
}
}
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 (rtSettings.srgb == "RT_sRGB") {
rtSettings.srgb = "RTv4_sRGB";
}
}
if (keyFile.has_key("Color Management", "Beta")) {
rtSettings.beta = keyFile.get_string("Color Management", "Beta");
if (rtSettings.beta == "BetaRGB") {
rtSettings.beta = "RTv4_Beta";
}
}
if (keyFile.has_key("Color Management", "Best")) {
rtSettings.best = keyFile.get_string("Color Management", "Best");
if (rtSettings.best == "BestRGB") {
rtSettings.best = "RTv4_Best";
}
}
if (keyFile.has_key("Color Management", "Rec2020")) {
rtSettings.rec2020 = keyFile.get_string("Color Management", "Rec2020");
if (rtSettings.rec2020 == "Rec2020") {
rtSettings.rec2020 = "RTv4_Rec2020";
}
}
if (keyFile.has_key("Color Management", "Bruce")) {
rtSettings.bruce = keyFile.get_string("Color Management", "Bruce");
if (rtSettings.bruce == "Bruce") {
rtSettings.bruce = "RTv4_Bruce";
}
}
if (keyFile.has_key("Color Management", "ACES-AP0")) {
@ -2039,10 +2053,8 @@ void Options::saveToFile(Glib::ustring fname)
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);