rawTherapee/rtgui/retinex.h
Hombre 965cadb52e New batch of update for issue 3446
This commit include :
- cleanup rtgui/retinex.cc file (constructor only) and switched to
Gtk::Grid (the new standard) instead of Gtk::Box. This however doesn't
solve the issue of the Transmission curves in the Retinex tool, with
wrong resize of the Frame when folding/unfolding the curves.
- better alignment of the Histogram panel now with 4px of padding on the
left and right side
- Threshold selector now use the Scale's Trough style to draw its box
and sliders
- Curve's background are darker and restricted to the curve diagram
- Diagonal and Flat curves has been converted to Gtk::Grid as well
- A special color is now used for unsensitive Threshold selector and
Sclaes widgets
- Gap around the main Window has been removed on windows to circumvent a
bug in Gtk3, but the window can now only be maximized (usual use case)
or resized vertically by the top border only.
- Buttons at the bottom of the Editor panel has now the same height
2016-11-01 20:39:41 +01:00

136 lines
4.2 KiB
C++

/*
* This file is part of RawTherapee.
*/
#ifndef _RETINEX_H_
#define _RETINEX_H_
#include <gtkmm.h>
#include "adjuster.h"
#include "toolpanel.h"
#include "guiutils.h"
#include "curveeditor.h"
#include "curveeditorgroup.h"
#include "thresholdadjuster.h"
#include "colorprovider.h"
class Retinex : public ToolParamBlock, public FoldableToolPanel, public rtengine::RetinexListener, public CurveListener,
public AdjusterListener, public ColorProvider
{
protected:
CurveEditorGroup* curveEditorGD;
CurveEditorGroup* curveEditorGDH;
CurveEditorGroup* curveEditorGH;
CurveEditorGroup* curveEditormap;
Adjuster* str;
Adjuster* scal;
Adjuster* grad;
Adjuster* grads;
Adjuster* iter;
Adjuster* neigh;
Adjuster* gain;
Adjuster* offs;
Adjuster* vart;
Adjuster* limd;
Adjuster* highl;
Adjuster* baselog;
Adjuster* skal;
Adjuster* gam;
Adjuster* slope;
Adjuster* highlights;
Adjuster* h_tonalwidth;
Adjuster* shadows;
Adjuster* s_tonalwidth;
Adjuster* radius;
MyExpander* expsettings;
Gtk::Label* labmdh;
Gtk::Grid* dhgrid;
Gtk::Grid* mapgrid;
Gtk::Label* labmap;
Gtk::Grid* viewgrid;
Gtk::Label* labview;
Gtk::Label* labgam;
Gtk::Grid* gamgrid;
Gtk::Button* neutral;
MyComboBoxText* retinexMethod;
MyComboBoxText* retinexcolorspace;
MyComboBoxText* gammaretinex;
MyComboBoxText* mapMethod;
MyComboBoxText* viewMethod;
Gtk::CheckButton* medianmap;
double nextmin;
double nextmax;
double nextminiT;
double nextmaxiT;
double nextmeanT;
double nextminT;
double nextmaxT;
double nextsigma;
Gtk::Label* mMLabels;
Gtk::Label* transLabels;
Gtk::Label* transLabels2;
Gtk::Frame *gainFrame;
Gtk::Frame *tranFrame;
Gtk::Frame *iterFrame;
Gtk::Frame *equalFrame;
DiagonalCurveEditor* cdshape;
DiagonalCurveEditor* cdshapeH;
DiagonalCurveEditor* mapshape;
CurveEditorGroup* transmissionCurveEditorG;
CurveEditorGroup* gaintransmissionCurve;
sigc::connection retinexMethodConn, neutralconn, mapMethodConn, viewMethodConn;
sigc::connection retinexColorSpaceConn;
sigc::connection gammaretinexConn;
FlatCurveEditor* transmissionShape;
FlatCurveEditor* gaintransmissionShape;
FlatCurveEditor* lhshape;
bool lastmedianmap;
sigc::connection medianmapConn;
public:
Retinex ();
~Retinex ();
void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr);
void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr);
void setBatchMode (bool batchMode);
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr);
void trimValues (rtengine::procparams::ProcParams* pp);
void adjusterChanged (Adjuster* a, double newval);
void autoOpenCurve ();
void medianmapChanged ();
void minmaxChanged (double cdma, double cdmin, double mini, double maxi, double Tmean, double Tsigma, double Tmin, double Tmax);
bool minmaxComputed_ ();
void updateLabel ();
void updateTrans ();
void neutral_pressed ();
void enabledChanged ();
void curveChanged (CurveEditor* ce);
void retinexMethodChanged();
void mapMethodChanged();
void viewMethodChanged();
void retinexColorSpaceChanged();
void gammaretinexChanged();
void ColorSpaceUpdateUI();
void writeOptions (std::vector<int> &tpOpen);
void updateToolState (std::vector<int> &tpOpen);
void setAdjusterBehavior (bool strAdd, bool neighAdd, bool limdAdd, bool gainAdd, bool offsAdd, bool vartAdd, bool gamAdd, bool slopeAdd);
void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histLRETI);
virtual void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller);
private:
void foldAllButMe (GdkEventButton* event, MyExpander *expander);
};
#endif