GUI part CH curve

This commit is contained in:
Desmis 2020-07-13 17:08:19 +02:00
parent 8af287aa8c
commit b6b03fd975
9 changed files with 74 additions and 3 deletions

View File

@ -1194,6 +1194,7 @@ HISTORY_MSG_952;Local - Mask Common soft radius
HISTORY_MSG_953;Local - Mask Common blend chroma HISTORY_MSG_953;Local - Mask Common blend chroma
HISTORY_MSG_954;Local - Show-hide tools HISTORY_MSG_954;Local - Show-hide tools
HISTORY_MSG_955;Local - Enable Spot HISTORY_MSG_955;Local - Enable Spot
HISTORY_MSG_956;Local - CH Curve
HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLSHAPE;Blur by level
HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURCWAV;Blur chroma
HISTORY_MSG_BLURWAV;Blur luminance HISTORY_MSG_BLURWAV;Blur luminance

View File

@ -978,7 +978,7 @@ enum ProcEventCode {
Evlocallabblendmaskab = 952, Evlocallabblendmaskab = 952,
EvLocallabSpotprevMethod = 953, EvLocallabSpotprevMethod = 953,
Evlocallabactiv = 954, Evlocallabactiv = 954,
EvlocallabCHshape = 955,
NUMOFEVENTS NUMOFEVENTS
}; };

View File

@ -2777,6 +2777,33 @@ LocallabParams::LocallabSpot::LocallabSpot() :
0.35, 0.35,
0.35 0.35
}, },
CHcurve{
static_cast<double>(FCT_MinMaxCPoints),
0.0,
0.50,
0.35,
0.35,
0.166,
0.50,
0.35,
0.35,
0.333,
0.50,
0.35,
0.35,
0.50,
0.50,
0.35,
0.35,
0.666,
0.50,
0.35,
0.35,
0.833,
0.50,
0.35,
0.35
},
invers(false), invers(false),
special(false), special(false),
toolcol(true), toolcol(true),
@ -3926,6 +3953,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const
&& rgbcurve == other.rgbcurve && rgbcurve == other.rgbcurve
&& LHcurve == other.LHcurve && LHcurve == other.LHcurve
&& HHcurve == other.HHcurve && HHcurve == other.HHcurve
&& CHcurve == other.CHcurve
&& invers == other.invers && invers == other.invers
&& special == other.special && special == other.special
&& toolcol == other.toolcol && toolcol == other.toolcol
@ -5448,6 +5476,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || spot_edited->rgbcurve, "Locallab", "RGBCurve_" + index_str, spot.rgbcurve, keyFile); saveToKeyfile(!pedited || spot_edited->rgbcurve, "Locallab", "RGBCurve_" + index_str, spot.rgbcurve, keyFile);
saveToKeyfile(!pedited || spot_edited->LHcurve, "Locallab", "LHCurve_" + index_str, spot.LHcurve, keyFile); saveToKeyfile(!pedited || spot_edited->LHcurve, "Locallab", "LHCurve_" + index_str, spot.LHcurve, keyFile);
saveToKeyfile(!pedited || spot_edited->HHcurve, "Locallab", "HHCurve_" + index_str, spot.HHcurve, keyFile); saveToKeyfile(!pedited || spot_edited->HHcurve, "Locallab", "HHCurve_" + index_str, spot.HHcurve, keyFile);
saveToKeyfile(!pedited || spot_edited->CHcurve, "Locallab", "CHCurve_" + index_str, spot.CHcurve, keyFile);
saveToKeyfile(!pedited || spot_edited->invers, "Locallab", "Invers_" + index_str, spot.invers, keyFile); saveToKeyfile(!pedited || spot_edited->invers, "Locallab", "Invers_" + index_str, spot.invers, keyFile);
saveToKeyfile(!pedited || spot_edited->special, "Locallab", "Special_" + index_str, spot.special, keyFile); saveToKeyfile(!pedited || spot_edited->special, "Locallab", "Special_" + index_str, spot.special, keyFile);
saveToKeyfile(!pedited || spot_edited->toolcol, "Locallab", "Toolcol_" + index_str, spot.toolcol, keyFile); saveToKeyfile(!pedited || spot_edited->toolcol, "Locallab", "Toolcol_" + index_str, spot.toolcol, keyFile);
@ -7119,6 +7148,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Locallab", "RGBCurve_" + index_str, pedited, spot.rgbcurve, spotEdited.rgbcurve); assignFromKeyfile(keyFile, "Locallab", "RGBCurve_" + index_str, pedited, spot.rgbcurve, spotEdited.rgbcurve);
assignFromKeyfile(keyFile, "Locallab", "LHCurve_" + index_str, pedited, spot.LHcurve, spotEdited.LHcurve); assignFromKeyfile(keyFile, "Locallab", "LHCurve_" + index_str, pedited, spot.LHcurve, spotEdited.LHcurve);
assignFromKeyfile(keyFile, "Locallab", "HHCurve_" + index_str, pedited, spot.HHcurve, spotEdited.HHcurve); assignFromKeyfile(keyFile, "Locallab", "HHCurve_" + index_str, pedited, spot.HHcurve, spotEdited.HHcurve);
assignFromKeyfile(keyFile, "Locallab", "CHCurve_" + index_str, pedited, spot.CHcurve, spotEdited.CHcurve);
assignFromKeyfile(keyFile, "Locallab", "Invers_" + index_str, pedited, spot.invers, spotEdited.invers); assignFromKeyfile(keyFile, "Locallab", "Invers_" + index_str, pedited, spot.invers, spotEdited.invers);
assignFromKeyfile(keyFile, "Locallab", "Special_" + index_str, pedited, spot.special, spotEdited.special); assignFromKeyfile(keyFile, "Locallab", "Special_" + index_str, pedited, spot.special, spotEdited.special);
assignFromKeyfile(keyFile, "Locallab", "Toolcol_" + index_str, pedited, spot.toolcol, spotEdited.toolcol); assignFromKeyfile(keyFile, "Locallab", "Toolcol_" + index_str, pedited, spot.toolcol, spotEdited.toolcol);

