Merge branch 'dev' into spot-removal-tool
This commit is contained in:
@@ -17,10 +17,174 @@
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "partialpastedlg.h"
|
||||
|
||||
#include "guiutils.h"
|
||||
#include "multilangmgr.h"
|
||||
#include "paramsedited.h"
|
||||
#include "guiutils.h"
|
||||
|
||||
#include "../rtengine/procparams.h"
|
||||
|
||||
using namespace rtengine::procparams;
|
||||
|
||||
/* ==== PartialSpotWidget ==== */
|
||||
PartialSpotWidget::PartialSpotWidget():
|
||||
// Widget GUI elements
|
||||
treeview(Gtk::manage(new Gtk::TreeView())),
|
||||
treemodel(Gtk::ListStore::create(spotRow)),
|
||||
|
||||
// Widget listener
|
||||
selListener(nullptr)
|
||||
{
|
||||
// Configure tree view
|
||||
treeview->set_model(treemodel);
|
||||
treeview->set_enable_search(false);
|
||||
treeview->set_headers_visible(false);
|
||||
|
||||
// Add tree view columns
|
||||
auto cell1 = Gtk::manage(new Gtk::CellRendererToggle());
|
||||
cell1->signal_toggled().connect(
|
||||
sigc::mem_fun(
|
||||
*this, &PartialSpotWidget::keepToggled));
|
||||
int cols_count = treeview->append_column("", *cell1);
|
||||
auto col = treeview->get_column(cols_count - 1);
|
||||
|
||||
if (col) {
|
||||
col->set_cell_data_func(
|
||||
*cell1, sigc::mem_fun(
|
||||
*this, &PartialSpotWidget::render_keep));
|
||||
}
|
||||
|
||||
auto cell2 = Gtk::manage(new Gtk::CellRendererText());
|
||||
cols_count = treeview->append_column("", *cell2);
|
||||
col = treeview->get_column(cols_count - 1);
|
||||
|
||||
if (col) {
|
||||
col->set_cell_data_func(
|
||||
*cell2, sigc::mem_fun(
|
||||
*this, &PartialSpotWidget::render_spotname));
|
||||
}
|
||||
|
||||
// Create and configure scrolled window
|
||||
Gtk::ScrolledWindow* const scrolledwindows = Gtk::manage(new Gtk::ScrolledWindow());
|
||||
scrolledwindows->add(*treeview);
|
||||
scrolledwindows->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
|
||||
scrolledwindows->set_min_content_height(100);
|
||||
|
||||
// Add widgets to VBox
|
||||
pack_start(*scrolledwindows);
|
||||
show_all();
|
||||
}
|
||||
|
||||
void PartialSpotWidget::updateSpotWidget(const rtengine::procparams::ProcParams* pp, const bool defValue)
|
||||
{
|
||||
treeviewconn.block(true);
|
||||
|
||||
// Clear tree model
|
||||
treemodel->clear();
|
||||
|
||||
// Add tree model element according to pp
|
||||
Gtk::TreeRow newspot;
|
||||
|
||||
for (size_t i = 0; i < pp->locallab.spots.size(); i++) {
|
||||
newspot = *(treemodel->append());
|
||||
newspot[spotRow.keep] = defValue;
|
||||
newspot[spotRow.spotname] = pp->locallab.spots.at(i).name;
|
||||
}
|
||||
|
||||
treeviewconn.block(false);
|
||||
}
|
||||
|
||||
void PartialSpotWidget::enableAll()
|
||||
{
|
||||
treeviewconn.block(true);
|
||||
|
||||
for (auto &spot : treemodel->children()) {
|
||||
spot[spotRow.keep] = true;
|
||||
}
|
||||
|
||||
treeviewconn.block(false);
|
||||
}
|
||||
|
||||
void PartialSpotWidget::disableAll()
|
||||
{
|
||||
treeviewconn.block(true);
|
||||
|
||||
for (auto &spot : treemodel->children()) {
|
||||
spot[spotRow.keep] = false;
|
||||
}
|
||||
|
||||
treeviewconn.block(false);
|
||||
}
|
||||
|
||||
std::vector<bool> PartialSpotWidget::getSelectionStatus()
|
||||
{
|
||||
std::vector<bool> keepVect;
|
||||
|
||||
for (auto &spot : treemodel->children()) {
|
||||
keepVect.push_back(spot[spotRow.keep]);
|
||||
}
|
||||
|
||||
return keepVect;
|
||||
}
|
||||
|
||||
void PartialSpotWidget::render_keep(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter)
|
||||
{
|
||||
const auto spot = *iter;
|
||||
Gtk::CellRendererToggle* const ct = static_cast<Gtk::CellRendererToggle*>(cell);
|
||||
|
||||
// Render cell toggle
|
||||
ct->property_active() = spot[spotRow.keep];
|
||||
}
|
||||
|
||||
void PartialSpotWidget::render_spotname(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter)
|
||||
{
|
||||
const auto spot = *iter;
|
||||
Gtk::CellRendererText* const ct = static_cast<Gtk::CellRendererText*>(cell);
|
||||
|
||||
// Render cell toggle
|
||||
ct->property_text() = spot[spotRow.spotname];
|
||||
}
|
||||
|
||||
void PartialSpotWidget::keepToggled(const Glib::ustring &path)
|
||||
{
|
||||
PartialSpotWidgetListener::UpdateStatus status;
|
||||
|
||||
// Get clicked row
|
||||
const auto selRow = *(treemodel->get_iter(path));
|
||||
|
||||
// Update treeview according to selected row
|
||||
selRow[spotRow.keep] = !selRow[spotRow.keep];
|
||||
|
||||
// Count total number of spot
|
||||
const int totalnb = (int)treemodel->children().size();
|
||||
|
||||
// Count number of toggled elements
|
||||
int togglednb = 0;
|
||||
|
||||
for (auto &spot : treemodel->children()) {
|
||||
if (spot[spotRow.keep]) {
|
||||
togglednb++;
|
||||
}
|
||||
}
|
||||
|
||||
// Compute status
|
||||
if (togglednb == 0) { // No spot toggled
|
||||
status = PartialSpotWidgetListener::UpdateStatus::NoSelection;
|
||||
} else {
|
||||
if (togglednb == totalnb) { // All spot toggled
|
||||
status = PartialSpotWidgetListener::UpdateStatus::AllSelection;
|
||||
} else { // Partial number of spots toggled
|
||||
status = PartialSpotWidgetListener::UpdateStatus::PartialSelection;
|
||||
}
|
||||
}
|
||||
|
||||
// Propagate event to listener
|
||||
if (selListener) {
|
||||
selListener->partialSpotUpdated(status);
|
||||
}
|
||||
}
|
||||
|
||||
/* ==== PartialPasteDlg ==== */
|
||||
PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* parent)
|
||||
: Gtk::Dialog (title, *parent, true)
|
||||
{
|
||||
@@ -45,6 +209,8 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren
|
||||
raw ->set_name("PartialPasteHeader");
|
||||
advanced = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_ADVANCEDGROUP")));
|
||||
advanced ->set_name("PartialPasteHeader");
|
||||
locallab = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_LOCALLABGROUP")));
|
||||
locallab ->set_name("PartialPasteHeader");
|
||||
|
||||
// Basic Settings:
|
||||
wb = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_WHITEBALANCE")));
|
||||
@@ -104,6 +270,10 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren
|
||||
exifch = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_EXIFCHANGES")));
|
||||
iptc = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_IPTCINFO")));
|
||||
|
||||
// Locallab:
|
||||
spots = Gtk::manage(new PartialSpotWidget());
|
||||
spots->setPartialSpotWidgetListener(this);
|
||||
|
||||
// Raw Settings:
|
||||
raw_method = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAW_DMETHOD")));
|
||||
raw_imagenum = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAW_IMAGENUM")));
|
||||
@@ -135,17 +305,17 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren
|
||||
raw_ca_autocorrect = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAWCACORR_AUTO")));
|
||||
raw_caredblue = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAWCACORR_CAREDBLUE")));
|
||||
raw_ca_avoid_colourshift = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAWCACORR_AVOIDCOLORSHIFT")));
|
||||
//---
|
||||
//...
|
||||
filmNegative = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_FILMNEGATIVE")) );
|
||||
//---
|
||||
captureSharpening = Gtk::manage (new Gtk::CheckButton (M("TP_PDSHARPENING_LABEL")) );
|
||||
//---
|
||||
raw_preprocwb = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_PREPROCWB")));
|
||||
|
||||
Gtk::VBox* vboxes[8];
|
||||
Gtk::HSeparator* hseps[8];
|
||||
Gtk::VBox* vboxes[9];
|
||||
Gtk::HSeparator* hseps[9];
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
for (int i = 0; i < 9; i++) {
|
||||
vboxes[i] = Gtk::manage (new Gtk::VBox ());
|
||||
vboxes[i]->set_name("PartialPasteGroupContainer");
|
||||
hseps[i] = Gtk::manage (new Gtk::HSeparator ());
|
||||
@@ -187,6 +357,7 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren
|
||||
vboxes[2]->pack_start (*blackwhite, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[2]->pack_start (*hsveq, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[2]->pack_start (*filmSimulation, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[2]->pack_start (*filmNegative, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[2]->pack_start (*softlight, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[2]->pack_start (*rgbcurves, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[2]->pack_start (*colortoning, Gtk::PACK_SHRINK, 2);
|
||||
@@ -217,50 +388,47 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren
|
||||
vboxes[5]->pack_start (*colorappearance, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[5]->pack_start (*wavelet, Gtk::PACK_SHRINK, 2);
|
||||
|
||||
//META
|
||||
vboxes[6]->pack_start (*meta, Gtk::PACK_SHRINK, 2);
|
||||
//LOCALLAB
|
||||
vboxes[6]->pack_start(*locallab, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[6]->pack_start(*spots, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[6]->pack_start (*hseps[6], Gtk::PACK_SHRINK, 2);
|
||||
vboxes[6]->pack_start(*metadata, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[6]->pack_start (*exifch, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[6]->pack_start (*iptc, Gtk::PACK_SHRINK, 2);
|
||||
|
||||
//RAW
|
||||
vboxes[7]->pack_start (*raw, Gtk::PACK_SHRINK, 2);
|
||||
//META
|
||||
vboxes[7]->pack_start (*meta, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*hseps[7], Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*raw_method, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*raw_border, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*raw_imagenum, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*raw_pixelshift, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*raw_ccSteps, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*raw_dcb_iterations, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*raw_dcb_enhance, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*raw_lmmse_iterations, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0);
|
||||
vboxes[7]->pack_start (*raw_linenoise, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*raw_greenthresh, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*raw_hotpix_filt, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*raw_deadpix_filt, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*raw_pdaf_lines_filter, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0);
|
||||
vboxes[7]->pack_start (*raw_expos, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*raw_black, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*raw_preprocwb, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0);
|
||||
vboxes[7]->pack_start (*df_file, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*df_AutoSelect, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0);
|
||||
vboxes[7]->pack_start (*ff_file, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*ff_AutoSelect, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*ff_BlurType, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*ff_BlurRadius, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*ff_ClipControl, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0);
|
||||
vboxes[7]->pack_start (*raw_ca_autocorrect, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*raw_caredblue, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*raw_ca_avoid_colourshift, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0);
|
||||
vboxes[7]->pack_start (*filmNegative, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[7]->pack_start (*captureSharpening, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*raw_method, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*raw_border, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*raw_imagenum, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*raw_pixelshift, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*raw_ccSteps, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*raw_dcb_iterations, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*raw_dcb_enhance, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*raw_lmmse_iterations, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0);
|
||||
vboxes[8]->pack_start (*raw_linenoise, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*raw_greenthresh, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*raw_hotpix_filt, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*raw_deadpix_filt, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*raw_pdaf_lines_filter, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0);
|
||||
vboxes[8]->pack_start (*raw_expos, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*raw_black, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*raw_preprocwb, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0);
|
||||
vboxes[8]->pack_start (*df_file, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*df_AutoSelect, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0);
|
||||
vboxes[8]->pack_start (*ff_file, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*ff_AutoSelect, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*ff_BlurType, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*ff_BlurRadius, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*ff_ClipControl, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0);
|
||||
vboxes[8]->pack_start (*raw_ca_autocorrect, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*raw_caredblue, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*raw_ca_avoid_colourshift, Gtk::PACK_SHRINK, 2);
|
||||
vboxes[8]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0);
|
||||
vboxes[8]->pack_start (*captureSharpening, Gtk::PACK_SHRINK, 2);
|
||||
|
||||
Gtk::VBox* vbCol1 = Gtk::manage (new Gtk::VBox ());
|
||||
Gtk::VBox* vbCol2 = Gtk::manage (new Gtk::VBox ());
|
||||
@@ -270,11 +438,11 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren
|
||||
vbCol1->pack_start (*vboxes[i], Gtk::PACK_SHRINK, 2);
|
||||
}
|
||||
|
||||
for (int i = 3; i < 7; i++) {
|
||||
for (int i = 3; i < 8; i++) {
|
||||
vbCol2->pack_start (*vboxes[i], Gtk::PACK_SHRINK, 2);
|
||||
}
|
||||
|
||||
for (int i = 7; i < 8; i++) {
|
||||
for (int i = 8; i < 9; i++) {
|
||||
vbCol3->pack_start (*vboxes[i], Gtk::PACK_SHRINK, 2);
|
||||
}
|
||||
|
||||
@@ -319,6 +487,7 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren
|
||||
metaConn = meta->signal_toggled().connect (sigc::mem_fun(*this, &PartialPasteDlg::metaToggled));
|
||||
rawConn = raw->signal_toggled().connect (sigc::mem_fun(*this, &PartialPasteDlg::rawToggled));
|
||||
advancedConn = advanced->signal_toggled().connect (sigc::mem_fun(*this, &PartialPasteDlg::advancedToggled));
|
||||
locallabConn = locallab->signal_toggled().connect (sigc::mem_fun(*this, &PartialPasteDlg::locallabToggled));
|
||||
|
||||
// Basic Settings
|
||||
wbConn = wb->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true));
|
||||
@@ -434,6 +603,7 @@ void PartialPasteDlg::everythingToggled ()
|
||||
ConnectionBlocker metaBlocker(metaConn);
|
||||
ConnectionBlocker rawBlocker(rawConn);
|
||||
ConnectionBlocker advancedBlocker(advancedConn);
|
||||
ConnectionBlocker locallabBlocker(locallabConn);
|
||||
|
||||
everything->set_inconsistent (false);
|
||||
|
||||
@@ -446,6 +616,7 @@ void PartialPasteDlg::everythingToggled ()
|
||||
meta->set_active(everything->get_active());
|
||||
raw->set_active(everything->get_active());
|
||||
advanced->set_active(everything->get_active());
|
||||
locallab->set_active(everything->get_active());
|
||||
|
||||
//toggle group children
|
||||
PartialPasteDlg::basicToggled ();
|
||||
@@ -456,6 +627,7 @@ void PartialPasteDlg::everythingToggled ()
|
||||
PartialPasteDlg::metaToggled ();
|
||||
PartialPasteDlg::rawToggled ();
|
||||
PartialPasteDlg::advancedToggled ();
|
||||
PartialPasteDlg::locallabToggled();
|
||||
}
|
||||
|
||||
void PartialPasteDlg::rawToggled ()
|
||||
@@ -486,7 +658,6 @@ void PartialPasteDlg::rawToggled ()
|
||||
ConnectionBlocker raw_ca_autocorrectBlocker(raw_ca_autocorrectConn);
|
||||
ConnectionBlocker raw_caredblueBlocker(raw_caredblueConn);
|
||||
ConnectionBlocker raw_ca_avoid_colourshiftBlocker(raw_ca_avoid_colourshiftconn);
|
||||
ConnectionBlocker filmNegativeBlocker(filmNegativeConn);
|
||||
ConnectionBlocker captureSharpeningBlocker(captureSharpeningConn);
|
||||
ConnectionBlocker raw_preprocwbBlocker(raw_preprocwbConn);
|
||||
|
||||
@@ -517,7 +688,6 @@ void PartialPasteDlg::rawToggled ()
|
||||
raw_ca_autocorrect->set_active (raw->get_active ());
|
||||
raw_caredblue->set_active (raw->get_active ());
|
||||
raw_ca_avoid_colourshift->set_active (raw->get_active ());
|
||||
filmNegative->set_active (raw->get_active());
|
||||
captureSharpening->set_active (raw->get_active());
|
||||
raw_preprocwb->set_active (raw->get_active());
|
||||
}
|
||||
@@ -597,6 +767,7 @@ void PartialPasteDlg::colorToggled ()
|
||||
ConnectionBlocker chmixerbwBlocker(chmixerbwConn);
|
||||
ConnectionBlocker hsveqBlocker(hsveqConn);
|
||||
ConnectionBlocker filmSimulationBlocker(filmSimulationConn);
|
||||
ConnectionBlocker filmNegativeBlocker(filmNegativeConn);
|
||||
ConnectionBlocker softlightBlocker(softlightConn);
|
||||
ConnectionBlocker rgbcurvesBlocker(rgbcurvesConn);
|
||||
ConnectionBlocker colortoningBlocker(colortoningConn);
|
||||
@@ -609,6 +780,7 @@ void PartialPasteDlg::colorToggled ()
|
||||
blackwhite->set_active (color->get_active ());
|
||||
hsveq->set_active (color->get_active ());
|
||||
filmSimulation->set_active (color->get_active ());
|
||||
filmNegative->set_active (color->get_active());
|
||||
softlight->set_active (color->get_active ());
|
||||
rgbcurves->set_active (color->get_active ());
|
||||
colortoning->set_active(color->get_active ());
|
||||
@@ -666,6 +838,17 @@ void PartialPasteDlg::metaToggled ()
|
||||
iptc->set_active (meta->get_active ());
|
||||
}
|
||||
|
||||
void PartialPasteDlg::locallabToggled()
|
||||
{
|
||||
locallab->set_inconsistent (false);
|
||||
|
||||
if (locallab->get_active()) {
|
||||
spots->enableAll();
|
||||
} else {
|
||||
spots->disableAll();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Copies the selected items from the source ProcParams+ParamsEdited(optional)
|
||||
@@ -675,7 +858,9 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param
|
||||
{
|
||||
|
||||
ParamsEdited falsePE; // falsePE is a workaround to set a group of ParamsEdited to false
|
||||
falsePE.locallab.spots.resize(srcPP->locallab.spots.size(), LocallabParamsEdited::LocallabSpotEdited(false));
|
||||
ParamsEdited filterPE(true); // Contains the initial information about the loaded values
|
||||
filterPE.locallab.spots.resize(srcPP->locallab.spots.size(), LocallabParamsEdited::LocallabSpotEdited(true));
|
||||
|
||||
if (srcPE) {
|
||||
filterPE = *srcPE;
|
||||
@@ -1002,7 +1187,9 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param
|
||||
filterPE.filmNegative.redRatio = falsePE.filmNegative.redRatio;
|
||||
filterPE.filmNegative.greenExp = falsePE.filmNegative.greenExp;
|
||||
filterPE.filmNegative.blueRatio = falsePE.filmNegative.blueRatio;
|
||||
filterPE.filmNegative.baseValues = falsePE.filmNegative.baseValues;
|
||||
filterPE.filmNegative.refInput = falsePE.filmNegative.refInput;
|
||||
filterPE.filmNegative.refOutput = falsePE.filmNegative.refOutput;
|
||||
filterPE.filmNegative.colorSpace = falsePE.filmNegative.colorSpace;
|
||||
}
|
||||
|
||||
if (!captureSharpening->get_active ()) {
|
||||
@@ -1020,10 +1207,65 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param
|
||||
filterPE.raw.preprocessWB.mode = falsePE.raw.preprocessWB.mode;
|
||||
}
|
||||
|
||||
if (dstPE) {
|
||||
*dstPE = filterPE;
|
||||
}
|
||||
// Locallab shall be kept in last position
|
||||
if (!locallab->get_active () && !locallab->get_inconsistent()) {
|
||||
filterPE.locallab = falsePE.locallab;
|
||||
|
||||
// Apply the filter!
|
||||
filterPE.combine(*dstPP, *srcPP, true);
|
||||
if (dstPE) {
|
||||
*dstPE = filterPE;
|
||||
}
|
||||
|
||||
// Apply the filter!
|
||||
filterPE.combine(*dstPP, *srcPP, true);
|
||||
} else { // Update PE and PP according to chosen spot
|
||||
// Get chosen spots
|
||||
std::vector<bool> chosenSpots = spots->getSelectionStatus();
|
||||
|
||||
// Create temporary PP and PE based on scrPP and scrPE
|
||||
rtengine::procparams::ProcParams tmpPP = rtengine::procparams::ProcParams(*srcPP);
|
||||
ParamsEdited tmpPE = ParamsEdited(filterPE);
|
||||
|
||||
// Update tmpPP and tmpPE according to chosen spots
|
||||
for (int i = ((int)chosenSpots.size() - 1); i >= 0; i--) {
|
||||
if (!chosenSpots.at(i)) {
|
||||
tmpPP.locallab.spots.erase(tmpPP.locallab.spots.begin() + i);
|
||||
tmpPE.locallab.spots.erase(tmpPE.locallab.spots.begin() + i);
|
||||
}
|
||||
}
|
||||
|
||||
if (dstPE) {
|
||||
*dstPE = tmpPE;
|
||||
}
|
||||
|
||||
// Apply the filter!
|
||||
tmpPE.combine(*dstPP, tmpPP, true);
|
||||
}
|
||||
}
|
||||
|
||||
void PartialPasteDlg::updateSpotWidget(const rtengine::procparams::ProcParams* pp)
|
||||
{
|
||||
locallab->set_inconsistent(false);
|
||||
|
||||
if (pp->locallab.spots.size() > 0) {
|
||||
spots->set_visible(true);
|
||||
spots->updateSpotWidget(pp, locallab->get_active());
|
||||
} else {
|
||||
spots->set_visible(false); // Hide widget if there is no locallab spot
|
||||
}
|
||||
}
|
||||
|
||||
void PartialPasteDlg::partialSpotUpdated(const UpdateStatus status)
|
||||
{
|
||||
switch (status) {
|
||||
case (AllSelection):
|
||||
locallab->set_active(true);
|
||||
break;
|
||||
|
||||
case (NoSelection):
|
||||
locallab->set_active(false);
|
||||
break;
|
||||
|
||||
case (PartialSelection):
|
||||
locallab->set_inconsistent(true);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user