various improvments to ICC Profile Creator
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -668,11 +668,13 @@ void ICCProfileCreator::savePressed()
|
||||
// -----------------setmedia white point for monitor profile sRGB or AdobeRGB in case of profile used for monitor---------------------
|
||||
//instead of calculations made by LCMS..small differences
|
||||
|
||||
v2except = (profileVersion == "v2" && (primariesPreset == "sRGB" || primariesPreset == "Adobe") && illuminant == "DEF");
|
||||
v2except = (profileVersion == "v2" && (primariesPreset == "sRGB" || primariesPreset == "Adobe" || primariesPreset == "Rec2020" || primariesPreset == "BruceRGB" || primariesPreset == "ACES-AP1" || primariesPreset == "ACES-AP0") && illuminant == "DEF");
|
||||
|
||||
//necessary for V2 profile
|
||||
|
||||
if (!v2except) {
|
||||
std::string is_RTv4 = "";
|
||||
|
||||
if (primariesPreset == "ACES-AP0" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.ACESp0)) {
|
||||
sNewProfile = options.rtSettings.ACESp0;
|
||||
sPrimariesPreset = "ACES-AP0";
|
||||
@@ -683,7 +685,14 @@ void ICCProfileCreator::savePressed()
|
||||
sNewProfile = options.rtSettings.adobe;
|
||||
sPrimariesPreset = "Medium";
|
||||
} else if (primariesPreset == "ProPhoto" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.prophoto)) {
|
||||
is_RTv4 = options.rtSettings.prophoto.substr(0, 4);
|
||||
|
||||
if (is_RTv4 == "RTv4") {
|
||||
options.rtSettings.prophoto = "RTv2_Large";
|
||||
};
|
||||
|
||||
sNewProfile = options.rtSettings.prophoto;
|
||||
|
||||
sPrimariesPreset = "Large";
|
||||
} else if (primariesPreset == "Rec2020" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.rec2020)) {
|
||||
sNewProfile = options.rtSettings.rec2020;
|
||||
@@ -692,13 +701,33 @@ void ICCProfileCreator::savePressed()
|
||||
sNewProfile = options.rtSettings.srgb;
|
||||
sPrimariesPreset = "sRGB";
|
||||
} else if (primariesPreset == "Widegamut" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.widegamut)) {
|
||||
is_RTv4 = options.rtSettings.widegamut.substr(0, 4);
|
||||
|
||||
if (is_RTv4 == "RTv4") {
|
||||
options.rtSettings.widegamut = "RTv2_Wide";
|
||||
};
|
||||
|
||||
sNewProfile = options.rtSettings.widegamut;
|
||||
|
||||
sPrimariesPreset = "Wide";
|
||||
} else if (primariesPreset == "BestRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.best)) {
|
||||
is_RTv4 = options.rtSettings.best.substr(0, 4);
|
||||
|
||||
if (is_RTv4 == "RTv4") {
|
||||
options.rtSettings.best = "RTv2_Best";
|
||||
};
|
||||
|
||||
sNewProfile = options.rtSettings.best;
|
||||
|
||||
sPrimariesPreset = "Best";
|
||||
} else if (primariesPreset == "BetaRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.beta)) {
|
||||
sNewProfile = options.rtSettings.beta;
|
||||
is_RTv4 = options.rtSettings.beta.substr(0, 4);
|
||||
|
||||
if (is_RTv4 == "RTv4") {
|
||||
options.rtSettings.widegamut = "RTv2_Beta";
|
||||
};
|
||||
|
||||
sPrimariesPreset = "Beta";
|
||||
} else if (primariesPreset == "BruceRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.bruce)) {
|
||||
sNewProfile = options.rtSettings.bruce;
|
||||
@@ -715,7 +744,22 @@ void ICCProfileCreator::savePressed()
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
sNewProfile = "RTv2_Beta";
|
||||
//new model for v2 profile different from D50 by entering directly XYZ values and media white point
|
||||
sNewProfile = "RTv2_Beta";//for copy
|
||||
|
||||
if (primariesPreset == "ACES-AP0") {
|
||||
sPrimariesPreset = "ACES-AP0";
|
||||
} else if (primariesPreset == "ACES-AP1") {
|
||||
sPrimariesPreset = "ACES-AP1";
|
||||
} else if (primariesPreset == "Adobe") {
|
||||
sPrimariesPreset = "Medium";
|
||||
} else if (primariesPreset == "Rec2020") {
|
||||
sPrimariesPreset = "Rec2020";
|
||||
} else if (primariesPreset == "BruceRGB") {
|
||||
sPrimariesPreset = "Bruce";
|
||||
} else if (primariesPreset == "sRGB") {
|
||||
sPrimariesPreset = "sRGB";
|
||||
}
|
||||
}
|
||||
|
||||
//begin adaptation rTRC gTRC bTRC
|
||||
@@ -957,16 +1001,30 @@ void ICCProfileCreator::savePressed()
|
||||
}
|
||||
|
||||
cmsWhitePointFromTemp(&xyD, tempv4);
|
||||
|
||||
if (illuminant == "D65") {
|
||||
xyD = {0.312700492, 0.329000939};
|
||||
}
|
||||
|
||||
if (illuminant == "D60") {
|
||||
xyD = {0.32168, 0.33767};
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
if (v2except) {
|
||||
|
||||
cmsCIExyY XYZ;
|
||||
|
||||
{
|
||||
// XYZ = {0.950486322, 1.0, 1.08902736};//White D65 point calculated from white point xy 0,312710 y 0,3290
|
||||
// XYZ = {0.95047, 1.0, 1.088830};//White D65 point from B.Lindbloom
|
||||
XYZ = {0.95045471, 1.0, 1.08905029};
|
||||
XYZ = {0.95045471, 1.0, 1.08905029};//white D65
|
||||
}
|
||||
|
||||
if (primariesPreset == "ACES-AP1" || primariesPreset == "ACES-AP0") {
|
||||
XYZ = {0.952646075, 1.0, 1.008825184};//white D60
|
||||
}
|
||||
|
||||
|
||||
cmsCIExyY blackpoint;
|
||||
|
||||
{
|
||||
@@ -981,16 +1039,6 @@ void ICCProfileCreator::savePressed()
|
||||
|
||||
if (primariesPreset == "sRGB") {
|
||||
|
||||
//Matrix value from B.Lindbloom
|
||||
/*
|
||||
rt = {0.4360747, 0.2225045, 0.0139322};
|
||||
cmsWriteTag(profile_v2_except, cmsSigRedColorantTag, &rt);
|
||||
bt = {0.1430804, 0.0606169, 0.7141733};
|
||||
cmsWriteTag(profile_v2_except, cmsSigBlueColorantTag, &bt);
|
||||
gt = {0.3850649, 0.7168786, 0.0971045};
|
||||
cmsWriteTag(profile_v2_except, cmsSigGreenColorantTag, >);
|
||||
}
|
||||
*/
|
||||
{
|
||||
//Matrix value from spec Adobe
|
||||
rt = {0.43607, 0.22249, 0.01392};
|
||||
@@ -1005,17 +1053,6 @@ void ICCProfileCreator::savePressed()
|
||||
}
|
||||
|
||||
if (primariesPreset == "Adobe") {
|
||||
{
|
||||
//B.Lindbloom
|
||||
/*
|
||||
rt = {0.6097559, 0.3111242, 0.0194811};
|
||||
cmsWriteTag(profile_v2_except, cmsSigRedColorantTag, &rt);
|
||||
bt = {0.1492240, 0.0632197, 0.7448387};
|
||||
cmsWriteTag(profile_v2_except, cmsSigBlueColorantTag, &bt);
|
||||
gt = {0.2052401, 0.6256560, 0.0608902};
|
||||
cmsWriteTag(profile_v2_except, cmsSigGreenColorantTag, >);
|
||||
*/
|
||||
}
|
||||
{
|
||||
//Adobe spec
|
||||
rt = {0.60974, 0.31111, 0.01947};
|
||||
@@ -1027,6 +1064,50 @@ void ICCProfileCreator::savePressed()
|
||||
}
|
||||
}
|
||||
|
||||
if (primariesPreset == "Rec2020") {
|
||||
{
|
||||
rt = {0.67337, 0.27901, -0.00192};
|
||||
cmsWriteTag(profile_v2_except, cmsSigRedColorantTag, &rt);
|
||||
bt = {0.12506, 0.04561, 0.79686};
|
||||
cmsWriteTag(profile_v2_except, cmsSigBlueColorantTag, &bt);
|
||||
gt = {0.16577, 0.67538, 0.02997};
|
||||
cmsWriteTag(profile_v2_except, cmsSigGreenColorantTag, >);
|
||||
}
|
||||
}
|
||||
|
||||
if (primariesPreset == "BruceRGB") {
|
||||
{
|
||||
rt = {0.49400, 0.25204, 0.01578};
|
||||
cmsWriteTag(profile_v2_except, cmsSigRedColorantTag, &rt);
|
||||
bt = {0.14949, 0.06332, 0.74617};
|
||||
cmsWriteTag(profile_v2_except, cmsSigBlueColorantTag, &bt);
|
||||
gt = {0.32071, 0.68463, 0.06294};
|
||||
cmsWriteTag(profile_v2_except, cmsSigGreenColorantTag, >);
|
||||
}
|
||||
}
|
||||
|
||||
if (primariesPreset == "ACES-AP0") {
|
||||
{
|
||||
rt = {0.99084, 0.36192, -0.00272};
|
||||
cmsWriteTag(profile_v2_except, cmsSigRedColorantTag, &rt);
|
||||
bt = {-0.03900, -0.08443, 0.81938};
|
||||
cmsWriteTag(profile_v2_except, cmsSigBlueColorantTag, &bt);
|
||||
gt = {0.01236, 0.72250, 0.00824};
|
||||
cmsWriteTag(profile_v2_except, cmsSigGreenColorantTag, >);
|
||||
}
|
||||
}
|
||||
|
||||
if (primariesPreset == "ACES-AP1") {
|
||||
{
|
||||
rt = {0.68970, 0.28445, -0.00604};
|
||||
cmsWriteTag(profile_v2_except, cmsSigRedColorantTag, &rt);
|
||||
bt = {0.12456, 0.04379, 0.82094};
|
||||
cmsWriteTag(profile_v2_except, cmsSigBlueColorantTag, &bt);
|
||||
gt = {0.14995, 0.67175, 0.00999};
|
||||
cmsWriteTag(profile_v2_except, cmsSigGreenColorantTag, >);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
cmsWhitePointFromTemp(&xyD, (double)temp);
|
||||
}
|
||||
@@ -1036,6 +1117,14 @@ void ICCProfileCreator::savePressed()
|
||||
xyD = {0.447573, 0.407440, 1.0};
|
||||
}
|
||||
|
||||
if (illuminant == "D65") {
|
||||
xyD = {0.312700492, 0.329000939};
|
||||
}
|
||||
|
||||
if (illuminant == "D60") {
|
||||
xyD = {0.32168, 0.33767};
|
||||
}
|
||||
|
||||
// Calculate output profile's rTRC gTRC bTRC
|
||||
|
||||
|
||||
@@ -1046,7 +1135,7 @@ void ICCProfileCreator::savePressed()
|
||||
}
|
||||
|
||||
if (gammaPreset == "standard_g2.2") {
|
||||
GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildGamma(NULL, 2.19921875);
|
||||
GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildGamma(NULL, 2.19921875);//spec Adobe
|
||||
}
|
||||
|
||||
if (gammaPreset == "standard_g1.8") {
|
||||
@@ -1176,6 +1265,7 @@ void ICCProfileCreator::savePressed()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else if (cmsMLUsetWide(descMLU, "en", "US", wDescription.str().c_str())) {
|
||||
if (!v2except) {
|
||||
|
||||
|
@@ -551,16 +551,16 @@ void Options::setDefaults()
|
||||
rtSettings.monitorIntent = rtengine::RI_RELATIVE;
|
||||
rtSettings.monitorBPC = true;
|
||||
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.widegamut = "RTv4_Wide";
|
||||
rtSettings.srgb = "RTv4_sRGB";
|
||||
rtSettings.bruce = "RTv4_Bruce";
|
||||
rtSettings.beta = "RTv4_Beta";
|
||||
rtSettings.best = "RTv4_Best";
|
||||
rtSettings.rec2020 = "RTv4_Rec2020";
|
||||
rtSettings.ACESp0 = "RTv4_ACES-AP0";
|
||||
rtSettings.ACESp1 = "RTv4_ACES-AP1";
|
||||
rtSettings.adobe = "RTv2_Medium"; // put the name of yours profiles (here windows)
|
||||
rtSettings.prophoto = "RTv2_Large"; // these names appear in the menu "output profile"
|
||||
rtSettings.widegamut = "RTv2_Wide";
|
||||
rtSettings.srgb = "RTv2_sRGB";
|
||||
rtSettings.bruce = "RTv2_Bruce";
|
||||
rtSettings.beta = "RTv2_Beta";
|
||||
rtSettings.best = "RTv2_Best";
|
||||
rtSettings.rec2020 = "RTv2_Rec2020";
|
||||
rtSettings.ACESp0 = "RTv2_ACES-AP0";
|
||||
rtSettings.ACESp1 = "RTv2_ACES-AP1";
|
||||
rtSettings.verbose = false;
|
||||
rtSettings.gamutICC = true;
|
||||
rtSettings.gamutLch = true;
|
||||
@@ -1442,66 +1442,74 @@ 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 (rtSettings.adobe == "RT_Medium_gsRGB" || rtSettings.adobe == "RTv4_Medium") {
|
||||
rtSettings.adobe = "RTv2_Medium";
|
||||
}
|
||||
}
|
||||
|
||||
if (keyFile.has_key("Color Management", "ProPhoto")) {
|
||||
rtSettings.prophoto = keyFile.get_string("Color Management", "ProPhoto");
|
||||
if (rtSettings.prophoto == "RT_Large_gBT709") {
|
||||
rtSettings.prophoto = "RTv4_Large";
|
||||
if (rtSettings.prophoto == "RT_Large_gBT709" || rtSettings.prophoto == "RTv4_Large") {
|
||||
rtSettings.prophoto = "RTv2_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 (rtSettings.widegamut == "WideGamutRGB" || rtSettings.widegamut == "RTv4_Wide") {
|
||||
rtSettings.widegamut = "RTv2_Wide";
|
||||
}
|
||||
}
|
||||
|
||||
if (keyFile.has_key("Color Management", "sRGB")) {
|
||||
rtSettings.srgb = keyFile.get_string("Color Management", "sRGB");
|
||||
if (rtSettings.srgb == "RT_sRGB") {
|
||||
rtSettings.srgb = "RTv4_sRGB";
|
||||
if (rtSettings.srgb == "RT_sRGB" || rtSettings.srgb == "RTv4_sRGB") {
|
||||
rtSettings.srgb = "RTv2_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 (rtSettings.beta == "BetaRGB" || rtSettings.beta == "RTv4_Beta") {
|
||||
rtSettings.beta = "RTv2_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 (rtSettings.best == "BestRGB" || rtSettings.best == "RTv4_Best") {
|
||||
rtSettings.best = "RTv2_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 (rtSettings.rec2020 == "Rec2020" || rtSettings.rec2020 == "RTv4_Rec2020") {
|
||||
rtSettings.rec2020 = "RTv2_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 (rtSettings.bruce == "Bruce" || rtSettings.bruce == "RTv4_Bruce") {
|
||||
rtSettings.bruce = "RTv2_Bruce";
|
||||
}
|
||||
}
|
||||
|
||||
if (keyFile.has_key("Color Management", "ACES-AP0")) {
|
||||
rtSettings.ACESp0 = keyFile.get_string("Color Management", "ACES-AP0");
|
||||
if (rtSettings.ACESp0 == "RTv4_ACES-AP0") {
|
||||
rtSettings.ACESp0 = "RTv2_ACES-AP0";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (keyFile.has_key("Color Management", "ACES-AP1")) {
|
||||
rtSettings.ACESp1 = keyFile.get_string("Color Management", "ACES-AP1");
|
||||
if (rtSettings.ACESp1 == "RTv4_ACES-AP1") {
|
||||
rtSettings.ACESp1 = "RTv2_ACES-AP1";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (keyFile.has_key("Color Management", "GamutLch")) {
|
||||
|
Reference in New Issue
Block a user