diff --git a/rtdata/languages/default b/rtdata/languages/default index c0e919042..3d49170ce 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1091,6 +1091,7 @@ HISTORY_MSG_851;Local - White Ev HISTORY_MSG_852;Local - Target Gray HISTORY_MSG_853;Local - Detail HISTORY_MSG_854;Local - Scope encoding log +HISTORY_MSG_855;Local - Entire image HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -2278,6 +2279,7 @@ TP_LOCALLAB_FEATVALUE;Feather gradient TP_LOCALLAB_FFTCOL_MASK;FFTW (to test ?) TP_LOCALLAB_FFTW2;Use Fast Fourier Transform (TIF, JPG,..) TP_LOCALLAB_FFTW;Use Fast Fourier Transform +TP_LOCALLAB_FULLIMAGE;Calculate DarkEv - WhiteEv - Value on the entire image TP_LOCALLAB_GAM;Gamma TP_LOCALLAB_GAMFRA;Tone response curve (TRC) TP_LOCALLAB_GAMM;Gamma diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 9546d372c..4e7bb6b56 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -733,6 +733,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) centx = new float[sizespot]; float *centy = nullptr; centy = new float[sizespot]; + for (int sp = 0; sp < params->locallab.nbspot && sp < sizespot; sp++) { @@ -749,6 +750,10 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) locyT[sp] = params->locallab.spots.at(sp).locYT / 2000.0; centx[sp] = params->locallab.spots.at(sp).centerX / 2000.0 + 0.5; centy[sp] = params->locallab.spots.at(sp).centerY / 2000.0 + 0.5; + bool fullim = true; + if(params->locallab.spots.at(sp).fullimage == false) { + fullim = false; + } if (log[sp] && autocomput[sp]) { constexpr int SCALE = 10; @@ -759,6 +764,12 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) float yend = std::min(static_cast(centy[sp] + locy[sp]), 1.f); float xsta = std::max(static_cast(centx[sp] - locxL[sp]), 0.f); float xend = std::min(static_cast(centx[sp] + locx[sp]), 1.f); + if(fullim) { + ysta = 0.f; + yend = 1.f; + xsta = 0.f; + xend = 1.f; + } ipf.getAutoLogloc(sp, imgsrc, sourceg, blackev, whiteev, Autogr, fw, fh, xsta, xend, ysta, yend, SCALE); params->locallab.spots.at(sp).blackEv = blackev[sp]; diff --git a/rtengine/procevents.h b/rtengine/procevents.h index dd469cddb..1bbec24bd 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -880,6 +880,7 @@ enum ProcEventCode { EvlocallabtargetGray = 851, Evlocallabdetail = 852, Evlocallabsensilog = 853, + Evlocallabfullimage = 854, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index a3fcd6d88..7c84daa7c 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2774,6 +2774,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : sourceGray(18.), targetGray(18.), Autogray(true), + fullimage(true), blackEv(-5.0), whiteEv(10.0), detail(1), @@ -3164,6 +3165,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && sourceGray == other.sourceGray && targetGray == other.targetGray && Autogray == other.Autogray + && fullimage == other.fullimage && blackEv == other.blackEv && whiteEv == other.whiteEv && detail == other.detail @@ -4521,6 +4523,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sourceGray, "Locallab", "SourceGray_" + std::to_string(i), spot.sourceGray, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).targetGray, "Locallab", "TargetGray_" + std::to_string(i), spot.targetGray, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).Autogray, "Locallab", "Autogray_" + std::to_string(i), spot.Autogray, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).fullimage, "Locallab", "Fullimage_" + std::to_string(i), spot.fullimage, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).blackEv, "Locallab", "BlackEv_" + std::to_string(i), spot.blackEv, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).whiteEv, "Locallab", "WhiteEv_" + std::to_string(i), spot.whiteEv, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).detail, "Locallab", "Detail_" + std::to_string(i), spot.detail, keyFile); @@ -6043,6 +6046,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "SourceGray_" + std::to_string(i), pedited, spot.sourceGray, spotEdited.sourceGray); assignFromKeyfile(keyFile, "Locallab", "TargetGray_" + std::to_string(i), pedited, spot.targetGray, spotEdited.targetGray); assignFromKeyfile(keyFile, "Locallab", "AutoGray_" + std::to_string(i), pedited, spot.Autogray, spotEdited.Autogray); + assignFromKeyfile(keyFile, "Locallab", "Fullimage_" + std::to_string(i), pedited, spot.fullimage, spotEdited.fullimage); assignFromKeyfile(keyFile, "Locallab", "BlackEv_" + std::to_string(i), pedited, spot.blackEv, spotEdited.blackEv); assignFromKeyfile(keyFile, "Locallab", "WhiteEv_" + std::to_string(i), pedited, spot.whiteEv, spotEdited.whiteEv); assignFromKeyfile(keyFile, "Locallab", "Detail_" + std::to_string(i), pedited, spot.detail, spotEdited.detail); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index ca664d6ef..28f54cd9d 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1318,6 +1318,7 @@ struct LocallabParams { double sourceGray; double targetGray; bool Autogray; + bool fullimage; double blackEv; double whiteEv; int detail; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 2323f7061..d5e347bae 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -883,7 +883,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, //EvlocallabwhiteEv LUMINANCECURVE, //EvlocallabtargetGray LUMINANCECURVE, //Evlocallabdetail - LUMINANCECURVE //Evlocallabsensilog + LUMINANCECURVE, //Evlocallabsensilog + AUTOEXP //Evlocallabfullimage }; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index faa445240..82db4c3d5 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -557,6 +557,7 @@ fftwlc(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_FFTW")))), enacbMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), //encoding log Autogray(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_AUTOGRAY")))), +fullimage(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_FULLIMAGE")))), // ComboBox widgets // Color & Light @@ -3279,6 +3280,7 @@ pe(nullptr) autoconn = autocompute->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::autocomputeToggled)); AutograyConn = Autogray->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::AutograyChanged)); //sourceGray = Gtk::manage(new Adjuster(M("TP_LO_SOURCE_GRAY"), 1.0, 100.0, 0.1, 18.0)); + fullimageConn = fullimage->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::fullimageChanged)); //sourceGray->throwOnButtonRelease(); @@ -3307,6 +3309,7 @@ pe(nullptr) logPBox->pack_start(*autocompute); logPBox->pack_start(*blackEv); logPBox->pack_start(*whiteEv); + logPBox->pack_start(*fullimage); logPFrame->add(*logPBox); logFrame->set_label_align(0.025, 0.5); @@ -4946,6 +4949,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited // pp->locallab.spots.at(pp->locallab.selspot).autogray = sourceGray->getAutoValue(); pp->locallab.spots.at(pp->locallab.selspot).sourceGray = sourceGray->getValue(); pp->locallab.spots.at(pp->locallab.selspot).Autogray = Autogray->get_active(); + pp->locallab.spots.at(pp->locallab.selspot).fullimage = fullimage->get_active(); pp->locallab.spots.at(pp->locallab.selspot).blackEv = blackEv->getValue(); pp->locallab.spots.at(pp->locallab.selspot).whiteEv = whiteEv->getValue(); pp->locallab.spots.at(pp->locallab.selspot).targetGray = targetGray->getValue(); @@ -5324,6 +5328,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pe->locallab.spots.at(pp->locallab.selspot).sourceGray = pe->locallab.spots.at(pp->locallab.selspot).sourceGray || sourceGray->getEditedState(); // pe->locallab.spots.at(pp->locallab.selspot).autogray = !sourceGray->getAutoInconsistent(); pe->locallab.spots.at(pp->locallab.selspot).Autogray = pe->locallab.spots.at(pp->locallab.selspot).Autogray || !Autogray->get_inconsistent(); + pe->locallab.spots.at(pp->locallab.selspot).fullimage = pe->locallab.spots.at(pp->locallab.selspot).fullimage || !fullimage->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).blackEv = pe->locallab.spots.at(pp->locallab.selspot).blackEv || blackEv->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).whiteEv = pe->locallab.spots.at(pp->locallab.selspot).whiteEv || whiteEv->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).targetGray = pe->locallab.spots.at(pp->locallab.selspot).targetGray || targetGray->getEditedState(); @@ -5703,6 +5708,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pedited->locallab.spots.at(pp->locallab.selspot).autocompute = pedited->locallab.spots.at(pp->locallab.selspot).autocompute || !autocompute->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).sourceGray = pedited->locallab.spots.at(pp->locallab.selspot).sourceGray || sourceGray->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).Autogray = pedited->locallab.spots.at(pp->locallab.selspot).Autogray || !Autogray->get_inconsistent(); + pedited->locallab.spots.at(pp->locallab.selspot).fullimage = pedited->locallab.spots.at(pp->locallab.selspot).fullimage || !fullimage->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).blackEv = pedited->locallab.spots.at(pp->locallab.selspot).blackEv || blackEv->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).whiteEv = pedited->locallab.spots.at(pp->locallab.selspot).whiteEv || whiteEv->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).targetGray = pedited->locallab.spots.at(pp->locallab.selspot).targetGray || targetGray->getEditedState(); @@ -7584,6 +7590,29 @@ void Locallab::AutograyChanged() } } +void Locallab::fullimageChanged() +{ + + if (multiImage) { + if (fullimage->get_inconsistent()) { + fullimage->set_inconsistent(false); + fullimageConn.block(true); + fullimage->set_active(false); + fullimageConn.block(false); + } + } + + if (getEnabled() && explog->getEnabled()) { + if (listener) { + if (fullimage->get_active()) { + listener->panelChanged(Evlocallabfullimage, M("GENERAL_ENABLED")); + } else { + listener->panelChanged(Evlocallabfullimage, M("GENERAL_DISABLED")); + } + } + } +} + void Locallab::fftwlcChanged() { @@ -10446,6 +10475,7 @@ void Locallab::enableListener() // autoconn.block(false); enablelogConn.block(false); AutograyConn.block(false); + fullimageConn.block(false); } @@ -10539,6 +10569,7 @@ void Locallab::disableListener() // autoconn.block(true); enablelogConn.block(true); AutograyConn.block(true); + fullimageConn.block(true); } @@ -11278,6 +11309,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con // sourceGray->setAutoValue(pp->locallab.spots.at(index).autogray); // lastAutogray = pp->locallab.spots.at(index).autogray; Autogray->set_active(pp->locallab.spots.at(index).Autogray); + fullimage->set_active(pp->locallab.spots.at(index).fullimage); blackEv->setValue(pp->locallab.spots.at(index).blackEv); whiteEv->setValue(pp->locallab.spots.at(index).whiteEv); targetGray->setValue(pp->locallab.spots.at(index).targetGray); @@ -11718,6 +11750,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con sourceGray->setEditedState(spotState->sourceGray ? Edited : UnEdited); // sourceGray->setAutoInconsistent(multiImage && !spotState->autogray); Autogray->set_inconsistent(multiImage && !spotState->Autogray); + fullimage->set_inconsistent(multiImage && !spotState->fullimage); blackEv->setEditedState(spotState->blackEv ? Edited : UnEdited); whiteEv->setEditedState(spotState->whiteEv ? Edited : UnEdited); targetGray->setEditedState(spotState->targetGray ? Edited : UnEdited); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index f2e19687f..5cd4a1b19 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -451,6 +451,8 @@ private: //encoding log Gtk::CheckButton* const Autogray; sigc::connection AutograyConn; + Gtk::CheckButton* const fullimage; + sigc::connection fullimageConn; // ComboBox widgets // Color & Light @@ -685,7 +687,8 @@ private: //log encoding void autocomputeToggled(); void AutograyChanged(); - + void fullimageChanged(); + // Other widgets event functions void lumacontrastMinusPressed(); void lumaneutralPressed(); diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index f293fd9f8..85655dc6b 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1315,6 +1315,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).sourceGray = locallab.spots.at(j).sourceGray && pSpot.sourceGray == otherSpot.sourceGray; locallab.spots.at(j).targetGray = locallab.spots.at(j).targetGray && pSpot.targetGray == otherSpot.targetGray; locallab.spots.at(j).Autogray = locallab.spots.at(j).Autogray && pSpot.Autogray == otherSpot.Autogray; + locallab.spots.at(j).fullimage = locallab.spots.at(j).fullimage && pSpot.fullimage == otherSpot.fullimage; locallab.spots.at(j).blackEv = locallab.spots.at(j).blackEv && pSpot.blackEv == otherSpot.blackEv; locallab.spots.at(j).whiteEv = locallab.spots.at(j).whiteEv && pSpot.whiteEv == otherSpot.whiteEv; locallab.spots.at(j).detail = locallab.spots.at(j).detail && pSpot.detail == otherSpot.detail; @@ -4198,6 +4199,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).Autogray = mods.locallab.spots.at(i).Autogray; } + if (locallab.spots.at(i).fullimage) { + toEdit.locallab.spots.at(i).fullimage = mods.locallab.spots.at(i).fullimage; + } + } @@ -5526,6 +5531,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : targetGray(v), // autogray(v), Autogray(v), + fullimage(v), blackEv(v), whiteEv(v), detail(v), @@ -5901,6 +5907,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) targetGray = v; // autogray = v; Autogray = v; + fullimage = v; blackEv = v; whiteEv = v; detail = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 41d69e6aa..7268dc233 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -745,6 +745,7 @@ public: bool targetGray; // bool autogray; bool Autogray; + bool fullimage; bool blackEv; bool whiteEv; bool detail;