View File

@ -50,6 +50,7 @@ class LocretigainCurve;
class LocretigainCurverab; class LocretigainCurverab;
class LocLHCurve; class LocLHCurve;
class LocHHCurve; class LocHHCurve;
class LocCHCurve;
class LocLLmaskCurve; class LocLLmaskCurve;
class LocCCmaskCurve; class LocCCmaskCurve;
class LocHHmaskCurve; class LocHHmaskCurve;
@ -1056,6 +1057,7 @@ struct LocallabParams {
std::vector<double> rgbcurve; std::vector<double> rgbcurve;
std::vector<double> LHcurve; std::vector<double> LHcurve;
std::vector<double> HHcurve; std::vector<double> HHcurve;
std::vector<double> CHcurve;
bool invers; bool invers;
bool special; bool special;
bool toolcol; bool toolcol;

View File

@ -981,8 +981,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
LUMINANCECURVE, // Evlocallabsoftradiusmask LUMINANCECURVE, // Evlocallabsoftradiusmask
LUMINANCECURVE, // Evlocallabblendmaskab LUMINANCECURVE, // Evlocallabblendmaskab
LUMINANCECURVE, // EvLocallabSpotprevMethod LUMINANCECURVE, // EvLocallabSpotprevMethod
LUMINANCECURVE // Evlocallabactiv LUMINANCECURVE, // Evlocallabactiv
LUMINANCECURVE // EvlocallabCHshape
}; };

View File

