Improvments to ICC profile creator
This commit is contained in:
parent
83975938ef
commit
c5c04769e4
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -41,7 +41,7 @@ extern const Settings* settings;
|
|||||||
const char* sTRCPreset[] = {"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
|
const char* sTRCPreset[] = {"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
|
||||||
|
|
||||||
ICCProfileCreator::ICCProfileCreator(RTWindow *rtwindow)
|
ICCProfileCreator::ICCProfileCreator(RTWindow *rtwindow)
|
||||||
: Gtk::Dialog (M ("MAIN_BUTTON_ICCPROFCREATOR"), *rtwindow, true)
|
: Gtk::Dialog(M("MAIN_BUTTON_ICCPROFCREATOR"), *rtwindow, true)
|
||||||
, primariesPreset(options.ICCPC_primariesPreset)
|
, primariesPreset(options.ICCPC_primariesPreset)
|
||||||
, redPrimaryX(options.ICCPC_redPrimaryX)
|
, redPrimaryX(options.ICCPC_redPrimaryX)
|
||||||
, redPrimaryY(options.ICCPC_redPrimaryY)
|
, redPrimaryY(options.ICCPC_redPrimaryY)
|
||||||
@ -141,12 +141,15 @@ ICCProfileCreator::ICCProfileCreator(RTWindow *rtwindow)
|
|||||||
setExpandAlignProperties(trcPresets, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE);
|
setExpandAlignProperties(trcPresets, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE);
|
||||||
std::vector<Glib::ustring> outputTRCPresets;
|
std::vector<Glib::ustring> outputTRCPresets;
|
||||||
outputTRCPresets.push_back(M("ICCPROFCREATOR_CUSTOM"));
|
outputTRCPresets.push_back(M("ICCPROFCREATOR_CUSTOM"));
|
||||||
|
|
||||||
for (unsigned int i = 0; i < sizeof(sTRCPreset) / sizeof(sTRCPreset[0]); i++) {
|
for (unsigned int i = 0; i < sizeof(sTRCPreset) / sizeof(sTRCPreset[0]); i++) {
|
||||||
outputTRCPresets.push_back(sTRCPreset[i]);
|
outputTRCPresets.push_back(sTRCPreset[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < outputTRCPresets.size(); i++) {
|
for (size_t i = 0; i < outputTRCPresets.size(); i++) {
|
||||||
trcPresets->append(outputTRCPresets[i]);
|
trcPresets->append(outputTRCPresets[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
mainGrid->attach(*trcPresets, 1, 2, 1, 1);
|
mainGrid->attach(*trcPresets, 1, 2, 1, 1);
|
||||||
|
|
||||||
//--------------------------------- sliders gampos and slpos
|
//--------------------------------- sliders gampos and slpos
|
||||||
@ -157,6 +160,7 @@ ICCProfileCreator::ICCProfileCreator(RTWindow *rtwindow)
|
|||||||
if (aGamma->delay < options.adjusterMaxDelay) {
|
if (aGamma->delay < options.adjusterMaxDelay) {
|
||||||
aGamma->delay = options.adjusterMaxDelay;
|
aGamma->delay = options.adjusterMaxDelay;
|
||||||
}
|
}
|
||||||
|
|
||||||
aGamma->show();
|
aGamma->show();
|
||||||
mainGrid->attach(*aGamma, 1, 3, 1, 1); //gamma
|
mainGrid->attach(*aGamma, 1, 3, 1, 1); //gamma
|
||||||
|
|
||||||
@ -166,6 +170,7 @@ ICCProfileCreator::ICCProfileCreator(RTWindow *rtwindow)
|
|||||||
if (aSlope->delay < options.adjusterMaxDelay) {
|
if (aSlope->delay < options.adjusterMaxDelay) {
|
||||||
aSlope->delay = options.adjusterMaxDelay;
|
aSlope->delay = options.adjusterMaxDelay;
|
||||||
}
|
}
|
||||||
|
|
||||||
aSlope->show();
|
aSlope->show();
|
||||||
mainGrid->attach(*aSlope, 1, 4, 1, 1); //slope
|
mainGrid->attach(*aSlope, 1, 4, 1, 1); //slope
|
||||||
|
|
||||||
@ -222,10 +227,10 @@ ICCProfileCreator::ICCProfileCreator(RTWindow *rtwindow)
|
|||||||
setExpandAlignProperties(eCopyright, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
|
setExpandAlignProperties(eCopyright, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
|
||||||
copygrid->attach(*eCopyright, 0, 0, 1, 1);
|
copygrid->attach(*eCopyright, 0, 0, 1, 1);
|
||||||
resetCopyright = Gtk::manage(new Gtk::Button());
|
resetCopyright = Gtk::manage(new Gtk::Button());
|
||||||
resetCopyright->add (*Gtk::manage (new RTImage ("undo-small.png", "redo-small.png")));
|
resetCopyright->add(*Gtk::manage(new RTImage("undo-small.png", "redo-small.png")));
|
||||||
setExpandAlignProperties(resetCopyright, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
|
setExpandAlignProperties(resetCopyright, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
|
||||||
resetCopyright->set_relief (Gtk::RELIEF_NONE);
|
resetCopyright->set_relief(Gtk::RELIEF_NONE);
|
||||||
resetCopyright->set_tooltip_markup (M("ICCPROFCREATOR_COPYRIGHT_RESET_TOOLTIP"));
|
resetCopyright->set_tooltip_markup(M("ICCPROFCREATOR_COPYRIGHT_RESET_TOOLTIP"));
|
||||||
resetCopyright->get_style_context()->add_class(GTK_STYLE_CLASS_FLAT);
|
resetCopyright->get_style_context()->add_class(GTK_STYLE_CLASS_FLAT);
|
||||||
resetCopyright->set_can_focus(false);
|
resetCopyright->set_can_focus(false);
|
||||||
copygrid->attach(*resetCopyright, 1, 0, 1, 1);
|
copygrid->attach(*resetCopyright, 1, 0, 1, 1);
|
||||||
@ -273,6 +278,7 @@ ICCProfileCreator::ICCProfileCreator(RTWindow *rtwindow)
|
|||||||
}
|
}
|
||||||
|
|
||||||
trcPresets->set_active(0);
|
trcPresets->set_active(0);
|
||||||
|
|
||||||
if (gammaPreset != "Custom") {
|
if (gammaPreset != "Custom") {
|
||||||
trcPresets->set_active_text(gammaPreset);
|
trcPresets->set_active_text(gammaPreset);
|
||||||
}
|
}
|
||||||
@ -309,6 +315,7 @@ ICCProfileCreator::ICCProfileCreator(RTWindow *rtwindow)
|
|||||||
}
|
}
|
||||||
|
|
||||||
iccVersion->set_active(0);
|
iccVersion->set_active(0);
|
||||||
|
|
||||||
if (profileVersion == "v2") {
|
if (profileVersion == "v2") {
|
||||||
iccVersion->set_active(1);
|
iccVersion->set_active(1);
|
||||||
}
|
}
|
||||||
@ -319,17 +326,17 @@ ICCProfileCreator::ICCProfileCreator(RTWindow *rtwindow)
|
|||||||
|
|
||||||
//--------------- Action area button
|
//--------------- Action area button
|
||||||
|
|
||||||
Gtk::Button* save = Gtk::manage (new Gtk::Button (M ("GENERAL_SAVE_AS")));
|
Gtk::Button* save = Gtk::manage(new Gtk::Button(M("GENERAL_SAVE_AS")));
|
||||||
save->signal_clicked().connect ( sigc::mem_fun (*this, &ICCProfileCreator::savePressed) );
|
save->signal_clicked().connect(sigc::mem_fun(*this, &ICCProfileCreator::savePressed));
|
||||||
get_action_area()->pack_start (*save);
|
get_action_area()->pack_start(*save);
|
||||||
|
|
||||||
Gtk::Button* close = Gtk::manage (new Gtk::Button (M ("GENERAL_CLOSE")));
|
Gtk::Button* close = Gtk::manage(new Gtk::Button(M("GENERAL_CLOSE")));
|
||||||
close->signal_clicked().connect ( sigc::mem_fun (*this, &ICCProfileCreator::closePressed) );
|
close->signal_clicked().connect(sigc::mem_fun(*this, &ICCProfileCreator::closePressed));
|
||||||
get_action_area()->pack_start (*close);
|
get_action_area()->pack_start(*close);
|
||||||
|
|
||||||
//--------------- Show childrens
|
//--------------- Show childrens
|
||||||
|
|
||||||
show_all_children ();
|
show_all_children();
|
||||||
|
|
||||||
//--------------- Connecting the signals
|
//--------------- Connecting the signals
|
||||||
|
|
||||||
@ -366,9 +373,8 @@ void ICCProfileCreator::updateICCVersion()
|
|||||||
void ICCProfileCreator::adjusterChanged(Adjuster* a, double newval)
|
void ICCProfileCreator::adjusterChanged(Adjuster* a, double newval)
|
||||||
{
|
{
|
||||||
if (a == aPrimariesRedX || a == aPrimariesRedY ||
|
if (a == aPrimariesRedX || a == aPrimariesRedY ||
|
||||||
a == aPrimariesGreenX || a == aPrimariesGreenY ||
|
a == aPrimariesGreenX || a == aPrimariesGreenY ||
|
||||||
a == aPrimariesBlueX || a == aPrimariesBlueY)
|
a == aPrimariesBlueX || a == aPrimariesBlueY) {
|
||||||
{
|
|
||||||
if (primaries->get_active_row_number() > 0) {
|
if (primaries->get_active_row_number() > 0) {
|
||||||
ConnectionBlocker blocker(primariesconn);
|
ConnectionBlocker blocker(primariesconn);
|
||||||
primaries->set_active(0);
|
primaries->set_active(0);
|
||||||
@ -401,6 +407,7 @@ void ICCProfileCreator::primariesChanged()
|
|||||||
aPrimariesBlueX->setValue(p[4]);
|
aPrimariesBlueX->setValue(p[4]);
|
||||||
aPrimariesBlueY->setValue(p[5]);
|
aPrimariesBlueY->setValue(p[5]);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateICCVersion();
|
updateICCVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -497,6 +504,7 @@ Glib::ustring ICCProfileCreator::getPrimariesPresetName(const Glib::ustring &pre
|
|||||||
void ICCProfileCreator::getPrimaries(const Glib::ustring &preset, float *p, ColorTemp &temp)
|
void ICCProfileCreator::getPrimaries(const Glib::ustring &preset, float *p, ColorTemp &temp)
|
||||||
{
|
{
|
||||||
temp = ColorTemp::D50;
|
temp = ColorTemp::D50;
|
||||||
|
|
||||||
if (preset == "Widegamut") {
|
if (preset == "Widegamut") {
|
||||||
p[0] = 0.7350; //Widegamut primaries
|
p[0] = 0.7350; //Widegamut primaries
|
||||||
p[1] = 0.2650;
|
p[1] = 0.2650;
|
||||||
@ -595,9 +603,11 @@ void ICCProfileCreator::getPrimaries(const Glib::ustring &preset, float *p, Colo
|
|||||||
Glib::ustring ICCProfileCreator::getGammaPresetName(const Glib::ustring &preset)
|
Glib::ustring ICCProfileCreator::getGammaPresetName(const Glib::ustring &preset)
|
||||||
{
|
{
|
||||||
Glib::ustring name(trcPresets->get_active_text());
|
Glib::ustring name(trcPresets->get_active_text());
|
||||||
|
|
||||||
if (name == M("ICCPROFCREATOR_CUSTOM")) {
|
if (name == M("ICCPROFCREATOR_CUSTOM")) {
|
||||||
name = "Custom";
|
name = "Custom";
|
||||||
}
|
}
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -646,6 +656,8 @@ void ICCProfileCreator::onResetCopyright()
|
|||||||
void ICCProfileCreator::savePressed()
|
void ICCProfileCreator::savePressed()
|
||||||
{
|
{
|
||||||
cmsHPROFILE newProfile = nullptr;
|
cmsHPROFILE newProfile = nullptr;
|
||||||
|
cmsHPROFILE profile_v2_except = nullptr;
|
||||||
|
|
||||||
Glib::ustring sNewProfile;
|
Glib::ustring sNewProfile;
|
||||||
Glib::ustring sPrimariesPreset;
|
Glib::ustring sPrimariesPreset;
|
||||||
Glib::ustring sGammaPreset;
|
Glib::ustring sGammaPreset;
|
||||||
@ -653,47 +665,57 @@ void ICCProfileCreator::savePressed()
|
|||||||
storeValues();
|
storeValues();
|
||||||
|
|
||||||
// -------------------------------------------- Compute the default file name
|
// -------------------------------------------- Compute the default file name
|
||||||
|
// -----------------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");
|
||||||
|
|
||||||
//necessary for V2 profile
|
//necessary for V2 profile
|
||||||
if (primariesPreset == "ACES-AP0" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.ACESp0)) {
|
|
||||||
sNewProfile = options.rtSettings.ACESp0;
|
if (!v2except) {
|
||||||
sPrimariesPreset = "ACES-AP0";
|
if (primariesPreset == "ACES-AP0" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.ACESp0)) {
|
||||||
} else if (primariesPreset == "ACES-AP1" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.ACESp1)) {
|
sNewProfile = options.rtSettings.ACESp0;
|
||||||
sNewProfile = options.rtSettings.ACESp1;
|
sPrimariesPreset = "ACES-AP0";
|
||||||
sPrimariesPreset = "ACES-AP1";
|
} else if (primariesPreset == "ACES-AP1" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.ACESp1)) {
|
||||||
} else if (primariesPreset == "Adobe" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.adobe)) {
|
sNewProfile = options.rtSettings.ACESp1;
|
||||||
sNewProfile = options.rtSettings.adobe;
|
sPrimariesPreset = "ACES-AP1";
|
||||||
sPrimariesPreset = "Medium";
|
} else if (primariesPreset == "Adobe" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.adobe)) {
|
||||||
} else if (primariesPreset == "ProPhoto" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.prophoto)) {
|
sNewProfile = options.rtSettings.adobe;
|
||||||
sNewProfile = options.rtSettings.prophoto;
|
sPrimariesPreset = "Medium";
|
||||||
sPrimariesPreset = "Large";
|
} else if (primariesPreset == "ProPhoto" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.prophoto)) {
|
||||||
} else if (primariesPreset == "Rec2020" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.rec2020)) {
|
sNewProfile = options.rtSettings.prophoto;
|
||||||
sNewProfile = options.rtSettings.rec2020;
|
sPrimariesPreset = "Large";
|
||||||
sPrimariesPreset = "Rec2020";
|
} else if (primariesPreset == "Rec2020" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.rec2020)) {
|
||||||
} else if (primariesPreset == "sRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.srgb)) {
|
sNewProfile = options.rtSettings.rec2020;
|
||||||
sNewProfile = options.rtSettings.srgb;
|
sPrimariesPreset = "Rec2020";
|
||||||
sPrimariesPreset = "sRGB";
|
} else if (primariesPreset == "sRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.srgb)) {
|
||||||
} else if (primariesPreset == "Widegamut" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.widegamut)) {
|
sNewProfile = options.rtSettings.srgb;
|
||||||
sNewProfile = options.rtSettings.widegamut;
|
sPrimariesPreset = "sRGB";
|
||||||
sPrimariesPreset = "Wide";
|
} else if (primariesPreset == "Widegamut" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.widegamut)) {
|
||||||
} else if (primariesPreset == "BestRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.best)) {
|
sNewProfile = options.rtSettings.widegamut;
|
||||||
sNewProfile = options.rtSettings.best;
|
sPrimariesPreset = "Wide";
|
||||||
sPrimariesPreset = "Best";
|
} else if (primariesPreset == "BestRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.best)) {
|
||||||
} else if (primariesPreset == "BetaRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.beta)) {
|
sNewProfile = options.rtSettings.best;
|
||||||
sNewProfile = options.rtSettings.beta;
|
sPrimariesPreset = "Best";
|
||||||
sPrimariesPreset = "Beta";
|
} else if (primariesPreset == "BetaRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.beta)) {
|
||||||
} else if (primariesPreset == "BruceRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.bruce)) {
|
sNewProfile = options.rtSettings.beta;
|
||||||
sNewProfile = options.rtSettings.bruce;
|
sPrimariesPreset = "Beta";
|
||||||
sPrimariesPreset = "Bruce";
|
} else if (primariesPreset == "BruceRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.bruce)) {
|
||||||
} else if (primariesPreset == "custom") {
|
sNewProfile = options.rtSettings.bruce;
|
||||||
sNewProfile = options.rtSettings.srgb;
|
sPrimariesPreset = "Bruce";
|
||||||
sPrimariesPreset = "Custom";
|
} else if (primariesPreset == "custom") {
|
||||||
} else {
|
sNewProfile = options.rtSettings.srgb;
|
||||||
// Should not occurs
|
sPrimariesPreset = "Custom";
|
||||||
if (rtengine::settings->verbose) {
|
} else {
|
||||||
printf("\"%s\": unknown working profile! - use LCMS2 substitution\n", primariesPreset.c_str());
|
// Should not occurs
|
||||||
|
if (rtengine::settings->verbose) {
|
||||||
|
printf("\"%s\": unknown working profile! - use LCMS2 substitution\n", primariesPreset.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
return;
|
} else {
|
||||||
|
sNewProfile = "RTv2_Beta";
|
||||||
}
|
}
|
||||||
|
|
||||||
//begin adaptation rTRC gTRC bTRC
|
//begin adaptation rTRC gTRC bTRC
|
||||||
@ -702,16 +724,23 @@ void ICCProfileCreator::savePressed()
|
|||||||
printf("Output Gamma - profile Primaries as RT profile: \"%s\"\n", sNewProfile.c_str());
|
printf("Output Gamma - profile Primaries as RT profile: \"%s\"\n", sNewProfile.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
newProfile = rtengine::ICCStore::getInstance()->getProfile(sNewProfile); //get output profile
|
if (!v2except) {
|
||||||
|
newProfile = rtengine::ICCStore::getInstance()->getProfile(sNewProfile); //get output profile
|
||||||
|
} else {
|
||||||
|
profile_v2_except = rtengine::ICCStore::getInstance()->getProfile(sNewProfile); //get output profile
|
||||||
|
|
||||||
if (newProfile == nullptr) {
|
|
||||||
|
|
||||||
if (rtengine::settings->verbose) {
|
|
||||||
printf("\"%s\" ICC output profile not found!\n", sNewProfile.c_str());
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
if (newProfile == nullptr ) {
|
||||||
|
|
||||||
|
if (rtengine::settings->verbose) {
|
||||||
|
printf("\"%s\" ICC output profile not found!\n", sNewProfile.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
*/
|
||||||
//change desc Tag , to "free gamma", or "BT709", etc.
|
//change desc Tag , to "free gamma", or "BT709", etc.
|
||||||
Glib::ustring fName;
|
Glib::ustring fName;
|
||||||
Glib::ustring sPrimariesAndIlluminant;
|
Glib::ustring sPrimariesAndIlluminant;
|
||||||
@ -719,6 +748,7 @@ void ICCProfileCreator::savePressed()
|
|||||||
double presetSlope = 12.92310;
|
double presetSlope = 12.92310;
|
||||||
const double eps = 0.000000001; // not divide by zero
|
const double eps = 0.000000001; // not divide by zero
|
||||||
getGamma(gammaPreset, presetGamma, presetSlope);
|
getGamma(gammaPreset, presetGamma, presetSlope);
|
||||||
|
|
||||||
if (gammaPreset == "High_g1.3_s3.35") {
|
if (gammaPreset == "High_g1.3_s3.35") {
|
||||||
sGammaPreset = "High_g=1.3_s=3.35";
|
sGammaPreset = "High_g=1.3_s=3.35";
|
||||||
ga[0] = 1.3 ; //for high dynamic images
|
ga[0] = 1.3 ; //for high dynamic images
|
||||||
@ -786,17 +816,18 @@ void ICCProfileCreator::savePressed()
|
|||||||
ga[4] = g_a[3] * ts;
|
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);
|
//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] = gamma;
|
ga[0] = gamma;
|
||||||
ga[1] = 1. /(1.0 + g_a[4]);
|
ga[1] = 1. / (1.0 + g_a[4]);
|
||||||
ga[2] = g_a[4] /(1.0 + g_a[4]);
|
ga[2] = g_a[4] / (1.0 + g_a[4]);
|
||||||
ga[3] = 1. / slope2;
|
ga[3] = 1. / slope2;
|
||||||
//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]);
|
||||||
|
|
||||||
sGammaPreset = Glib::ustring::compose("g%1_s%2",
|
sGammaPreset = Glib::ustring::compose("g%1_s%2",
|
||||||
Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), gamma),
|
Glib::ustring::format(std::setw(3), std::fixed, std::setprecision(2), gamma),
|
||||||
Glib::ustring::format (std::setw(6), std::fixed, std::setprecision(5), slope));
|
Glib::ustring::format(std::setw(6), std::fixed, std::setprecision(5), slope));
|
||||||
presetGamma = gamma;
|
presetGamma = gamma;
|
||||||
presetSlope = slope;
|
presetSlope = slope;
|
||||||
}
|
}
|
||||||
|
|
||||||
ga[5] = 0.0;
|
ga[5] = 0.0;
|
||||||
ga[6] = 0.0;
|
ga[6] = 0.0;
|
||||||
|
|
||||||
@ -804,8 +835,7 @@ void ICCProfileCreator::savePressed()
|
|||||||
sPrimariesAndIlluminant = sPrimariesPreset;
|
sPrimariesAndIlluminant = sPrimariesPreset;
|
||||||
|
|
||||||
if (profileVersion == "v4" && illuminant != "DEF") {
|
if (profileVersion == "v4" && illuminant != "DEF") {
|
||||||
sPrimariesPreset += "-" + illuminant;
|
sPrimariesPreset += "-" + illuminant;
|
||||||
// printf("outpr=%s \n",outPr.c_str());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Glib::ustring profileDesc;
|
Glib::ustring profileDesc;
|
||||||
@ -815,16 +845,17 @@ void ICCProfileCreator::savePressed()
|
|||||||
Glib::ustring sSlope;
|
Glib::ustring sSlope;
|
||||||
|
|
||||||
if (gammaPreset == "Custom") {
|
if (gammaPreset == "Custom") {
|
||||||
sGamma = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), gamma);
|
sGamma = Glib::ustring::format(std::setw(3), std::fixed, std::setprecision(2), gamma);
|
||||||
sSlope = Glib::ustring::format (std::setw(6), std::fixed, std::setprecision(5), slope);
|
sSlope = Glib::ustring::format(std::setw(6), std::fixed, std::setprecision(5), slope);
|
||||||
fName = Glib::ustring::compose("RT%1_%2_g%3_s%4.icc", profileVersion, sPrimariesAndIlluminant, sGamma, sSlope);
|
fName = Glib::ustring::compose("RT%1_%2_g%3_s%4.icc", profileVersion, sPrimariesAndIlluminant, sGamma, sSlope);
|
||||||
profileDesc = sPrimariesPreset;
|
profileDesc = sPrimariesPreset;
|
||||||
} else {
|
} else {
|
||||||
sGamma = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), presetGamma);
|
sGamma = Glib::ustring::format(std::setw(3), std::fixed, std::setprecision(2), presetGamma);
|
||||||
sSlope = Glib::ustring::format (std::setw(6), std::fixed, std::setprecision(5), presetSlope);
|
sSlope = Glib::ustring::format(std::setw(6), std::fixed, std::setprecision(5), presetSlope);
|
||||||
fName = Glib::ustring::compose("RT%1_%2_%3.icc", profileVersion, sPrimariesAndIlluminant, sGammaPreset);
|
fName = Glib::ustring::compose("RT%1_%2_%3.icc", profileVersion, sPrimariesAndIlluminant, sGammaPreset);
|
||||||
profileDesc == sPrimariesPreset + sGammaPreset;
|
profileDesc == sPrimariesPreset + sGammaPreset;
|
||||||
}
|
}
|
||||||
|
|
||||||
sGammaSlopeParam = Glib::ustring::compose("g%1s%2!", sGamma, sSlope);
|
sGammaSlopeParam = Glib::ustring::compose("g%1s%2!", sGamma, sSlope);
|
||||||
sGammaSlopeDesc = Glib::ustring::compose("g=%1 s=%2", sGamma, sSlope);
|
sGammaSlopeDesc = Glib::ustring::compose("g=%1 s=%2", sGamma, sSlope);
|
||||||
|
|
||||||
@ -876,12 +907,13 @@ void ICCProfileCreator::savePressed()
|
|||||||
} while (1);
|
} while (1);
|
||||||
|
|
||||||
// --------------- main tags ------------------
|
// --------------- main tags ------------------
|
||||||
|
/*
|
||||||
if (profileVersion == "v4") {
|
if (profileVersion == "v4") {
|
||||||
cmsSetProfileVersion(newProfile, 4.3);
|
cmsSetProfileVersion(newProfile, 4.3);
|
||||||
} else {
|
} else {
|
||||||
cmsSetProfileVersion(newProfile, 2.0);
|
cmsSetProfileVersion(newProfile, 2.0);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
//change
|
//change
|
||||||
float p[6]; //primaries
|
float p[6]; //primaries
|
||||||
@ -897,8 +929,17 @@ void ICCProfileCreator::savePressed()
|
|||||||
{p[4], p[5], 1.0} // blue
|
{p[4], p[5], 1.0} // blue
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
if (v2except) {
|
||||||
|
cmsSetDeviceClass(profile_v2_except, cmsSigDisplayClass);
|
||||||
|
cmsSetPCS(profile_v2_except, cmsSigXYZData);
|
||||||
|
cmsSetHeaderRenderingIntent(profile_v2_except, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (profileVersion == "v4" && illuminant != "DEF") {
|
if (profileVersion == "v4" && illuminant != "DEF") {
|
||||||
double tempv4 = 5000.;
|
double tempv4 = 5000.;
|
||||||
|
|
||||||
if (illuminant == "D41") {
|
if (illuminant == "D41") {
|
||||||
tempv4 = 4100.;
|
tempv4 = 4100.;
|
||||||
} else if (illuminant == "D50") {
|
} else if (illuminant == "D50") {
|
||||||
@ -914,9 +955,81 @@ void ICCProfileCreator::savePressed()
|
|||||||
} else if (illuminant == "stdA") {
|
} else if (illuminant == "stdA") {
|
||||||
tempv4 = 5003.;
|
tempv4 = 5003.;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmsWhitePointFromTemp(&xyD, tempv4);
|
cmsWhitePointFromTemp(&xyD, tempv4);
|
||||||
} else {
|
} else {
|
||||||
cmsWhitePointFromTemp(&xyD, (double)temp);
|
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};
|
||||||
|
}
|
||||||
|
cmsCIExyY blackpoint;
|
||||||
|
|
||||||
|
{
|
||||||
|
blackpoint = {0., 0., 0.};//White D65 point from the sRGB.icm and AdobeRGB1998 profile specs
|
||||||
|
}
|
||||||
|
|
||||||
|
cmsWriteTag(profile_v2_except, cmsSigMediaBlackPointTag, &blackpoint);
|
||||||
|
cmsWriteTag(profile_v2_except, cmsSigMediaWhitePointTag, &XYZ);
|
||||||
|
cmsCIExyY rt;
|
||||||
|
cmsCIExyY bt;
|
||||||
|
cmsCIExyY gt;
|
||||||
|
|
||||||
|
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};
|
||||||
|
cmsWriteTag(profile_v2_except, cmsSigRedColorantTag, &rt);
|
||||||
|
bt = {0.14307, 0.06061, 0.71410};
|
||||||
|
cmsWriteTag(profile_v2_except, cmsSigBlueColorantTag, &bt);
|
||||||
|
gt = {0.38515, 0.71687, 0.09708};
|
||||||
|
cmsWriteTag(profile_v2_except, cmsSigGreenColorantTag, >);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
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};
|
||||||
|
cmsWriteTag(profile_v2_except, cmsSigRedColorantTag, &rt);
|
||||||
|
bt = {0.14919, 0.06322, 0.74457};
|
||||||
|
cmsWriteTag(profile_v2_except, cmsSigBlueColorantTag, &bt);
|
||||||
|
gt = {0.20528, 0.62567, 0.06087};
|
||||||
|
cmsWriteTag(profile_v2_except, cmsSigGreenColorantTag, >);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
cmsWhitePointFromTemp(&xyD, (double)temp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (illuminant == "stdA") {
|
if (illuminant == "stdA") {
|
||||||
@ -924,26 +1037,67 @@ void ICCProfileCreator::savePressed()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Calculate output profile's rTRC gTRC bTRC
|
// Calculate output profile's rTRC gTRC bTRC
|
||||||
|
|
||||||
|
|
||||||
cmsToneCurve* GammaTRC[3];
|
cmsToneCurve* GammaTRC[3];
|
||||||
GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildParametricToneCurve(nullptr, 5, ga);
|
|
||||||
|
if (gammaPreset != "standard_g2.2" || gammaPreset != "standard_g1.8" || gammaPreset != "linear_g1.0") {
|
||||||
|
GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildParametricToneCurve(nullptr, 5, ga);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gammaPreset == "standard_g2.2") {
|
||||||
|
GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildGamma(NULL, 2.19921875);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gammaPreset == "standard_g1.8") {
|
||||||
|
GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildGamma(NULL, 1.80078125);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gammaPreset == "linear_g1.0") {
|
||||||
|
GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildGamma(NULL, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (profileVersion == "v4") {
|
if (profileVersion == "v4") {
|
||||||
newProfile = cmsCreateRGBProfile(&xyD, &Primaries, GammaTRC);
|
newProfile = cmsCreateRGBProfile(&xyD, &Primaries, GammaTRC);
|
||||||
}
|
}
|
||||||
|
|
||||||
cmsWriteTag(newProfile, cmsSigRedTRCTag, GammaTRC[0]);
|
if (profileVersion == "v2") {
|
||||||
cmsWriteTag(newProfile, cmsSigGreenTRCTag, GammaTRC[1]);
|
if (v2except) {
|
||||||
cmsWriteTag(newProfile, cmsSigBlueTRCTag, GammaTRC[2]);
|
cmsSetProfileVersion(profile_v2_except, 2.2);
|
||||||
|
} else {
|
||||||
|
cmsSetProfileVersion(newProfile, 2.2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!v2except) {
|
||||||
|
cmsWriteTag(newProfile, cmsSigRedTRCTag, GammaTRC[0]);
|
||||||
|
cmsWriteTag(newProfile, cmsSigGreenTRCTag, GammaTRC[1]);
|
||||||
|
cmsWriteTag(newProfile, cmsSigBlueTRCTag, GammaTRC[2]);
|
||||||
|
} else {
|
||||||
|
cmsWriteTag(profile_v2_except, cmsSigRedTRCTag, GammaTRC[0]);
|
||||||
|
cmsWriteTag(profile_v2_except, cmsSigGreenTRCTag, GammaTRC[1]);
|
||||||
|
cmsWriteTag(profile_v2_except, cmsSigBlueTRCTag, GammaTRC[2]);
|
||||||
|
}
|
||||||
|
|
||||||
// --------------- set dmnd tag ------------------
|
// --------------- set dmnd tag ------------------
|
||||||
|
|
||||||
cmsMLU *dmnd;
|
cmsMLU *dmnd;
|
||||||
dmnd = cmsMLUalloc(nullptr, 1);
|
dmnd = cmsMLUalloc(nullptr, 1);
|
||||||
cmsMLUsetASCII(dmnd, "en", "US", "RawTherapee");
|
cmsMLUsetASCII(dmnd, "en", "US", "RawTherapee");
|
||||||
cmsWriteTag(newProfile, cmsSigDeviceMfgDescTag, dmnd);
|
|
||||||
|
if (!v2except) {
|
||||||
|
cmsWriteTag(newProfile, cmsSigDeviceMfgDescTag, dmnd);
|
||||||
|
} else {
|
||||||
|
cmsWriteTag(profile_v2_except, cmsSigDeviceMfgDescTag, dmnd);
|
||||||
|
}
|
||||||
|
|
||||||
cmsMLUfree(dmnd);
|
cmsMLUfree(dmnd);
|
||||||
|
|
||||||
// --------------- set dmdd tag ------------------
|
|
||||||
|
|
||||||
|
// --------------- set dmdd tag ------------------
|
||||||
|
|
||||||
if (profileVersion == "v2") {
|
if (profileVersion == "v2") {
|
||||||
//write in tag 'dmdd' values of current gamma and slope to retrieve after in Output profile
|
//write in tag 'dmdd' values of current gamma and slope to retrieve after in Output profile
|
||||||
@ -951,27 +1105,43 @@ void ICCProfileCreator::savePressed()
|
|||||||
wGammaSlopeParam << sGammaSlopeParam;
|
wGammaSlopeParam << sGammaSlopeParam;
|
||||||
|
|
||||||
cmsMLU *dmdd = cmsMLUalloc(nullptr, 1);
|
cmsMLU *dmdd = cmsMLUalloc(nullptr, 1);
|
||||||
|
|
||||||
// Language code (2 letters code) : https://www.iso.org/obp/ui/
|
// Language code (2 letters code) : https://www.iso.org/obp/ui/
|
||||||
// Country code (2 letters code) : http://www.loc.gov/standards/iso639-2/php/code_list.php
|
// Country code (2 letters code) : http://www.loc.gov/standards/iso639-2/php/code_list.php
|
||||||
if (sGammaSlopeParam.is_ascii()) {
|
if (sGammaSlopeParam.is_ascii()) {
|
||||||
if (cmsMLUsetASCII(dmdd, "en", "US", sGammaSlopeParam.c_str())) {
|
if (cmsMLUsetASCII(dmdd, "en", "US", sGammaSlopeParam.c_str())) {
|
||||||
if (!cmsWriteTag(newProfile, cmsSigProfileDescriptionTag, dmdd)) {
|
if (!v2except) {
|
||||||
printf("Error: Can't write cmsSigProfileDescriptionTag!\n");
|
if (!cmsWriteTag(newProfile, cmsSigProfileDescriptionTag, dmdd)) {
|
||||||
|
printf("Error: Can't write cmsSigProfileDescriptionTag!\n");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!cmsWriteTag(profile_v2_except, cmsSigProfileDescriptionTag, dmdd)) {
|
||||||
|
printf("Error: Can't write cmsSigProfileDescriptionTag!\n");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (cmsMLUsetWide(dmdd, "en", "US", wGammaSlopeParam.str().c_str())) {
|
} else if (cmsMLUsetWide(dmdd, "en", "US", wGammaSlopeParam.str().c_str())) {
|
||||||
if (!cmsWriteTag(newProfile, cmsSigDeviceModelDescTag, dmdd)) {
|
if (!v2except) {
|
||||||
printf("Error: Can't write cmsSigDeviceModelDescTag!\n");
|
if (!cmsWriteTag(newProfile, cmsSigDeviceModelDescTag, dmdd)) {
|
||||||
|
printf("Error: Can't write cmsSigDeviceModelDescTag!\n");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!cmsWriteTag(profile_v2_except, cmsSigDeviceModelDescTag, dmdd)) {
|
||||||
|
printf("Error: Can't write cmsSigDeviceModelDescTag!\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
printf("Error: cmsMLUsetWide failed for dmdd \"%s\" !\n", sGammaSlopeParam.c_str());
|
printf("Error: cmsMLUsetWide failed for dmdd \"%s\" !\n", sGammaSlopeParam.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
cmsMLUfree(dmdd);
|
cmsMLUfree(dmdd);
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------- set desc tag ------------------
|
// --------------- set desc tag ------------------
|
||||||
|
|
||||||
Glib::ustring sDescription;
|
Glib::ustring sDescription;
|
||||||
|
|
||||||
if (!description.empty()) {
|
if (!description.empty()) {
|
||||||
if (cAppendParamsToDesc->get_active()) {
|
if (cAppendParamsToDesc->get_active()) {
|
||||||
sDescription = description + " / " + sGammaSlopeDesc;
|
sDescription = description + " / " + sGammaSlopeDesc;
|
||||||
@ -986,41 +1156,66 @@ void ICCProfileCreator::savePressed()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//write in tag 'dmdd' values of current gamma and slope to retrieve after in Output profile
|
//write in tag 'dmdd' values of current gamma and slope to retrieve after in Output profile
|
||||||
std::wostringstream wDescription;
|
std::wostringstream wDescription;
|
||||||
wDescription << sDescription;
|
wDescription << sDescription;
|
||||||
|
|
||||||
cmsMLU *descMLU = cmsMLUalloc(nullptr, 1);
|
cmsMLU *descMLU = cmsMLUalloc(nullptr, 1);
|
||||||
// Language code (2 letters code) : https://www.iso.org/obp/ui/
|
|
||||||
// Country code (2 letters code) : http://www.loc.gov/standards/iso639-2/php/code_list.php
|
// Language code (2 letters code) : https://www.iso.org/obp/ui/
|
||||||
|
// Country code (2 letters code) : http://www.loc.gov/standards/iso639-2/php/code_list.php
|
||||||
if (sDescription.is_ascii()) {
|
if (sDescription.is_ascii()) {
|
||||||
if (cmsMLUsetASCII(descMLU, "en", "US", sDescription.c_str())) {
|
if (cmsMLUsetASCII(descMLU, "en", "US", sDescription.c_str())) {
|
||||||
if (!cmsWriteTag(newProfile, cmsSigProfileDescriptionTag, descMLU)) {
|
if (!v2except) {
|
||||||
printf("Error: Can't write cmsSigProfileDescriptionTag!\n");
|
if (!cmsWriteTag(newProfile, cmsSigProfileDescriptionTag, descMLU)) {
|
||||||
|
printf("Error: Can't write cmsSigProfileDescriptionTag!\n");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!cmsWriteTag(profile_v2_except, cmsSigProfileDescriptionTag, descMLU)) {
|
||||||
|
printf("Error: Can't write cmsSigProfileDescriptionTag!\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (cmsMLUsetWide(descMLU, "en", "US", wDescription.str().c_str())) {
|
} else if (cmsMLUsetWide(descMLU, "en", "US", wDescription.str().c_str())) {
|
||||||
if (!cmsWriteTag(newProfile, cmsSigProfileDescriptionTag, descMLU)) {
|
if (!v2except) {
|
||||||
printf("Error: Can't write cmsSigProfileDescriptionTag!\n");
|
|
||||||
|
if (!cmsWriteTag(newProfile, cmsSigProfileDescriptionTag, descMLU)) {
|
||||||
|
printf("Error: Can't write cmsSigProfileDescriptionTag!\n");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!cmsWriteTag(profile_v2_except, cmsSigProfileDescriptionTag, descMLU)) {
|
||||||
|
printf("Error: Can't write cmsSigProfileDescriptionTag!\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
printf("Error: cmsMLUsetWide failed for desc \"%s\" !\n", sDescription.c_str());
|
printf("Error: cmsMLUsetWide failed for desc \"%s\" !\n", sDescription.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
cmsMLUfree(descMLU);
|
cmsMLUfree(descMLU);
|
||||||
|
|
||||||
// --------------- set cprt tag ------------------
|
// --------------- set cprt tag ------------------
|
||||||
|
|
||||||
std::wostringstream wCopyright;
|
std::wostringstream wCopyright;
|
||||||
wCopyright << copyright;
|
wCopyright << copyright;
|
||||||
|
|
||||||
cmsMLU *copyMLU = cmsMLUalloc(nullptr, 1);
|
cmsMLU *copyMLU = cmsMLUalloc(nullptr, 1);
|
||||||
|
|
||||||
if (cmsMLUsetWide(copyMLU, "en", "US", wCopyright.str().c_str())) {
|
if (cmsMLUsetWide(copyMLU, "en", "US", wCopyright.str().c_str())) {
|
||||||
if (!cmsWriteTag(newProfile, cmsSigCopyrightTag, copyMLU)) {
|
if (!v2except) {
|
||||||
printf("Error: Can't write cmsSigCopyrightTag!\n");
|
|
||||||
|
if (!cmsWriteTag(newProfile, cmsSigCopyrightTag, copyMLU)) {
|
||||||
|
printf("Error: Can't write cmsSigCopyrightTag!\n");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!cmsWriteTag(profile_v2_except, cmsSigCopyrightTag, copyMLU)) {
|
||||||
|
printf("Error: Can't write cmsSigCopyrightTag!\n");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
printf("Error: cmsMLUsetWide failed for cprt \"%s\" !\n", copyright.c_str());
|
printf("Error: cmsMLUsetWide failed for cprt \"%s\" !\n", copyright.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
cmsMLUfree(copyMLU);
|
cmsMLUfree(copyMLU);
|
||||||
|
|
||||||
|
|
||||||
@ -1030,8 +1225,13 @@ void ICCProfileCreator::savePressed()
|
|||||||
cmsCIEXYZ *blueT = static_cast<cmsCIEXYZ*>(cmsReadTag(newProfile, cmsSigBlueMatrixColumnTag));
|
cmsCIEXYZ *blueT = static_cast<cmsCIEXYZ*>(cmsReadTag(newProfile, cmsSigBlueMatrixColumnTag));
|
||||||
printf("rx=%f gx=%f bx=%f ry=%f gy=%f by=%f rz=%f gz=%f bz=%f\n", redT->X, greenT->X, blueT->X, redT->Y, greenT->Y, blueT->Y, redT->Z, greenT->Z, blueT->Z);
|
printf("rx=%f gx=%f bx=%f ry=%f gy=%f by=%f rz=%f gz=%f bz=%f\n", redT->X, greenT->X, blueT->X, redT->Y, greenT->Y, blueT->Y, redT->Z, greenT->Z, blueT->Z);
|
||||||
*/
|
*/
|
||||||
|
if (!v2except) {
|
||||||
|
cmsSaveProfileToFile(newProfile, absoluteFName.c_str());
|
||||||
|
} else {
|
||||||
|
printf("save except\n");
|
||||||
|
cmsSaveProfileToFile(profile_v2_except, absoluteFName.c_str());
|
||||||
|
|
||||||
cmsSaveProfileToFile(newProfile, absoluteFName.c_str());
|
}
|
||||||
|
|
||||||
cmsFreeToneCurve(GammaTRC[0]);
|
cmsFreeToneCurve(GammaTRC[0]);
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ private:
|
|||||||
double gamma;
|
double gamma;
|
||||||
double slope;
|
double slope;
|
||||||
bool appendParamsToDesc;
|
bool appendParamsToDesc;
|
||||||
|
bool v2except;
|
||||||
Glib::ustring profileVersion;
|
Glib::ustring profileVersion;
|
||||||
Glib::ustring illuminant;
|
Glib::ustring illuminant;
|
||||||
Glib::ustring description;
|
Glib::ustring description;
|
||||||
|
@ -769,8 +769,13 @@ Gtk::Widget* Preferences::getColorManPanel ()
|
|||||||
const std::vector<Glib::ustring> profiles = rtengine::ICCStore::getInstance ()->getProfiles (rtengine::ICCStore::ProfileType::MONITOR);
|
const std::vector<Glib::ustring> profiles = rtengine::ICCStore::getInstance ()->getProfiles (rtengine::ICCStore::ProfileType::MONITOR);
|
||||||
|
|
||||||
for (const auto profile : profiles) {
|
for (const auto profile : profiles) {
|
||||||
if (profile.find ("file:") != 0) {
|
if (profile.find("file:") != 0) {
|
||||||
monProfile->append (profile);
|
std::string fileis_RTv4 = profile.substr(0, 4);
|
||||||
|
|
||||||
|
if (fileis_RTv4 != "RTv4") {
|
||||||
|
// printf("pro=%s \n", profile.c_str());
|
||||||
|
monProfile->append(profile);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user