1 /* -*- C++ -*-
2  *
3  *  This file is part of RawTherapee.
4  *
5  *  RawTherapee is free software: you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation, either version 3 of the License, or
8  *  (at your option) any later version.
9  *
10  *  RawTherapee is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with RawTherapee.  If not, see <http://www.gnu.org/licenses/>.
17  *
18  *  2010 Ilya Popov <ilia_popov@rambler.ru>
19  */
20 
21 #pragma once
22 
23 #include <gtkmm.h>
24 #include "adjuster.h"
25 #include "toolpanel.h"
26 #include "guiutils.h"
27 #include "curveeditor.h"
28 #include "curveeditorgroup.h"
29 #include "colorprovider.h"
30 
31 
32 class HSLEqualizer: public ToolParamBlock, public FoldableToolPanel, public CurveListener, public ColorProvider, public AdjusterListener {
33 public:
34     HSLEqualizer();
35     ~HSLEqualizer() override;
36 
37     void read(const rtengine::procparams::ProcParams *pp) override;
38     void write(rtengine::procparams::ProcParams *pp) override;
39     void curveChanged(CurveEditor *ce) override;
40     void setEditProvider(EditDataProvider *provider) override;
41     void autoOpenCurve() override;
42     void colorForValue(double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller) override;
43 
44     void enabledChanged() override;
45     void adjusterChanged(Adjuster *a, double newval) override;
46     void adjusterAutoToggled(Adjuster *a, bool newval) override;
47 
48     void setDefaults(const rtengine::procparams::ProcParams *def) override;
49     void toolReset(bool to_initial) override;
50 
51 private:
52     rtengine::ProcEvent EvHSLSmoothing;
53 
54     CurveEditorGroup *curveEditorG;
55     FlatCurveEditor *hshape;
56     FlatCurveEditor *sshape;
57     FlatCurveEditor *lshape;
58     Adjuster *smoothing;
59 
60     rtengine::procparams::HSLEqualizerParams initial_params;
61     std::vector<double> default_flat_curve_;
62 };
63