@ -420,6 +420,8 @@ LocallabColor::LocallabColor():
LHshape(static_cast<FlatCurveEditor*>(HCurveEditorG->addCurve(CT_Flat, "L(H)", nullptr, false, true))), LHshape(static_cast<FlatCurveEditor*>(HCurveEditorG->addCurve(CT_Flat, "L(H)", nullptr, false, true))),
H2CurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_HLH"))), H2CurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_HLH"))),
HHshape(static_cast<FlatCurveEditor*>(H2CurveEditorG->addCurve(CT_Flat, "H(H)", nullptr, false, true))), HHshape(static_cast<FlatCurveEditor*>(H2CurveEditorG->addCurve(CT_Flat, "H(H)", nullptr, false, true))),
H3CurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_HLH"))),
CHshape(static_cast<FlatCurveEditor*>(H3CurveEditorG->addCurve(CT_Flat, "C(H)", nullptr, false, true))),
rgbCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_RGB"))), rgbCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_RGB"))),
toneMethod(Gtk::manage(new MyComboBoxText())), toneMethod(Gtk::manage(new MyComboBoxText())),
rgbshape(static_cast<DiagonalCurveEditor*>(rgbCurveEditorG->addCurve(CT_Diagonal, "", toneMethod))), rgbshape(static_cast<DiagonalCurveEditor*>(rgbCurveEditorG->addCurve(CT_Diagonal, "", toneMethod))),
@ -574,6 +576,16 @@ LocallabColor::LocallabColor():
H2CurveEditorG->curveListComplete(); H2CurveEditorG->curveListComplete();
H3CurveEditorG->setCurveListener(this);
CHshape->setIdentityValue(0.);
CHshape->setResetCurve(FlatCurveType(defSpot.CHcurve.at(0)), defSpot.CHcurve);
CHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP"));
CHshape->setCurveColorProvider(this, 3);
CHshape->setBottomBarBgGradient(six_shape);
H3CurveEditorG->curveListComplete();
rgbCurveEditorG->setCurveListener(this); rgbCurveEditorG->setCurveListener(this);
toneMethod->append(M("TP_EXPOSURE_TCMODE_STANDARD")); toneMethod->append(M("TP_EXPOSURE_TCMODE_STANDARD"));
@ -769,6 +781,7 @@ LocallabColor::LocallabColor():
curvBox->pack_start(*clCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor curvBox->pack_start(*clCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor
curvBox->pack_start(*HCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor curvBox->pack_start(*HCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor
curvBox->pack_start(*H2CurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor curvBox->pack_start(*H2CurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor
curvBox->pack_start(*H3CurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor
curvBox->pack_start(*rgbCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor curvBox->pack_start(*rgbCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor
curvBox->pack_start(*special); curvBox->pack_start(*special);
expcurvcol->add(*curvBox, false); expcurvcol->add(*curvBox, false);
@ -840,6 +853,7 @@ LocallabColor::~LocallabColor()
delete clCurveEditorG; delete clCurveEditorG;
delete HCurveEditorG; delete HCurveEditorG;
delete H2CurveEditorG; delete H2CurveEditorG;
delete H3CurveEditorG;
delete rgbCurveEditorG; delete rgbCurveEditorG;
delete maskCurveEditorG; delete maskCurveEditorG;
delete maskHCurveEditorG; delete maskHCurveEditorG;
@ -1017,6 +1031,7 @@ void LocallabColor::read(const rtengine::procparams::ProcParams* pp, const Param
lcshape->setCurve(spot.lccurve); lcshape->setCurve(spot.lccurve);
LHshape->setCurve(spot.LHcurve); LHshape->setCurve(spot.LHcurve);
HHshape->setCurve(spot.HHcurve); HHshape->setCurve(spot.HHcurve);
CHshape->setCurve(spot.CHcurve);
if (spot.toneMethod == "one") { if (spot.toneMethod == "one") {
toneMethod->set_active(0); toneMethod->set_active(0);
@ -1188,6 +1203,7 @@ void LocallabColor::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pe
spot.lccurve = lcshape->getCurve(); spot.lccurve = lcshape->getCurve();
spot.LHcurve = LHshape->getCurve(); spot.LHcurve = LHshape->getCurve();
spot.HHcurve = HHshape->getCurve(); spot.HHcurve = HHshape->getCurve();
spot.CHcurve = CHshape->getCurve();
if (toneMethod->get_active_row_number() == 0) { if (toneMethod->get_active_row_number() == 0) {
spot.toneMethod = "one"; spot.toneMethod = "one";
@ -1580,6 +1596,13 @@ void LocallabColor::curveChanged(CurveEditor* ce)
} }
} }
if (ce == CHshape) {
if (listener) {
listener->panelChanged(EvlocallabCHshape,
M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (ce == HHshape) { if (ce == HHshape) {
if (listener) { if (listener) {
listener->panelChanged(EvlocallabHHshape, listener->panelChanged(EvlocallabHHshape,
@ -1670,6 +1693,7 @@ void LocallabColor::convertParamToNormal()
lcshape->setCurve(defSpot.lccurve); lcshape->setCurve(defSpot.lccurve);
LHshape->setCurve(defSpot.LHcurve); LHshape->setCurve(defSpot.LHcurve);
HHshape->setCurve(defSpot.HHcurve); HHshape->setCurve(defSpot.HHcurve);
CHshape->setCurve(defSpot.CHcurve);
if (defSpot.toneMethod == "one") { if (defSpot.toneMethod == "one") {
toneMethod->set_active(0); toneMethod->set_active(0);
@ -1782,6 +1806,7 @@ void LocallabColor::updateGUIToMode(const modeType new_type)
clCurveEditorG->hide(); clCurveEditorG->hide();
HCurveEditorG->hide(); HCurveEditorG->hide();
H2CurveEditorG->hide(); H2CurveEditorG->hide();
H3CurveEditorG->hide();
rgbCurveEditorG->hide(); rgbCurveEditorG->hide();
special->hide(); special->hide();
expmaskcol1->hide(); expmaskcol1->hide();
@ -1810,6 +1835,7 @@ void LocallabColor::updateGUIToMode(const modeType new_type)
if (!invers->get_active()) { // Keep widgets hidden when invers is toggled if (!invers->get_active()) { // Keep widgets hidden when invers is toggled
clCurveEditorG->show(); clCurveEditorG->show();
HCurveEditorG->show(); HCurveEditorG->show();
H3CurveEditorG->show();
} }
H2CurveEditorG->show(); H2CurveEditorG->show();
@ -2047,6 +2073,7 @@ void LocallabColor::updateColorGUI1()
qualitycurveMethod->hide(); qualitycurveMethod->hide();
clCurveEditorG->hide(); clCurveEditorG->hide();
HCurveEditorG->hide(); HCurveEditorG->hide();
H3CurveEditorG->hide();
expmaskcol1->hide(); expmaskcol1->hide();
showmaskcolMethod->hide(); showmaskcolMethod->hide();
// Reset hidden mask combobox // Reset hidden mask combobox
@ -2072,6 +2099,7 @@ void LocallabColor::updateColorGUI1()
if (mode == Normal) { // Keep widgets hidden in Normal mode if (mode == Normal) { // Keep widgets hidden in Normal mode
clCurveEditorG->show(); clCurveEditorG->show();
HCurveEditorG->show(); HCurveEditorG->show();
H3CurveEditorG->show();
expmaskcol1->show(); expmaskcol1->show();
} }

View File

@ -206,6 +206,8 @@ private:
FlatCurveEditor* const LHshape; FlatCurveEditor* const LHshape;
CurveEditorGroup* const H2CurveEditorG; CurveEditorGroup* const H2CurveEditorG;
FlatCurveEditor* const HHshape; FlatCurveEditor* const HHshape;
CurveEditorGroup* const H3CurveEditorG;
FlatCurveEditor* const CHshape;
CurveEditorGroup* const rgbCurveEditorG; CurveEditorGroup* const rgbCurveEditorG;
MyComboBoxText* const toneMethod; MyComboBoxText* const toneMethod;
DiagonalCurveEditor* const rgbshape; DiagonalCurveEditor* const rgbshape;

View File

@ -1104,6 +1104,7 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
locallab.spots.at(j).rgbcurve = locallab.spots.at(j).rgbcurve && pSpot.rgbcurve == otherSpot.rgbcurve; locallab.spots.at(j).rgbcurve = locallab.spots.at(j).rgbcurve && pSpot.rgbcurve == otherSpot.rgbcurve;
locallab.spots.at(j).LHcurve = locallab.spots.at(j).LHcurve && pSpot.LHcurve == otherSpot.LHcurve; locallab.spots.at(j).LHcurve = locallab.spots.at(j).LHcurve && pSpot.LHcurve == otherSpot.LHcurve;
locallab.spots.at(j).HHcurve = locallab.spots.at(j).HHcurve && pSpot.HHcurve == otherSpot.HHcurve; locallab.spots.at(j).HHcurve = locallab.spots.at(j).HHcurve && pSpot.HHcurve == otherSpot.HHcurve;
locallab.spots.at(j).CHcurve = locallab.spots.at(j).CHcurve && pSpot.CHcurve == otherSpot.CHcurve;
locallab.spots.at(j).invers = locallab.spots.at(j).invers && pSpot.invers == otherSpot.invers; locallab.spots.at(j).invers = locallab.spots.at(j).invers && pSpot.invers == otherSpot.invers;
locallab.spots.at(j).special = locallab.spots.at(j).special && pSpot.special == otherSpot.special; locallab.spots.at(j).special = locallab.spots.at(j).special && pSpot.special == otherSpot.special;
locallab.spots.at(j).toolcol = locallab.spots.at(j).toolcol && pSpot.toolcol == otherSpot.toolcol; locallab.spots.at(j).toolcol = locallab.spots.at(j).toolcol && pSpot.toolcol == otherSpot.toolcol;
@ -3381,6 +3382,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.locallab.spots.at(i).HHcurve = mods.locallab.spots.at(i).HHcurve; toEdit.locallab.spots.at(i).HHcurve = mods.locallab.spots.at(i).HHcurve;
} }
if (locallab.spots.at(i).CHcurve) {
toEdit.locallab.spots.at(i).CHcurve = mods.locallab.spots.at(i).CHcurve;
}
if (locallab.spots.at(i).invers) { if (locallab.spots.at(i).invers) {
toEdit.locallab.spots.at(i).invers = mods.locallab.spots.at(i).invers; toEdit.locallab.spots.at(i).invers = mods.locallab.spots.at(i).invers;
} }
@ -6138,6 +6143,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) :
rgbcurve(v), rgbcurve(v),
LHcurve(v), LHcurve(v),
HHcurve(v), HHcurve(v),
CHcurve(v),
invers(v), invers(v),
special(v), special(v),
toolcol(v), toolcol(v),
@ -6622,6 +6628,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v)
rgbcurve = v; rgbcurve = v;
LHcurve = v; LHcurve = v;
HHcurve = v; HHcurve = v;
CHcurve = v;
invers = v; invers = v;
special = v; special = v;
toolcol = v; toolcol = v;

View File

@ -470,6 +470,7 @@ public:
bool rgbcurve; bool rgbcurve;
bool LHcurve; bool LHcurve;
bool HHcurve; bool HHcurve;
bool CHcurve;
bool invers; bool invers;
bool special; bool special;
bool toolcol; bool toolcol;