Batch editor's sliders behaves better and easier to code for the developper :
- if only one file is selected, all sliders are in SET mode - if more than one file is selected, the ADD/SET mode depend on the preference The range of the slider in ADD mode is now twice the range of the same slider in SET mode, so you'll be able to reach the total range for each image at each session. Overflows are correctly handled. I've added more sliders in the preference window (the one that are not listed behave in SET mode, like before). It's also easier to code for the developper, as the Adjuster class now handle the "add" booleans, instead of each tools. But it's still spreaded all over the code :-/ Furthermore, when clicking on the reset button of a slider, it now reset to the system default value ; resetting to the value of the loaded profil can still be done with CTRL+click on the reset button. This behavior is available in the Editors and in the Batch Editor if only one file is selected.
This commit is contained in:
@@ -857,6 +857,7 @@ TP_RAWCACORR_CABLUE;Blue
|
|||||||
TP_RAWCACORR_CARED;Red
|
TP_RAWCACORR_CARED;Red
|
||||||
TP_RAWEXPOS_LINEAR;White Point: Linear corr. factor
|
TP_RAWEXPOS_LINEAR;White Point: Linear corr. factor
|
||||||
TP_RAWEXPOS_PRESER;White Point: HL preserving corr.(EV)
|
TP_RAWEXPOS_PRESER;White Point: HL preserving corr.(EV)
|
||||||
|
TP_RAWEXPOS_BLACKS;Black Levels
|
||||||
TP_RAWEXPOS_BLACKZERO;Black Level: Green 1 (leader)
|
TP_RAWEXPOS_BLACKZERO;Black Level: Green 1 (leader)
|
||||||
TP_RAWEXPOS_BLACKONE;Black Level: Red
|
TP_RAWEXPOS_BLACKONE;Black Level: Red
|
||||||
TP_RAWEXPOS_BLACKTWO;Black Level: Blue
|
TP_RAWEXPOS_BLACKTWO;Black Level: Blue
|
||||||
|
@@ -1,6 +1,10 @@
|
|||||||
#ifndef _ADDSETIDS_
|
#ifndef _ADDSETIDS_
|
||||||
#define _ADDSETIDS_
|
#define _ADDSETIDS_
|
||||||
|
|
||||||
|
|
||||||
|
// UPDATE THE DEFAULT VALUE IN OPTIONS.CC TOO !!!
|
||||||
|
|
||||||
|
|
||||||
#define ADDSET_TC_EXPCOMP 0
|
#define ADDSET_TC_EXPCOMP 0
|
||||||
#define ADDSET_TC_BRIGHTNESS 1
|
#define ADDSET_TC_BRIGHTNESS 1
|
||||||
#define ADDSET_TC_BLACKLEVEL 2
|
#define ADDSET_TC_BLACKLEVEL 2
|
||||||
@@ -27,9 +31,21 @@
|
|||||||
|
|
||||||
#define ADDSET_TC_HLCOMPAMOUNT 23
|
#define ADDSET_TC_HLCOMPAMOUNT 23
|
||||||
#define ADDSET_TC_HLCOMPTHRESH 24
|
#define ADDSET_TC_HLCOMPTHRESH 24
|
||||||
#define ADDSET_TC_SHCOMP 25
|
#define ADDSET_TC_SHCOMP 25
|
||||||
// When adding items, make sure to update ADDSET_PARAM_NUM
|
|
||||||
#define ADDSET_PARAM_NUM 26 // THIS IS USED AS A DELIMITER!!
|
|
||||||
|
|
||||||
|
#define ADDSET_DIRPYREQ 26
|
||||||
|
#define ADDSET_DIRPYRDN_CHLUM 27
|
||||||
|
#define ADDSET_DIRPYRDN_GAMMA 28
|
||||||
|
#define ADDSET_CHMIXER 29
|
||||||
|
|
||||||
|
#define ADDSET_PREPROCESS_GREENEQUIL 30
|
||||||
|
#define ADDSET_PREPROCESS_LINEDENOISE 31
|
||||||
|
#define ADDSET_RAWCACORR 32
|
||||||
|
#define ADDSET_RAWEXPOS_LINEAR 33
|
||||||
|
#define ADDSET_RAWEXPOS_PRESER 34
|
||||||
|
#define ADDSET_RAWEXPOS_BLACKS 35
|
||||||
|
|
||||||
|
// When adding items, make sure to update ADDSET_PARAM_NUM
|
||||||
|
#define ADDSET_PARAM_NUM 36 // THIS IS USED AS A DELIMITER!!
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -31,6 +31,12 @@ Adjuster::Adjuster (Glib::ustring vlabel, double vmin, double vmax, double vstep
|
|||||||
afterReset = false;
|
afterReset = false;
|
||||||
blocked = false;
|
blocked = false;
|
||||||
|
|
||||||
|
vMin = vmin;
|
||||||
|
vMax = vmax;
|
||||||
|
vStep = vstep;
|
||||||
|
initialDefaultVal = vdefault;
|
||||||
|
addMode = false;
|
||||||
|
|
||||||
// TODO: let the user chose the default value of Adjuster::delay, for slow machines
|
// TODO: let the user chose the default value of Adjuster::delay, for slow machines
|
||||||
delay = options.adjusterDelay; // delay is no more static, so we can set the delay individually (usefull for the RAW editor tab)
|
delay = options.adjusterDelay; // delay is no more static, so we can set the delay individually (usefull for the RAW editor tab)
|
||||||
|
|
||||||
@@ -74,11 +80,12 @@ Adjuster::Adjuster (Glib::ustring vlabel, double vmin, double vmax, double vstep
|
|||||||
setLimits (vmin, vmax, vstep, vdefault);
|
setLimits (vmin, vmax, vstep, vdefault);
|
||||||
|
|
||||||
defaultVal = shapeValue (vdefault);
|
defaultVal = shapeValue (vdefault);
|
||||||
|
initialDefaultVal = shapeValue (vdefault);
|
||||||
editedState = defEditedState = Irrelevant;
|
editedState = defEditedState = Irrelevant;
|
||||||
|
|
||||||
sliderChange = slider->signal_value_changed().connect( sigc::mem_fun(*this, &Adjuster::sliderChanged) );
|
sliderChange = slider->signal_value_changed().connect( sigc::mem_fun(*this, &Adjuster::sliderChanged) );
|
||||||
spinChange = spin->signal_value_changed().connect ( sigc::mem_fun(*this, &Adjuster::spinChanged), true);
|
spinChange = spin->signal_value_changed().connect ( sigc::mem_fun(*this, &Adjuster::spinChanged), true);
|
||||||
reset->signal_clicked().connect( sigc::mem_fun(*this, &Adjuster::resetPressed) );
|
reset->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &Adjuster::resetPressed) );
|
||||||
slider->set_update_policy (Gtk::UPDATE_CONTINUOUS);
|
slider->set_update_policy (Gtk::UPDATE_CONTINUOUS);
|
||||||
|
|
||||||
show_all ();
|
show_all ();
|
||||||
@@ -102,7 +109,7 @@ void Adjuster::setDefaultEditedState (EditedState eState) {
|
|||||||
defEditedState = eState;
|
defEditedState = eState;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Adjuster::resetPressed () {
|
void Adjuster::resetPressed (GdkEventButton* event) {
|
||||||
|
|
||||||
if (editedState!=Irrelevant) {
|
if (editedState!=Irrelevant) {
|
||||||
editedState = defEditedState;
|
editedState = defEditedState;
|
||||||
@@ -114,7 +121,12 @@ void Adjuster::resetPressed () {
|
|||||||
refreshLabelStyle ();
|
refreshLabelStyle ();
|
||||||
}
|
}
|
||||||
afterReset = true;
|
afterReset = true;
|
||||||
slider->set_value (defaultVal);
|
if ((event != NULL) && (event->state & GDK_CONTROL_MASK) && (event->button == 1))
|
||||||
|
// CTRL pressed : resetting to current default value
|
||||||
|
slider->set_value (defaultVal);
|
||||||
|
else
|
||||||
|
// no modifier key or addMode=true : resetting to initial default value
|
||||||
|
slider->set_value (initialDefaultVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
double Adjuster::shapeValue (double a) {
|
double Adjuster::shapeValue (double a) {
|
||||||
@@ -135,11 +147,28 @@ void Adjuster::setLimits (double vmin, double vmax, double vstep, double vdefaul
|
|||||||
slider->set_increments (vstep, 2.0*vstep);
|
slider->set_increments (vstep, 2.0*vstep);
|
||||||
slider->set_range (vmin, vmax);
|
slider->set_range (vmin, vmax);
|
||||||
slider->set_value (shapeValue(vdefault));
|
slider->set_value (shapeValue(vdefault));
|
||||||
defaultVal = shapeValue (vdefault);
|
//defaultVal = shapeValue (vdefault);
|
||||||
sliderChange.block (false);
|
sliderChange.block (false);
|
||||||
spinChange.block (false);
|
spinChange.block (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Adjuster::setAddMode(bool addM) {
|
||||||
|
if (addM != addMode) {
|
||||||
|
// Switching the Adjuster to the new mode
|
||||||
|
if (addM) {
|
||||||
|
// Switching to the relative mode
|
||||||
|
double range = -vMin + vMax;
|
||||||
|
if (range < 0.) range = -range;
|
||||||
|
setLimits(-range, range, vStep, 0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Switching to the absolute mode
|
||||||
|
setLimits(vMin, vMax, vStep, defaultVal);
|
||||||
|
}
|
||||||
|
addMode = addM;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Adjuster::setAdjusterListener (AdjusterListener* alistener) {
|
void Adjuster::setAdjusterListener (AdjusterListener* alistener) {
|
||||||
|
|
||||||
adjusterListener = alistener;
|
adjusterListener = alistener;
|
||||||
@@ -209,16 +238,19 @@ void Adjuster::setValue (double a) {
|
|||||||
afterReset = false;
|
afterReset = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// return the value trimmed to the limits at construction time
|
||||||
double Adjuster::getValue () {
|
double Adjuster::getValue () {
|
||||||
|
|
||||||
return spin->get_value ();
|
return spin->get_value ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// return the value trimmed to the limits at construction time
|
||||||
int Adjuster::getIntValue () {
|
int Adjuster::getIntValue () {
|
||||||
|
|
||||||
return spin->get_value_as_int ();
|
return spin->get_value_as_int ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// method only used by the history manager
|
||||||
Glib::ustring Adjuster::getTextValue () {
|
Glib::ustring Adjuster::getTextValue () {
|
||||||
|
|
||||||
return spin->get_text ();
|
return spin->get_text ();
|
||||||
@@ -284,3 +316,25 @@ void Adjuster::editedToggled () {
|
|||||||
if (adjusterListener && !blocked)
|
if (adjusterListener && !blocked)
|
||||||
adjusterListener->adjusterChanged (this, spin->get_value ());
|
adjusterListener->adjusterChanged (this, spin->get_value ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double Adjuster::trimValue (double& val) {
|
||||||
|
|
||||||
|
if (val > vMax) val = vMax; // shapeValue(vMax) ?
|
||||||
|
else if (val < vMin) val = vMin; // shapeValue(vMin) ?
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
int Adjuster::trimValue (int& val) {
|
||||||
|
|
||||||
|
if (val > (int)vMax) val = (int)vMax; // shapeValue(vMax) ?
|
||||||
|
else if (val < (int)vMin) val = (int)vMin; // shapeValue(vMin) ?
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
float Adjuster::trimValue (float& val) {
|
||||||
|
|
||||||
|
if (val > (float)vMax) val = (float)vMax; // shapeValue(vMax) ?
|
||||||
|
else if (val < (float)vMin) val = (float)vMin; // shapeValue(vMin) ?
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -44,13 +44,18 @@ class Adjuster : public Gtk::VBox {
|
|||||||
sigc::connection sliderChange;
|
sigc::connection sliderChange;
|
||||||
sigc::connection editedChange;
|
sigc::connection editedChange;
|
||||||
bool listenerReady;
|
bool listenerReady;
|
||||||
double defaultVal;
|
double defaultVal; // current default value (it can change when switching from ADD or SET mode)
|
||||||
|
double initialDefaultVal; // default value at construction time
|
||||||
EditedState editedState;
|
EditedState editedState;
|
||||||
EditedState defEditedState;
|
EditedState defEditedState;
|
||||||
int digits;
|
int digits;
|
||||||
Gtk::CheckButton* editedCheckBox;
|
Gtk::CheckButton* editedCheckBox;
|
||||||
bool afterReset;
|
bool afterReset;
|
||||||
bool blocked;
|
bool blocked;
|
||||||
|
bool addMode;
|
||||||
|
double vMin;
|
||||||
|
double vMax;
|
||||||
|
double vStep;
|
||||||
|
|
||||||
double shapeValue (double a);
|
double shapeValue (double a);
|
||||||
void refreshLabelStyle ();
|
void refreshLabelStyle ();
|
||||||
@@ -76,12 +81,16 @@ class Adjuster : public Gtk::VBox {
|
|||||||
void showEditedCB ();
|
void showEditedCB ();
|
||||||
void block(bool isBlocked) { blocked = isBlocked; }
|
void block(bool isBlocked) { blocked = isBlocked; }
|
||||||
|
|
||||||
|
void setAddMode(bool addM);
|
||||||
|
bool getAddMode() { return addMode; };
|
||||||
void spinChanged ();
|
void spinChanged ();
|
||||||
void sliderChanged ();
|
void sliderChanged ();
|
||||||
bool notifyListener ();
|
bool notifyListener ();
|
||||||
void resetPressed ();
|
void resetPressed (GdkEventButton* event);
|
||||||
void editedToggled ();
|
void editedToggled ();
|
||||||
|
double trimValue (double& val);
|
||||||
|
float trimValue (float& val);
|
||||||
|
int trimValue (int& val);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,313 +1,358 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of RawTherapee.
|
* This file is part of RawTherapee.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
|
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
|
||||||
*
|
*
|
||||||
* RawTherapee is free software: you can redistribute it and/or modify
|
* RawTherapee is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* RawTherapee is distributed in the hope that it will be useful,
|
* RawTherapee is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <multilangmgr.h>
|
#include <multilangmgr.h>
|
||||||
#include <batchtoolpanelcoord.h>
|
#include <batchtoolpanelcoord.h>
|
||||||
#include <options.h>
|
#include <options.h>
|
||||||
#include <filepanel.h>
|
#include <filepanel.h>
|
||||||
#include <procparamchangers.h>
|
#include <procparamchangers.h>
|
||||||
#include <addsetids.h>
|
#include <addsetids.h>
|
||||||
|
|
||||||
using namespace rtengine::procparams;
|
using namespace rtengine::procparams;
|
||||||
|
|
||||||
BatchToolPanelCoordinator::BatchToolPanelCoordinator (FilePanel* parent) : ToolPanelCoordinator(), parent(parent) {
|
BatchToolPanelCoordinator::BatchToolPanelCoordinator (FilePanel* parent) : ToolPanelCoordinator(), parent(parent) {
|
||||||
|
|
||||||
// remove exif panel and iptc panel
|
// remove exif panel and iptc panel
|
||||||
std::vector<ToolPanel*>::iterator epi = std::find (toolPanels.begin(), toolPanels.end(), exifpanel);
|
std::vector<ToolPanel*>::iterator epi = std::find (toolPanels.begin(), toolPanels.end(), exifpanel);
|
||||||
if (epi!=toolPanels.end())
|
if (epi!=toolPanels.end())
|
||||||
toolPanels.erase (epi);
|
toolPanels.erase (epi);
|
||||||
std::vector<ToolPanel*>::iterator ipi = std::find (toolPanels.begin(), toolPanels.end(), iptcpanel);
|
std::vector<ToolPanel*>::iterator ipi = std::find (toolPanels.begin(), toolPanels.end(), iptcpanel);
|
||||||
if (ipi!=toolPanels.end())
|
if (ipi!=toolPanels.end())
|
||||||
toolPanels.erase (ipi);
|
toolPanels.erase (ipi);
|
||||||
toolPanelNotebook->remove_page (*metadataPanel);
|
toolPanelNotebook->remove_page (*metadataPanel);
|
||||||
|
|
||||||
for (int i=0; i<toolPanels.size(); i++)
|
for (int i=0; i<toolPanels.size(); i++)
|
||||||
toolPanels[i]->setBatchMode (true);
|
toolPanels[i]->setBatchMode (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BatchToolPanelCoordinator::selectionChanged (const std::vector<Thumbnail*>& selected) {
|
void BatchToolPanelCoordinator::selectionChanged (const std::vector<Thumbnail*>& selected) {
|
||||||
|
|
||||||
if (selected!=this->selected) {
|
if (selected!=this->selected) {
|
||||||
closeSession ();
|
closeSession ();
|
||||||
this->selected = selected;
|
this->selected = selected;
|
||||||
selFileNames.clear ();
|
selFileNames.clear ();
|
||||||
for (int i=0; i<selected.size(); i++)
|
for (int i=0; i<selected.size(); i++)
|
||||||
selFileNames.push_back (selected[i]->getFileName ());
|
selFileNames.push_back (selected[i]->getFileName ());
|
||||||
initSession ();
|
initSession ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BatchToolPanelCoordinator::closeSession (bool save) {
|
void BatchToolPanelCoordinator::closeSession (bool save) {
|
||||||
|
|
||||||
pparamsEdited.set (false);
|
pparamsEdited.set (false);
|
||||||
|
|
||||||
for (int i=0; i<selected.size(); i++)
|
for (int i=0; i<selected.size(); i++)
|
||||||
selected[i]->removeThumbnailListener (this);
|
selected[i]->removeThumbnailListener (this);
|
||||||
|
|
||||||
if (somethingChanged && save) {
|
if (somethingChanged && save) {
|
||||||
|
|
||||||
// read new values from the gui
|
// read new values from the gui
|
||||||
for (int i=0; i<toolPanels.size(); i++)
|
for (int i=0; i<toolPanels.size(); i++)
|
||||||
toolPanels[i]->write (&pparams, &pparamsEdited);
|
toolPanels[i]->write (&pparams, &pparamsEdited);
|
||||||
|
|
||||||
// combine with initial parameters and set
|
// combine with initial parameters and set
|
||||||
ProcParams newParams;
|
ProcParams newParams;
|
||||||
for (int i=0; i<selected.size(); i++) {
|
for (int i=0; i<selected.size(); i++) {
|
||||||
newParams = initialPP[i];
|
newParams = initialPP[i];
|
||||||
pparamsEdited.combine (newParams, pparams);
|
pparamsEdited.combine (newParams, pparams, selected.size()==1);
|
||||||
selected[i]->setProcParams (newParams, BATCHEDITOR, true);
|
|
||||||
}
|
// trim new adjuster's values to the adjuster's limits
|
||||||
}
|
for (unsigned int j=0; j<toolPanels.size(); j++)
|
||||||
for (int i=0; i<paramcListeners.size(); i++)
|
toolPanels[j]->trimValues (&newParams);
|
||||||
paramcListeners[i]->clearParamChanges ();
|
|
||||||
}
|
selected[i]->setProcParams (newParams, BATCHEDITOR, true);
|
||||||
|
}
|
||||||
void BatchToolPanelCoordinator::initSession () {
|
}
|
||||||
|
for (int i=0; i<paramcListeners.size(); i++)
|
||||||
somethingChanged = false;
|
paramcListeners[i]->clearParamChanges ();
|
||||||
|
}
|
||||||
initialPP.resize (selected.size());
|
|
||||||
for (int i=0; i<selected.size(); i++) {
|
void BatchToolPanelCoordinator::initSession () {
|
||||||
initialPP[i] = selected[i]->getProcParams ();
|
|
||||||
selected[i]->applyAutoExp (initialPP[i]);
|
somethingChanged = false;
|
||||||
selected[i]->addThumbnailListener (this);
|
|
||||||
}
|
initialPP.resize (selected.size());
|
||||||
|
for (int i=0; i<selected.size(); i++) {
|
||||||
pparamsEdited.initFrom (initialPP);
|
initialPP[i] = selected[i]->getProcParams ();
|
||||||
|
selected[i]->applyAutoExp (initialPP[i]);
|
||||||
/* curve->setAdjusterBehavior (false, false, false, false);
|
selected[i]->addThumbnailListener (this);
|
||||||
whitebalance->setAdjusterBehavior (false, false);
|
}
|
||||||
vignetting->setAdjusterBehavior (false);
|
|
||||||
rotate->setAdjusterBehavior (false);
|
pparamsEdited.initFrom (initialPP);
|
||||||
distortion->setAdjusterBehavior (false);
|
|
||||||
cacorrection->setAdjusterBehavior (false, false);
|
crop->setDimensions (100000, 100000);
|
||||||
colorshift->setAdjusterBehavior (false, false);
|
|
||||||
colorboost->setAdjusterBehavior (false);
|
/* if (selected.size()>0) {
|
||||||
lumadenoise->setAdjusterBehavior (false);
|
pparams = selected[0]->getProcParams ();
|
||||||
sharpening->setAdjusterBehavior (false);
|
for (int i=0; i<toolPanels.size(); i++) {
|
||||||
shadowshighlights->setAdjusterBehavior (false, false, false);
|
toolPanels[i]->setDefaults (&pparams, &pparamsEdited);
|
||||||
*/
|
toolPanels[i]->read (&pparams, &pparamsEdited);
|
||||||
crop->setDimensions (100000, 100000);
|
}
|
||||||
|
for (int i=0; i<paramcListeners.size(); i++)
|
||||||
/* if (selected.size()>0) {
|
paramcListeners[i]->procParamsChanged (&pparams, rtengine::EvPhotoLoaded, "batch processing", &pparamsEdited);
|
||||||
pparams = selected[0]->getProcParams ();
|
}
|
||||||
for (int i=0; i<toolPanels.size(); i++) {
|
*/
|
||||||
toolPanels[i]->setDefaults (&pparams, &pparamsEdited);
|
|
||||||
toolPanels[i]->read (&pparams, &pparamsEdited);
|
if (selected.size()>0) {
|
||||||
}
|
|
||||||
for (int i=0; i<paramcListeners.size(); i++)
|
// The first selected image (in the thumbnail list, not the click list) is used to populate the EditorPanel and set the default values
|
||||||
paramcListeners[i]->procParamsChanged (&pparams, rtengine::EvPhotoLoaded, "batch processing", &pparamsEdited);
|
pparams = selected[0]->getProcParams ();
|
||||||
}
|
|
||||||
*/
|
coarse->initBatchBehavior ();
|
||||||
|
|
||||||
if (selected.size()>0) {
|
if (selected.size()==1) {
|
||||||
|
|
||||||
pparams = selected[0]->getProcParams ();
|
toneCurve->setAdjusterBehavior (false, false, false, false, false, false, false, false);
|
||||||
coarse->initBatchBehavior ();
|
lcurve->setAdjusterBehavior (false, false, false);
|
||||||
|
whitebalance->setAdjusterBehavior (false, false);
|
||||||
toneCurve->setAdjusterBehavior (options.baBehav[ADDSET_TC_EXPCOMP], options.baBehav[ADDSET_TC_HLCOMPAMOUNT],options.baBehav[ADDSET_TC_HLCOMPTHRESH], options.baBehav[ADDSET_TC_BRIGHTNESS], options.baBehav[ADDSET_TC_BLACKLEVEL],options.baBehav[ADDSET_TC_SHCOMP], options.baBehav[ADDSET_TC_CONTRAST], options.baBehav[ADDSET_TC_SATURATION]);
|
vignetting->setAdjusterBehavior (false);
|
||||||
lcurve->setAdjusterBehavior (options.baBehav[ADDSET_LC_BRIGHTNESS], options.baBehav[ADDSET_LC_CONTRAST], options.baBehav[ADDSET_LC_SATURATION]);
|
rotate->setAdjusterBehavior (false);
|
||||||
whitebalance->setAdjusterBehavior (options.baBehav[ADDSET_WB_TEMPERATURE], options.baBehav[ADDSET_WB_GREEN]);
|
distortion->setAdjusterBehavior (false);
|
||||||
vignetting->setAdjusterBehavior (options.baBehav[ADDSET_VIGN_AMOUNT]);
|
perspective->setAdjusterBehavior (false);
|
||||||
rotate->setAdjusterBehavior (options.baBehav[ADDSET_ROTATE_DEGREE]);
|
cacorrection->setAdjusterBehavior (false);
|
||||||
distortion->setAdjusterBehavior (options.baBehav[ADDSET_DIST_AMOUNT]);
|
//colorshift->setAdjusterBehavior (false, false);
|
||||||
perspective->setAdjusterBehavior (options.baBehav[ADDSET_PERSPECTIVE]);
|
//colorboost->setAdjusterBehavior (false);
|
||||||
cacorrection->setAdjusterBehavior (options.baBehav[ADDSET_CA]);
|
//lumadenoise->setAdjusterBehavior (false);
|
||||||
//colorshift->setAdjusterBehavior (options.baBehav[ADDSET_CS_BLUEYELLOW], options.baBehav[ADDSET_CS_GREENMAGENTA]);
|
sharpening->setAdjusterBehavior (false);
|
||||||
//colorboost->setAdjusterBehavior (options.baBehav[ADDSET_CBOOST_AMOUNT]);
|
chmixer->setAdjusterBehavior (false);
|
||||||
//lumadenoise->setAdjusterBehavior (options.baBehav[ADDSET_LD_EDGETOLERANCE]);
|
shadowshighlights->setAdjusterBehavior (false, false, false);
|
||||||
sharpening->setAdjusterBehavior (options.baBehav[ADDSET_SHARP_AMOUNT]);
|
dirpyrequalizer->setAdjusterBehavior (false);
|
||||||
shadowshighlights->setAdjusterBehavior (options.baBehav[ADDSET_SH_HIGHLIGHTS], options.baBehav[ADDSET_SH_SHADOWS], options.baBehav[ADDSET_SH_LOCALCONTRAST]);
|
dirpyrdenoise->setAdjusterBehavior (false, false);
|
||||||
|
preprocess->setAdjusterBehavior (false, false);
|
||||||
if (options.baBehav[ADDSET_TC_EXPCOMP]) pparams.toneCurve.expcomp = 0;
|
rawcacorrection->setAdjusterBehavior (false);
|
||||||
if (options.baBehav[ADDSET_TC_HLCOMPAMOUNT]) pparams.toneCurve.hlcompr = 0;
|
rawexposure->setAdjusterBehavior (false, false, false);
|
||||||
if (options.baBehav[ADDSET_TC_HLCOMPTHRESH]) pparams.toneCurve.hlcomprthresh = 0;
|
}
|
||||||
if (options.baBehav[ADDSET_TC_BRIGHTNESS]) pparams.toneCurve.brightness = 0;
|
else {
|
||||||
if (options.baBehav[ADDSET_TC_BLACKLEVEL]) pparams.toneCurve.black = 0;
|
|
||||||
if (options.baBehav[ADDSET_TC_SHCOMP]) pparams.toneCurve.shcompr = 0;
|
toneCurve->setAdjusterBehavior (options.baBehav[ADDSET_TC_EXPCOMP], options.baBehav[ADDSET_TC_HLCOMPAMOUNT],options.baBehav[ADDSET_TC_HLCOMPTHRESH], options.baBehav[ADDSET_TC_BRIGHTNESS], options.baBehav[ADDSET_TC_BLACKLEVEL],options.baBehav[ADDSET_TC_SHCOMP], options.baBehav[ADDSET_TC_CONTRAST], options.baBehav[ADDSET_TC_SATURATION]);
|
||||||
if (options.baBehav[ADDSET_TC_CONTRAST]) pparams.toneCurve.contrast = 0;
|
lcurve->setAdjusterBehavior (options.baBehav[ADDSET_LC_BRIGHTNESS], options.baBehav[ADDSET_LC_CONTRAST], options.baBehav[ADDSET_LC_SATURATION]);
|
||||||
|
whitebalance->setAdjusterBehavior (options.baBehav[ADDSET_WB_TEMPERATURE], options.baBehav[ADDSET_WB_GREEN]);
|
||||||
if (options.baBehav[ADDSET_SH_HIGHLIGHTS]) pparams.sh.highlights = 0;
|
vignetting->setAdjusterBehavior (options.baBehav[ADDSET_VIGN_AMOUNT]);
|
||||||
if (options.baBehav[ADDSET_SH_SHADOWS]) pparams.sh.shadows = 0;
|
rotate->setAdjusterBehavior (options.baBehav[ADDSET_ROTATE_DEGREE]);
|
||||||
if (options.baBehav[ADDSET_SH_LOCALCONTRAST]) pparams.sh.localcontrast = 0;
|
distortion->setAdjusterBehavior (options.baBehav[ADDSET_DIST_AMOUNT]);
|
||||||
|
perspective->setAdjusterBehavior (options.baBehav[ADDSET_PERSPECTIVE]);
|
||||||
if (options.baBehav[ADDSET_LC_BRIGHTNESS]) pparams.labCurve.brightness = 0;
|
cacorrection->setAdjusterBehavior (options.baBehav[ADDSET_CA]);
|
||||||
if (options.baBehav[ADDSET_LC_CONTRAST]) pparams.labCurve.contrast = 0;
|
//colorshift->setAdjusterBehavior (options.baBehav[ADDSET_CS_BLUEYELLOW], options.baBehav[ADDSET_CS_GREENMAGENTA]);
|
||||||
if (options.baBehav[ADDSET_LC_SATURATION]) pparams.labCurve.saturation = 0;
|
//colorboost->setAdjusterBehavior (options.baBehav[ADDSET_CBOOST_AMOUNT]);
|
||||||
|
//lumadenoise->setAdjusterBehavior (options.baBehav[ADDSET_LD_EDGETOLERANCE]);
|
||||||
if (options.baBehav[ADDSET_SHARP_AMOUNT]) pparams.sharpening.amount = 0;
|
sharpening->setAdjusterBehavior (options.baBehav[ADDSET_SHARP_AMOUNT]);
|
||||||
if (options.baBehav[ADDSET_LD_EDGETOLERANCE]) pparams.lumaDenoise.edgetolerance = 0;
|
chmixer->setAdjusterBehavior (options.baBehav[ADDSET_CHMIXER]);
|
||||||
|
shadowshighlights->setAdjusterBehavior (options.baBehav[ADDSET_SH_HIGHLIGHTS], options.baBehav[ADDSET_SH_SHADOWS], options.baBehav[ADDSET_SH_LOCALCONTRAST]);
|
||||||
if (options.baBehav[ADDSET_WB_TEMPERATURE]) pparams.wb.temperature = 0;
|
dirpyrequalizer->setAdjusterBehavior (options.baBehav[ADDSET_DIRPYREQ]);
|
||||||
if (options.baBehav[ADDSET_WB_GREEN]) pparams.wb.green = 0;
|
dirpyrdenoise->setAdjusterBehavior (options.baBehav[ADDSET_DIRPYRDN_CHLUM], options.baBehav[ADDSET_DIRPYRDN_GAMMA]);
|
||||||
|
preprocess->setAdjusterBehavior (options.baBehav[ADDSET_PREPROCESS_LINEDENOISE], options.baBehav[ADDSET_PREPROCESS_GREENEQUIL]);
|
||||||
if (options.baBehav[ADDSET_CBOOST_AMOUNT]) pparams.colorBoost.amount = 0;
|
rawcacorrection->setAdjusterBehavior (options.baBehav[ADDSET_RAWCACORR]);
|
||||||
|
rawexposure->setAdjusterBehavior (options.baBehav[ADDSET_RAWEXPOS_LINEAR], options.baBehav[ADDSET_RAWEXPOS_PRESER], options.baBehav[ADDSET_RAWEXPOS_BLACKS]);
|
||||||
if (options.baBehav[ADDSET_CS_BLUEYELLOW]) pparams.colorShift.a = 0;
|
|
||||||
if (options.baBehav[ADDSET_CS_GREENMAGENTA]) pparams.colorShift.b = 0;
|
if (options.baBehav[ADDSET_TC_EXPCOMP]) pparams.toneCurve.expcomp = 0;
|
||||||
|
if (options.baBehav[ADDSET_TC_HLCOMPAMOUNT]) pparams.toneCurve.hlcompr = 0;
|
||||||
if (options.baBehav[ADDSET_ROTATE_DEGREE]) pparams.rotate.degree = 0;
|
if (options.baBehav[ADDSET_TC_HLCOMPTHRESH]) pparams.toneCurve.hlcomprthresh = 0;
|
||||||
if (options.baBehav[ADDSET_DIST_AMOUNT]) pparams.distortion.amount = 0;
|
if (options.baBehav[ADDSET_TC_BRIGHTNESS]) pparams.toneCurve.brightness = 0;
|
||||||
if (options.baBehav[ADDSET_PERSPECTIVE]) pparams.perspective.horizontal = pparams.perspective.vertical = 0;
|
if (options.baBehav[ADDSET_TC_BLACKLEVEL]) pparams.toneCurve.black = 0;
|
||||||
if (options.baBehav[ADDSET_CA]) pparams.cacorrection.red = 0;
|
if (options.baBehav[ADDSET_TC_SHCOMP]) pparams.toneCurve.shcompr = 0;
|
||||||
if (options.baBehav[ADDSET_CA]) pparams.cacorrection.blue = 0;
|
if (options.baBehav[ADDSET_TC_CONTRAST]) pparams.toneCurve.contrast = 0;
|
||||||
if (options.baBehav[ADDSET_VIGN_AMOUNT]) pparams.vignetting.amount = 0;
|
|
||||||
|
if (options.baBehav[ADDSET_SH_HIGHLIGHTS]) pparams.sh.highlights = 0;
|
||||||
for (int i=0; i<toolPanels.size(); i++) {
|
if (options.baBehav[ADDSET_SH_SHADOWS]) pparams.sh.shadows = 0;
|
||||||
toolPanels[i]->setDefaults (&pparams, &pparamsEdited);
|
if (options.baBehav[ADDSET_SH_LOCALCONTRAST]) pparams.sh.localcontrast = 0;
|
||||||
toolPanels[i]->read (&pparams, &pparamsEdited);
|
|
||||||
}
|
if (options.baBehav[ADDSET_LC_BRIGHTNESS]) pparams.labCurve.brightness = 0;
|
||||||
for (int i=0; i<paramcListeners.size(); i++)
|
if (options.baBehav[ADDSET_LC_CONTRAST]) pparams.labCurve.contrast = 0;
|
||||||
paramcListeners[i]->procParamsChanged (&pparams, rtengine::EvPhotoLoaded, M("BATCH_PROCESSING"), &pparamsEdited);
|
if (options.baBehav[ADDSET_LC_SATURATION]) pparams.labCurve.saturation = 0;
|
||||||
}
|
|
||||||
}
|
if (options.baBehav[ADDSET_SHARP_AMOUNT]) pparams.sharpening.amount = 0;
|
||||||
|
if (options.baBehav[ADDSET_CHMIXER]) for (int i=0; i<3; i++) pparams.chmixer.red[i] = pparams.chmixer.green[i] = pparams.chmixer.blue[i] = 0;
|
||||||
void BatchToolPanelCoordinator::panelChanged (rtengine::ProcEvent event, const Glib::ustring& descr) {
|
if (options.baBehav[ADDSET_LD_EDGETOLERANCE]) pparams.lumaDenoise.edgetolerance = 0;
|
||||||
|
|
||||||
if (selected.size()==0)
|
if (options.baBehav[ADDSET_WB_TEMPERATURE]) pparams.wb.temperature = 0;
|
||||||
return;
|
if (options.baBehav[ADDSET_WB_GREEN]) pparams.wb.green = 0;
|
||||||
|
|
||||||
somethingChanged = true;
|
if (options.baBehav[ADDSET_CBOOST_AMOUNT]) pparams.colorBoost.amount = 0;
|
||||||
|
|
||||||
pparamsEdited.set (false);
|
if (options.baBehav[ADDSET_CS_BLUEYELLOW]) pparams.colorShift.a = 0;
|
||||||
// read new values from the gui
|
if (options.baBehav[ADDSET_CS_GREENMAGENTA]) pparams.colorShift.b = 0;
|
||||||
for (int i=0; i<toolPanels.size(); i++)
|
|
||||||
toolPanels[i]->write (&pparams, &pparamsEdited);
|
if (options.baBehav[ADDSET_ROTATE_DEGREE]) pparams.rotate.degree = 0;
|
||||||
|
if (options.baBehav[ADDSET_DIST_AMOUNT]) pparams.distortion.amount = 0;
|
||||||
// TODO: We may update the crop on coarse rotate events here, like in ToolPanelCoordinator::panelChanged
|
if (options.baBehav[ADDSET_PERSPECTIVE]) pparams.perspective.horizontal = pparams.perspective.vertical = 0;
|
||||||
|
if (options.baBehav[ADDSET_CA]) pparams.cacorrection.red = 0;
|
||||||
if (event==rtengine::EvAutoExp || event==rtengine::EvClip)
|
if (options.baBehav[ADDSET_CA]) pparams.cacorrection.blue = 0;
|
||||||
for (int i=0; i<selected.size(); i++) {
|
if (options.baBehav[ADDSET_VIGN_AMOUNT]) pparams.vignetting.amount = 0;
|
||||||
initialPP[i].toneCurve.autoexp = pparams.toneCurve.autoexp;
|
|
||||||
initialPP[i].toneCurve.clip = pparams.toneCurve.clip;
|
if (options.baBehav[ADDSET_DIRPYREQ]) for (int i=0; i<5; i++) pparams.dirpyrequalizer.mult[i] = 0;
|
||||||
selected[i]->applyAutoExp (initialPP[i]);
|
if (options.baBehav[ADDSET_DIRPYRDN_CHLUM]) pparams.dirpyrDenoise.luma = pparams.dirpyrDenoise.chroma = 0;
|
||||||
}
|
if (options.baBehav[ADDSET_DIRPYRDN_GAMMA]) pparams.dirpyrDenoise.gamma = 0;
|
||||||
|
|
||||||
if (event==rtengine::EvAutoDIST) {
|
if (options.baBehav[ADDSET_PREPROCESS_GREENEQUIL]) pparams.raw.greenthresh = 0;
|
||||||
for (int i=0; i<selected.size(); i++) {
|
if (options.baBehav[ADDSET_PREPROCESS_LINEDENOISE]) pparams.raw.linenoise = 0;
|
||||||
initialPP[i].distortion.amount = pparams.distortion.amount;
|
if (options.baBehav[ADDSET_RAWCACORR]) pparams.raw.cablue = pparams.raw.cared = 0;
|
||||||
}
|
if (options.baBehav[ADDSET_RAWEXPOS_LINEAR]) pparams.raw.expos = 0;
|
||||||
}
|
if (options.baBehav[ADDSET_RAWEXPOS_PRESER]) pparams.raw.preser = 0;
|
||||||
|
if (options.baBehav[ADDSET_RAWEXPOS_BLACKS]) pparams.raw.blackzero = pparams.raw.blackone = pparams.raw.blacktwo = pparams.raw.blackthree = 0;
|
||||||
// combine with initial parameters and set
|
}
|
||||||
ProcParams newParams;
|
|
||||||
for (int i=0; i<selected.size(); i++) {
|
for (int i=0; i<toolPanels.size(); i++) {
|
||||||
newParams = initialPP[i];
|
toolPanels[i]->setDefaults (&pparams, &pparamsEdited);
|
||||||
pparamsEdited.combine (newParams, pparams);
|
toolPanels[i]->read (&pparams, &pparamsEdited);
|
||||||
selected[i]->setProcParams (newParams, BATCHEDITOR, false);
|
}
|
||||||
}
|
for (int i=0; i<paramcListeners.size(); i++)
|
||||||
|
paramcListeners[i]->procParamsChanged (&pparams, rtengine::EvPhotoLoaded, M("BATCH_PROCESSING"), &pparamsEdited);
|
||||||
for (int i=0; i<paramcListeners.size(); i++)
|
}
|
||||||
paramcListeners[i]->procParamsChanged (&pparams, event, descr, &pparamsEdited);
|
}
|
||||||
}
|
|
||||||
|
void BatchToolPanelCoordinator::panelChanged (rtengine::ProcEvent event, const Glib::ustring& descr) {
|
||||||
void BatchToolPanelCoordinator::getAutoWB (double& temp, double& green) {
|
|
||||||
|
if (selected.size()==0)
|
||||||
if (selected.size()>0)
|
return;
|
||||||
selected[0]->getAutoWB (temp, green);
|
|
||||||
}
|
somethingChanged = true;
|
||||||
|
|
||||||
void BatchToolPanelCoordinator::getCamWB (double& temp, double& green) {
|
pparamsEdited.set (false);
|
||||||
|
// read new values from the gui
|
||||||
if (selected.size()>0)
|
for (int i=0; i<toolPanels.size(); i++)
|
||||||
selected[0]->getCamWB (temp, green);
|
toolPanels[i]->write (&pparams, &pparamsEdited);
|
||||||
}
|
|
||||||
|
// TODO: We may update the crop on coarse rotate events here, like in ToolPanelCoordinator::panelChanged
|
||||||
void BatchToolPanelCoordinator::optionsChanged () {
|
|
||||||
|
if (event==rtengine::EvAutoExp || event==rtengine::EvClip)
|
||||||
closeSession ();
|
for (int i=0; i<selected.size(); i++) {
|
||||||
initSession ();
|
initialPP[i].toneCurve.autoexp = pparams.toneCurve.autoexp;
|
||||||
}
|
initialPP[i].toneCurve.clip = pparams.toneCurve.clip;
|
||||||
|
selected[i]->applyAutoExp (initialPP[i]);
|
||||||
void BatchToolPanelCoordinator::procParamsChanged (Thumbnail* thm, int whoChangedIt) {
|
}
|
||||||
|
|
||||||
if (whoChangedIt!=BATCHEDITOR) {
|
if (event==rtengine::EvAutoDIST) {
|
||||||
closeSession (false);
|
for (int i=0; i<selected.size(); i++) {
|
||||||
initSession ();
|
initialPP[i].distortion.amount = pparams.distortion.amount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BatchToolPanelCoordinator::profileChange (const ProcParams *nparams, rtengine::ProcEvent event, const Glib::ustring& descr, const ParamsEdited* paramsEdited) {
|
// combine with initial parameters and set
|
||||||
|
ProcParams newParams;
|
||||||
pparams = *nparams;
|
for (int i=0; i<selected.size(); i++) {
|
||||||
if (paramsEdited)
|
newParams = initialPP[i];
|
||||||
pparamsEdited = *paramsEdited;
|
// If only one file is selected, slider's addMode has been set to false, and hence the behave
|
||||||
|
// like in SET mode like in an editor ; that's why we force the combination to the SET mode too
|
||||||
for (int i=0; i<toolPanels.size(); i++)
|
pparamsEdited.combine (newParams, pparams, selected.size()==1);
|
||||||
toolPanels[i]->read (&pparams, &pparamsEdited);
|
|
||||||
|
// trim new adjuster's values to the adjuster's limits
|
||||||
somethingChanged = true;
|
for (unsigned int j=0; j<toolPanels.size(); j++)
|
||||||
|
toolPanels[j]->trimValues (&newParams);
|
||||||
// read new values from the gui
|
|
||||||
for (int i=0; i<toolPanels.size(); i++)
|
selected[i]->setProcParams (newParams, BATCHEDITOR, false);
|
||||||
toolPanels[i]->write (&pparams, &pparamsEdited);
|
}
|
||||||
|
|
||||||
// combine with initial parameters and set
|
for (int i=0; i<paramcListeners.size(); i++)
|
||||||
ProcParams newParams;
|
paramcListeners[i]->procParamsChanged (&pparams, event, descr, &pparamsEdited);
|
||||||
for (int i=0; i<selected.size(); i++) {
|
}
|
||||||
newParams = initialPP[i];
|
|
||||||
pparamsEdited.combine (newParams, pparams);
|
void BatchToolPanelCoordinator::getAutoWB (double& temp, double& green) {
|
||||||
selected[i]->setProcParams (newParams, BATCHEDITOR, false);
|
|
||||||
}
|
if (selected.size()>0)
|
||||||
|
selected[0]->getAutoWB (temp, green);
|
||||||
for (int i=0; i<paramcListeners.size(); i++)
|
}
|
||||||
paramcListeners[i]->procParamsChanged (&pparams, event, descr, &pparamsEdited);
|
|
||||||
}
|
void BatchToolPanelCoordinator::getCamWB (double& temp, double& green) {
|
||||||
|
|
||||||
void BatchToolPanelCoordinator::cropSelectionReady () {
|
if (selected.size()>0)
|
||||||
|
selected[0]->getCamWB (temp, green);
|
||||||
toolBar->setTool (TMHand);
|
}
|
||||||
}
|
|
||||||
|
void BatchToolPanelCoordinator::optionsChanged () {
|
||||||
CropGUIListener* BatchToolPanelCoordinator::startCropEditing (Thumbnail* thm) {
|
|
||||||
|
closeSession ();
|
||||||
if (thm) {
|
initSession ();
|
||||||
int w, h;
|
}
|
||||||
thm->getFinalSize (thm->getProcParams (), w, h);
|
|
||||||
crop->setDimensions (w, h);
|
void BatchToolPanelCoordinator::procParamsChanged (Thumbnail* thm, int whoChangedIt) {
|
||||||
}
|
|
||||||
return crop;
|
if (whoChangedIt!=BATCHEDITOR) {
|
||||||
}
|
closeSession (false);
|
||||||
|
initSession ();
|
||||||
void BatchToolPanelCoordinator::rotateSelectionReady (double rotate_deg, Thumbnail* thm) {
|
}
|
||||||
|
}
|
||||||
toolBar->setTool (TMHand);
|
|
||||||
if (rotate_deg!=0.0)
|
void BatchToolPanelCoordinator::profileChange (const ProcParams *nparams, rtengine::ProcEvent event, const Glib::ustring& descr, const ParamsEdited* paramsEdited) {
|
||||||
rotate->straighten (rotate_deg);
|
|
||||||
}
|
pparams = *nparams;
|
||||||
|
if (paramsEdited)
|
||||||
void BatchToolPanelCoordinator::spotWBselected (int x, int y, Thumbnail* thm) {
|
pparamsEdited = *paramsEdited;
|
||||||
|
|
||||||
// toolBar->setTool (TOOL_HAND);
|
for (int i=0; i<toolPanels.size(); i++)
|
||||||
if (x>0 && y>0 && thm) {
|
toolPanels[i]->read (&pparams, &pparamsEdited);
|
||||||
for (int i=0; i<selected.size(); i++)
|
|
||||||
if (selected[i]==thm) {
|
somethingChanged = true;
|
||||||
double temp;
|
|
||||||
double green;
|
// read new values from the gui
|
||||||
thm->getSpotWB (x, y, whitebalance->getSize(), temp, green);
|
for (int i=0; i<toolPanels.size(); i++)
|
||||||
double otemp = initialPP[i].wb.temperature;
|
toolPanels[i]->write (&pparams, &pparamsEdited);
|
||||||
double ogreen = initialPP[i].wb.green;
|
|
||||||
if (options.baBehav[12])
|
// combine with initial parameters and set
|
||||||
temp = temp - otemp;
|
ProcParams newParams;
|
||||||
if (options.baBehav[13])
|
for (int i=0; i<selected.size(); i++) {
|
||||||
green = green - ogreen;
|
newParams = initialPP[i];
|
||||||
whitebalance->setWB (temp, green);
|
pparamsEdited.combine (newParams, pparams, true);
|
||||||
}
|
selected[i]->setProcParams (newParams, BATCHEDITOR, false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
for (int i=0; i<paramcListeners.size(); i++)
|
||||||
|
paramcListeners[i]->procParamsChanged (&pparams, event, descr, &pparamsEdited);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BatchToolPanelCoordinator::cropSelectionReady () {
|
||||||
|
|
||||||
|
toolBar->setTool (TMHand);
|
||||||
|
}
|
||||||
|
|
||||||
|
CropGUIListener* BatchToolPanelCoordinator::startCropEditing (Thumbnail* thm) {
|
||||||
|
|
||||||
|
if (thm) {
|
||||||
|
int w, h;
|
||||||
|
thm->getFinalSize (thm->getProcParams (), w, h);
|
||||||
|
crop->setDimensions (w, h);
|
||||||
|
}
|
||||||
|
return crop;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BatchToolPanelCoordinator::rotateSelectionReady (double rotate_deg, Thumbnail* thm) {
|
||||||
|
|
||||||
|
toolBar->setTool (TMHand);
|
||||||
|
if (rotate_deg!=0.0)
|
||||||
|
rotate->straighten (rotate_deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BatchToolPanelCoordinator::spotWBselected (int x, int y, Thumbnail* thm) {
|
||||||
|
|
||||||
|
// toolBar->setTool (TOOL_HAND);
|
||||||
|
if (x>0 && y>0 && thm) {
|
||||||
|
for (int i=0; i<selected.size(); i++)
|
||||||
|
if (selected[i]==thm) {
|
||||||
|
double temp;
|
||||||
|
double green;
|
||||||
|
thm->getSpotWB (x, y, whitebalance->getSize(), temp, green);
|
||||||
|
double otemp = initialPP[i].wb.temperature;
|
||||||
|
double ogreen = initialPP[i].wb.green;
|
||||||
|
if (options.baBehav[12])
|
||||||
|
temp = temp - otemp;
|
||||||
|
if (options.baBehav[13])
|
||||||
|
green = green - ogreen;
|
||||||
|
whitebalance->setWB (temp, green);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
using namespace rtengine;
|
using namespace rtengine;
|
||||||
using namespace rtengine::procparams;
|
using namespace rtengine::procparams;
|
||||||
|
|
||||||
CACorrection::CACorrection () : Gtk::VBox(), FoldableToolPanel(this), vAdd(false) {
|
CACorrection::CACorrection () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||||
|
|
||||||
red = Gtk::manage (new Adjuster (M("TP_CACORRECTION_RED"), -0.005, 0.005, 0.0001, 0));
|
red = Gtk::manage (new Adjuster (M("TP_CACORRECTION_RED"), -0.005, 0.005, 0.0001, 0));
|
||||||
red->setAdjusterListener (this);
|
red->setAdjusterListener (this);
|
||||||
@@ -85,12 +85,14 @@ void CACorrection::adjusterChanged (Adjuster* a, double newval) {
|
|||||||
|
|
||||||
void CACorrection::setAdjusterBehavior (bool badd) {
|
void CACorrection::setAdjusterBehavior (bool badd) {
|
||||||
|
|
||||||
if ((!vAdd && badd) || (vAdd && !badd)) {
|
red->setAddMode(badd);
|
||||||
red->setLimits (-0.005, 0.005, 0.0001, 0);
|
blue->setAddMode(badd);
|
||||||
blue->setLimits (-0.005, 0.005, 0.0001, 0);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
vAdd = badd;
|
void CACorrection::trimValues (rtengine::procparams::ProcParams* pp) {
|
||||||
|
|
||||||
|
red->trimValue(pp->cacorrection.red);
|
||||||
|
blue->trimValue(pp->cacorrection.blue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CACorrection::setBatchMode (bool batchMode) {
|
void CACorrection::setBatchMode (bool batchMode) {
|
||||||
|
@@ -28,7 +28,6 @@ class CACorrection : public Gtk::VBox, public AdjusterListener, public FoldableT
|
|||||||
protected:
|
protected:
|
||||||
Adjuster* red;
|
Adjuster* red;
|
||||||
Adjuster* blue;
|
Adjuster* blue;
|
||||||
bool vAdd;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -41,6 +40,7 @@ class CACorrection : public Gtk::VBox, public AdjusterListener, public FoldableT
|
|||||||
|
|
||||||
void adjusterChanged (Adjuster* a, double newval);
|
void adjusterChanged (Adjuster* a, double newval);
|
||||||
void setAdjusterBehavior (bool badd);
|
void setAdjusterBehavior (bool badd);
|
||||||
|
void trimValues (rtengine::procparams::ProcParams* pp);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -149,3 +149,21 @@ void ChMixer::setBatchMode (bool batchMode) {
|
|||||||
blue[i]->showEditedCB ();
|
blue[i]->showEditedCB ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ChMixer::setAdjusterBehavior (bool rgbadd) {
|
||||||
|
|
||||||
|
for (int i=0; i<3; i++) {
|
||||||
|
red[i]->setAddMode(rgbadd);
|
||||||
|
green[i]->setAddMode(rgbadd);
|
||||||
|
blue[i]->setAddMode(rgbadd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ChMixer::trimValues (rtengine::procparams::ProcParams* pp) {
|
||||||
|
|
||||||
|
for (int i=0; i<3; i++) {
|
||||||
|
red[i]->trimValue(pp->chmixer.red[i]);
|
||||||
|
green[i]->trimValue(pp->chmixer.green[i]);
|
||||||
|
blue[i]->trimValue(pp->chmixer.blue[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -40,6 +40,8 @@ class ChMixer : public Gtk::VBox, public AdjusterListener, public FoldableToolPa
|
|||||||
void setBatchMode (bool batchMode);
|
void setBatchMode (bool batchMode);
|
||||||
|
|
||||||
void adjusterChanged (Adjuster* a, double newval);
|
void adjusterChanged (Adjuster* a, double newval);
|
||||||
|
void setAdjusterBehavior (bool rgbadd);
|
||||||
|
void trimValues (rtengine::procparams::ProcParams* pp);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -138,13 +138,3 @@ void Defringe::setBatchMode (bool batchMode) {
|
|||||||
radius->showEditedCB ();
|
radius->showEditedCB ();
|
||||||
threshold->showEditedCB ();
|
threshold->showEditedCB ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*void Defringe::setAdjusterBehavior (bool bthresholdtoladd) {
|
|
||||||
|
|
||||||
if (!thresholdtolAdd && bthresholdtoladd)
|
|
||||||
threshold->setLimits (-10000, 10000, 100, 0);
|
|
||||||
else if (thresholdtolAdd && !bthresholdtoladd)
|
|
||||||
threshold->setLimits (100, 10000, 100, 1000);
|
|
||||||
|
|
||||||
thresholdtolAdd = bthresholdtoladd;
|
|
||||||
}*/
|
|
||||||
|
@@ -32,7 +32,6 @@ class Defringe : public Gtk::VBox, public AdjusterListener, public FoldableToolP
|
|||||||
bool lastEnabled;
|
bool lastEnabled;
|
||||||
sigc::connection enaConn;
|
sigc::connection enaConn;
|
||||||
bool edges;
|
bool edges;
|
||||||
bool thresholdtolAdd;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -46,7 +45,6 @@ class Defringe : public Gtk::VBox, public AdjusterListener, public FoldableToolP
|
|||||||
void adjusterChanged (Adjuster* a, double newval);
|
void adjusterChanged (Adjuster* a, double newval);
|
||||||
void enabledChanged ();
|
void enabledChanged ();
|
||||||
|
|
||||||
void setAdjusterBehavior (bool bthresholdtoladd);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -569,10 +569,10 @@ bool DiagonalCurveEditorSubGroup::curveReset(int cType) {
|
|||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
case (DCT_Parametric) :
|
case (DCT_Parametric) :
|
||||||
highlights->resetPressed();
|
highlights->resetPressed(NULL);
|
||||||
lights->resetPressed();
|
lights->resetPressed(NULL);
|
||||||
darks->resetPressed();
|
darks->resetPressed(NULL);
|
||||||
shadows->resetPressed();
|
shadows->resetPressed(NULL);
|
||||||
shcSelector->reset();
|
shcSelector->reset();
|
||||||
paramCurve->reset ();
|
paramCurve->reset ();
|
||||||
return true;
|
return true;
|
||||||
|
@@ -158,12 +158,16 @@ void DirPyrDenoise::setBatchMode (bool batchMode) {
|
|||||||
chroma->showEditedCB ();
|
chroma->showEditedCB ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*void DirPyrDenoise::setAdjusterBehavior (bool bedgetoladd) {
|
void DirPyrDenoise::setAdjusterBehavior (bool chrolumaadd, bool gammaadd) {
|
||||||
|
|
||||||
if (!edgetolAdd && bedgetoladd)
|
luma->setAddMode(chrolumaadd);
|
||||||
edge->setLimits (-10000, 10000, 100, 0);
|
chroma->setAddMode(chrolumaadd);
|
||||||
else if (edgetolAdd && !bedgetoladd)
|
gamma->setAddMode(gammaadd);
|
||||||
edge->setLimits (10, 30000, 100, 1500);
|
}
|
||||||
|
|
||||||
edgetolAdd = bedgetoladd;
|
void DirPyrDenoise::trimValues (rtengine::procparams::ProcParams* pp) {
|
||||||
}*/
|
|
||||||
|
luma->trimValue(pp->dirpyrDenoise.luma);
|
||||||
|
chroma->trimValue(pp->dirpyrDenoise.chroma);
|
||||||
|
gamma->trimValue(pp->dirpyrDenoise.gamma);
|
||||||
|
}
|
||||||
|
@@ -33,7 +33,6 @@ class DirPyrDenoise : public Gtk::VBox, public AdjusterListener, public Foldable
|
|||||||
Gtk::CheckButton* enabled;
|
Gtk::CheckButton* enabled;
|
||||||
bool lastEnabled;
|
bool lastEnabled;
|
||||||
sigc::connection enaConn;
|
sigc::connection enaConn;
|
||||||
bool edgetolAdd;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -45,9 +44,10 @@ class DirPyrDenoise : public Gtk::VBox, public AdjusterListener, public Foldable
|
|||||||
void setBatchMode (bool batchMode);
|
void setBatchMode (bool batchMode);
|
||||||
|
|
||||||
void adjusterChanged (Adjuster* a, double newval);
|
void adjusterChanged (Adjuster* a, double newval);
|
||||||
void enabledChanged ();
|
void enabledChanged ();
|
||||||
|
|
||||||
void setAdjusterBehavior (bool bedgetoladd);
|
void setAdjusterBehavior (bool chrolumaadd, bool gammaadd);
|
||||||
|
void trimValues (rtengine::procparams::ProcParams* pp);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -220,4 +220,14 @@ void DirPyrEqualizer::lumacontrastMinusPressed () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DirPyrEqualizer::setAdjusterBehavior (bool multiplieradd) {
|
||||||
|
|
||||||
|
for (int i=0; i<5; i++)
|
||||||
|
multiplier[i]->setAddMode(multiplieradd);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DirPyrEqualizer::trimValues (rtengine::procparams::ProcParams* pp) {
|
||||||
|
|
||||||
|
for (int i=0; i<5; i++)
|
||||||
|
multiplier[i]->trimValue(pp->dirpyrequalizer.mult[i]);
|
||||||
|
}
|
||||||
|
@@ -44,11 +44,13 @@ public:
|
|||||||
DirPyrEqualizer ();
|
DirPyrEqualizer ();
|
||||||
virtual ~DirPyrEqualizer ();
|
virtual ~DirPyrEqualizer ();
|
||||||
|
|
||||||
void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL);
|
void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL);
|
||||||
void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL);
|
void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL);
|
||||||
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL);
|
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL);
|
||||||
void setBatchMode (bool batchMode);
|
void setBatchMode (bool batchMode);
|
||||||
|
void setAdjusterBehavior (bool multiplieradd);
|
||||||
|
void trimValues (rtengine::procparams::ProcParams* pp);
|
||||||
|
|
||||||
void adjusterChanged (Adjuster* a, double newval);
|
void adjusterChanged (Adjuster* a, double newval);
|
||||||
void enabledToggled ();
|
void enabledToggled ();
|
||||||
void lumaneutralPressed ();
|
void lumaneutralPressed ();
|
||||||
|
@@ -1,109 +1,110 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of RawTherapee.
|
* This file is part of RawTherapee.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
|
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
|
||||||
*
|
*
|
||||||
* RawTherapee is free software: you can redistribute it and/or modify
|
* RawTherapee is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* RawTherapee is distributed in the hope that it will be useful,
|
* RawTherapee is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <distortion.h>
|
#include <distortion.h>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
extern Glib::ustring argv0;
|
extern Glib::ustring argv0;
|
||||||
|
|
||||||
using namespace rtengine;
|
using namespace rtengine;
|
||||||
using namespace rtengine::procparams;
|
using namespace rtengine::procparams;
|
||||||
|
|
||||||
Distortion::Distortion (): Gtk::VBox(), FoldableToolPanel(this) {
|
Distortion::Distortion (): Gtk::VBox(), FoldableToolPanel(this) {
|
||||||
|
|
||||||
rlistener = NULL;
|
rlistener = NULL;
|
||||||
autoDistor = Gtk::manage (new Gtk::Button (M("TP_DISTORTION_AUTO")));
|
autoDistor = Gtk::manage (new Gtk::Button (M("TP_DISTORTION_AUTO")));
|
||||||
autoDistor->set_image (*Gtk::manage (new Gtk::Image (argv0+"/images/distortion_auto.png")));
|
autoDistor->set_image (*Gtk::manage (new Gtk::Image (argv0+"/images/distortion_auto.png")));
|
||||||
autoDistor->set_tooltip_text (M("TP_DISTORTION_AUTO_TIP"));
|
autoDistor->set_tooltip_text (M("TP_DISTORTION_AUTO_TIP"));
|
||||||
idConn = autoDistor->signal_pressed().connect( sigc::mem_fun(*this, &Distortion::idPressed) );
|
idConn = autoDistor->signal_pressed().connect( sigc::mem_fun(*this, &Distortion::idPressed) );
|
||||||
autoDistor->show();
|
autoDistor->show();
|
||||||
pack_start (*autoDistor);
|
pack_start (*autoDistor);
|
||||||
|
|
||||||
distor = Gtk::manage (new Adjuster (M("TP_DISTORTION_AMOUNT"), -0.5, 0.5, 0.001, 0));
|
distor = Gtk::manage (new Adjuster (M("TP_DISTORTION_AMOUNT"), -0.5, 0.5, 0.001, 0));
|
||||||
distor->setAdjusterListener (this);
|
distor->setAdjusterListener (this);
|
||||||
distor->show();
|
distor->show();
|
||||||
pack_start (*distor);
|
pack_start (*distor);
|
||||||
distAdd = false;
|
}
|
||||||
}
|
|
||||||
|
void Distortion::read (const ProcParams* pp, const ParamsEdited* pedited) {
|
||||||
void Distortion::read (const ProcParams* pp, const ParamsEdited* pedited) {
|
|
||||||
|
disableListener ();
|
||||||
disableListener ();
|
|
||||||
|
if (pedited) {
|
||||||
if (pedited) {
|
distor->setEditedState (pedited->distortion.amount ? Edited : UnEdited);
|
||||||
distor->setEditedState (pedited->distortion.amount ? Edited : UnEdited);
|
}
|
||||||
}
|
|
||||||
|
distor->setValue (pp->distortion.amount);
|
||||||
distor->setValue (pp->distortion.amount);
|
|
||||||
|
enableListener ();
|
||||||
enableListener ();
|
}
|
||||||
}
|
|
||||||
|
void Distortion::write (ProcParams* pp, ParamsEdited* pedited) {
|
||||||
void Distortion::write (ProcParams* pp, ParamsEdited* pedited) {
|
|
||||||
|
pp->distortion.amount = distor->getValue ();
|
||||||
pp->distortion.amount = distor->getValue ();
|
|
||||||
|
if (pedited) {
|
||||||
if (pedited) {
|
pedited->distortion.amount = distor->getEditedState ();
|
||||||
pedited->distortion.amount = distor->getEditedState ();
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
void Distortion::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) {
|
||||||
void Distortion::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) {
|
|
||||||
|
distor->setDefault (defParams->distortion.amount);
|
||||||
distor->setDefault (defParams->distortion.amount);
|
|
||||||
|
if (pedited) {
|
||||||
if (pedited) {
|
distor->setDefaultEditedState (pedited->distortion.amount ? Edited : UnEdited);
|
||||||
distor->setDefaultEditedState (pedited->distortion.amount ? Edited : UnEdited);
|
}
|
||||||
}
|
else {
|
||||||
else {
|
distor->setDefaultEditedState (Irrelevant);
|
||||||
distor->setDefaultEditedState (Irrelevant);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
void Distortion::adjusterChanged (Adjuster* a, double newval) {
|
||||||
void Distortion::adjusterChanged (Adjuster* a, double newval) {
|
|
||||||
|
if (listener)
|
||||||
if (listener)
|
listener->panelChanged (EvDISTAmount, Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(3), a->getValue()));
|
||||||
listener->panelChanged (EvDISTAmount, Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(3), a->getValue()));
|
}
|
||||||
}
|
|
||||||
|
void Distortion::setBatchMode (bool batchMode) {
|
||||||
void Distortion::setAdjusterBehavior (bool bvadd) {
|
|
||||||
|
ToolPanel::setBatchMode (batchMode);
|
||||||
if ((!distAdd && bvadd) || (distAdd && !bvadd))
|
if (batchMode) {
|
||||||
distor->setLimits (-0.5, 0.5, 0.001, 0);
|
autoDistor->set_sensitive(false);
|
||||||
|
}
|
||||||
distAdd = bvadd;
|
distor->showEditedCB ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Distortion::setBatchMode (bool batchMode) {
|
void Distortion::idPressed () {
|
||||||
|
if (!batchMode) {
|
||||||
ToolPanel::setBatchMode (batchMode);
|
if (rlistener) {
|
||||||
if (batchMode) {
|
double new_amount = rlistener->autoDistorRequested();
|
||||||
autoDistor->set_sensitive(false);
|
distor->setValue(new_amount);
|
||||||
}
|
adjusterChanged (distor, new_amount);
|
||||||
distor->showEditedCB ();
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
void Distortion::idPressed () {
|
|
||||||
if (!batchMode) {
|
void Distortion::setAdjusterBehavior (bool vadd) {
|
||||||
if (rlistener) {
|
|
||||||
double new_amount = rlistener->autoDistorRequested();
|
distor->setAddMode(vadd);
|
||||||
distor->setValue(new_amount);
|
}
|
||||||
adjusterChanged (distor, new_amount);
|
|
||||||
}
|
void Distortion::trimValues (rtengine::procparams::ProcParams* pp) {
|
||||||
}
|
|
||||||
}
|
distor->trimValue(pp->distortion.amount);
|
||||||
|
}
|
||||||
|
@@ -1,51 +1,51 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of RawTherapee.
|
* This file is part of RawTherapee.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
|
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
|
||||||
*
|
*
|
||||||
* RawTherapee is free software: you can redistribute it and/or modify
|
* RawTherapee is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* RawTherapee is distributed in the hope that it will be useful,
|
* RawTherapee is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef _DISTORTION_H_
|
#ifndef _DISTORTION_H_
|
||||||
#define _DISTORTION_H_
|
#define _DISTORTION_H_
|
||||||
|
|
||||||
#include <gtkmm.h>
|
#include <gtkmm.h>
|
||||||
#include <adjuster.h>
|
#include <adjuster.h>
|
||||||
#include <toolpanel.h>
|
#include <toolpanel.h>
|
||||||
#include <lensgeomlistener.h>
|
#include <lensgeomlistener.h>
|
||||||
|
|
||||||
class Distortion : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel {
|
class Distortion : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel {
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Gtk::Button* autoDistor;
|
Gtk::Button* autoDistor;
|
||||||
Adjuster* distor;
|
Adjuster* distor;
|
||||||
bool distAdd;
|
sigc::connection idConn;
|
||||||
sigc::connection idConn;
|
LensGeomListener * rlistener;
|
||||||
LensGeomListener * rlistener;
|
|
||||||
|
public:
|
||||||
public:
|
|
||||||
|
Distortion ();
|
||||||
Distortion ();
|
|
||||||
|
void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL);
|
||||||
void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL);
|
void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL);
|
||||||
void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL);
|
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL);
|
||||||
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL);
|
void setBatchMode (bool batchMode);
|
||||||
void setBatchMode (bool batchMode);
|
|
||||||
|
void adjusterChanged (Adjuster* a, double newval);
|
||||||
void adjusterChanged (Adjuster* a, double newval);
|
void setAdjusterBehavior (bool vadd);
|
||||||
void setAdjusterBehavior (bool bvadd);
|
void trimValues (rtengine::procparams::ProcParams* pp);
|
||||||
void idPressed ();
|
void idPressed ();
|
||||||
void setLensGeomListener (LensGeomListener* l) { rlistener = l; }
|
void setLensGeomListener (LensGeomListener* l) { rlistener = l; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -118,3 +118,13 @@ void ImpulseDenoise::setBatchMode (bool batchMode) {
|
|||||||
ToolPanel::setBatchMode (batchMode);
|
ToolPanel::setBatchMode (batchMode);
|
||||||
thresh->showEditedCB ();
|
thresh->showEditedCB ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ImpulseDenoise::setAdjusterBehavior (bool threshadd) {
|
||||||
|
|
||||||
|
thresh->setAddMode(threshadd);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImpulseDenoise::trimValues (rtengine::procparams::ProcParams* pp) {
|
||||||
|
|
||||||
|
thresh->trimValue(pp->impulseDenoise.thresh);
|
||||||
|
}
|
||||||
|
@@ -31,7 +31,6 @@ class ImpulseDenoise : public Gtk::VBox, public AdjusterListener, public Foldabl
|
|||||||
Gtk::CheckButton* enabled;
|
Gtk::CheckButton* enabled;
|
||||||
bool lastEnabled;
|
bool lastEnabled;
|
||||||
sigc::connection enaConn;
|
sigc::connection enaConn;
|
||||||
bool edgetolAdd;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -45,7 +44,8 @@ class ImpulseDenoise : public Gtk::VBox, public AdjusterListener, public Foldabl
|
|||||||
void adjusterChanged (Adjuster* a, double newval);
|
void adjusterChanged (Adjuster* a, double newval);
|
||||||
void enabledChanged ();
|
void enabledChanged ();
|
||||||
|
|
||||||
void setAdjusterBehavior (bool bedgetoladd);
|
void setAdjusterBehavior (bool threshadd);
|
||||||
|
void trimValues (rtengine::procparams::ProcParams* pp);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,369 +1,368 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of RawTherapee.
|
* This file is part of RawTherapee.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
|
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
|
||||||
*
|
*
|
||||||
* RawTherapee is free software: you can redistribute it and/or modify
|
* RawTherapee is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* RawTherapee is distributed in the hope that it will be useful,
|
* RawTherapee is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <labcurve.h>
|
#include <labcurve.h>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
using namespace rtengine;
|
using namespace rtengine;
|
||||||
using namespace rtengine::procparams;
|
using namespace rtengine::procparams;
|
||||||
|
|
||||||
LCurve::LCurve () : Gtk::VBox(), FoldableToolPanel(this), brAdd(false), contrAdd(false), satAdd(false) {
|
LCurve::LCurve () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||||
|
|
||||||
brightness = Gtk::manage (new Adjuster (M("TP_LABCURVE_BRIGHTNESS"), -100, 100, 0.01, 0));
|
brightness = Gtk::manage (new Adjuster (M("TP_LABCURVE_BRIGHTNESS"), -100, 100, 0.01, 0));
|
||||||
contrast = Gtk::manage (new Adjuster (M("TP_LABCURVE_CONTRAST"), -100, 100, 1, 0));
|
contrast = Gtk::manage (new Adjuster (M("TP_LABCURVE_CONTRAST"), -100, 100, 1, 0));
|
||||||
saturation = Gtk::manage (new Adjuster (M("TP_LABCURVE_SATURATION"), -100, 100, 1, 0));
|
saturation = Gtk::manage (new Adjuster (M("TP_LABCURVE_SATURATION"), -100, 100, 1, 0));
|
||||||
|
|
||||||
pack_start (*brightness);
|
pack_start (*brightness);
|
||||||
brightness->show ();
|
brightness->show ();
|
||||||
|
|
||||||
pack_start (*contrast);
|
pack_start (*contrast);
|
||||||
contrast->show ();
|
contrast->show ();
|
||||||
|
|
||||||
pack_start (*saturation);
|
pack_start (*saturation);
|
||||||
saturation->show ();
|
saturation->show ();
|
||||||
|
|
||||||
brightness->setAdjusterListener (this);
|
brightness->setAdjusterListener (this);
|
||||||
contrast->setAdjusterListener (this);
|
contrast->setAdjusterListener (this);
|
||||||
saturation->setAdjusterListener (this);
|
saturation->setAdjusterListener (this);
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%
|
||||||
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
||||||
|
|
||||||
avoidclip = Gtk::manage (new Gtk::CheckButton (M("TP_LABCURVE_AVOIDCOLORCLIP")));
|
avoidclip = Gtk::manage (new Gtk::CheckButton (M("TP_LABCURVE_AVOIDCOLORCLIP")));
|
||||||
|
|
||||||
pack_start (*avoidclip);
|
pack_start (*avoidclip);
|
||||||
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
||||||
|
|
||||||
enablelimiter = Gtk::manage (new Gtk::CheckButton (M("TP_LABCURVE_ENABLESATLIMITER")));
|
enablelimiter = Gtk::manage (new Gtk::CheckButton (M("TP_LABCURVE_ENABLESATLIMITER")));
|
||||||
pack_start (*enablelimiter);
|
pack_start (*enablelimiter);
|
||||||
|
|
||||||
saturationlimiter = Gtk::manage ( new Adjuster (M("TP_LABCURVE_SATLIMIT"), 0, 100, 1.0, 40) );
|
saturationlimiter = Gtk::manage ( new Adjuster (M("TP_LABCURVE_SATLIMIT"), 0, 100, 1.0, 40) );
|
||||||
pack_start (*saturationlimiter);
|
pack_start (*saturationlimiter);
|
||||||
saturationlimiter->show ();
|
saturationlimiter->show ();
|
||||||
saturationlimiter->reference ();
|
saturationlimiter->reference ();
|
||||||
|
|
||||||
//saturation->setAdjusterListener (this);
|
//saturation->setAdjusterListener (this);
|
||||||
saturationlimiter->setAdjusterListener (this);
|
saturationlimiter->setAdjusterListener (this);
|
||||||
acconn = avoidclip->signal_toggled().connect( sigc::mem_fun(*this, &LCurve::avoidclip_toggled) );
|
acconn = avoidclip->signal_toggled().connect( sigc::mem_fun(*this, &LCurve::avoidclip_toggled) );
|
||||||
elconn = enablelimiter->signal_toggled().connect( sigc::mem_fun(*this, &LCurve::enablelimiter_toggled) );
|
elconn = enablelimiter->signal_toggled().connect( sigc::mem_fun(*this, &LCurve::enablelimiter_toggled) );
|
||||||
//%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
Gtk::HSeparator *hsep3 = Gtk::manage (new Gtk::HSeparator());
|
Gtk::HSeparator *hsep3 = Gtk::manage (new Gtk::HSeparator());
|
||||||
hsep3->show ();
|
hsep3->show ();
|
||||||
pack_start (*hsep3);
|
pack_start (*hsep3);
|
||||||
|
|
||||||
curveEditorG = new CurveEditorGroup ();
|
curveEditorG = new CurveEditorGroup ();
|
||||||
curveEditorG->setCurveListener (this);
|
curveEditorG->setCurveListener (this);
|
||||||
curveEditorG->setColorProvider (this);
|
curveEditorG->setColorProvider (this);
|
||||||
|
|
||||||
lshape = (DiagonalCurveEditor*)curveEditorG->addCurve(CT_Diagonal, "L");
|
lshape = (DiagonalCurveEditor*)curveEditorG->addCurve(CT_Diagonal, "L");
|
||||||
ashape = (DiagonalCurveEditor*)curveEditorG->addCurve(CT_Diagonal, "a");
|
ashape = (DiagonalCurveEditor*)curveEditorG->addCurve(CT_Diagonal, "a");
|
||||||
bshape = (DiagonalCurveEditor*)curveEditorG->addCurve(CT_Diagonal, "b");
|
bshape = (DiagonalCurveEditor*)curveEditorG->addCurve(CT_Diagonal, "b");
|
||||||
|
|
||||||
// This will add the reset button at the end of the curveType buttons
|
// This will add the reset button at the end of the curveType buttons
|
||||||
curveEditorG->curveListComplete();
|
curveEditorG->curveListComplete();
|
||||||
|
|
||||||
pack_start (*curveEditorG, Gtk::PACK_SHRINK, 4);
|
pack_start (*curveEditorG, Gtk::PACK_SHRINK, 4);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LCurve::~LCurve () {
|
LCurve::~LCurve () {
|
||||||
delete curveEditorG;
|
delete curveEditorG;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LCurve::read (const ProcParams* pp, const ParamsEdited* pedited) {
|
void LCurve::read (const ProcParams* pp, const ParamsEdited* pedited) {
|
||||||
|
|
||||||
disableListener ();
|
disableListener ();
|
||||||
|
|
||||||
if (pedited) {
|
if (pedited) {
|
||||||
brightness->setEditedState (pedited->labCurve.brightness ? Edited : UnEdited);
|
brightness->setEditedState (pedited->labCurve.brightness ? Edited : UnEdited);
|
||||||
contrast->setEditedState (pedited->labCurve.contrast ? Edited : UnEdited);
|
contrast->setEditedState (pedited->labCurve.contrast ? Edited : UnEdited);
|
||||||
saturation->setEditedState (pedited->labCurve.saturation ? Edited : UnEdited);
|
saturation->setEditedState (pedited->labCurve.saturation ? Edited : UnEdited);
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%
|
||||||
saturationlimiter->setEditedState (pedited->labCurve.saturationlimit ? Edited : UnEdited);
|
saturationlimiter->setEditedState (pedited->labCurve.saturationlimit ? Edited : UnEdited);
|
||||||
avoidclip->set_inconsistent (!pedited->labCurve.avoidclip);
|
avoidclip->set_inconsistent (!pedited->labCurve.avoidclip);
|
||||||
enablelimiter->set_inconsistent (!pedited->labCurve.enable_saturationlimiter);
|
enablelimiter->set_inconsistent (!pedited->labCurve.enable_saturationlimiter);
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
lshape->setUnChanged (!pedited->labCurve.lcurve);
|
lshape->setUnChanged (!pedited->labCurve.lcurve);
|
||||||
ashape->setUnChanged (!pedited->labCurve.acurve);
|
ashape->setUnChanged (!pedited->labCurve.acurve);
|
||||||
bshape->setUnChanged (!pedited->labCurve.bcurve);
|
bshape->setUnChanged (!pedited->labCurve.bcurve);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
brightness->setValue (pp->labCurve.brightness);
|
brightness->setValue (pp->labCurve.brightness);
|
||||||
contrast->setValue (pp->labCurve.contrast);
|
contrast->setValue (pp->labCurve.contrast);
|
||||||
saturation->setValue (pp->labCurve.saturation);
|
saturation->setValue (pp->labCurve.saturation);
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%
|
||||||
saturationlimiter->setValue (pp->labCurve.saturationlimit);
|
saturationlimiter->setValue (pp->labCurve.saturationlimit);
|
||||||
acconn.block (true);
|
acconn.block (true);
|
||||||
avoidclip->set_active (pp->labCurve.avoidclip);
|
avoidclip->set_active (pp->labCurve.avoidclip);
|
||||||
acconn.block (false);
|
acconn.block (false);
|
||||||
elconn.block (true);
|
elconn.block (true);
|
||||||
enablelimiter->set_active (pp->labCurve.enable_saturationlimiter);
|
enablelimiter->set_active (pp->labCurve.enable_saturationlimiter);
|
||||||
elconn.block (false);
|
elconn.block (false);
|
||||||
|
|
||||||
//removeIfThere (this, saturationlimiter, false);
|
//removeIfThere (this, saturationlimiter, false);
|
||||||
// if (enablelimiter->get_active () || enablelimiter->get_inconsistent())
|
// if (enablelimiter->get_active () || enablelimiter->get_inconsistent())
|
||||||
// pack_start (*saturationlimiter);
|
// pack_start (*saturationlimiter);
|
||||||
|
|
||||||
lastACVal = pp->labCurve.avoidclip;
|
lastACVal = pp->labCurve.avoidclip;
|
||||||
lastELVal = pp->labCurve.enable_saturationlimiter;
|
lastELVal = pp->labCurve.enable_saturationlimiter;
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
lshape->setCurve (pp->labCurve.lcurve);
|
lshape->setCurve (pp->labCurve.lcurve);
|
||||||
ashape->setCurve (pp->labCurve.acurve);
|
ashape->setCurve (pp->labCurve.acurve);
|
||||||
bshape->setCurve (pp->labCurve.bcurve);
|
bshape->setCurve (pp->labCurve.bcurve);
|
||||||
|
|
||||||
// Open up the first curve if selected
|
// Open up the first curve if selected
|
||||||
bool active = lshape->openIfNonlinear();
|
bool active = lshape->openIfNonlinear();
|
||||||
if (!active) ashape->openIfNonlinear();
|
if (!active) ashape->openIfNonlinear();
|
||||||
if (!active) bshape->openIfNonlinear();
|
if (!active) bshape->openIfNonlinear();
|
||||||
|
|
||||||
enableListener ();
|
enableListener ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LCurve::write (ProcParams* pp, ParamsEdited* pedited) {
|
void LCurve::write (ProcParams* pp, ParamsEdited* pedited) {
|
||||||
|
|
||||||
pp->labCurve.brightness = brightness->getValue ();
|
pp->labCurve.brightness = brightness->getValue ();
|
||||||
pp->labCurve.contrast = (int)contrast->getValue ();
|
pp->labCurve.contrast = (int)contrast->getValue ();
|
||||||
pp->labCurve.saturation = (int)saturation->getValue ();
|
pp->labCurve.saturation = (int)saturation->getValue ();
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%
|
||||||
pp->labCurve.avoidclip = avoidclip->get_active ();
|
pp->labCurve.avoidclip = avoidclip->get_active ();
|
||||||
pp->labCurve.enable_saturationlimiter = enablelimiter->get_active ();
|
pp->labCurve.enable_saturationlimiter = enablelimiter->get_active ();
|
||||||
pp->labCurve.saturationlimit = saturationlimiter->getValue ();
|
pp->labCurve.saturationlimit = saturationlimiter->getValue ();
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
pp->labCurve.lcurve = lshape->getCurve ();
|
pp->labCurve.lcurve = lshape->getCurve ();
|
||||||
pp->labCurve.acurve = ashape->getCurve ();
|
pp->labCurve.acurve = ashape->getCurve ();
|
||||||
pp->labCurve.bcurve = bshape->getCurve ();
|
pp->labCurve.bcurve = bshape->getCurve ();
|
||||||
|
|
||||||
if (pedited) {
|
if (pedited) {
|
||||||
pedited->labCurve.brightness = brightness->getEditedState ();
|
pedited->labCurve.brightness = brightness->getEditedState ();
|
||||||
pedited->labCurve.contrast = contrast->getEditedState ();
|
pedited->labCurve.contrast = contrast->getEditedState ();
|
||||||
pedited->labCurve.saturation = saturation->getEditedState ();
|
pedited->labCurve.saturation = saturation->getEditedState ();
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%
|
||||||
pedited->labCurve.avoidclip = !avoidclip->get_inconsistent();
|
pedited->labCurve.avoidclip = !avoidclip->get_inconsistent();
|
||||||
pedited->labCurve.enable_saturationlimiter = !enablelimiter->get_inconsistent();
|
pedited->labCurve.enable_saturationlimiter = !enablelimiter->get_inconsistent();
|
||||||
pedited->labCurve.saturationlimit = saturationlimiter->getEditedState ();
|
pedited->labCurve.saturationlimit = saturationlimiter->getEditedState ();
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
pedited->labCurve.lcurve = !lshape->isUnChanged ();
|
pedited->labCurve.lcurve = !lshape->isUnChanged ();
|
||||||
pedited->labCurve.acurve = !ashape->isUnChanged ();
|
pedited->labCurve.acurve = !ashape->isUnChanged ();
|
||||||
pedited->labCurve.bcurve = !bshape->isUnChanged ();
|
pedited->labCurve.bcurve = !bshape->isUnChanged ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LCurve::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) {
|
void LCurve::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) {
|
||||||
|
|
||||||
brightness->setDefault (defParams->labCurve.brightness);
|
brightness->setDefault (defParams->labCurve.brightness);
|
||||||
contrast->setDefault (defParams->labCurve.contrast);
|
contrast->setDefault (defParams->labCurve.contrast);
|
||||||
saturation->setDefault (defParams->labCurve.saturation);
|
saturation->setDefault (defParams->labCurve.saturation);
|
||||||
saturationlimiter->setDefault (defParams->labCurve.saturationlimit);
|
saturationlimiter->setDefault (defParams->labCurve.saturationlimit);
|
||||||
|
|
||||||
if (pedited) {
|
if (pedited) {
|
||||||
brightness->setDefaultEditedState (pedited->labCurve.brightness ? Edited : UnEdited);
|
brightness->setDefaultEditedState (pedited->labCurve.brightness ? Edited : UnEdited);
|
||||||
contrast->setDefaultEditedState (pedited->labCurve.contrast ? Edited : UnEdited);
|
contrast->setDefaultEditedState (pedited->labCurve.contrast ? Edited : UnEdited);
|
||||||
saturation->setDefaultEditedState (pedited->labCurve.saturation ? Edited : UnEdited);
|
saturation->setDefaultEditedState (pedited->labCurve.saturation ? Edited : UnEdited);
|
||||||
saturationlimiter->setDefaultEditedState (pedited->labCurve.saturationlimit ? Edited : UnEdited);
|
saturationlimiter->setDefaultEditedState (pedited->labCurve.saturationlimit ? Edited : UnEdited);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
brightness->setDefaultEditedState (Irrelevant);
|
brightness->setDefaultEditedState (Irrelevant);
|
||||||
contrast->setDefaultEditedState (Irrelevant);
|
contrast->setDefaultEditedState (Irrelevant);
|
||||||
saturation->setDefaultEditedState (Irrelevant);
|
saturation->setDefaultEditedState (Irrelevant);
|
||||||
saturationlimiter->setDefaultEditedState (Irrelevant);
|
saturationlimiter->setDefaultEditedState (Irrelevant);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%
|
||||||
//Clipping control changed
|
//Clipping control changed
|
||||||
void LCurve::avoidclip_toggled () {
|
void LCurve::avoidclip_toggled () {
|
||||||
|
|
||||||
if (batchMode) {
|
if (batchMode) {
|
||||||
if (avoidclip->get_inconsistent()) {
|
if (avoidclip->get_inconsistent()) {
|
||||||
avoidclip->set_inconsistent (false);
|
avoidclip->set_inconsistent (false);
|
||||||
acconn.block (true);
|
acconn.block (true);
|
||||||
avoidclip->set_active (false);
|
avoidclip->set_active (false);
|
||||||
acconn.block (false);
|
acconn.block (false);
|
||||||
}
|
}
|
||||||
else if (lastACVal)
|
else if (lastACVal)
|
||||||
avoidclip->set_inconsistent (true);
|
avoidclip->set_inconsistent (true);
|
||||||
|
|
||||||
lastACVal = avoidclip->get_active ();
|
lastACVal = avoidclip->get_active ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (listener) {
|
if (listener) {
|
||||||
if (avoidclip->get_active ())
|
if (avoidclip->get_active ())
|
||||||
listener->panelChanged (EvLAvoidClip, M("GENERAL_ENABLED"));
|
listener->panelChanged (EvLAvoidClip, M("GENERAL_ENABLED"));
|
||||||
else
|
else
|
||||||
listener->panelChanged (EvLAvoidClip, M("GENERAL_DISABLED"));
|
listener->panelChanged (EvLAvoidClip, M("GENERAL_DISABLED"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LCurve::enablelimiter_toggled () {
|
void LCurve::enablelimiter_toggled () {
|
||||||
|
|
||||||
if (batchMode) {
|
if (batchMode) {
|
||||||
if (enablelimiter->get_inconsistent()) {
|
if (enablelimiter->get_inconsistent()) {
|
||||||
enablelimiter->set_inconsistent (false);
|
enablelimiter->set_inconsistent (false);
|
||||||
elconn.block (true);
|
elconn.block (true);
|
||||||
enablelimiter->set_active (false);
|
enablelimiter->set_active (false);
|
||||||
elconn.block (false);
|
elconn.block (false);
|
||||||
}
|
}
|
||||||
else if (lastELVal)
|
else if (lastELVal)
|
||||||
enablelimiter->set_inconsistent (true);
|
enablelimiter->set_inconsistent (true);
|
||||||
|
|
||||||
lastELVal = enablelimiter->get_active ();
|
lastELVal = enablelimiter->get_active ();
|
||||||
}
|
}
|
||||||
|
|
||||||
//removeIfThere (this, saturationlimiter, false);
|
//removeIfThere (this, saturationlimiter, false);
|
||||||
//if (enablelimiter->get_active () || enablelimiter->get_inconsistent())
|
//if (enablelimiter->get_active () || enablelimiter->get_inconsistent())
|
||||||
// pack_start (*saturationlimiter);
|
// pack_start (*saturationlimiter);
|
||||||
|
|
||||||
if (listener) {
|
if (listener) {
|
||||||
if (enablelimiter->get_active ())
|
if (enablelimiter->get_active ())
|
||||||
listener->panelChanged (EvLSatLimiter, M("GENERAL_ENABLED"));
|
listener->panelChanged (EvLSatLimiter, M("GENERAL_ENABLED"));
|
||||||
else
|
else
|
||||||
listener->panelChanged (EvLSatLimiter, M("GENERAL_DISABLED"));
|
listener->panelChanged (EvLSatLimiter, M("GENERAL_DISABLED"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Curve listener
|
* Curve listener
|
||||||
*
|
*
|
||||||
* If more than one curve has been added, the curve listener is automatically
|
* If more than one curve has been added, the curve listener is automatically
|
||||||
* set to 'multi=true', and send a pointer of the modified curve in a parameter
|
* set to 'multi=true', and send a pointer of the modified curve in a parameter
|
||||||
*/
|
*/
|
||||||
void LCurve::curveChanged (CurveEditor* ce) {
|
void LCurve::curveChanged (CurveEditor* ce) {
|
||||||
|
|
||||||
if (listener) {
|
if (listener) {
|
||||||
if (ce == lshape)
|
if (ce == lshape)
|
||||||
listener->panelChanged (EvLLCurve, M("HISTORY_CUSTOMCURVE"));
|
listener->panelChanged (EvLLCurve, M("HISTORY_CUSTOMCURVE"));
|
||||||
if (ce == ashape)
|
if (ce == ashape)
|
||||||
listener->panelChanged (EvLaCurve, M("HISTORY_CUSTOMCURVE"));
|
listener->panelChanged (EvLaCurve, M("HISTORY_CUSTOMCURVE"));
|
||||||
if (ce == bshape)
|
if (ce == bshape)
|
||||||
listener->panelChanged (EvLbCurve, M("HISTORY_CUSTOMCURVE"));
|
listener->panelChanged (EvLbCurve, M("HISTORY_CUSTOMCURVE"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LCurve::adjusterChanged (Adjuster* a, double newval) {
|
void LCurve::adjusterChanged (Adjuster* a, double newval) {
|
||||||
|
|
||||||
if (!listener)
|
if (!listener)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Glib::ustring costr;
|
Glib::ustring costr;
|
||||||
if (a==brightness)
|
if (a==brightness)
|
||||||
costr = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), a->getValue());
|
costr = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), a->getValue());
|
||||||
else if (a==saturationlimiter)
|
else if (a==saturationlimiter)
|
||||||
costr = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(1), a->getValue());
|
costr = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(1), a->getValue());
|
||||||
else
|
else
|
||||||
costr = Glib::ustring::format ((int)a->getValue());
|
costr = Glib::ustring::format ((int)a->getValue());
|
||||||
|
|
||||||
if (a==brightness)
|
if (a==brightness)
|
||||||
listener->panelChanged (EvLBrightness, costr);
|
listener->panelChanged (EvLBrightness, costr);
|
||||||
else if (a==contrast)
|
else if (a==contrast)
|
||||||
listener->panelChanged (EvLContrast, costr);
|
listener->panelChanged (EvLContrast, costr);
|
||||||
else if (a==saturation)
|
else if (a==saturation)
|
||||||
listener->panelChanged (EvLSaturation, costr);
|
listener->panelChanged (EvLSaturation, costr);
|
||||||
else if (a==saturationlimiter)
|
else if (a==saturationlimiter)
|
||||||
listener->panelChanged (EvLSatLimit, costr);
|
listener->panelChanged (EvLSatLimit, costr);
|
||||||
}
|
}
|
||||||
|
|
||||||
//attempt to hide unused channels
|
//attempt to hide unused channels
|
||||||
/*void LCurve::channel_changed () {
|
/*void LCurve::channel_changed () {
|
||||||
|
|
||||||
removeIfThere (this, lcurve, false);
|
removeIfThere (this, lcurve, false);
|
||||||
removeIfThere (this, acurve, false);
|
removeIfThere (this, acurve, false);
|
||||||
removeIfThere (this, bcurve, false);
|
removeIfThere (this, bcurve, false);
|
||||||
|
|
||||||
if (channel->get_active_row_number()==0)
|
if (channel->get_active_row_number()==0)
|
||||||
pack_start (*lcurve);
|
pack_start (*lcurve);
|
||||||
else if (channel->get_active_row_number()==1)
|
else if (channel->get_active_row_number()==1)
|
||||||
pack_start (*acurve);
|
pack_start (*acurve);
|
||||||
else if (method->get_active_row_number()==2)
|
else if (method->get_active_row_number()==2)
|
||||||
pack_start (*bcurve);
|
pack_start (*bcurve);
|
||||||
|
|
||||||
|
|
||||||
if (listener && enabled->get_active ())
|
if (listener && enabled->get_active ())
|
||||||
listener->panelChanged (EvLabCurvetype, channel->get_active_text ());
|
listener->panelChanged (EvLabCurvetype, channel->get_active_text ());
|
||||||
|
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
void LCurve::colorForValue (double valX, double valY) {
|
void LCurve::colorForValue (double valX, double valY) {
|
||||||
|
|
||||||
CurveEditor* ce = curveEditorG->getDisplayedCurve();
|
CurveEditor* ce = curveEditorG->getDisplayedCurve();
|
||||||
|
|
||||||
if (ce == lshape) { // L = f(L)
|
if (ce == lshape) { // L = f(L)
|
||||||
red = (double)valY;
|
red = (double)valY;
|
||||||
green = (double)valY;
|
green = (double)valY;
|
||||||
blue = (double)valY;
|
blue = (double)valY;
|
||||||
}
|
}
|
||||||
else if (ce == ashape) { // a = f(a)
|
else if (ce == ashape) { // a = f(a)
|
||||||
// TODO: To be implemented
|
// TODO: To be implemented
|
||||||
red = (double)valY;
|
red = (double)valY;
|
||||||
green = (double)valY;
|
green = (double)valY;
|
||||||
blue = (double)valY;
|
blue = (double)valY;
|
||||||
}
|
}
|
||||||
else if (ce == bshape) { // b = f(b)
|
else if (ce == bshape) { // b = f(b)
|
||||||
red = (double)valY;
|
red = (double)valY;
|
||||||
green = (double)valY;
|
green = (double)valY;
|
||||||
blue = (double)valY;
|
blue = (double)valY;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
printf("Error: no curve displayed!\n");
|
printf("Error: no curve displayed!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LCurve::setBatchMode (bool batchMode) {
|
void LCurve::setBatchMode (bool batchMode) {
|
||||||
|
|
||||||
ToolPanel::setBatchMode (batchMode);
|
ToolPanel::setBatchMode (batchMode);
|
||||||
brightness->showEditedCB ();
|
brightness->showEditedCB ();
|
||||||
contrast->showEditedCB ();
|
contrast->showEditedCB ();
|
||||||
saturation->showEditedCB ();
|
saturation->showEditedCB ();
|
||||||
saturationlimiter->showEditedCB ();
|
saturationlimiter->showEditedCB ();
|
||||||
|
|
||||||
curveEditorG->setBatchMode (batchMode);
|
curveEditorG->setBatchMode (batchMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LCurve::setAdjusterBehavior (bool bradd, bool contradd, bool satadd) {
|
|
||||||
|
void LCurve::updateCurveBackgroundHistogram (LUTu & hist) {
|
||||||
if ((!brAdd && bradd) || (brAdd && !bradd))
|
|
||||||
brightness->setLimits (-100, 100, 1, 0);
|
lshape->updateBackgroundHistogram (hist);
|
||||||
if ((!contrAdd && contradd) || (contrAdd && !contradd))
|
}
|
||||||
contrast->setLimits (-100, 100, 1, 0);
|
|
||||||
if ((!satAdd && satadd) || (satAdd && !satadd))
|
void LCurve::setAdjusterBehavior (bool bradd, bool contradd, bool satadd) {
|
||||||
saturation->setLimits (-100, 100, 1, 0);
|
|
||||||
|
brightness->setAddMode(bradd);
|
||||||
|
contrast->setAddMode(contradd);
|
||||||
brAdd = bradd;
|
saturation->setAddMode(satadd);
|
||||||
contrAdd = contradd;
|
}
|
||||||
satAdd = satadd;
|
|
||||||
|
void LCurve::trimValues (rtengine::procparams::ProcParams* pp) {
|
||||||
}
|
|
||||||
|
brightness->trimValue(pp->labCurve.brightness);
|
||||||
void LCurve::updateCurveBackgroundHistogram (LUTu & hist) {
|
contrast->trimValue(pp->labCurve.contrast);
|
||||||
|
saturation->trimValue(pp->labCurve.saturation);
|
||||||
lshape->updateBackgroundHistogram (hist);
|
}
|
||||||
}
|
|
||||||
|
@@ -48,8 +48,6 @@ class LCurve : public Gtk::VBox, public AdjusterListener, public FoldableToolPan
|
|||||||
bool lastACVal, lastELVal;
|
bool lastACVal, lastELVal;
|
||||||
//%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
bool brAdd, contrAdd, satAdd;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
LCurve ();
|
LCurve ();
|
||||||
@@ -59,7 +57,8 @@ class LCurve : public Gtk::VBox, public AdjusterListener, public FoldableToolPan
|
|||||||
void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL);
|
void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL);
|
||||||
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL);
|
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL);
|
||||||
void setBatchMode (bool batchMode);
|
void setBatchMode (bool batchMode);
|
||||||
void setAdjusterBehavior (bool bradd, bool contradd, bool satadd);
|
void setAdjusterBehavior (bool bradd, bool contradd, bool satadd);
|
||||||
|
void trimValues (rtengine::procparams::ProcParams* pp);
|
||||||
|
|
||||||
void curveChanged (CurveEditor* ce);
|
void curveChanged (CurveEditor* ce);
|
||||||
void adjusterChanged (Adjuster* a, double newval);
|
void adjusterChanged (Adjuster* a, double newval);
|
||||||
|
@@ -140,11 +140,48 @@ void Options::setDefaults () {
|
|||||||
showProfileSelector = true;
|
showProfileSelector = true;
|
||||||
|
|
||||||
cutOverlayBrush = std::vector<double> (4);
|
cutOverlayBrush = std::vector<double> (4);
|
||||||
cutOverlayBrush[3] = 0.667;
|
cutOverlayBrush[3] = 0.667; // :-p
|
||||||
|
|
||||||
sndLngEditProcDoneSecs=3.0;
|
sndLngEditProcDoneSecs=3.0;
|
||||||
|
|
||||||
int babehav[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0};
|
int babehav[] = {
|
||||||
|
1, // ADDSET_TC_EXPCOMP
|
||||||
|
1, // ADDSET_TC_BRIGHTNESS
|
||||||
|
1, // ADDSET_TC_BLACKLEVEL
|
||||||
|
1, // ADDSET_TC_CONTRAST
|
||||||
|
1, // ADDSET_SH_HIGHLIGHTS
|
||||||
|
1, // ADDSET_SH_SHADOWS
|
||||||
|
1, // ADDSET_SH_LOCALCONTRAST
|
||||||
|
1, // ADDSET_LC_BRIGHTNESS
|
||||||
|
1, // ADDSET_LC_CONTRAST
|
||||||
|
0, // ADDSET_SHARP_AMOUNT
|
||||||
|
0, // ADDSET_LD_EDGETOLERANCE
|
||||||
|
1, // ADDSET_WB_TEMPERATURE
|
||||||
|
1, // ADDSET_WB_GREEN
|
||||||
|
0, // ADDSET_CBOOST_AMOUNT
|
||||||
|
0, // ADDSET_CS_BLUEYELLOW
|
||||||
|
0, // ADDSET_CS_GREENMAGENTA
|
||||||
|
0, // ADDSET_ROTATE_DEGREE
|
||||||
|
0, // ADDSET_DIST_AMOUNT
|
||||||
|
0, // ADDSET_PERSPECTIVE
|
||||||
|
0, // ADDSET_CA
|
||||||
|
1, // ADDSET_VIGN_AMOUNT
|
||||||
|
1, // ADDSET_LC_SATURATION
|
||||||
|
1, // ADDSET_TC_SATURATION
|
||||||
|
1, // ADDSET_TC_HLCOMPAMOUNT
|
||||||
|
0, // ADDSET_TC_HLCOMPTHRESH
|
||||||
|
1, // ADDSET_TC_SHCOMP
|
||||||
|
1, // ADDSET_DIRPYREQ
|
||||||
|
0, // ADDSET_DIRPYRDN_CHLUM
|
||||||
|
0, // ADDSET_DIRPYRDN_GAMMA
|
||||||
|
1, // ADDSET_CHMIXER
|
||||||
|
1, // ADDSET_PREPROCESS_GREENEQUIL
|
||||||
|
0, // ADDSET_PREPROCESS_LINEDENOISE
|
||||||
|
0, // ADDSET_RAWCACORR
|
||||||
|
1, // ADDSET_RAWEXPOS_LINEAR
|
||||||
|
1, // ADDSET_RAWEXPOS_PRESER
|
||||||
|
1 // ADDSET_RAWEXPOS_BLACKS
|
||||||
|
};
|
||||||
baBehav = std::vector<int> (babehav, babehav+ADDSET_PARAM_NUM);
|
baBehav = std::vector<int> (babehav, babehav+ADDSET_PARAM_NUM);
|
||||||
|
|
||||||
rtSettings.dualThreadEnabled = true;
|
rtSettings.dualThreadEnabled = true;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -360,7 +360,7 @@ class ParamsEdited {
|
|||||||
|
|
||||||
void set (bool v);
|
void set (bool v);
|
||||||
void initFrom (const std::vector<rtengine::procparams::ProcParams>& src);
|
void initFrom (const std::vector<rtengine::procparams::ProcParams>& src);
|
||||||
void combine (rtengine::procparams::ProcParams& toEdit, const rtengine::procparams::ProcParams& mods);
|
void combine (rtengine::procparams::ProcParams& toEdit, const rtengine::procparams::ProcParams& mods, bool forceSet);
|
||||||
|
|
||||||
bool operator== (const ParamsEdited& other);
|
bool operator== (const ParamsEdited& other);
|
||||||
bool operator!= (const ParamsEdited& other);
|
bool operator!= (const ParamsEdited& other);
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
using namespace rtengine;
|
using namespace rtengine;
|
||||||
using namespace rtengine::procparams;
|
using namespace rtengine::procparams;
|
||||||
|
|
||||||
PerspCorrection::PerspCorrection () : Gtk::VBox(), FoldableToolPanel(this), vAdd(false) {
|
PerspCorrection::PerspCorrection () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||||
|
|
||||||
horiz = Gtk::manage (new Adjuster (M("TP_PERSPECTIVE_HORIZONTAL"), -100, 100, 1, 0));
|
horiz = Gtk::manage (new Adjuster (M("TP_PERSPECTIVE_HORIZONTAL"), -100, 100, 1, 0));
|
||||||
horiz->setAdjusterListener (this);
|
horiz->setAdjusterListener (this);
|
||||||
@@ -84,12 +84,14 @@ void PerspCorrection::adjusterChanged (Adjuster* a, double newval) {
|
|||||||
|
|
||||||
void PerspCorrection::setAdjusterBehavior (bool badd) {
|
void PerspCorrection::setAdjusterBehavior (bool badd) {
|
||||||
|
|
||||||
if ((!vAdd && badd) || (vAdd && !badd)) {
|
horiz->setAddMode(badd);
|
||||||
// horiz->setLimits (-0.005, 0.005, 0.0001, 0);
|
vert->setAddMode(badd);
|
||||||
// vert->setLimits (-0.005, 0.005, 0.0001, 0);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
vAdd = badd;
|
void PerspCorrection::trimValues (rtengine::procparams::ProcParams* pp) {
|
||||||
|
|
||||||
|
horiz->trimValue(pp->perspective.horizontal);
|
||||||
|
vert->trimValue(pp->perspective.vertical);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PerspCorrection::setBatchMode (bool batchMode) {
|
void PerspCorrection::setBatchMode (bool batchMode) {
|
||||||
|
@@ -28,7 +28,6 @@ class PerspCorrection : public Gtk::VBox, public AdjusterListener, public Foldab
|
|||||||
protected:
|
protected:
|
||||||
Adjuster* horiz;
|
Adjuster* horiz;
|
||||||
Adjuster* vert;
|
Adjuster* vert;
|
||||||
bool vAdd;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -41,6 +40,7 @@ class PerspCorrection : public Gtk::VBox, public AdjusterListener, public Foldab
|
|||||||
|
|
||||||
void adjusterChanged (Adjuster* a, double newval);
|
void adjusterChanged (Adjuster* a, double newval);
|
||||||
void setAdjusterBehavior (bool badd);
|
void setAdjusterBehavior (bool badd);
|
||||||
|
void trimValues (rtengine::procparams::ProcParams* pp);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -138,6 +138,9 @@ Gtk::Widget* Preferences::getBatchProcPanel () {
|
|||||||
// fill model
|
// fill model
|
||||||
Gtk::TreeModel::iterator mi, ci;
|
Gtk::TreeModel::iterator mi, ci;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The TRUE/FALSE values of appendBehavList are replaced by the one defined in options.cc,
|
||||||
|
*/
|
||||||
mi = behModel->append ();
|
mi = behModel->append ();
|
||||||
mi->set_value (behavColumns.label, M("TP_EXPOSURE_LABEL"));
|
mi->set_value (behavColumns.label, M("TP_EXPOSURE_LABEL"));
|
||||||
appendBehavList (mi, M("TP_EXPOSURE_EXPCOMP"), ADDSET_TC_EXPCOMP, false);
|
appendBehavList (mi, M("TP_EXPOSURE_EXPCOMP"), ADDSET_TC_EXPCOMP, false);
|
||||||
@@ -169,11 +172,20 @@ Gtk::Widget* Preferences::getBatchProcPanel () {
|
|||||||
//mi->set_value (behavColumns.label, M("TP_LUMADENOISE_LABEL"));
|
//mi->set_value (behavColumns.label, M("TP_LUMADENOISE_LABEL"));
|
||||||
//appendBehavList (mi, M("TP_LUMADENOISE_EDGETOLERANCE"), ADDSET_LD_EDGETOLERANCE, true);
|
//appendBehavList (mi, M("TP_LUMADENOISE_EDGETOLERANCE"), ADDSET_LD_EDGETOLERANCE, true);
|
||||||
|
|
||||||
|
mi = behModel->append ();
|
||||||
|
mi->set_value (behavColumns.label, M("TP_DIRPYRDENOISE_LABEL"));
|
||||||
|
appendBehavList (mi, M("TP_DIRPYRDENOISE_LUMA")+", "+M("TP_DIRPYRDENOISE_CHROMA"), ADDSET_DIRPYRDN_CHLUM, true);
|
||||||
|
appendBehavList (mi, M("TP_DIRPYRDENOISE_GAMMA"), ADDSET_DIRPYRDN_GAMMA, true);
|
||||||
|
|
||||||
mi = behModel->append ();
|
mi = behModel->append ();
|
||||||
mi->set_value (behavColumns.label, M("TP_WBALANCE_LABEL"));
|
mi->set_value (behavColumns.label, M("TP_WBALANCE_LABEL"));
|
||||||
appendBehavList (mi, M("TP_WBALANCE_TEMPERATURE"), ADDSET_WB_TEMPERATURE, true);
|
appendBehavList (mi, M("TP_WBALANCE_TEMPERATURE"), ADDSET_WB_TEMPERATURE, true);
|
||||||
appendBehavList (mi, M("TP_WBALANCE_GREEN"), ADDSET_WB_GREEN, true);
|
appendBehavList (mi, M("TP_WBALANCE_GREEN"), ADDSET_WB_GREEN, true);
|
||||||
|
|
||||||
|
mi = behModel->append ();
|
||||||
|
mi->set_value (behavColumns.label, M("TP_CHMIXER_LABEL"));
|
||||||
|
appendBehavList (mi, M("TP_CHMIXER_RED")+", "+M("TP_CHMIXER_GREEN")+", "+M("TP_CHMIXER_BLUE"), ADDSET_CHMIXER, false);
|
||||||
|
|
||||||
//mi = behModel->append ();
|
//mi = behModel->append ();
|
||||||
//mi->set_value (behavColumns.label, M("TP_COLORBOOST_LABEL"));
|
//mi->set_value (behavColumns.label, M("TP_COLORBOOST_LABEL"));
|
||||||
//appendBehavList (mi, M("TP_COLORBOOST_AMOUNT"), ADDSET_CBOOST_AMOUNT, false);
|
//appendBehavList (mi, M("TP_COLORBOOST_AMOUNT"), ADDSET_CBOOST_AMOUNT, false);
|
||||||
@@ -203,6 +215,25 @@ Gtk::Widget* Preferences::getBatchProcPanel () {
|
|||||||
mi->set_value (behavColumns.label, M("TP_VIGNETTING_LABEL"));
|
mi->set_value (behavColumns.label, M("TP_VIGNETTING_LABEL"));
|
||||||
appendBehavList (mi, M("TP_VIGNETTING_AMOUNT"), ADDSET_VIGN_AMOUNT, false);
|
appendBehavList (mi, M("TP_VIGNETTING_AMOUNT"), ADDSET_VIGN_AMOUNT, false);
|
||||||
|
|
||||||
|
mi = behModel->append ();
|
||||||
|
mi->set_value (behavColumns.label, M("TP_DIRPYREQUALIZER_LABEL"));
|
||||||
|
appendBehavList (mi, M("TP_EXPOSURE_CONTRAST")+", "+M("TP_DIRPYREQUALIZER_THRESHOLD"), ADDSET_DIRPYREQ, true);
|
||||||
|
|
||||||
|
mi = behModel->append ();
|
||||||
|
mi->set_value (behavColumns.label, M("TP_PREPROCESS_LABEL"));
|
||||||
|
appendBehavList (mi, M("TP_PREPROCESS_GREENEQUIL"), ADDSET_PREPROCESS_GREENEQUIL, false);
|
||||||
|
appendBehavList (mi, M("TP_PREPROCESS_LINEDENOISE"), ADDSET_PREPROCESS_LINEDENOISE, true);
|
||||||
|
|
||||||
|
mi = behModel->append ();
|
||||||
|
mi->set_value (behavColumns.label, M("TP_EXPOSCORR_LABEL"));
|
||||||
|
appendBehavList (mi, M("TP_RAWEXPOS_LINEAR"), ADDSET_RAWEXPOS_LINEAR, false);
|
||||||
|
appendBehavList (mi, M("TP_RAWEXPOS_PRESER"), ADDSET_RAWEXPOS_PRESER, false);
|
||||||
|
appendBehavList (mi, M("TP_RAWEXPOS_BLACKS"), ADDSET_RAWEXPOS_BLACKS, false);
|
||||||
|
|
||||||
|
mi = behModel->append ();
|
||||||
|
mi->set_value (behavColumns.label, M("TP_CHROMATABERR_LABEL"));
|
||||||
|
appendBehavList (mi, M("TP_RAWCACORR_CARED")+", "+M("TP_RAWCACORR_CABLUE"), ADDSET_RAWCACORR, true);
|
||||||
|
|
||||||
behTreeView->expand_all ();
|
behTreeView->expand_all ();
|
||||||
|
|
||||||
chOverwriteOutputFile = Gtk::manage( new Gtk::CheckButton (M("PREFERENCES_OVERWRITEOUTPUTFILE")) );
|
chOverwriteOutputFile = Gtk::manage( new Gtk::CheckButton (M("PREFERENCES_OVERWRITEOUTPUTFILE")) );
|
||||||
|
@@ -136,3 +136,15 @@ void PreProcess::hotDeadPixelChanged ()
|
|||||||
if (listener)
|
if (listener)
|
||||||
listener->panelChanged (EvPreProcessHotDeadPixel, hotDeadPixel->get_active()?M("GENERAL_ENABLED"):M("GENERAL_DISABLED"));
|
listener->panelChanged (EvPreProcessHotDeadPixel, hotDeadPixel->get_active()?M("GENERAL_ENABLED"):M("GENERAL_DISABLED"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PreProcess::setAdjusterBehavior (bool linedenoiseadd, bool greenequiladd) {
|
||||||
|
|
||||||
|
lineDenoise->setAddMode(linedenoiseadd);
|
||||||
|
greenEqThreshold->setAddMode(greenequiladd);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PreProcess::trimValues (rtengine::procparams::ProcParams* pp) {
|
||||||
|
|
||||||
|
lineDenoise->trimValue(pp->raw.linenoise);
|
||||||
|
greenEqThreshold->trimValue(pp->raw.greenthresh);
|
||||||
|
}
|
||||||
|
@@ -46,6 +46,8 @@ class PreProcess : public Gtk::VBox, public AdjusterListener, public FoldableToo
|
|||||||
|
|
||||||
void adjusterChanged (Adjuster* a, double newval);
|
void adjusterChanged (Adjuster* a, double newval);
|
||||||
void hotDeadPixelChanged();
|
void hotDeadPixelChanged();
|
||||||
|
void setAdjusterBehavior (bool linedenoiseadd, bool greenequiladd);
|
||||||
|
void trimValues (rtengine::procparams::ProcParams* pp);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -157,3 +157,15 @@ void RAWCACorr::caCorrectionChanged()
|
|||||||
if (listener)
|
if (listener)
|
||||||
listener->panelChanged (EvPreProcessAutoCA, caAutocorrect->get_active()?M("GENERAL_ENABLED"):M("GENERAL_DISABLED"));
|
listener->panelChanged (EvPreProcessAutoCA, caAutocorrect->get_active()?M("GENERAL_ENABLED"):M("GENERAL_DISABLED"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RAWCACorr::setAdjusterBehavior (bool caadd) {
|
||||||
|
|
||||||
|
caRed->setAddMode(caadd);
|
||||||
|
caBlue->setAddMode(caadd);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RAWCACorr::trimValues (rtengine::procparams::ProcParams* pp) {
|
||||||
|
|
||||||
|
caRed->trimValue(pp->raw.cared);
|
||||||
|
caBlue->trimValue(pp->raw.cablue);
|
||||||
|
}
|
||||||
|
@@ -37,10 +37,12 @@ public:
|
|||||||
|
|
||||||
RAWCACorr ();
|
RAWCACorr ();
|
||||||
|
|
||||||
void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL);
|
void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL);
|
||||||
void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL);
|
void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL);
|
||||||
void setBatchMode (bool batchMode);
|
void setBatchMode (bool batchMode);
|
||||||
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL);
|
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL);
|
||||||
|
void setAdjusterBehavior (bool caadd);
|
||||||
|
void trimValues (rtengine::procparams::ProcParams* pp);
|
||||||
|
|
||||||
void adjusterChanged (Adjuster* a, double newval);
|
void adjusterChanged (Adjuster* a, double newval);
|
||||||
void caCorrectionChanged ();
|
void caCorrectionChanged ();
|
||||||
|
@@ -209,3 +209,23 @@ void RAWExposure::setDefaults(const rtengine::procparams::ProcParams* defParams,
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RAWExposure::setAdjusterBehavior (bool pexposadd, bool pexpreseradd, bool pexblackadd) {
|
||||||
|
|
||||||
|
PexPos->setAddMode(pexposadd);
|
||||||
|
PexPreser->setAddMode(pexpreseradd);
|
||||||
|
PexBlackzero->setAddMode(pexblackadd);
|
||||||
|
PexBlackone->setAddMode(pexblackadd);
|
||||||
|
PexBlacktwo->setAddMode(pexblackadd);
|
||||||
|
PexBlackthree->setAddMode(pexblackadd);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RAWExposure::trimValues (rtengine::procparams::ProcParams* pp) {
|
||||||
|
|
||||||
|
PexPos->trimValue(pp->raw.expos);
|
||||||
|
PexPreser->trimValue(pp->raw.preser);
|
||||||
|
PexBlackzero->trimValue(pp->raw.blackzero);
|
||||||
|
PexBlackone->trimValue(pp->raw.blackone);
|
||||||
|
PexBlacktwo->trimValue(pp->raw.blacktwo);
|
||||||
|
PexBlackthree->trimValue(pp->raw.blackthree);
|
||||||
|
}
|
||||||
|
@@ -48,7 +48,9 @@ public:
|
|||||||
void setBatchMode (bool batchMode);
|
void setBatchMode (bool batchMode);
|
||||||
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL);
|
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL);
|
||||||
void GreenChanged() ;
|
void GreenChanged() ;
|
||||||
void adjusterChanged (Adjuster* a, double newval);
|
void adjusterChanged (Adjuster* a, double newval);
|
||||||
|
void setAdjusterBehavior (bool pexposadd, bool pexpreseradd, bool pexblackadd);
|
||||||
|
void trimValues (rtengine::procparams::ProcParams* pp);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -25,7 +25,7 @@ extern Glib::ustring argv0;
|
|||||||
using namespace rtengine;
|
using namespace rtengine;
|
||||||
using namespace rtengine::procparams;
|
using namespace rtengine::procparams;
|
||||||
|
|
||||||
Rotate::Rotate () : Gtk::VBox(), FoldableToolPanel(this), degAdd(false) {
|
Rotate::Rotate () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||||
|
|
||||||
rlistener = NULL;
|
rlistener = NULL;
|
||||||
|
|
||||||
@@ -99,10 +99,12 @@ void Rotate::setBatchMode (bool batchMode) {
|
|||||||
degree->showEditedCB ();
|
degree->showEditedCB ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Rotate::setAdjusterBehavior (bool brotadd) {
|
void Rotate::setAdjusterBehavior (bool rotadd) {
|
||||||
|
|
||||||
if ((!degAdd && brotadd) || (degAdd && !brotadd))
|
degree->setAddMode(rotadd);
|
||||||
degree->setLimits (-45, 45, 0.01, 0);
|
}
|
||||||
|
|
||||||
degAdd = brotadd;
|
void Rotate::trimValues (rtengine::procparams::ProcParams* pp) {
|
||||||
|
|
||||||
|
degree->trimValue(pp->rotate.degree);
|
||||||
}
|
}
|
||||||
|
@@ -30,7 +30,6 @@ class Rotate : public Gtk::VBox, public AdjusterListener, public FoldableToolPan
|
|||||||
Adjuster* degree;
|
Adjuster* degree;
|
||||||
Gtk::Button* selectStraight;
|
Gtk::Button* selectStraight;
|
||||||
LensGeomListener* rlistener;
|
LensGeomListener* rlistener;
|
||||||
bool degAdd;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -44,7 +43,8 @@ class Rotate : public Gtk::VBox, public AdjusterListener, public FoldableToolPan
|
|||||||
void straighten (double deg);
|
void straighten (double deg);
|
||||||
|
|
||||||
void adjusterChanged (Adjuster* a, double newval);
|
void adjusterChanged (Adjuster* a, double newval);
|
||||||
void setAdjusterBehavior (bool brotadd);
|
void setAdjusterBehavior (bool rotadd);
|
||||||
|
void trimValues (rtengine::procparams::ProcParams* pp);
|
||||||
void selectStraightPressed ();
|
void selectStraightPressed ();
|
||||||
void setLensGeomListener (LensGeomListener* l) { rlistener = l; }
|
void setLensGeomListener (LensGeomListener* l) { rlistener = l; }
|
||||||
};
|
};
|
||||||
|
@@ -233,22 +233,14 @@ void ShadowsHighlights::setBatchMode (bool batchMode) {
|
|||||||
|
|
||||||
void ShadowsHighlights::setAdjusterBehavior (bool hadd, bool sadd, bool lcadd) {
|
void ShadowsHighlights::setAdjusterBehavior (bool hadd, bool sadd, bool lcadd) {
|
||||||
|
|
||||||
if (!hAdd && hadd)
|
highlights->setAddMode(hadd);
|
||||||
highlights->setLimits (-100, 100, 1, 0);
|
shadows->setAddMode(sadd);
|
||||||
else if (hAdd && !hadd)
|
lcontrast->setAddMode(lcadd);
|
||||||
highlights->setLimits (0, 100, 1, 0);
|
}
|
||||||
|
|
||||||
if (!sAdd && sadd)
|
void ShadowsHighlights::trimValues (rtengine::procparams::ProcParams* pp) {
|
||||||
shadows->setLimits (-100, 100, 1, 0);
|
|
||||||
else if (sAdd && !sadd)
|
highlights->trimValue(pp->sh.highlights);
|
||||||
shadows->setLimits (0, 100, 1, 0);
|
shadows->trimValue(pp->sh.shadows);
|
||||||
|
lcontrast->trimValue(pp->sh.localcontrast);
|
||||||
if (!lcAdd && lcadd)
|
|
||||||
lcontrast->setLimits (-100, 100, 1, 0);
|
|
||||||
else if (lcAdd && !lcadd)
|
|
||||||
lcontrast->setLimits (0, 100, 1, 0);
|
|
||||||
|
|
||||||
hAdd = hadd;
|
|
||||||
sAdd = sadd;
|
|
||||||
lcAdd = lcadd;
|
|
||||||
}
|
}
|
||||||
|
@@ -34,7 +34,6 @@ class ShadowsHighlights : public Gtk::VBox, public AdjusterListener, public Fold
|
|||||||
Adjuster* radius;
|
Adjuster* radius;
|
||||||
Gtk::CheckButton* enabled;
|
Gtk::CheckButton* enabled;
|
||||||
Gtk::CheckButton* hq;
|
Gtk::CheckButton* hq;
|
||||||
bool hAdd, sAdd, lcAdd;
|
|
||||||
bool lastEnabled, lastHQ;
|
bool lastEnabled, lastHQ;
|
||||||
sigc::connection enaConn, hqConn;
|
sigc::connection enaConn, hqConn;
|
||||||
|
|
||||||
@@ -52,6 +51,7 @@ class ShadowsHighlights : public Gtk::VBox, public AdjusterListener, public Fold
|
|||||||
void hqChanged ();
|
void hqChanged ();
|
||||||
|
|
||||||
void setAdjusterBehavior (bool hadd, bool sadd, bool lcadd);
|
void setAdjusterBehavior (bool hadd, bool sadd, bool lcadd);
|
||||||
|
void trimValues (rtengine::procparams::ProcParams* pp);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -447,15 +447,14 @@ void Sharpening::setBatchMode (bool batchMode) {
|
|||||||
method->append_text (M("GENERAL_UNCHANGED"));
|
method->append_text (M("GENERAL_UNCHANGED"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sharpening::setAdjusterBehavior (bool bamountadd) {
|
void Sharpening::setAdjusterBehavior (bool amountadd) {
|
||||||
|
|
||||||
if (!amountAdd && bamountadd) {
|
amount->setAddMode(amountadd);
|
||||||
amount->setLimits (-100, 100, 1, 0);
|
damount->setAddMode(amountadd);
|
||||||
damount->setLimits (-100, 100, 1, 0);
|
}
|
||||||
}
|
|
||||||
else if (amountAdd && !bamountadd) {
|
void Sharpening::trimValues (rtengine::procparams::ProcParams* pp) {
|
||||||
amount->setLimits (1, 1000, 1, 150);
|
|
||||||
damount->setLimits (0, 100, 1, 75);
|
amount->trimValue(pp->sharpening.amount);
|
||||||
}
|
damount->trimValue(pp->sharpening.deconvamount);
|
||||||
amountAdd = bamountadd;
|
|
||||||
}
|
}
|
||||||
|
@@ -53,7 +53,6 @@ class Sharpening : public Gtk::VBox, public AdjusterListener, public FoldableToo
|
|||||||
Gtk::CheckButton* halocontrol;
|
Gtk::CheckButton* halocontrol;
|
||||||
bool lastHaloControl;
|
bool lastHaloControl;
|
||||||
sigc::connection hcConn;
|
sigc::connection hcConn;
|
||||||
bool amountAdd;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -73,7 +72,8 @@ class Sharpening : public Gtk::VBox, public AdjusterListener, public FoldableToo
|
|||||||
void halocontrol_toggled ();
|
void halocontrol_toggled ();
|
||||||
void method_changed ();
|
void method_changed ();
|
||||||
|
|
||||||
void setAdjusterBehavior (bool bamountadd);
|
void setAdjusterBehavior (bool amountadd);
|
||||||
|
void trimValues (rtengine::procparams::ProcParams* pp);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,405 +1,398 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of RawTherapee.
|
* This file is part of RawTherapee.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
|
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
|
||||||
*
|
*
|
||||||
* RawTherapee is free software: you can redistribute it and/or modify
|
* RawTherapee is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* RawTherapee is distributed in the hope that it will be useful,
|
* RawTherapee is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <tonecurve.h>
|
#include <tonecurve.h>
|
||||||
#include <adjuster.h>
|
#include <adjuster.h>
|
||||||
#include <sigc++/class_slot.h>
|
#include <sigc++/class_slot.h>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <guiutils.h>
|
#include <guiutils.h>
|
||||||
|
|
||||||
using namespace rtengine;
|
using namespace rtengine;
|
||||||
using namespace rtengine::procparams;
|
using namespace rtengine::procparams;
|
||||||
|
|
||||||
ToneCurve::ToneCurve () : Gtk::VBox(), FoldableToolPanel(this), expAdd(false),hlcompAdd(false),hlcompthreshAdd(false), blackAdd(false), shcompAdd(false), brAdd(false), contrAdd(false) {
|
ToneCurve::ToneCurve () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||||
|
|
||||||
//----------- Auto Levels ----------------------------------
|
//----------- Auto Levels ----------------------------------
|
||||||
abox = Gtk::manage (new Gtk::HBox ());
|
abox = Gtk::manage (new Gtk::HBox ());
|
||||||
abox->set_border_width (2);
|
abox->set_border_width (2);
|
||||||
|
|
||||||
autolevels = Gtk::manage (new Gtk::ToggleButton (M("TP_EXPOSURE_AUTOLEVELS")));
|
autolevels = Gtk::manage (new Gtk::ToggleButton (M("TP_EXPOSURE_AUTOLEVELS")));
|
||||||
autoconn = autolevels->signal_toggled().connect( sigc::mem_fun(*this, &ToneCurve::autolevels_toggled) );
|
autoconn = autolevels->signal_toggled().connect( sigc::mem_fun(*this, &ToneCurve::autolevels_toggled) );
|
||||||
|
|
||||||
sclip = Gtk::manage (new Gtk::SpinButton ());
|
sclip = Gtk::manage (new Gtk::SpinButton ());
|
||||||
sclip->set_range (0.0, 0.9999);
|
sclip->set_range (0.0, 0.9999);
|
||||||
sclip->set_increments (0.001, 0.01);
|
sclip->set_increments (0.001, 0.01);
|
||||||
sclip->set_value (0.002);
|
sclip->set_value (0.002);
|
||||||
sclip->set_digits (4);
|
sclip->set_digits (4);
|
||||||
sclip->signal_value_changed().connect( sigc::mem_fun(*this, &ToneCurve::clip_changed) );
|
sclip->signal_value_changed().connect( sigc::mem_fun(*this, &ToneCurve::clip_changed) );
|
||||||
|
|
||||||
abox->pack_start (*autolevels);
|
abox->pack_start (*autolevels);
|
||||||
abox->pack_end (*sclip);
|
abox->pack_end (*sclip);
|
||||||
abox->pack_end (*Gtk::manage (new Gtk::Label (M("TP_EXPOSURE_CLIP"))));
|
abox->pack_end (*Gtk::manage (new Gtk::Label (M("TP_EXPOSURE_CLIP"))));
|
||||||
pack_start (*abox);
|
pack_start (*abox);
|
||||||
|
|
||||||
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
||||||
|
|
||||||
//----------- Exposure Compensation ------------------------
|
//----------- Exposure Compensation ------------------------
|
||||||
expcomp = Gtk::manage (new Adjuster (M("TP_EXPOSURE_EXPCOMP"), -5, 10, 0.05, 0));
|
expcomp = Gtk::manage (new Adjuster (M("TP_EXPOSURE_EXPCOMP"), -5, 10, 0.05, 0));
|
||||||
pack_start (*expcomp);
|
pack_start (*expcomp);
|
||||||
hlcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 100, 1, 70));
|
hlcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 100, 1, 70));
|
||||||
pack_start (*hlcompr);
|
pack_start (*hlcompr);
|
||||||
hlcomprthresh = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 0));
|
hlcomprthresh = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 0));
|
||||||
pack_start (*hlcomprthresh);
|
pack_start (*hlcomprthresh);
|
||||||
|
|
||||||
//----------- Black Level ----------------------------------
|
//----------- Black Level ----------------------------------
|
||||||
black = Gtk::manage (new Adjuster (M("TP_EXPOSURE_BLACKLEVEL"), -16384, 32768, 50, 0));
|
black = Gtk::manage (new Adjuster (M("TP_EXPOSURE_BLACKLEVEL"), -16384, 32768, 50, 0));
|
||||||
pack_start (*black);
|
pack_start (*black);
|
||||||
shcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRSHADOWS"), 0, 100, 1, 50));
|
shcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRSHADOWS"), 0, 100, 1, 50));
|
||||||
pack_start (*shcompr);
|
pack_start (*shcompr);
|
||||||
|
|
||||||
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
||||||
|
|
||||||
//---------Brightness / Contrast -------------------------
|
//---------Brightness / Contrast -------------------------
|
||||||
brightness = Gtk::manage (new Adjuster (M("TP_EXPOSURE_BRIGHTNESS"), -100, 100, 1, 0));
|
brightness = Gtk::manage (new Adjuster (M("TP_EXPOSURE_BRIGHTNESS"), -100, 100, 1, 0));
|
||||||
pack_start (*brightness);
|
pack_start (*brightness);
|
||||||
contrast = Gtk::manage (new Adjuster (M("TP_EXPOSURE_CONTRAST"), -100, 100, 1, 0));
|
contrast = Gtk::manage (new Adjuster (M("TP_EXPOSURE_CONTRAST"), -100, 100, 1, 0));
|
||||||
pack_start (*contrast);
|
pack_start (*contrast);
|
||||||
saturation = Gtk::manage (new Adjuster (M("TP_EXPOSURE_SATURATION"), -100, 100, 1, 0));
|
saturation = Gtk::manage (new Adjuster (M("TP_EXPOSURE_SATURATION"), -100, 100, 1, 0));
|
||||||
pack_start (*saturation);
|
pack_start (*saturation);
|
||||||
|
|
||||||
//----------- Curve ------------------------------
|
//----------- Curve ------------------------------
|
||||||
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
||||||
|
|
||||||
curveEditorG = new CurveEditorGroup (M("TP_EXPOSURE_CURVEEDITOR"));
|
curveEditorG = new CurveEditorGroup (M("TP_EXPOSURE_CURVEEDITOR"));
|
||||||
curveEditorG->setCurveListener (this);
|
curveEditorG->setCurveListener (this);
|
||||||
|
|
||||||
shape = (DiagonalCurveEditor*)curveEditorG->addCurve(CT_Diagonal, "");
|
shape = (DiagonalCurveEditor*)curveEditorG->addCurve(CT_Diagonal, "");
|
||||||
|
|
||||||
// This will add the reset button at the end of the curveType buttons
|
// This will add the reset button at the end of the curveType buttons
|
||||||
curveEditorG->curveListComplete();
|
curveEditorG->curveListComplete();
|
||||||
|
|
||||||
pack_start (*curveEditorG, Gtk::PACK_SHRINK, 4);
|
pack_start (*curveEditorG, Gtk::PACK_SHRINK, 4);
|
||||||
|
|
||||||
//curveEditorG->show();
|
//curveEditorG->show();
|
||||||
|
|
||||||
// --------- Set Up Listeners -------------
|
// --------- Set Up Listeners -------------
|
||||||
expcomp->setAdjusterListener (this);
|
expcomp->setAdjusterListener (this);
|
||||||
brightness->setAdjusterListener (this);
|
brightness->setAdjusterListener (this);
|
||||||
black->setAdjusterListener (this);
|
black->setAdjusterListener (this);
|
||||||
hlcompr->setAdjusterListener (this);
|
hlcompr->setAdjusterListener (this);
|
||||||
hlcomprthresh->setAdjusterListener (this);
|
hlcomprthresh->setAdjusterListener (this);
|
||||||
shcompr->setAdjusterListener (this);
|
shcompr->setAdjusterListener (this);
|
||||||
contrast->setAdjusterListener (this);
|
contrast->setAdjusterListener (this);
|
||||||
saturation->setAdjusterListener (this);
|
saturation->setAdjusterListener (this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToneCurve::read (const ProcParams* pp, const ParamsEdited* pedited) {
|
void ToneCurve::read (const ProcParams* pp, const ParamsEdited* pedited) {
|
||||||
|
|
||||||
disableListener ();
|
disableListener ();
|
||||||
|
|
||||||
if (pedited) {
|
if (pedited) {
|
||||||
expcomp->setEditedState (pedited->toneCurve.expcomp ? Edited : UnEdited);
|
expcomp->setEditedState (pedited->toneCurve.expcomp ? Edited : UnEdited);
|
||||||
black->setEditedState (pedited->toneCurve.black ? Edited : UnEdited);
|
black->setEditedState (pedited->toneCurve.black ? Edited : UnEdited);
|
||||||
hlcompr->setEditedState (pedited->toneCurve.hlcompr ? Edited : UnEdited);
|
hlcompr->setEditedState (pedited->toneCurve.hlcompr ? Edited : UnEdited);
|
||||||
hlcomprthresh->setEditedState (pedited->toneCurve.hlcomprthresh ? Edited : UnEdited);
|
hlcomprthresh->setEditedState (pedited->toneCurve.hlcomprthresh ? Edited : UnEdited);
|
||||||
shcompr->setEditedState (pedited->toneCurve.shcompr ? Edited : UnEdited);
|
shcompr->setEditedState (pedited->toneCurve.shcompr ? Edited : UnEdited);
|
||||||
brightness->setEditedState (pedited->toneCurve.brightness ? Edited : UnEdited);
|
brightness->setEditedState (pedited->toneCurve.brightness ? Edited : UnEdited);
|
||||||
contrast->setEditedState (pedited->toneCurve.contrast ? Edited : UnEdited);
|
contrast->setEditedState (pedited->toneCurve.contrast ? Edited : UnEdited);
|
||||||
saturation->setEditedState (pedited->toneCurve.saturation ? Edited : UnEdited);
|
saturation->setEditedState (pedited->toneCurve.saturation ? Edited : UnEdited);
|
||||||
autolevels->set_inconsistent (!pedited->toneCurve.autoexp);
|
autolevels->set_inconsistent (!pedited->toneCurve.autoexp);
|
||||||
clipDirty = pedited->toneCurve.clip;
|
clipDirty = pedited->toneCurve.clip;
|
||||||
shape->setUnChanged (!pedited->toneCurve.curve);
|
shape->setUnChanged (!pedited->toneCurve.curve);
|
||||||
}
|
}
|
||||||
|
|
||||||
autoconn.block (true);
|
autoconn.block (true);
|
||||||
autolevels->set_active (pp->toneCurve.autoexp);
|
autolevels->set_active (pp->toneCurve.autoexp);
|
||||||
autoconn.block (false);
|
autoconn.block (false);
|
||||||
lastAuto = pp->toneCurve.autoexp;
|
lastAuto = pp->toneCurve.autoexp;
|
||||||
sclip->set_value (pp->toneCurve.clip);
|
sclip->set_value (pp->toneCurve.clip);
|
||||||
|
|
||||||
expcomp->setValue (pp->toneCurve.expcomp);
|
expcomp->setValue (pp->toneCurve.expcomp);
|
||||||
black->setValue (pp->toneCurve.black);
|
black->setValue (pp->toneCurve.black);
|
||||||
hlcompr->setValue (pp->toneCurve.hlcompr);
|
hlcompr->setValue (pp->toneCurve.hlcompr);
|
||||||
hlcomprthresh->setValue (pp->toneCurve.hlcomprthresh);
|
hlcomprthresh->setValue (pp->toneCurve.hlcomprthresh);
|
||||||
shcompr->setValue (pp->toneCurve.shcompr);
|
shcompr->setValue (pp->toneCurve.shcompr);
|
||||||
if (!blackAdd) shcompr->set_sensitive(!((int)black->getValue ()==0)); //at black=0 shcompr value has no effect
|
if (!black->getAddMode()) shcompr->set_sensitive(!((int)black->getValue ()==0)); //at black=0 shcompr value has no effect
|
||||||
brightness->setValue (pp->toneCurve.brightness);
|
brightness->setValue (pp->toneCurve.brightness);
|
||||||
contrast->setValue (pp->toneCurve.contrast);
|
contrast->setValue (pp->toneCurve.contrast);
|
||||||
saturation->setValue (pp->toneCurve.saturation);
|
saturation->setValue (pp->toneCurve.saturation);
|
||||||
shape->setCurve (pp->toneCurve.curve);
|
shape->setCurve (pp->toneCurve.curve);
|
||||||
|
|
||||||
shape->openIfNonlinear();
|
shape->openIfNonlinear();
|
||||||
|
|
||||||
enableListener ();
|
enableListener ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToneCurve::write (ProcParams* pp, ParamsEdited* pedited) {
|
void ToneCurve::write (ProcParams* pp, ParamsEdited* pedited) {
|
||||||
|
|
||||||
pp->toneCurve.autoexp = autolevels->get_active();
|
pp->toneCurve.autoexp = autolevels->get_active();
|
||||||
pp->toneCurve.clip = sclip->get_value ();
|
pp->toneCurve.clip = sclip->get_value ();
|
||||||
pp->toneCurve.expcomp = expcomp->getValue ();
|
pp->toneCurve.expcomp = expcomp->getValue ();
|
||||||
pp->toneCurve.black = (int)black->getValue ();
|
pp->toneCurve.black = (int)black->getValue ();
|
||||||
pp->toneCurve.hlcompr = (int)hlcompr->getValue ();
|
pp->toneCurve.hlcompr = (int)hlcompr->getValue ();
|
||||||
pp->toneCurve.hlcomprthresh = (int)hlcomprthresh->getValue ();
|
pp->toneCurve.hlcomprthresh = (int)hlcomprthresh->getValue ();
|
||||||
pp->toneCurve.shcompr = (int)shcompr->getValue ();
|
pp->toneCurve.shcompr = (int)shcompr->getValue ();
|
||||||
pp->toneCurve.brightness = (int)brightness->getValue ();
|
pp->toneCurve.brightness = (int)brightness->getValue ();
|
||||||
pp->toneCurve.contrast = (int)contrast->getValue ();
|
pp->toneCurve.contrast = (int)contrast->getValue ();
|
||||||
pp->toneCurve.saturation = (int)saturation->getValue ();
|
pp->toneCurve.saturation = (int)saturation->getValue ();
|
||||||
pp->toneCurve.curve = shape->getCurve ();
|
pp->toneCurve.curve = shape->getCurve ();
|
||||||
|
|
||||||
if (pedited) {
|
if (pedited) {
|
||||||
pedited->toneCurve.expcomp = expcomp->getEditedState ();
|
pedited->toneCurve.expcomp = expcomp->getEditedState ();
|
||||||
pedited->toneCurve.black = black->getEditedState ();
|
pedited->toneCurve.black = black->getEditedState ();
|
||||||
pedited->toneCurve.hlcompr = hlcompr->getEditedState ();
|
pedited->toneCurve.hlcompr = hlcompr->getEditedState ();
|
||||||
pedited->toneCurve.hlcomprthresh = hlcomprthresh->getEditedState ();
|
pedited->toneCurve.hlcomprthresh = hlcomprthresh->getEditedState ();
|
||||||
pedited->toneCurve.shcompr = shcompr->getEditedState ();
|
pedited->toneCurve.shcompr = shcompr->getEditedState ();
|
||||||
pedited->toneCurve.brightness = brightness->getEditedState ();
|
pedited->toneCurve.brightness = brightness->getEditedState ();
|
||||||
pedited->toneCurve.contrast = contrast->getEditedState ();
|
pedited->toneCurve.contrast = contrast->getEditedState ();
|
||||||
pedited->toneCurve.saturation = saturation->getEditedState ();
|
pedited->toneCurve.saturation = saturation->getEditedState ();
|
||||||
pedited->toneCurve.autoexp = !autolevels->get_inconsistent();
|
pedited->toneCurve.autoexp = !autolevels->get_inconsistent();
|
||||||
pedited->toneCurve.clip = clipDirty;
|
pedited->toneCurve.clip = clipDirty;
|
||||||
pedited->toneCurve.curve = !shape->isUnChanged ();
|
pedited->toneCurve.curve = !shape->isUnChanged ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToneCurve::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) {
|
void ToneCurve::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) {
|
||||||
|
|
||||||
expcomp->setDefault (defParams->toneCurve.expcomp);
|
expcomp->setDefault (defParams->toneCurve.expcomp);
|
||||||
brightness->setDefault (defParams->toneCurve.brightness);
|
brightness->setDefault (defParams->toneCurve.brightness);
|
||||||
black->setDefault (defParams->toneCurve.black);
|
black->setDefault (defParams->toneCurve.black);
|
||||||
hlcompr->setDefault (defParams->toneCurve.hlcompr);
|
hlcompr->setDefault (defParams->toneCurve.hlcompr);
|
||||||
hlcomprthresh->setDefault (defParams->toneCurve.hlcomprthresh);
|
hlcomprthresh->setDefault (defParams->toneCurve.hlcomprthresh);
|
||||||
shcompr->setDefault (defParams->toneCurve.shcompr);
|
shcompr->setDefault (defParams->toneCurve.shcompr);
|
||||||
contrast->setDefault (defParams->toneCurve.contrast);
|
contrast->setDefault (defParams->toneCurve.contrast);
|
||||||
saturation->setDefault (defParams->toneCurve.saturation);
|
saturation->setDefault (defParams->toneCurve.saturation);
|
||||||
|
|
||||||
if (pedited) {
|
if (pedited) {
|
||||||
expcomp->setDefaultEditedState (pedited->toneCurve.expcomp ? Edited : UnEdited);
|
expcomp->setDefaultEditedState (pedited->toneCurve.expcomp ? Edited : UnEdited);
|
||||||
black->setDefaultEditedState (pedited->toneCurve.black ? Edited : UnEdited);
|
black->setDefaultEditedState (pedited->toneCurve.black ? Edited : UnEdited);
|
||||||
hlcompr->setDefaultEditedState (pedited->toneCurve.hlcompr ? Edited : UnEdited);
|
hlcompr->setDefaultEditedState (pedited->toneCurve.hlcompr ? Edited : UnEdited);
|
||||||
hlcomprthresh->setDefaultEditedState (pedited->toneCurve.hlcomprthresh ? Edited : UnEdited);
|
hlcomprthresh->setDefaultEditedState (pedited->toneCurve.hlcomprthresh ? Edited : UnEdited);
|
||||||
shcompr->setDefaultEditedState (pedited->toneCurve.shcompr ? Edited : UnEdited);
|
shcompr->setDefaultEditedState (pedited->toneCurve.shcompr ? Edited : UnEdited);
|
||||||
brightness->setDefaultEditedState (pedited->toneCurve.brightness ? Edited : UnEdited);
|
brightness->setDefaultEditedState (pedited->toneCurve.brightness ? Edited : UnEdited);
|
||||||
contrast->setDefaultEditedState (pedited->toneCurve.contrast ? Edited : UnEdited);
|
contrast->setDefaultEditedState (pedited->toneCurve.contrast ? Edited : UnEdited);
|
||||||
saturation->setDefaultEditedState (pedited->toneCurve.saturation ? Edited : UnEdited);
|
saturation->setDefaultEditedState (pedited->toneCurve.saturation ? Edited : UnEdited);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
expcomp->setDefaultEditedState (Irrelevant);
|
expcomp->setDefaultEditedState (Irrelevant);
|
||||||
black->setDefaultEditedState (Irrelevant);
|
black->setDefaultEditedState (Irrelevant);
|
||||||
hlcompr->setDefaultEditedState (Irrelevant);
|
hlcompr->setDefaultEditedState (Irrelevant);
|
||||||
hlcomprthresh->setDefaultEditedState (Irrelevant);
|
hlcomprthresh->setDefaultEditedState (Irrelevant);
|
||||||
shcompr->setDefaultEditedState (Irrelevant);
|
shcompr->setDefaultEditedState (Irrelevant);
|
||||||
brightness->setDefaultEditedState (Irrelevant);
|
brightness->setDefaultEditedState (Irrelevant);
|
||||||
contrast->setDefaultEditedState (Irrelevant);
|
contrast->setDefaultEditedState (Irrelevant);
|
||||||
saturation->setDefaultEditedState (Irrelevant);
|
saturation->setDefaultEditedState (Irrelevant);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToneCurve::curveChanged () {
|
void ToneCurve::curveChanged () {
|
||||||
|
|
||||||
if (listener) listener->panelChanged (EvToneCurve, M("HISTORY_CUSTOMCURVE"));
|
if (listener) listener->panelChanged (EvToneCurve, M("HISTORY_CUSTOMCURVE"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToneCurve::adjusterChanged (Adjuster* a, double newval) {
|
void ToneCurve::adjusterChanged (Adjuster* a, double newval) {
|
||||||
|
|
||||||
// Switch off auto exposure if user changes sliders manually
|
// Switch off auto exposure if user changes sliders manually
|
||||||
if (autolevels->get_active() && (a==expcomp || a==black)) {
|
if (autolevels->get_active() && (a==expcomp || a==black)) {
|
||||||
autolevels->set_active (false);
|
autolevels->set_active (false);
|
||||||
autolevels->set_inconsistent (false);
|
autolevels->set_inconsistent (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!listener)
|
if (!listener)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Glib::ustring costr;
|
Glib::ustring costr;
|
||||||
if (a==expcomp)
|
if (a==expcomp)
|
||||||
costr = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), a->getValue());
|
costr = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), a->getValue());
|
||||||
else
|
else
|
||||||
costr = Glib::ustring::format ((int)a->getValue());
|
costr = Glib::ustring::format ((int)a->getValue());
|
||||||
|
|
||||||
if (a==expcomp)
|
if (a==expcomp)
|
||||||
listener->panelChanged (EvExpComp, costr);
|
listener->panelChanged (EvExpComp, costr);
|
||||||
else if (a==brightness)
|
else if (a==brightness)
|
||||||
listener->panelChanged (EvBrightness, costr);
|
listener->panelChanged (EvBrightness, costr);
|
||||||
else if (a==black){
|
else if (a==black){
|
||||||
listener->panelChanged (EvBlack, costr);
|
listener->panelChanged (EvBlack, costr);
|
||||||
if (!blackAdd) shcompr->set_sensitive(!((int)black->getValue ()==0)); //at black=0 shcompr value has no effect
|
if (!black->getAddMode()) shcompr->set_sensitive(!((int)black->getValue ()==0)); //at black=0 shcompr value has no effect
|
||||||
}
|
}
|
||||||
else if (a==contrast)
|
else if (a==contrast)
|
||||||
listener->panelChanged (EvContrast, costr);
|
listener->panelChanged (EvContrast, costr);
|
||||||
else if (a==saturation)
|
else if (a==saturation)
|
||||||
listener->panelChanged (EvSaturation, costr);
|
listener->panelChanged (EvSaturation, costr);
|
||||||
else if (a==hlcompr)
|
else if (a==hlcompr)
|
||||||
listener->panelChanged (EvHLCompr, costr);
|
listener->panelChanged (EvHLCompr, costr);
|
||||||
else if (a==hlcomprthresh)
|
else if (a==hlcomprthresh)
|
||||||
listener->panelChanged (EvHLComprThreshold, costr);
|
listener->panelChanged (EvHLComprThreshold, costr);
|
||||||
else if (a==shcompr)
|
else if (a==shcompr)
|
||||||
listener->panelChanged (EvSHCompr, costr);
|
listener->panelChanged (EvSHCompr, costr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToneCurve::autolevels_toggled () {
|
void ToneCurve::autolevels_toggled () {
|
||||||
|
|
||||||
if (batchMode) {
|
if (batchMode) {
|
||||||
if (autolevels->get_inconsistent()) {
|
if (autolevels->get_inconsistent()) {
|
||||||
autolevels->set_inconsistent (false);
|
autolevels->set_inconsistent (false);
|
||||||
autoconn.block (true);
|
autoconn.block (true);
|
||||||
autolevels->set_active (false);
|
autolevels->set_active (false);
|
||||||
autoconn.block (false);
|
autoconn.block (false);
|
||||||
}
|
}
|
||||||
else if (lastAuto)
|
else if (lastAuto)
|
||||||
autolevels->set_inconsistent (true);
|
autolevels->set_inconsistent (true);
|
||||||
|
|
||||||
lastAuto = autolevels->get_active ();
|
lastAuto = autolevels->get_active ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!batchMode && autolevels->get_active() && listener) {
|
if (!batchMode && autolevels->get_active() && listener) {
|
||||||
listener->panelChanged (EvAutoExp, M("GENERAL_ENABLED"));
|
listener->panelChanged (EvAutoExp, M("GENERAL_ENABLED"));
|
||||||
waitForAutoExp ();
|
waitForAutoExp ();
|
||||||
if (!blackAdd) shcompr->set_sensitive(!((int)black->getValue ()==0)); //at black=0 shcompr value has no effect
|
if (!black->getAddMode()) shcompr->set_sensitive(!((int)black->getValue ()==0)); //at black=0 shcompr value has no effect
|
||||||
}
|
}
|
||||||
|
|
||||||
if (batchMode) {
|
if (batchMode) {
|
||||||
expcomp->setEditedState (UnEdited);
|
expcomp->setEditedState (UnEdited);
|
||||||
black->setEditedState (UnEdited);
|
black->setEditedState (UnEdited);
|
||||||
if (expAdd)
|
if (expcomp->getAddMode())
|
||||||
expcomp->setValue (0);
|
expcomp->setValue (0);
|
||||||
if (blackAdd)
|
if (black->getAddMode())
|
||||||
black->setValue (0);
|
black->setValue (0);
|
||||||
listener->panelChanged (EvAutoExp, M("GENERAL_ENABLED"));
|
listener->panelChanged (EvAutoExp, M("GENERAL_ENABLED"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToneCurve::clip_changed () {
|
void ToneCurve::clip_changed () {
|
||||||
|
|
||||||
clipDirty = true;
|
clipDirty = true;
|
||||||
if (autolevels->get_active() && listener)
|
if (autolevels->get_active() && listener)
|
||||||
Glib::signal_idle().connect (sigc::mem_fun(*this, &ToneCurve::clip_changed_));
|
Glib::signal_idle().connect (sigc::mem_fun(*this, &ToneCurve::clip_changed_));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ToneCurve::clip_changed_ () {
|
bool ToneCurve::clip_changed_ () {
|
||||||
|
|
||||||
if (listener) {
|
if (listener) {
|
||||||
listener->panelChanged (EvClip, Glib::ustring::format (std::setprecision(5), sclip->get_value()));
|
listener->panelChanged (EvClip, Glib::ustring::format (std::setprecision(5), sclip->get_value()));
|
||||||
if (!batchMode)
|
if (!batchMode)
|
||||||
waitForAutoExp ();
|
waitForAutoExp ();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToneCurve::waitForAutoExp () {
|
void ToneCurve::waitForAutoExp () {
|
||||||
|
|
||||||
sclip->set_sensitive (false);
|
sclip->set_sensitive (false);
|
||||||
expcomp->setEnabled (false);
|
expcomp->setEnabled (false);
|
||||||
brightness->setEnabled (false);
|
brightness->setEnabled (false);
|
||||||
black->setEnabled (false);
|
black->setEnabled (false);
|
||||||
hlcompr->setEnabled (false);
|
hlcompr->setEnabled (false);
|
||||||
hlcomprthresh->setEnabled (false);
|
hlcomprthresh->setEnabled (false);
|
||||||
shcompr->setEnabled (false);
|
shcompr->setEnabled (false);
|
||||||
contrast->setEnabled (false);
|
contrast->setEnabled (false);
|
||||||
saturation->setEnabled (false);
|
saturation->setEnabled (false);
|
||||||
curveEditorG->set_sensitive (false);
|
curveEditorG->set_sensitive (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
int aexpcomputed (void* data) {
|
int aexpcomputed (void* data) {
|
||||||
|
|
||||||
gdk_threads_enter();
|
gdk_threads_enter();
|
||||||
((ToneCurve*)data)->autoExpComputed_ ();
|
((ToneCurve*)data)->autoExpComputed_ ();
|
||||||
gdk_threads_leave();
|
gdk_threads_leave();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToneCurve::autoExpChanged (double expcomp, int black) {
|
void ToneCurve::autoExpChanged (double expcomp, int black) {
|
||||||
|
|
||||||
nextBlack = black;
|
nextBlack = black;
|
||||||
nextExpcomp = expcomp;
|
nextExpcomp = expcomp;
|
||||||
g_idle_add (aexpcomputed, this);
|
g_idle_add (aexpcomputed, this);
|
||||||
|
|
||||||
// Glib::signal_idle().connect (sigc::mem_fun(*this, &ToneCurve::autoExpComputed_));
|
// Glib::signal_idle().connect (sigc::mem_fun(*this, &ToneCurve::autoExpComputed_));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToneCurve::enableAll () {
|
void ToneCurve::enableAll () {
|
||||||
|
|
||||||
sclip->set_sensitive (true);
|
sclip->set_sensitive (true);
|
||||||
expcomp->setEnabled (true);
|
expcomp->setEnabled (true);
|
||||||
brightness->setEnabled (true);
|
brightness->setEnabled (true);
|
||||||
black->setEnabled (true);
|
black->setEnabled (true);
|
||||||
hlcompr->setEnabled (true);
|
hlcompr->setEnabled (true);
|
||||||
hlcomprthresh->setEnabled (true);
|
hlcomprthresh->setEnabled (true);
|
||||||
shcompr->setEnabled (true);
|
shcompr->setEnabled (true);
|
||||||
contrast->setEnabled (true);
|
contrast->setEnabled (true);
|
||||||
saturation->setEnabled (true);
|
saturation->setEnabled (true);
|
||||||
curveEditorG->set_sensitive (true);
|
curveEditorG->set_sensitive (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ToneCurve::autoExpComputed_ () {
|
bool ToneCurve::autoExpComputed_ () {
|
||||||
|
|
||||||
disableListener ();
|
disableListener ();
|
||||||
enableAll ();
|
enableAll ();
|
||||||
expcomp->setValue (nextExpcomp);
|
expcomp->setValue (nextExpcomp);
|
||||||
black->setValue (nextBlack);
|
black->setValue (nextBlack);
|
||||||
if (!blackAdd) shcompr->set_sensitive(!((int)black->getValue ()==0)); //at black=0 shcompr value has no effect
|
if (!black->getAddMode()) shcompr->set_sensitive(!((int)black->getValue ()==0)); //at black=0 shcompr value has no effect
|
||||||
enableListener ();
|
enableListener ();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToneCurve::setBatchMode (bool batchMode) {
|
void ToneCurve::setBatchMode (bool batchMode) {
|
||||||
|
|
||||||
removeIfThere (abox, autolevels, false);
|
removeIfThere (abox, autolevels, false);
|
||||||
autolevels = Gtk::manage (new Gtk::CheckButton (M("TP_EXPOSURE_AUTOLEVELS")));
|
autolevels = Gtk::manage (new Gtk::CheckButton (M("TP_EXPOSURE_AUTOLEVELS")));
|
||||||
autoconn = autolevels->signal_toggled().connect( sigc::mem_fun(*this, &ToneCurve::autolevels_toggled) );
|
autoconn = autolevels->signal_toggled().connect( sigc::mem_fun(*this, &ToneCurve::autolevels_toggled) );
|
||||||
abox->pack_start (*autolevels);
|
abox->pack_start (*autolevels);
|
||||||
|
|
||||||
ToolPanel::setBatchMode (batchMode);
|
ToolPanel::setBatchMode (batchMode);
|
||||||
expcomp->showEditedCB ();
|
expcomp->showEditedCB ();
|
||||||
black->showEditedCB ();
|
black->showEditedCB ();
|
||||||
hlcompr->showEditedCB ();
|
hlcompr->showEditedCB ();
|
||||||
hlcomprthresh->showEditedCB ();
|
hlcomprthresh->showEditedCB ();
|
||||||
shcompr->showEditedCB ();
|
shcompr->showEditedCB ();
|
||||||
brightness->showEditedCB ();
|
brightness->showEditedCB ();
|
||||||
contrast->showEditedCB ();
|
contrast->showEditedCB ();
|
||||||
saturation->showEditedCB ();
|
saturation->showEditedCB ();
|
||||||
|
|
||||||
curveEditorG->setBatchMode (batchMode);
|
curveEditorG->setBatchMode (batchMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToneCurve::setAdjusterBehavior (bool expadd, bool hlcompadd, bool hlcompthreshadd, bool bradd, bool blackadd, bool shcompadd, bool contradd, bool satadd) {
|
void ToneCurve::setAdjusterBehavior (bool expadd, bool hlcompadd, bool hlcompthreshadd, bool bradd, bool blackadd, bool shcompadd, bool contradd, bool satadd) {
|
||||||
|
|
||||||
if ((!expAdd && expadd) || (expAdd && !expadd))
|
expcomp->setAddMode(expadd);
|
||||||
expcomp->setLimits (-5, 5, 0.01, 0);
|
hlcompr->setAddMode(hlcompadd);
|
||||||
if ((!hlcompAdd && hlcompadd) || (hlcompAdd && !hlcompadd))
|
hlcomprthresh->setAddMode(hlcompthreshadd);
|
||||||
hlcompr->setLimits (0, 100, 1, 0);
|
brightness->setAddMode(bradd);
|
||||||
if ((!hlcompthreshAdd && hlcompthreshadd) || (hlcompthreshAdd && !hlcompthreshadd))
|
black->setAddMode(blackadd);
|
||||||
hlcomprthresh->setLimits (0, 100, 1, 0);
|
shcompr->setAddMode(shcompadd);
|
||||||
if (!blackAdd && blackadd)
|
contrast->setAddMode(contradd);
|
||||||
black->setLimits (0, 16384, 1, 0);
|
saturation->setAddMode(satadd);
|
||||||
else if (blackAdd && !blackadd)
|
}
|
||||||
black->setLimits (0, 32768, 1, 0);
|
|
||||||
if ((!shcompAdd && shcompadd) || (shcompAdd && !shcompadd))
|
void ToneCurve::trimValues (rtengine::procparams::ProcParams* pp) {
|
||||||
shcompr->setLimits (0, 100, 1, 0);
|
|
||||||
if ((!brAdd && bradd) || (brAdd && !bradd))
|
expcomp->trimValue(pp->toneCurve.expcomp);
|
||||||
brightness->setLimits (-100, 100, 1, 0);
|
hlcompr->trimValue(pp->toneCurve.hlcompr);
|
||||||
if ((!contrAdd && contradd) || (contrAdd && !contradd))
|
hlcomprthresh->trimValue(pp->toneCurve.hlcomprthresh);
|
||||||
contrast->setLimits (-100, 100, 1, 0);
|
brightness->trimValue(pp->toneCurve.brightness);
|
||||||
if ((!satAdd && satadd) || (satAdd && !satadd))
|
black->trimValue(pp->toneCurve.black);
|
||||||
saturation->setLimits (-100, 100, 1, 0);
|
shcompr->trimValue(pp->toneCurve.shcompr);
|
||||||
|
contrast->trimValue(pp->toneCurve.contrast);
|
||||||
expAdd = expadd;
|
saturation->trimValue(pp->toneCurve.saturation);
|
||||||
hlcompAdd = hlcompadd;
|
}
|
||||||
hlcompthreshAdd = hlcompthreshadd;
|
|
||||||
blackAdd = blackadd;
|
void ToneCurve::updateCurveBackgroundHistogram (LUTu & hist) {
|
||||||
shcompAdd = shcompadd;
|
|
||||||
brAdd = bradd;
|
shape->updateBackgroundHistogram (hist);
|
||||||
contrAdd = contradd;
|
}
|
||||||
satAdd = satadd;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ToneCurve::updateCurveBackgroundHistogram (LUTu & hist) {
|
|
||||||
|
|
||||||
shape->updateBackgroundHistogram (hist);
|
|
||||||
}
|
|
||||||
|
@@ -41,7 +41,7 @@ class ToneCurve : public Gtk::VBox, public AdjusterListener, public FoldableTool
|
|||||||
Adjuster* contrast;
|
Adjuster* contrast;
|
||||||
Adjuster* saturation;
|
Adjuster* saturation;
|
||||||
|
|
||||||
bool expAdd,hlcompAdd,hlcompthreshAdd, blackAdd, shcompAdd, brAdd, contrAdd, satAdd, clipDirty, lastAuto;
|
bool clipDirty, lastAuto;
|
||||||
sigc::connection autoconn;
|
sigc::connection autoconn;
|
||||||
CurveEditorGroup* curveEditorG;
|
CurveEditorGroup* curveEditorG;
|
||||||
DiagonalCurveEditor* shape;
|
DiagonalCurveEditor* shape;
|
||||||
@@ -54,11 +54,13 @@ class ToneCurve : public Gtk::VBox, public AdjusterListener, public FoldableTool
|
|||||||
|
|
||||||
ToneCurve ();
|
ToneCurve ();
|
||||||
|
|
||||||
void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL);
|
void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL);
|
||||||
void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL);
|
void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL);
|
||||||
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL);
|
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL);
|
||||||
void setBatchMode (bool batchMode);
|
void setBatchMode (bool batchMode);
|
||||||
void setAdjusterBehavior (bool expadd, bool hlcompadd, bool hlcompthreshadd, bool bradd, bool blackadd, bool shcompadd, bool contradd, bool satadd);
|
void setAdjusterBehavior (bool expadd, bool hlcompadd, bool hlcompthreshadd, bool bradd, bool blackadd, bool shcompadd, bool contradd, bool satadd);
|
||||||
|
void trimValues (rtengine::procparams::ProcParams* pp);
|
||||||
|
|
||||||
|
|
||||||
void adjusterChanged (Adjuster* a, double newval);
|
void adjusterChanged (Adjuster* a, double newval);
|
||||||
void autolevels_toggled ();
|
void autolevels_toggled ();
|
||||||
|
@@ -52,6 +52,7 @@ class ToolPanel {
|
|||||||
void setListener (ToolPanelListener* tpl) { listener = tpl; }
|
void setListener (ToolPanelListener* tpl) { listener = tpl; }
|
||||||
virtual void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL) {}
|
virtual void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL) {}
|
||||||
virtual void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL) {}
|
virtual void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL) {}
|
||||||
|
virtual void trimValues (rtengine::procparams::ProcParams* pp) { return; }
|
||||||
virtual void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL) {}
|
virtual void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL) {}
|
||||||
|
|
||||||
void disableListener () { if (tmp==NULL) tmp = listener; listener = NULL; }
|
void disableListener () { if (tmp==NULL) tmp = listener; listener = NULL; }
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
using namespace rtengine;
|
using namespace rtengine;
|
||||||
using namespace rtengine::procparams;
|
using namespace rtengine::procparams;
|
||||||
|
|
||||||
Vignetting::Vignetting () : Gtk::VBox(), FoldableToolPanel(this), vigAdd(false) {
|
Vignetting::Vignetting () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||||
|
|
||||||
amount = Gtk::manage (new Adjuster (M("TP_VIGNETTING_AMOUNT"), -100, 100, 1, 0));
|
amount = Gtk::manage (new Adjuster (M("TP_VIGNETTING_AMOUNT"), -100, 100, 1, 0));
|
||||||
amount->setAdjusterListener (this);
|
amount->setAdjusterListener (this);
|
||||||
@@ -96,12 +96,14 @@ void Vignetting::adjusterChanged (Adjuster* a, double newval) {
|
|||||||
listener->panelChanged (EvVignetting, Glib::ustring::compose ("%1=%5\n%2=%6\n%3=%7\n%4=%8 %9", M("TP_VIGNETTING_AMOUNT"), M("TP_VIGNETTING_RADIUS"), M("TP_VIGNETTING_STRENGTH"), M("TP_VIGNETTING_CENTER"), (int)amount->getValue(), (int)radius->getValue(), (int)strength->getValue(), (int)centerX->getValue(), (int)centerY->getValue()));
|
listener->panelChanged (EvVignetting, Glib::ustring::compose ("%1=%5\n%2=%6\n%3=%7\n%4=%8 %9", M("TP_VIGNETTING_AMOUNT"), M("TP_VIGNETTING_RADIUS"), M("TP_VIGNETTING_STRENGTH"), M("TP_VIGNETTING_CENTER"), (int)amount->getValue(), (int)radius->getValue(), (int)strength->getValue(), (int)centerX->getValue(), (int)centerY->getValue()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Vignetting::setAdjusterBehavior (bool bvadd) {
|
void Vignetting::setAdjusterBehavior (bool vadd) {
|
||||||
|
|
||||||
if ((!vigAdd && bvadd) || (vigAdd && !bvadd))
|
amount->setAddMode(vadd);
|
||||||
amount->setLimits (-100, 100, 1, 0);
|
}
|
||||||
|
|
||||||
vigAdd = bvadd;
|
void Vignetting::trimValues (rtengine::procparams::ProcParams* pp) {
|
||||||
|
|
||||||
|
amount->trimValue(pp->vignetting.amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Vignetting::setBatchMode (bool batchMode) {
|
void Vignetting::setBatchMode (bool batchMode) {
|
||||||
|
@@ -31,7 +31,6 @@ class Vignetting : public Gtk::VBox, public AdjusterListener, public FoldableToo
|
|||||||
Adjuster* strength;
|
Adjuster* strength;
|
||||||
Adjuster* centerX;
|
Adjuster* centerX;
|
||||||
Adjuster* centerY;
|
Adjuster* centerY;
|
||||||
bool vigAdd;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -43,7 +42,8 @@ class Vignetting : public Gtk::VBox, public AdjusterListener, public FoldableToo
|
|||||||
void setBatchMode (bool batchMode);
|
void setBatchMode (bool batchMode);
|
||||||
|
|
||||||
void adjusterChanged (Adjuster* a, double newval);
|
void adjusterChanged (Adjuster* a, double newval);
|
||||||
void setAdjusterBehavior (bool bvadd);
|
void setAdjusterBehavior (bool vadd);
|
||||||
|
void trimValues (rtengine::procparams::ProcParams* pp);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -29,7 +29,7 @@ extern Glib::ustring argv0;
|
|||||||
using namespace rtengine;
|
using namespace rtengine;
|
||||||
using namespace rtengine::procparams;
|
using namespace rtengine::procparams;
|
||||||
|
|
||||||
WhiteBalance::WhiteBalance () : Gtk::VBox(), FoldableToolPanel(this), wbp(NULL), wblistener(NULL), tempAdd(false), greenAdd (false) {
|
WhiteBalance::WhiteBalance () : Gtk::VBox(), FoldableToolPanel(this), wbp(NULL), wblistener(NULL) {
|
||||||
|
|
||||||
Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox ());
|
Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox ());
|
||||||
hbox->show ();
|
hbox->show ();
|
||||||
@@ -114,8 +114,8 @@ void WhiteBalance::optChanged () {
|
|||||||
if (opt==0 && wbp) {
|
if (opt==0 && wbp) {
|
||||||
double ctemp; double cgreen;
|
double ctemp; double cgreen;
|
||||||
wbp->getCamWB (ctemp, cgreen);
|
wbp->getCamWB (ctemp, cgreen);
|
||||||
temp->setValue (tempAdd ? 0.0 : (int)ctemp);
|
temp->setValue (temp->getAddMode() ? 0.0 : (int)ctemp);
|
||||||
green->setValue (greenAdd ? 0.0 : cgreen);
|
green->setValue (green->getAddMode() ? 0.0 : cgreen);
|
||||||
meth = M("TP_WBALANCE_CAMERA");
|
meth = M("TP_WBALANCE_CAMERA");
|
||||||
if (batchMode) {
|
if (batchMode) {
|
||||||
temp->setEditedState (UnEdited);
|
temp->setEditedState (UnEdited);
|
||||||
@@ -125,8 +125,8 @@ void WhiteBalance::optChanged () {
|
|||||||
else if (opt==1 && wbp) {
|
else if (opt==1 && wbp) {
|
||||||
double ctemp; double cgreen;
|
double ctemp; double cgreen;
|
||||||
wbp->getAutoWB (ctemp, cgreen);
|
wbp->getAutoWB (ctemp, cgreen);
|
||||||
temp->setValue (tempAdd ? 0.0 : (int)ctemp);
|
temp->setValue (temp->getAddMode() ? 0.0 : (int)ctemp);
|
||||||
green->setValue (greenAdd ? 0.0 : cgreen);
|
green->setValue (green->getAddMode() ? 0.0 : cgreen);
|
||||||
meth = M("TP_WBALANCE_AUTO");
|
meth = M("TP_WBALANCE_AUTO");
|
||||||
if (batchMode) {
|
if (batchMode) {
|
||||||
temp->setEditedState (UnEdited);
|
temp->setEditedState (UnEdited);
|
||||||
@@ -175,8 +175,8 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited) {
|
|||||||
if (wbp) {
|
if (wbp) {
|
||||||
double ctemp; double cgreen;
|
double ctemp; double cgreen;
|
||||||
wbp->getCamWB (ctemp, cgreen);
|
wbp->getCamWB (ctemp, cgreen);
|
||||||
temp->setValue (tempAdd ? 0.0 : (int)ctemp);
|
temp->setValue (temp->getAddMode() ? 0.0 : (int)ctemp);
|
||||||
green->setValue (greenAdd ? 0.0 : cgreen);
|
green->setValue (green->getAddMode() ? 0.0 : cgreen);
|
||||||
}
|
}
|
||||||
opt = 0;
|
opt = 0;
|
||||||
}
|
}
|
||||||
@@ -185,8 +185,8 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited) {
|
|||||||
if (wbp) {
|
if (wbp) {
|
||||||
double ctemp; double cgreen;
|
double ctemp; double cgreen;
|
||||||
wbp->getAutoWB (ctemp, cgreen);
|
wbp->getAutoWB (ctemp, cgreen);
|
||||||
temp->setValue (tempAdd ? 0.0 : (int)ctemp);
|
temp->setValue (temp->getAddMode() ? 0.0 : (int)ctemp);
|
||||||
green->setValue (greenAdd ? 0.0 : cgreen);
|
green->setValue (green->getAddMode() ? 0.0 : cgreen);
|
||||||
}
|
}
|
||||||
opt = 1;
|
opt = 1;
|
||||||
}
|
}
|
||||||
@@ -230,14 +230,14 @@ void WhiteBalance::setDefaults (const ProcParams* defParams, const ParamsEdited*
|
|||||||
if (wbp && defParams->wb.method == "Camera") {
|
if (wbp && defParams->wb.method == "Camera") {
|
||||||
double ctemp; double cgreen;
|
double ctemp; double cgreen;
|
||||||
wbp->getCamWB (ctemp, cgreen);
|
wbp->getCamWB (ctemp, cgreen);
|
||||||
temp->setDefault (tempAdd ? 0 : (int)ctemp);
|
temp->setDefault (temp->getAddMode() ? 0 : (int)ctemp);
|
||||||
green->setDefault (greenAdd ? 0 : cgreen);
|
green->setDefault (green->getAddMode() ? 0 : cgreen);
|
||||||
}
|
}
|
||||||
else if (wbp && defParams->wb.method == "Auto") {
|
else if (wbp && defParams->wb.method == "Auto") {
|
||||||
double ctemp; double cgreen;
|
double ctemp; double cgreen;
|
||||||
wbp->getAutoWB (ctemp, cgreen);
|
wbp->getAutoWB (ctemp, cgreen);
|
||||||
temp->setDefault (tempAdd ? 0 : (int)ctemp);
|
temp->setDefault (temp->getAddMode() ? 0 : (int)ctemp);
|
||||||
green->setDefault (greenAdd ? 0 : cgreen);
|
green->setDefault (green->getAddMode() ? 0 : cgreen);
|
||||||
}
|
}
|
||||||
else if (defParams->wb.method == "Custom") {
|
else if (defParams->wb.method == "Custom") {
|
||||||
temp->setDefault (defParams->wb.temperature);
|
temp->setDefault (defParams->wb.temperature);
|
||||||
@@ -279,19 +279,14 @@ void WhiteBalance::setWB (int vtemp, double vgreen) {
|
|||||||
if (listener)
|
if (listener)
|
||||||
listener->panelChanged (EvWBTemp, Glib::ustring::compose("%1, %2", (int)temp->getValue(), Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(3), green->getValue())));
|
listener->panelChanged (EvWBTemp, Glib::ustring::compose("%1, %2", (int)temp->getValue(), Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(3), green->getValue())));
|
||||||
}
|
}
|
||||||
void WhiteBalance::setAdjusterBehavior (bool btempadd, bool bgreenadd) {
|
void WhiteBalance::setAdjusterBehavior (bool tempadd, bool greenadd) {
|
||||||
|
|
||||||
if (!tempAdd && btempadd)
|
temp->setAddMode(tempadd);
|
||||||
temp->setLimits (-4000, +4000, 1, 0);
|
green->setAddMode(greenadd);
|
||||||
else if (tempAdd && !btempadd)
|
|
||||||
temp->setLimits (MINTEMP, MAXTEMP, 1, 4750);
|
|
||||||
|
|
||||||
if (!greenAdd && bgreenadd)
|
|
||||||
green->setLimits (-1.0, +1.0, 0.001, 0);
|
|
||||||
else if (greenAdd && bgreenadd)
|
|
||||||
green->setLimits (MINGREEN, MAXGREEN, 0.001, 1.2);
|
|
||||||
|
|
||||||
tempAdd = btempadd;
|
|
||||||
greenAdd = bgreenadd;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WhiteBalance::trimValues (rtengine::procparams::ProcParams* pp) {
|
||||||
|
|
||||||
|
temp->trimValue(pp->wb.temperature);
|
||||||
|
green->trimValue(pp->wb.green);
|
||||||
|
}
|
||||||
|
@@ -44,7 +44,6 @@ class WhiteBalance : public Gtk::VBox, public AdjusterListener, public FoldableT
|
|||||||
WBProvider *wbp;
|
WBProvider *wbp;
|
||||||
SpotWBListener* wblistener;
|
SpotWBListener* wblistener;
|
||||||
sigc::connection methconn;
|
sigc::connection methconn;
|
||||||
bool tempAdd, greenAdd;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -65,7 +64,8 @@ class WhiteBalance : public Gtk::VBox, public AdjusterListener, public FoldableT
|
|||||||
void setSpotWBListener (SpotWBListener* l) { wblistener = l; }
|
void setSpotWBListener (SpotWBListener* l) { wblistener = l; }
|
||||||
void setWB (int temp, double green);
|
void setWB (int temp, double green);
|
||||||
|
|
||||||
void setAdjusterBehavior (bool btempadd, bool bgreenadd);
|
void setAdjusterBehavior (bool tempadd, bool greenadd);
|
||||||
|
void trimValues (rtengine::procparams::ProcParams* pp);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user