"Fossies" - the Fresh Open Source Software Archive

Member "rawtherapee-5.7/rtgui/wavelet.h" (10 Sep 2019, 9321 Bytes) of package /linux/misc/rawtherapee-5.7.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "wavelet.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 5.6_vs_5.7.

    1 /*
    2  *  This file is part of RawTherapee.
    3  *
    4  *  RawTherapee is free software: you can redistribute it and/or modify
    5  *  it under the terms of the GNU General Public License as published by
    6  *  the Free Software Foundation, either version 3 of the License, or
    7  *  (at your option) any later version.
    8  *
    9  *  RawTherapee is distributed in the hope that it will be useful,
   10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
   11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12  *  GNU General Public License for more details.
   13  *
   14  *  You should have received a copy of the GNU General Public License
   15  *  along with RawTherapee.  If not, see <https://www.gnu.org/licenses/>.
   16  *
   17  *  2014 Jacques Desmis <jdesmis@gmail.com>
   18  */
   19 
   20 #pragma once
   21 
   22 #include <gtkmm.h>
   23 #include "adjuster.h"
   24 #include "toolpanel.h"
   25 #include "curveeditor.h"
   26 #include "curveeditorgroup.h"
   27 #include "thresholdadjuster.h"
   28 #include "colorprovider.h"
   29 #include "guiutils.h"
   30 #include "options.h"
   31 
   32 class EditDataProvider;
   33 
   34 class Wavelet :
   35     public ToolParamBlock,
   36     public ThresholdAdjusterListener,
   37     public AdjusterListener,
   38     public CurveListener,
   39     public ColorProvider,
   40     public rtengine::WaveletListener,
   41     public FoldableToolPanel
   42 {
   43 public:
   44     Wavelet ();
   45     ~Wavelet () override;
   46 
   47     bool wavComputed_ ();
   48     void adjusterChanged(Adjuster* a, double newval) override;
   49     void autoOpenCurve () override;
   50     void curveChanged (CurveEditor* ce) override;
   51     void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr) override;
   52     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);
   53     void setBatchMode (bool batchMode) override;
   54     void setDefaults  (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override;
   55     void setEditProvider (EditDataProvider *provider) override;
   56     void updateToolState (std::vector<int> &tpOpen);
   57     void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr) override;
   58     void writeOptions (std::vector<int> &tpOpen);
   59 
   60     void adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop) override;
   61     void adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight) override;
   62     void adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop) override;
   63     void adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) override;
   64     void adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR) override;
   65 
   66 private:
   67     void foldAllButMe (GdkEventButton* event, MyExpander *expander);
   68 
   69     void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller) override;
   70     void BAmethodChanged ();
   71     void NPmethodChanged ();
   72     void BackmethodChanged ();
   73     void CHSLmethodChanged ();
   74     void CHmethodChanged ();
   75     void CLmethodChanged ();
   76     void DirmethodChanged ();
   77     void EDmethodChanged ();
   78     void HSmethodChanged ();
   79     void LmethodChanged ();
   80     void MedgreinfChanged ();
   81     void TMmethodChanged ();
   82     void TilesmethodChanged ();
   83     void avoidToggled ();
   84     void cbenabToggled ();
   85     void contrastMinusPressed ();
   86     void contrastPlusPressed ();
   87     void daubcoeffmethodChanged ();
   88     void enabledChanged () override;
   89     void linkedgToggled ();
   90     void lipstToggled ();
   91     void medianToggled ();
   92     void medianlevToggled ();
   93     void neutralPressed ();
   94     void neutral_pressed ();
   95     void neutralchPressed ();
   96     void tmrToggled ();
   97     void updatewavLabel ();
   98     void wavChanged (double nlevel) override;
   99 
  100     void HSmethodUpdateUI();
  101     void CHmethodUpdateUI();
  102 //  void CHSLmethodChangedUI();
  103     void EDmethodUpdateUI();
  104     void NPmethodUpdateUI();
  105     void BAmethodUpdateUI();
  106     void TMmethodUpdateUI();
  107 //  void BackmethodUpdateUI();
  108     void CLmethodUpdateUI();
  109 //  void TilesmethodUpdateUI();
  110 //  void daubcoeffmethodUpdateUI();
  111 //  void MedgreinfUpdateUI();
  112 //  void DirmethodUpdateUI();
  113 //  void LmethodUpdateUI();
  114     void adjusterUpdateUI (Adjuster* a);
  115     void enabledUpdateUI ();
  116     void medianlevUpdateUI ();
  117     void cbenabUpdateUI ();
  118     void lipstUpdateUI ();
  119 
  120     void enableToggled(MyExpander *expander);
  121 
  122     CurveEditorGroup* const curveEditorG;
  123 
  124     CurveEditorGroup* const CCWcurveEditorG;
  125     CurveEditorGroup* const curveEditorRES;
  126     CurveEditorGroup* const curveEditorGAM;
  127     Gtk::HSeparator* const separatorNeutral;
  128     Gtk::HSeparator* const separatoredge;
  129 
  130     CurveEditorGroup* const opaCurveEditorG;
  131     FlatCurveEditor* opacityShapeRG;
  132     CurveEditorGroup* const opacityCurveEditorG;
  133     FlatCurveEditor* opacityShapeBY;
  134     CurveEditorGroup* const opacityCurveEditorW;
  135     CurveEditorGroup* const opacityCurveEditorWL;
  136     FlatCurveEditor* opacityShape;
  137     FlatCurveEditor* opacityShapeWL;
  138     FlatCurveEditor* hhshape;
  139     FlatCurveEditor* Chshape;
  140     DiagonalCurveEditor* clshape;
  141 
  142     FlatCurveEditor* ccshape;
  143     Gtk::CheckButton* const median;
  144     Gtk::CheckButton* const medianlev;
  145     Gtk::CheckButton* const linkedg;
  146     Gtk::CheckButton* const cbenab;
  147     Gtk::CheckButton* const lipst;
  148     Gtk::CheckButton* const avoid;
  149     Gtk::CheckButton* const tmr;
  150 
  151     Gtk::Button* const neutralchButton;
  152     Adjuster* correction[9];
  153     Adjuster* correctionch[9];
  154     Adjuster* const rescon;
  155     Adjuster* const resconH;
  156     Adjuster* const reschro;
  157     Adjuster* const tmrs;
  158     Adjuster* const gamma;
  159     Adjuster* const sup;
  160     Adjuster* const sky;
  161     Adjuster* const thres;
  162     Adjuster* const chroma;
  163     Adjuster* const chro;
  164     Adjuster* const contrast;
  165     Adjuster* const thr;
  166     Adjuster* const thrH;
  167     Adjuster* const skinprotect;
  168     Adjuster* const edgrad;
  169     Adjuster* const edgval;
  170     Adjuster* const edgthresh;
  171     Adjuster* const strength;
  172     Adjuster* const balance;
  173     Adjuster* const iter;
  174     Adjuster* greenlow;
  175     Adjuster* bluelow;
  176     Adjuster* greenmed;
  177     Adjuster* bluemed;
  178     Adjuster* greenhigh;
  179     Adjuster* bluehigh;
  180 
  181     ThresholdAdjuster* const hueskin;
  182     ThresholdAdjuster* const hueskin2;
  183     ThresholdAdjuster* const hllev;
  184     ThresholdAdjuster* const bllev;
  185     ThresholdAdjuster* const pastlev;
  186     ThresholdAdjuster* const satlev;
  187     ThresholdAdjuster* const edgcont;
  188     ThresholdAdjuster* const level0noise;
  189     ThresholdAdjuster* const level1noise;
  190     ThresholdAdjuster* const level2noise;
  191     ThresholdAdjuster* const level3noise;
  192 
  193     Adjuster* const threshold;
  194     Adjuster* const threshold2;
  195     Adjuster* const edgedetect;
  196     Adjuster* const edgedetectthr;
  197     Adjuster* const edgedetectthr2;
  198     Adjuster* const edgesensi;
  199     Adjuster* const edgeampli;
  200     MyComboBoxText* const Lmethod;
  201     sigc::connection  Lmethodconn;
  202     MyComboBoxText* const CHmethod;
  203     sigc::connection  CHmethodconn;
  204     MyComboBoxText* const CHSLmethod;
  205     sigc::connection  CHSLmethodconn;
  206     MyComboBoxText* const EDmethod;
  207     sigc::connection  EDmethodconn;
  208     MyComboBoxText* const BAmethod;
  209     sigc::connection  BAmethodconn;
  210     MyComboBoxText* const NPmethod;
  211     sigc::connection  NPmethodconn;
  212     MyComboBoxText* const TMmethod;
  213     sigc::connection  TMmethodconn;
  214     MyComboBoxText* const HSmethod;
  215     sigc::connection  HSmethodconn;
  216     MyComboBoxText* const CLmethod;
  217     sigc::connection  CLmethodconn;
  218     MyComboBoxText* const Backmethod;
  219     sigc::connection  Backmethodconn;
  220     MyComboBoxText* const Tilesmethod;
  221     sigc::connection  Tilesmethodconn;
  222     MyComboBoxText* const daubcoeffmethod;
  223     sigc::connection  daubcoeffmethodconn;
  224     MyComboBoxText* const Dirmethod;
  225     sigc::connection  Dirmethodconn;
  226     MyComboBoxText* const Medgreinf;
  227     sigc::connection  MedgreinfConn;
  228     Gtk::Frame* const chanMixerHLFrame;
  229     Gtk::Frame* const chanMixerMidFrame;
  230     Gtk::Frame* const chanMixerShadowsFrame;
  231 
  232     Gtk::Label* const wavLabels;
  233     Gtk::Label* const labmC;
  234     Gtk::Label* const labmNP;
  235     MyExpander* const expchroma;
  236     MyExpander* const expcontrast;
  237     MyExpander* const expedge;
  238     MyExpander* const expfinal;
  239     MyExpander* const expgamut;
  240     MyExpander* const expnoise;
  241     MyExpander* const expresid;
  242     MyExpander* const expsettings;
  243     MyExpander* const exptoning;
  244 
  245     Gtk::HBox* const neutrHBox;
  246 
  247     sigc::connection enableChromaConn, enableContrastConn, enableEdgeConn, enableFinalConn;
  248     sigc::connection enableNoiseConn, enableResidConn, enableToningConn;
  249     sigc::connection medianConn, avoidConn, tmrConn, medianlevConn, linkedgConn, lipstConn, cbenabConn, neutralconn;
  250     sigc::connection neutralPressedConn;
  251     sigc::connection contrastPlusPressedConn;
  252     sigc::connection contrastMinusPressedConn;
  253     sigc::connection neutralchPressedConn;
  254 
  255     bool lastmedian, lastmedianlev, lastlinkedg, lastavoid, lastlipst, lasttmr, lastcbenab;
  256     int nextnlevel;
  257 
  258     IdleRegister idle_register;
  259 };