Merge with "Beep6581/dev"

This commit is contained in:
Pandagrapher
2023-03-11 11:02:29 +01:00
252 changed files with 9021 additions and 3231 deletions

View File

@@ -35,7 +35,9 @@
using namespace rtengine;
using namespace rtengine::procparams;
ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iunchanged(nullptr), icmplistener(nullptr)
const Glib::ustring ICMPanel::TOOL_NAME = "icm";
ICMPanel::ICMPanel() : FoldableToolPanel(this, TOOL_NAME, M("TP_ICM_LABEL")), iunchanged(nullptr), icmplistener(nullptr)
{
auto m = ProcEventMapper::getInstance();
EvICMprimariMethod = m->newEvent(GAMMA, "HISTORY_MSG_ICM_OUTPUT_PRIMARIES");
@@ -62,6 +64,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha
EvICMpreser = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_ICM_PRESER");
EvICMLabGridciexy = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_ICL_LABGRIDCIEXY");
EvICMfbw = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_ICM_FBW");
EvICMgamut = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_ICM_GAMUT");
isBatchMode = lastToneCurve = lastApplyLookTable = lastApplyBaselineExposureOffset = lastApplyHueSatMap = false;
ipDialog = Gtk::manage(new MyFileChooserButton(M("TP_ICM_INPUTDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN));
@@ -263,8 +266,12 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha
wprimBox->pack_start(*wprim, Gtk::PACK_EXPAND_WIDGET);
fbw = Gtk::manage(new Gtk::CheckButton((M("TP_ICM_FBW"))));
fbw->set_active(true);
gamut = Gtk::manage(new Gtk::CheckButton((M("TP_ICM_GAMUT"))));
gamut->set_active(false);
trcProfVBox->pack_start(*wprimBox, Gtk::PACK_EXPAND_WIDGET);
trcProfVBox->pack_start(*fbw, Gtk::PACK_EXPAND_WIDGET);
trcProfVBox->pack_start(*gamut, Gtk::PACK_EXPAND_WIDGET);
neutral = Gtk::manage (new Gtk::Button (M ("TP_ICM_NEUTRAL")));
setExpandAlignProperties (neutral, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
@@ -468,6 +475,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha
wprimconn = wprim->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::wprimChanged));
fbwconn = fbw->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::fbwChanged));
gamutconn = gamut->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::gamutChanged));
obpcconn = obpc->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::oBPCChanged));
tcurveconn = ckbToneCurve->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::toneCurveChanged));
ltableconn = ckbApplyLookTable->signal_toggled().connect(sigc::mem_fun(*this, &ICMPanel::applyLookTableChanged));
@@ -513,6 +521,7 @@ void ICMPanel::neutral_pressed ()
wSlope->setValue(defPar.workingTRCSlope);//12.92
preser->setValue(defPar.preser);
fbw->set_active(defPar.fbw);
gamut->set_active(defPar.gamut);
wTRC->set_active(toUnderlying(ColorManagementParams::WorkingTrc::NONE));//reset to none
will->set_active(toUnderlying(ColorManagementParams::Illuminant::DEFAULT));//reset to default - after wprim
}
@@ -765,6 +774,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
ConnectionBlocker obpcconn_(obpcconn);
ConnectionBlocker fbwconn_(fbwconn);
ConnectionBlocker gamutconn_(gamutconn);
ConnectionBlocker ipc_(ipc);
ConnectionBlocker tcurveconn_(tcurveconn);
ConnectionBlocker ltableconn_(ltableconn);
@@ -838,6 +848,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
obpc->set_active(pp->icm.outputBPC);
fbw->set_active(pp->icm.fbw);
gamut->set_active(pp->icm.gamut);
ckbToneCurve->set_active(pp->icm.toneCurve);
lastToneCurve = pp->icm.toneCurve;
ckbApplyLookTable->set_active(pp->icm.applyLookTable);
@@ -862,6 +873,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
iunchanged->set_active(!pedited->icm.inputProfile);
obpc->set_inconsistent(!pedited->icm.outputBPC);
fbw->set_inconsistent(!pedited->icm.fbw);
gamut->set_inconsistent(!pedited->icm.gamut);
ckbToneCurve->set_inconsistent(!pedited->icm.toneCurve);
ckbApplyLookTable->set_inconsistent(!pedited->icm.applyLookTable);
ckbApplyBaselineExposureOffset->set_inconsistent(!pedited->icm.applyBaselineExposureOffset);
@@ -920,6 +932,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
willulab->set_sensitive(false);
wprim->set_sensitive(false);
fbw->set_sensitive(false);
gamut->set_sensitive(false);
wprimlab->set_sensitive(false);
riaHBox->set_sensitive(false);
redFrame->hide();
@@ -931,6 +944,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
willulab->set_sensitive(true);
wprim->set_sensitive(true);
fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true);
if (ColorManagementParams::Primaries(wprim->get_active_row_number()) == ColorManagementParams::Primaries::DEFAULT) {
redFrame->hide();
@@ -973,6 +987,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
willulab->set_sensitive(true);
wprim->set_sensitive(true);
fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true);
wGamma->set_sensitive(false);
wSlope->set_sensitive(false);
@@ -990,6 +1005,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
willulab->set_sensitive(true);
wprim->set_sensitive(true);
fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true);
wGamma->set_sensitive(false);
wSlope->set_sensitive(false);
@@ -1007,6 +1023,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
willulab->set_sensitive(true);
wprim->set_sensitive(true);
fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true);
redFrame->show();
wGamma->set_sensitive(false);
@@ -1025,6 +1042,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
willulab->set_sensitive(true);
wprim->set_sensitive(true);
fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true);
riaHBox->set_sensitive(true);
if (ColorManagementParams::Primaries(wprim->get_active_row_number()) == ColorManagementParams::Primaries::DEFAULT) {
@@ -1042,6 +1060,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
willulab->set_sensitive(true);
wprim->set_sensitive(true);
fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true);
wGamma->set_sensitive(false);
wSlope->set_sensitive(false);
@@ -1143,6 +1162,7 @@ void ICMPanel::write(ProcParams* pp, ParamsEdited* pedited)
pp->icm.applyHueSatMap = ckbApplyHueSatMap->get_active();
pp->icm.outputBPC = obpc->get_active();
pp->icm.fbw = fbw->get_active();
pp->icm.gamut = gamut->get_active();
pp->icm.workingTRCGamma = wGamma->getValue();
pp->icm.workingTRCSlope = wSlope->getValue();
pp->icm.redx = redx->getValue();
@@ -1162,6 +1182,7 @@ void ICMPanel::write(ProcParams* pp, ParamsEdited* pedited)
pedited->icm.aRendIntent = aRendIntent->getSelected() < 4;
pedited->icm.outputBPC = !obpc->get_inconsistent();
pedited->icm.fbw = !fbw->get_inconsistent();
pedited->icm.gamut = !gamut->get_inconsistent();
pedited->icm.dcpIlluminant = dcpIll->get_active_text() != M("GENERAL_UNCHANGED");
pedited->icm.toneCurve = !ckbToneCurve->get_inconsistent();
pedited->icm.applyLookTable = !ckbApplyLookTable->get_inconsistent();
@@ -1268,6 +1289,7 @@ void ICMPanel::wtrcinChanged()
willulab->set_sensitive(false);
wprim->set_sensitive(false);
fbw->set_sensitive(false);
gamut->set_sensitive(false);
wprimlab->set_sensitive(false);
redFrame->hide();
riaHBox->set_sensitive(false);
@@ -1278,6 +1300,7 @@ void ICMPanel::wtrcinChanged()
will->set_sensitive(false);
wprim->set_sensitive(true);
fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true);
willulab->set_sensitive(true);
if (ColorManagementParams::Primaries(wprim->get_active_row_number()) == ColorManagementParams::Primaries::DEFAULT) {
@@ -1311,6 +1334,7 @@ void ICMPanel::wtrcinChanged()
willulab->set_sensitive(true);
wprim->set_sensitive(true);
fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true);
wGamma->set_sensitive(false);
wSlope->set_sensitive(false);
@@ -1336,6 +1360,7 @@ void ICMPanel::wtrcinChanged()
willulab->set_sensitive(true);
wprim->set_sensitive(true);
fbw->set_sensitive(true);
gamut->set_sensitive(true);
wGamma->set_sensitive(false);
wSlope->set_sensitive(false);
riaHBox->set_sensitive(true);
@@ -1362,6 +1387,7 @@ void ICMPanel::wtrcinChanged()
willulab->set_sensitive(true);
wprim->set_sensitive(true);
fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true);
wGamma->set_sensitive(false);
wSlope->set_sensitive(false);
@@ -1389,6 +1415,7 @@ void ICMPanel::wtrcinChanged()
willulab->set_sensitive(true);
wprim->set_sensitive(true);
fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true);
wGamma->set_sensitive(false);
wSlope->set_sensitive(false);
@@ -1416,6 +1443,7 @@ void ICMPanel::wtrcinChanged()
willulab->set_sensitive(true);
wprim->set_sensitive(true);
fbw->set_sensitive(true);
gamut->set_sensitive(true);
wprimlab->set_sensitive(true);
wGamma->set_sensitive(false);
wSlope->set_sensitive(false);
@@ -2023,6 +2051,33 @@ void ICMPanel::fbwChanged()
}
}
void ICMPanel::gamutChanged()
{
if (multiImage) {
if (gamut->get_inconsistent()) {
gamut->set_inconsistent(false);
gamutconn.block(true);
gamut->set_active(false);
gamutconn.block(false);
} else if (lastgamut) {
gamut->set_inconsistent(true);
}
lastgamut = gamut->get_active();
}
if (listener) {
if (gamut->get_inconsistent()) {
listener->panelChanged(EvICMgamut, M("GENERAL_UNCHANGED"));
} else if (fbw->get_active()) {
listener->panelChanged(EvICMgamut, M("GENERAL_ENABLED"));
} else {
listener->panelChanged(EvICMgamut, M("GENERAL_DISABLED"));
}
}
}
void ICMPanel::setRawMeta(bool raw, const rtengine::FramesData* pMeta)
{