Settings output device in main menu

This commit is contained in:
Desmis
2017-07-28 17:41:48 +02:00
parent 10822f5c2e
commit ef39df4f39
11 changed files with 2107 additions and 1748 deletions

View File

@@ -73,8 +73,8 @@ public:
initEq1 = startAtOne;
value[0] = bottom;
value[1] = top;
value[2] = T(0);
value[3] = T(0);
value[2] = T (0);
value[3] = T (0);
_isDouble = false;
}
@@ -89,14 +89,14 @@ public:
}
// for convenience, since 'values' is public
void setValues(T bottom, T top)
void setValues (T bottom, T top)
{
value[0] = bottom;
value[1] = top;
}
// for convenience, since 'values' is public
void setValues(T bottomLeft, T topLeft, T bottomRight, T topRight)
void setValues (T bottomLeft, T topLeft, T bottomRight, T topRight)
{
value[0] = bottomLeft;
value[1] = topLeft;
@@ -113,64 +113,64 @@ public:
// RV: Type of the value on the X axis
// RV2: Type of the maximum value on the Y axis
template <typename RT, typename RV, typename RV2>
RT multiply(RV x, RV2 yMax) const
RT multiply (RV x, RV2 yMax) const
{
double val = double(x);
double val = double (x);
if (initEq1) {
if (_isDouble) {
if (val == double(value[2]) && double(value[2]) == double(value[3]))
if (val == double (value[2]) && double (value[2]) == double (value[3]))
// this handle the special case where the 2 right values are the same, then bottom one is sent back,
// useful if one wants to keep the bottom value even beyond the x max bound
{
return RT(0.);
return RT (0.);
}
if (val >= double(value[3])) {
return RT(yMax);
if (val >= double (value[3])) {
return RT (yMax);
}
if (val > double(value[2])) {
return RT(double(yMax) * (val - double(value[2])) / (double(value[3]) - double(value[2])));
if (val > double (value[2])) {
return RT (double (yMax) * (val - double (value[2])) / (double (value[3]) - double (value[2])));
}
}
if (val >= double(value[0])) {
return RT(0);
if (val >= double (value[0])) {
return RT (0);
}
if (val > double(value[1])) {
return RT(double(yMax) * (1. - (val - double(value[0])) / (double(value[1]) - double(value[0]))));
if (val > double (value[1])) {
return RT (double (yMax) * (1. - (val - double (value[0])) / (double (value[1]) - double (value[0]))));
}
return RT(yMax);
return RT (yMax);
} else {
if (_isDouble) {
if (val == double(value[2]) && double(value[2]) == double(value[3]))
if (val == double (value[2]) && double (value[2]) == double (value[3]))
// this handle the special case where the 2 right values are the same, then top one is sent back,
// useful if one wants to keep the top value even beyond the x max bound
{
return RT(yMax);
return RT (yMax);
}
if (val >= double(value[2])) {
return RT(0);
if (val >= double (value[2])) {
return RT (0);
}
if (val > double(value[3])) {
return RT(double(yMax) * (1. - (val - double(value[3])) / (double(value[2]) - double(value[3]))));
if (val > double (value[3])) {
return RT (double (yMax) * (1. - (val - double (value[3])) / (double (value[2]) - double (value[3]))));
}
}
if (val >= double(value[1])) {
return RT(yMax);
if (val >= double (value[1])) {
return RT (yMax);
}
if (val > double(value[0])) {
return RT(double(yMax) * (val - double(value[0])) / (double(value[1]) - double(value[0])));
if (val > double (value[0])) {
return RT (double (yMax) * (val - double (value[0])) / (double (value[1]) - double (value[0])));
}
return RT(0);
return RT (0);
}
}
@@ -207,7 +207,7 @@ public:
}
}*/
Threshold<T>& operator =(const Threshold<T> &rhs)
Threshold<T>& operator = (const Threshold<T> &rhs)
{
value[0] = rhs.value[0];
value[1] = rhs.value[1];
@@ -219,21 +219,21 @@ public:
}
template<typename U = T>
typename std::enable_if<std::is_floating_point<U>::value, bool>::type operator ==(const Threshold<U> &rhs) const
typename std::enable_if<std::is_floating_point<U>::value, bool>::type operator == (const Threshold<U> &rhs) const
{
if (_isDouble) {
return std::fabs(value[0] - rhs.value[0]) < 1e-10
&& std::fabs(value[1] - rhs.value[1]) < 1e-10
&& std::fabs(value[2] - rhs.value[2]) < 1e-10
&& std::fabs(value[3] - rhs.value[3]) < 1e-10;
return std::fabs (value[0] - rhs.value[0]) < 1e-10
&& std::fabs (value[1] - rhs.value[1]) < 1e-10
&& std::fabs (value[2] - rhs.value[2]) < 1e-10
&& std::fabs (value[3] - rhs.value[3]) < 1e-10;
} else {
return std::fabs(value[0] - rhs.value[0]) < 1e-10
&& std::fabs(value[1] - rhs.value[1]) < 1e-10;
return std::fabs (value[0] - rhs.value[0]) < 1e-10
&& std::fabs (value[1] - rhs.value[1]) < 1e-10;
}
}
template<typename U = T>
typename std::enable_if<std::is_integral<U>::value, bool>::type operator ==(const Threshold<U> &rhs) const
typename std::enable_if<std::is_integral<U>::value, bool>::type operator == (const Threshold<U> &rhs) const
{
if (_isDouble) {
return
@@ -288,7 +288,7 @@ public:
setDefaults();
}
void setDefaults();
static bool HLReconstructionNecessary(LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw);
static bool HLReconstructionNecessary (LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw);
};
/**
* Parameters of Retinex
@@ -331,11 +331,11 @@ public:
bool medianmap;
RetinexParams ();
void setDefaults();
void getCurves(RetinextransmissionCurve &transmissionCurveLUT, RetinexgaintransmissionCurve &gaintransmissionCurveLUT) const;
void getCurves (RetinextransmissionCurve &transmissionCurveLUT, RetinexgaintransmissionCurve &gaintransmissionCurveLUT) const;
static void getDefaultgaintransmissionCurve(std::vector<double> &curve);
static void getDefaultgaintransmissionCurve (std::vector<double> &curve);
static void getDefaulttransmissionCurve(std::vector<double> &curve);
static void getDefaulttransmissionCurve (std::vector<double> &curve);
};
@@ -431,16 +431,16 @@ public:
ColorToningParams ();
void setDefaults(); // SHOULD BE GENERALIZED TO ALL CLASSES!
/// @brief Transform the mixer values to their curve equivalences
void mixerToCurve(std::vector<double> &colorCurve, std::vector<double> &opacityCurve) const;
void mixerToCurve (std::vector<double> &colorCurve, std::vector<double> &opacityCurve) const;
/// @brief Specifically transform the sliders values to their curve equivalences
void slidersToCurve(std::vector<double> &colorCurve, std::vector<double> &opacityCurve) const;
void slidersToCurve (std::vector<double> &colorCurve, std::vector<double> &opacityCurve) const;
/// @brief Fill the ColorGradientCurve and OpacityCurve LUTf from the control points curve or sliders value
void getCurves(ColorGradientCurve &colorCurveLUT, OpacityCurve &opacityCurveLUT, const double xyz_rgb[3][3], const double rgb_xyz[3][3], bool &opautili) const;
void getCurves (ColorGradientCurve &colorCurveLUT, OpacityCurve &opacityCurveLUT, const double xyz_rgb[3][3], const double rgb_xyz[3][3], bool &opautili) const;
static void getDefaultColorCurve(std::vector<double> &curve);
static void getDefaultOpacityCurve(std::vector<double> &curve);
static void getDefaultCLCurve(std::vector<double> &curve);
static void getDefaultCL2Curve(std::vector<double> &curve);
static void getDefaultColorCurve (std::vector<double> &curve);
static void getDefaultOpacityCurve (std::vector<double> &curve);
static void getDefaultCLCurve (std::vector<double> &curve);
static void getDefaultCL2Curve (std::vector<double> &curve);
};
/**
@@ -546,7 +546,7 @@ public:
double equal;
double tempBias;
WBEntry(const Glib::ustring &p, enum WBTypes t, const Glib::ustring &l, int temp, double green, double equal, double bias) : ppLabel(p), type(t), GUILabel(l), temperature(temp), green(green), equal(equal), tempBias(bias) {};
WBEntry (const Glib::ustring &p, enum WBTypes t, const Glib::ustring &l, int temp, double green, double equal, double bias) : ppLabel (p), type (t), GUILabel (l), temperature (temp), green (green), equal (equal), tempBias (bias) {};
};
class WBParams
@@ -614,6 +614,10 @@ public:
// bool badpix;
bool datacie;
bool tonecie;
int tempout;
int ybout;
double greenout;
// bool sharpcie;
};
@@ -708,10 +712,10 @@ public:
DirPyrDenoiseParams ();
void setDefaults(); // SHOULD BE GENERALIZED TO ALL CLASSES!
void getCurves(NoiseCurve &lCurve, NoiseCurve &cCurve) const;
void getCurves (NoiseCurve &lCurve, NoiseCurve &cCurve) const;
static void getDefaultNoisCurve(std::vector<double> &curve);
static void getDefaultCCCurve(std::vector<double> &curve);
static void getDefaultNoisCurve (std::vector<double> &curve);
static void getDefaultCCCurve (std::vector<double> &curve);
};
@@ -761,8 +765,8 @@ public:
Glib::ustring orientation;
Glib::ustring guide;
CropParams() : enabled(false), x(0), y(0), w(0), h(0), fixratio(false) {};
void mapToResized(int resizedWidth, int resizedHeight, int scale, int &x1, int &x2, int &y1, int &y2) const;
CropParams() : enabled (false), x (0), y (0), w (0), h (0), fixratio (false) {};
void mapToResized (int resizedWidth, int resizedHeight, int scale, int &x1, int &x2, int &y1, int &y2) const;
};
/**
@@ -1104,12 +1108,12 @@ public:
WaveletParams ();
void setDefaults();
void getCurves(WavCurve &cCurve, WavOpacityCurveRG &opacityCurveLUTRG , WavOpacityCurveBY &opacityCurveLUTBY, WavOpacityCurveW &opacityCurveLUTW, WavOpacityCurveWL &opacityCurveLUTWL) const;
static void getDefaultCCWCurve(std::vector<double> &curve);
static void getDefaultOpacityCurveRG(std::vector<double> &curve);
static void getDefaultOpacityCurveBY(std::vector<double> &curve);
static void getDefaultOpacityCurveW(std::vector<double> &curve);
static void getDefaultOpacityCurveWL(std::vector<double> &curve);
void getCurves (WavCurve &cCurve, WavOpacityCurveRG &opacityCurveLUTRG , WavOpacityCurveBY &opacityCurveLUTBY, WavOpacityCurveW &opacityCurveLUTW, WavOpacityCurveWL &opacityCurveLUTWL) const;
static void getDefaultCCWCurve (std::vector<double> &curve);
static void getDefaultOpacityCurveRG (std::vector<double> &curve);
static void getDefaultOpacityCurveBY (std::vector<double> &curve);
static void getDefaultOpacityCurveW (std::vector<double> &curve);
static void getDefaultOpacityCurveWL (std::vector<double> &curve);
};
@@ -1129,7 +1133,7 @@ public:
Threshold<int> hueskin;
//Glib::ustring algo;
Glib::ustring cbdlMethod;
DirPyrEqualizerParams() : hueskin(20, 80, 2000, 1200, false) {};
DirPyrEqualizerParams() : hueskin (20, 80, 2000, 1200, false) {};
};
/**
@@ -1420,7 +1424,7 @@ class PartialProfile
public:
rtengine::procparams::ProcParams* pparams;
ParamsEdited* pedited;
PartialProfile& operator =(const PartialProfile& rhs)
PartialProfile& operator = (const PartialProfile& rhs)
{
pparams = rhs.pparams;
pedited = rhs.pedited;
@@ -1445,7 +1449,7 @@ public:
class AutoPartialProfile : public PartialProfile
{
public:
AutoPartialProfile() : PartialProfile(true) {}
AutoPartialProfile() : PartialProfile (true) {}
~AutoPartialProfile()
{
deleteInstance();