Solving issue 2846: "Wavelet - expanding a sub-tool adds a history item"

This commit is contained in:
Hombre
2015-07-23 20:26:22 +02:00
parent 11093f939b
commit db306ccfed
2 changed files with 1895 additions and 1998 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -33,120 +33,120 @@
class Wavelet : public ToolParamBlock, public ThresholdAdjusterListener, public AdjusterListener, public CurveListener, public ColorProvider, public rtengine::WaveletListener, public FoldableToolPanel class Wavelet : public ToolParamBlock, public ThresholdAdjusterListener, public AdjusterListener, public CurveListener, public ColorProvider, public rtengine::WaveletListener, public FoldableToolPanel
{ {
protected: protected:
Glib::RefPtr<Gtk::Tooltip> bgTTips; Glib::RefPtr<Gtk::Tooltip> bgTTips;
Glib::RefPtr<Gtk::Tooltip> srTTips; Glib::RefPtr<Gtk::Tooltip> srTTips;
Glib::RefPtr<Gdk::Pixbuf> bgPixbuf; Glib::RefPtr<Gdk::Pixbuf> bgPixbuf;
Glib::RefPtr<Gdk::Pixbuf> srPixbuf; Glib::RefPtr<Gdk::Pixbuf> srPixbuf;
CurveEditorGroup* curveEditorG; CurveEditorGroup* curveEditorG;
CurveEditorGroup* CCWcurveEditorG; CurveEditorGroup* CCWcurveEditorG;
CurveEditorGroup* curveEditorRES; CurveEditorGroup* curveEditorRES;
CurveEditorGroup* curveEditorGAM; CurveEditorGroup* curveEditorGAM;
Gtk::HSeparator* colorSep; Gtk::HSeparator* colorSep;
Gtk::HSeparator* separator3; Gtk::HSeparator* separator3;
Gtk::HSeparator* separatorCB; Gtk::HSeparator* separatorCB;
Gtk::HSeparator* separatorNeutral; Gtk::HSeparator* separatorNeutral;
CurveEditorGroup* opaCurveEditorG; CurveEditorGroup* opaCurveEditorG;
FlatCurveEditor* opacityShapeRG; FlatCurveEditor* opacityShapeRG;
CurveEditorGroup* opacityCurveEditorG; CurveEditorGroup* opacityCurveEditorG;
FlatCurveEditor* opacityShapeBY; FlatCurveEditor* opacityShapeBY;
CurveEditorGroup* opacityCurveEditorW; CurveEditorGroup* opacityCurveEditorW;
CurveEditorGroup* opacityCurveEditorWL; CurveEditorGroup* opacityCurveEditorWL;
FlatCurveEditor* opacityShape; FlatCurveEditor* opacityShape;
FlatCurveEditor* opacityShapeWL; FlatCurveEditor* opacityShapeWL;
FlatCurveEditor* hhshape; FlatCurveEditor* hhshape;
FlatCurveEditor* Chshape; FlatCurveEditor* Chshape;
DiagonalCurveEditor* clshape; DiagonalCurveEditor* clshape;
Gtk::VBox* chanMixerBox; Gtk::VBox* chanMixerBox;
FlatCurveEditor* ccshape; FlatCurveEditor* ccshape;
Gtk::CheckButton * display; Gtk::CheckButton * display;
Gtk::CheckButton * displaylevel; Gtk::CheckButton * displaylevel;
Gtk::CheckButton * displaychro; Gtk::CheckButton * displaychro;
Gtk::CheckButton * displaygam; Gtk::CheckButton * displaygam;
Gtk::CheckButton * displayres; Gtk::CheckButton * displayres;
Gtk::CheckButton * median; Gtk::CheckButton * median;
Gtk::CheckButton * medianlev; Gtk::CheckButton * medianlev;
Gtk::CheckButton * linkedg; Gtk::CheckButton * linkedg;
Gtk::CheckButton * cbenab; Gtk::CheckButton * cbenab;
Gtk::CheckButton * lipst; Gtk::CheckButton * lipst;
Gtk::CheckButton * avoid; Gtk::CheckButton * avoid;
Gtk::CheckButton * tmr; Gtk::CheckButton * tmr;
Gtk::Button * neutralchButton; Gtk::Button * neutralchButton;
Adjuster* correction[9]; Adjuster* correction[9];
Adjuster* correctionch[9]; Adjuster* correctionch[9];
Adjuster* rescon; Adjuster* rescon;
Adjuster* resconH; Adjuster* resconH;
Adjuster* reschro; Adjuster* reschro;
Adjuster* tmrs; Adjuster* tmrs;
Adjuster* gamma; Adjuster* gamma;
Adjuster* sup; Adjuster* sup;
Adjuster* sky; Adjuster* sky;
Adjuster* thres; Adjuster* thres;
Adjuster* chroma; Adjuster* chroma;
Adjuster* chro; Adjuster* chro;
Adjuster* contrast; Adjuster* contrast;
Adjuster* thr; Adjuster* thr;
Adjuster* thrH; Adjuster* thrH;
Adjuster* skinprotect; Adjuster* skinprotect;
Adjuster* edgrad; Adjuster* edgrad;
Adjuster* edgval; Adjuster* edgval;
Adjuster* edgthresh; Adjuster* edgthresh;
Adjuster* strength; Adjuster* strength;
Adjuster* balance; Adjuster* balance;
Adjuster* iter; Adjuster* iter;
Adjuster* greenlow; Adjuster* greenlow;
Adjuster* bluelow; Adjuster* bluelow;
Adjuster* greenmed; Adjuster* greenmed;
Adjuster* bluemed; Adjuster* bluemed;
Adjuster* greenhigh; Adjuster* greenhigh;
Adjuster* bluehigh; Adjuster* bluehigh;
ThresholdAdjuster* hueskin; ThresholdAdjuster* hueskin;
ThresholdAdjuster* hueskin2; ThresholdAdjuster* hueskin2;
ThresholdAdjuster* hllev; ThresholdAdjuster* hllev;
ThresholdAdjuster* bllev; ThresholdAdjuster* bllev;
ThresholdAdjuster* pastlev; ThresholdAdjuster* pastlev;
ThresholdAdjuster* satlev; ThresholdAdjuster* satlev;
ThresholdAdjuster* edgcont; ThresholdAdjuster* edgcont;
ThresholdAdjuster* level0noise; ThresholdAdjuster* level0noise;
ThresholdAdjuster* level1noise; ThresholdAdjuster* level1noise;
ThresholdAdjuster* level2noise; ThresholdAdjuster* level2noise;
Adjuster* threshold; Adjuster* threshold;
Adjuster* threshold2; Adjuster* threshold2;
Adjuster* edgedetect; Adjuster* edgedetect;
Adjuster* edgedetectthr; Adjuster* edgedetectthr;
Adjuster* edgedetectthr2; Adjuster* edgedetectthr2;
MyComboBoxText* Lmethod; MyComboBoxText* Lmethod;
sigc::connection Lmethodconn; sigc::connection Lmethodconn;
MyComboBoxText* CHmethod; MyComboBoxText* CHmethod;
sigc::connection CHmethodconn; sigc::connection CHmethodconn;
MyComboBoxText* CHSLmethod; MyComboBoxText* CHSLmethod;
sigc::connection CHSLmethodconn; sigc::connection CHSLmethodconn;
MyComboBoxText* EDmethod; MyComboBoxText* EDmethod;
sigc::connection EDmethodconn; sigc::connection EDmethodconn;
MyComboBoxText* BAmethod; MyComboBoxText* BAmethod;
sigc::connection BAmethodconn; sigc::connection BAmethodconn;
MyComboBoxText* TMmethod; MyComboBoxText* TMmethod;
sigc::connection TMmethodconn; sigc::connection TMmethodconn;
MyComboBoxText* HSmethod; MyComboBoxText* HSmethod;
sigc::connection HSmethodconn; sigc::connection HSmethodconn;
MyComboBoxText* CLmethod; MyComboBoxText* CLmethod;
sigc::connection CLmethodconn; sigc::connection CLmethodconn;
MyComboBoxText* Backmethod; MyComboBoxText* Backmethod;
sigc::connection Backmethodconn; sigc::connection Backmethodconn;
MyComboBoxText* Tilesmethod; MyComboBoxText* Tilesmethod;
sigc::connection Tilesmethodconn; sigc::connection Tilesmethodconn;
MyComboBoxText* daubcoeffmethod; MyComboBoxText* daubcoeffmethod;
sigc::connection daubcoeffmethodconn; sigc::connection daubcoeffmethodconn;
MyComboBoxText* Dirmethod; MyComboBoxText* Dirmethod;
sigc::connection Dirmethodconn; sigc::connection Dirmethodconn;
MyComboBoxText* Medgreinf; MyComboBoxText* Medgreinf;
sigc::connection MedgreinfConn; sigc::connection MedgreinfConn;
Gtk::Frame* settingsFrame; Gtk::Frame* settingsFrame;
Gtk::Frame* toningFrame; Gtk::Frame* toningFrame;
Gtk::Frame* residualFrame; Gtk::Frame* residualFrame;
Gtk::Frame* dispFrame; Gtk::Frame* dispFrame;
@@ -155,17 +155,17 @@ protected:
Gtk::Frame* controlFrame; Gtk::Frame* controlFrame;
Gtk::Frame* edgeFrame; Gtk::Frame* edgeFrame;
Gtk::Frame* noiseFrame; Gtk::Frame* noiseFrame;
Gtk::Frame* contrastSHFrame; Gtk::Frame* contrastSHFrame;
Gtk::Frame* finalFrame; Gtk::Frame* finalFrame;
Gtk::Frame *chanMixerHLFrame; Gtk::Frame *chanMixerHLFrame;
Gtk::Frame *chanMixerMidFrame; Gtk::Frame *chanMixerMidFrame;
Gtk::Frame *chanMixerShadowsFrame; Gtk::Frame *chanMixerShadowsFrame;
Gtk::Frame *dFrame; Gtk::Frame *dFrame;
Gtk::Label* colLabel; Gtk::Label* colLabel;
Gtk::Label* interLabel; Gtk::Label* interLabel;
Gtk::Label* wavLabels; Gtk::Label* wavLabels;
Gtk::Label* hsmethodLabel; Gtk::Label* hsmethodLabel;
Gtk::Label* daubcoeffLabel; Gtk::Label* daubcoeffLabel;
Gtk::Label* ColorBalanceLabel; Gtk::Label* ColorBalanceLabel;
Gtk::Label* labmC; Gtk::Label* labmC;
@@ -189,33 +189,35 @@ protected:
Gtk::HBox* ctboxED; Gtk::HBox* ctboxED;
Gtk::HBox* ctboxTM; Gtk::HBox* ctboxTM;
Gtk::HBox* hbresid; Gtk::HBox* hbresid;
Gtk::HBox* backgroundHBox; Gtk::HBox* backgroundHBox;
Gtk::HBox* daubcoeffHBox; Gtk::HBox* daubcoeffHBox;
Gtk::HBox* hsmethodHBox; Gtk::HBox* hsmethodHBox;
Gtk::HBox* levdirMainHBox; Gtk::HBox* levdirMainHBox;
Gtk::HBox* levdirSubHBox; Gtk::HBox* levdirSubHBox;
Gtk::HBox* tilesizeHBox; Gtk::HBox* tilesizeHBox;
Gtk::HBox* ctboxFI; Gtk::HBox* ctboxFI;
Gtk::HBox* ctboxch; Gtk::HBox* ctboxch;
Gtk::HBox* edbox; Gtk::HBox* edbox;
Gtk::HBox* ednoisbox; Gtk::HBox* ednoisbox;
Gtk::HBox* eddebox; Gtk::HBox* eddebox;
Gtk::VBox* settingsVBox; Gtk::VBox* settingsVBox;
Gtk::VBox* contrastSHVBox; Gtk::VBox* contrastSHVBox;
Gtk::Label* tilesizeLabel; Gtk::Label* tilesizeLabel;
Gtk::Label* levdirMainLabel; Gtk::Label* levdirMainLabel;
Gtk::Label* backgroundLabel; Gtk::Label* backgroundLabel;
Gtk::Button* neutral; Gtk::Button* neutral;
Gtk::HBox* neutrHBox; Gtk::HBox* neutrHBox;
sigc::connection expConn, medianConn, avoidConn, tmrConn, medianlevConn, linkedgConn, lipstConn, cbenabConn, neutralconn; sigc::connection enableChromaConn, enableContrastConn, enableEdgeConn, enableFinalConn;
sigc::connection neutralPressedConn; sigc::connection enableNoiseConn, enableResidConn, enableToningConn;
sigc::connection contrastPlusPressedConn; sigc::connection expConn, medianConn, avoidConn, tmrConn, medianlevConn, linkedgConn, lipstConn, cbenabConn, neutralconn;
sigc::connection contrastMinusPressedConn; sigc::connection neutralPressedConn;
sigc::connection neutralchPressedConn; sigc::connection contrastPlusPressedConn;
sigc::connection contrastMinusPressedConn;
sigc::connection neutralchPressedConn;
bool lastdisplay, lastdisplaygam,lastdisplayres,lastdisplaychro, lastdisplaylevel,lastmedian, lastmedianlev, lastlinkedg, lastavoid, lastlipst, lasttmr, lastcbenab; bool lastdisplay, lastdisplaygam,lastdisplayres,lastdisplaychro, lastdisplaylevel,lastmedian, lastmedianlev, lastlinkedg, lastavoid, lastlipst, lasttmr, lastcbenab;
int nextnlevel; int nextnlevel;
double tr; double tr;
double br; double br;
@@ -223,65 +225,79 @@ protected:
double bl; double bl;
public: public:
Wavelet (); Wavelet ();
virtual ~Wavelet (); virtual ~Wavelet ();
bool wavComputed_ ();
void adjusterChanged (ThresholdAdjuster* a, double newBottom, double newTop);
void adjusterChanged (Adjuster* a, double newval);
void adjusterChanged2 (ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR);
void autoOpenCurve ();
void curveChanged (CurveEditor* ce);
void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL);
void setAdjusterBehavior (bool multiplieradd, bool thresholdadd, bool threshold2add, bool thresadd, bool chroadd,bool chromaadd, bool contrastadd, bool skinadd, bool reschroadd, bool tmrsadd, bool resconadd, bool resconHadd, bool thradd, bool thrHadd, bool skyadd, bool edgradadd, bool edgvaladd, bool strengthadd, bool gammaadd, bool edgedetectadd, bool edgedetectthradd, bool edgedetectthr2add);
void setBatchMode (bool batchMode);
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL);
void setEditProvider (EditDataProvider *provider);
void updateToolState (std::vector<int> &tpOpen);
void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL);
void writeOptions (std::vector<int> &tpOpen);
bool wavComputed_ ();
void adjusterChanged (ThresholdAdjuster* a, double newBottom, double newTop);
void adjusterChanged (Adjuster* a, double newval);
void adjusterChanged2 (ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR);
void autoOpenCurve ();
void curveChanged (CurveEditor* ce);
void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL);
void setAdjusterBehavior (bool multiplieradd, bool thresholdadd, bool threshold2add, bool thresadd, bool chroadd,bool chromaadd, bool contrastadd, bool skinadd, bool reschroadd, bool tmrsadd, bool resconadd, bool resconHadd, bool thradd, bool thrHadd, bool skyadd, bool edgradadd, bool edgvaladd, bool strengthadd, bool gammaadd, bool edgedetectadd, bool edgedetectthradd, bool edgedetectthr2add);
void setBatchMode (bool batchMode);
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL);
void setEditProvider (EditDataProvider *provider);
void updateToolState(std::vector<int> &tpOpen);
void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL);
void writeOptions(std::vector<int> &tpOpen);
private: private:
void foldAllButSettings (GdkEventButton* event); void foldAllButMe (GdkEventButton* event, MyExpander *expander);
void foldAllButContrast (GdkEventButton* event);
void foldAllButChroma (GdkEventButton* event);
void foldAllButToning (GdkEventButton* event);
void foldAllButNoise (GdkEventButton* event);
void foldAllButEdge (GdkEventButton* event);
void foldAllButGamut (GdkEventButton* event);
void foldAllButResid (GdkEventButton* event);
void foldAllButFinal (GdkEventButton* event);
void foldAllButOne (MyExpander * whichOne);
virtual void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller); virtual void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller);
void BAmethodChanged (); void BAmethodChanged ();
void BackmethodChanged (); void BackmethodChanged ();
void CHSLmethodChanged (); void CHSLmethodChanged ();
void CHmethodChanged (); void CHmethodChanged ();
void CLmethodChanged (); void CLmethodChanged ();
void DirmethodChanged (); void DirmethodChanged ();
void EDmethodChanged (); void EDmethodChanged ();
void HSmethodChanged (); void HSmethodChanged ();
void LmethodChanged (); void LmethodChanged ();
void MedgreinfChanged (); void MedgreinfChanged ();
void TMmethodChanged (); void TMmethodChanged ();
void TilesmethodChanged (); void TilesmethodChanged ();
void avoidToggled (); void avoidToggled ();
void cbenabToggled (); void cbenabToggled ();
void contrastMinusPressed (); void contrastMinusPressed ();
void contrastPlusPressed (); void contrastPlusPressed ();
void daubcoeffmethodChanged (); void daubcoeffmethodChanged ();
void enabledChanged (); void enabledChanged ();
void linkedgToggled (); void linkedgToggled ();
void lipstToggled (); void lipstToggled ();
void medianToggled (); void medianToggled ();
void medianlevToggled (); void medianlevToggled ();
void neutralPressed (); void neutralPressed ();
void neutral_pressed (); void neutral_pressed ();
void neutralchPressed (); void neutralchPressed ();
void tmrToggled (); void tmrToggled ();
void updatewavLabel (); void updatewavLabel ();
void wavChanged (double nlevel); void wavChanged (double nlevel);
void HSmethodUpdateUI();
void CHmethodUpdateUI();
// void CHSLmethodChangedUI();
void EDmethodUpdateUI();
void BAmethodUpdateUI();
void TMmethodUpdateUI();
// void BackmethodUpdateUI();
void CLmethodUpdateUI();
// void TilesmethodUpdateUI();
// void daubcoeffmethodUpdateUI();
// void MedgreinfUpdateUI();
// void DirmethodUpdateUI();
// void LmethodUpdateUI();
void adjusterUpdateUI (Adjuster* a);
void enabledUpdateUI ();
void medianlevUpdateUI ();
void cbenabUpdateUI ();
// void lipstUpdateUI ();
void enableToggled(MyExpander *expander);
}; };
#endif #endif