Merge from 'dev'

This commit is contained in:
Lawrence Lee
2020-06-25 21:58:02 -07:00
132 changed files with 53786 additions and 5273 deletions

View File

@@ -42,9 +42,20 @@ class RetinextransmissionCurve;
class WavCurve;
class Wavblcurve;
class WavOpacityCurveBY;
class WavOpacityCurveSH;
class WavOpacityCurveRG;
class WavOpacityCurveW;
class WavOpacityCurveWL;
class LocretigainCurve;
class LocretigainCurverab;
class LocLHCurve;
class LocHHCurve;
class LocLLmaskCurve;
class LocCCmaskCurve;
class LocHHmaskCurve;
class LocLLmaskexpCurve;
class LocCCmaskexpCurve;
class LocHHmaskexpCurve;
enum RenderingIntent : int {
RI_PERCEPTUAL = INTENT_PERCEPTUAL,
@@ -103,6 +114,12 @@ public:
}
}
template<typename U = T>
typename std::enable_if<std::is_integral<U>::value, bool>::type operator !=(const Threshold<U>& rhs) const
{
return !(*this == rhs);
}
T getBottom() const
{
return bottom_left;
@@ -402,7 +419,6 @@ struct RGBCurvesParams {
/**
* Parameters of the Color Toning
*/
struct ColorToningParams {
bool enabled;
bool autosat;
@@ -490,6 +506,7 @@ struct ColorToningParams {
void getCurves(ColorGradientCurve& colorCurveLUT, OpacityCurve& opacityCurveLUT, const double xyz_rgb[3][3], bool& opautili) const;
};
/**
* Parameters of the sharpening
*/
@@ -529,8 +546,10 @@ struct SharpenEdgeParams {
bool operator ==(const SharpenEdgeParams& other) const;
bool operator !=(const SharpenEdgeParams& other) const;
};
struct SharpenMicroParams {
bool enabled;
bool matrix;
@@ -950,6 +969,480 @@ struct GradientParams {
bool operator !=(const GradientParams& other) const;
};
/**
* Parameters of the Local Lab
*/
struct LocallabParams {
struct LocallabSpot {
// Control spot settings
Glib::ustring name;
bool isvisible;
Glib::ustring shape; // ELI, RECT
Glib::ustring spotMethod; // norm, exc
Glib::ustring wavMethod; // D2, D4, D6, D10, D14
int sensiexclu;
int structexclu;
double struc;
Glib::ustring shapeMethod; // IND, SYM, INDSL, SYMSL
std::vector<int> loc; // For ellipse/rectangle: {locX, locXL, locY, locYT}
int centerX;
int centerY;
int circrad;
Glib::ustring qualityMethod; // none, std, enh, enhsup, contr, sob2
Glib::ustring complexMethod; // sim, mod, all
double transit;
double feather;
double thresh;
double iter;
double balan;
double balanh;
double colorde;
double colorscope;
double transitweak;
double transitgrad;
bool avoid;
bool blwh;
bool recurs;
bool laplac;
bool deltae;
bool shortc;
bool savrest;
int scopemask;
int lumask;
// Color & Light
bool visicolor;
bool expcolor;
int complexcolor;
bool curvactiv;
int lightness;
int contrast;
int chroma;
double labgridALow;
double labgridBLow;
double labgridAHigh;
double labgridBHigh;
double labgridALowmerg;
double labgridBLowmerg;
double labgridAHighmerg;
double labgridBHighmerg;
int strengthgrid;
int sensi;
int structcol;
double strcol;
double strcolab;
double strcolh;
double angcol;
int blurcolde;
double blurcol;
double contcol;
int blendmaskcol;
double radmaskcol;
double chromaskcol;
double gammaskcol;
double slomaskcol;
int shadmaskcol;
double strumaskcol;
double lapmaskcol;
Glib::ustring qualitycurveMethod; // none, std
Glib::ustring gridMethod; // one, two
Glib::ustring merMethod; // mone, mtwo, mthr, mfou, mfiv
Glib::ustring toneMethod; // one, two, thr, fou
Glib::ustring mergecolMethod; // one, two, thr, fou, fiv, six, sev, sev0, sev1, sev2, hei, nin, ten, ele, twe, thi, for, hue, sat, col, lum
std::vector<double> llcurve;
std::vector<double> lccurve;
std::vector<double> cccurve;
std::vector<double> clcurve;
std::vector<double> rgbcurve;
std::vector<double> LHcurve;
std::vector<double> HHcurve;
bool invers;
bool special;
bool toolcol;
bool enaColorMask;
bool fftColorMask;
std::vector<double> CCmaskcurve;
std::vector<double> LLmaskcurve;
std::vector<double> HHmaskcurve;
std::vector<double> HHhmaskcurve;
double softradiuscol;
double opacol;
double mercol;
double merlucol;
double conthrcol;
std::vector<double> Lmaskcurve;
std::vector<double> LLmaskcolcurvewav;
Threshold<int> csthresholdcol;
// Exposure
bool visiexpose;
bool expexpose;
int complexexpose;
double expcomp;
int hlcompr;
int hlcomprthresh;
int black;
int shadex;
int shcompr;
int expchroma;
int sensiex;
int structexp;
int blurexpde;
double strexp;
double angexp;
std::vector<double> excurve;
bool inversex;
bool enaExpMask;
bool enaExpMaskaft;
std::vector<double> CCmaskexpcurve;
std::vector<double> LLmaskexpcurve;
std::vector<double> HHmaskexpcurve;
int blendmaskexp;
double radmaskexp;
double chromaskexp;
double gammaskexp;
double slomaskexp;
double lapmaskexp;
double strmaskexp;
double angmaskexp;
double softradiusexp;
std::vector<double> Lmaskexpcurve;
Glib::ustring expMethod; // std, pde
Glib::ustring exnoiseMethod; // none, med, medhi
double laplacexp;
double balanexp;
double linear;
double gamm;
double fatamount;
double fatdetail;
double fatanchor;
double fatlevel;
// Shadow highlight
bool visishadhigh;
bool expshadhigh;
int complexshadhigh;
Glib::ustring shMethod; // std, tone
int multsh[5];
int highlights;
int h_tonalwidth;
int shadows;
int s_tonalwidth;
int sh_radius;
int sensihs;
bool enaSHMask;
std::vector<double> CCmaskSHcurve;
std::vector<double> LLmaskSHcurve;
std::vector<double> HHmaskSHcurve;
int blendmaskSH;
double radmaskSH;
int blurSHde;
double strSH;
double angSH;
bool inverssh;
double chromaskSH;
double gammaskSH;
double slomaskSH;
double lapmaskSH;
int detailSH;
std::vector<double> LmaskSHcurve;
double fatamountSH;
double fatanchorSH;
double gamSH;
double sloSH;
// Vibrance
bool visivibrance;
bool expvibrance;
int complexvibrance;
int saturated;
int pastels;
int warm;
Threshold<int> psthreshold;
bool protectskins;
bool avoidcolorshift;
bool pastsattog;
int sensiv;
std::vector<double> skintonescurve;
std::vector<double> CCmaskvibcurve;
std::vector<double> LLmaskvibcurve;
std::vector<double> HHmaskvibcurve;
bool enavibMask;
int blendmaskvib;
double radmaskvib;
double chromaskvib;
double gammaskvib;
double slomaskvib;
double lapmaskvib;
double strvib;
double strvibab;
double strvibh;
double angvib;
std::vector<double> Lmaskvibcurve;
// Soft Light
bool visisoft;
bool expsoft;
int complexsoft;
int streng;
int sensisf;
double laplace;
Glib::ustring softMethod; // soft, reti
// Blur & Noise
bool visiblur;
bool expblur;
int complexblur;
double radius;
int strength;
int sensibn;
int itera;
int guidbl;
int strbl;
int isogr;
int strengr;
int scalegr;
int epsbl;
Glib::ustring blMethod; // blur, med, guid
Glib::ustring chroMethod; // lum, chr, all
Glib::ustring blurMethod; // norm, inv
Glib::ustring medMethod; // none, 33, 55, 77, 99
bool activlum;
double noiselumf;
double noiselumf0;
double noiselumf2;
double noiselumc;
double noiselumdetail;
int noiselequal;
double noisechrof;
double noisechroc;
double noisechrodetail;
int adjblur;
int bilateral;
int sensiden;
int detailthr;
std::vector<double> locwavcurveden;
Glib::ustring showmaskblMethodtyp;
std::vector<double> CCmaskblcurve;
std::vector<double> LLmaskblcurve;
std::vector<double> HHmaskblcurve;
bool enablMask;
bool fftwbl;
bool toolbl;
int blendmaskbl;
double radmaskbl;
double chromaskbl;
double gammaskbl;
double slomaskbl;
double lapmaskbl;
int shadmaskbl;
int shadmaskblsha;
double strumaskbl;
std::vector<double> Lmaskblcurve;
std::vector<double> LLmaskblcurvewav;
Threshold<int> csthresholdblur;
// Tone Mapping
bool visitonemap;
bool exptonemap;
int complextonemap;
double stren;
double gamma;
double estop;
double scaltm;
int rewei;
double satur;
int sensitm;
double softradiustm;
double amount;
bool equiltm;
std::vector<double> CCmasktmcurve;
std::vector<double> LLmasktmcurve;
std::vector<double> HHmasktmcurve;
bool enatmMask;
bool enatmMaskaft;
int blendmasktm;
double radmasktm;
double chromasktm;
double gammasktm;
double slomasktm;
double lapmasktm;
std::vector<double> Lmasktmcurve;
// Retinex
bool visireti;
bool expreti;
int complexreti;
Glib::ustring retinexMethod; // low, uni, high
double str;
double chrrt;
double neigh;
double vart;
double offs;
int dehaz;
int depth;
int sensih;
std::vector<double> localTgaincurve;
std::vector<double> localTtranscurve;
bool inversret;
bool equilret;
bool loglin;
bool lumonly;
double softradiusret;
std::vector<double> CCmaskreticurve;
std::vector<double> LLmaskreticurve;
std::vector<double> HHmaskreticurve;
bool enaretiMask;
bool enaretiMasktmap;
int blendmaskreti;
double radmaskreti;
double chromaskreti;
double gammaskreti;
double slomaskreti;
double lapmaskreti;
double scalereti;
double darkness;
double lightnessreti;
double limd;
double cliptm;
bool fftwreti;
std::vector<double> Lmaskreticurve;
// Sharpening
bool visisharp;
bool expsharp;
int complexsharp;
int sharcontrast;
double sharradius;
int sharamount;
int shardamping;
int shariter;
double sharblur;
int sensisha;
bool inverssha;
// Local Contrast
bool visicontrast;
bool expcontrast;
int complexcontrast;
int lcradius;
double lcamount;
double lcdarkness;
double lclightness;
double sigmalc;
int levelwav;
double residcont;
double residsha;
double residshathr;
double residhi;
double residhithr;
double residblur;
double levelblur;
double sigmabl;
double residchro;
double residcomp;
double sigma;
double offset;
double sigmadr;
double threswav;
double chromalev;
double chromablu;
double sigmadc;
double deltad;
double fatres;
double clarilres;
double claricres;
double clarisoft;
double sigmalc2;
double strwav;
double angwav;
double strengthw;
double sigmaed;
double radiusw;
double detailw;
double gradw;
double tloww;
double thigw;
double edgw;
double basew;
int sensilc;
bool fftwlc;
bool blurlc;
bool wavblur;
bool wavedg;
bool waveshow;
bool wavcont;
bool wavcomp;
bool wavgradl;
bool wavcompre;
bool origlc;
Glib::ustring localcontMethod; // loc, wav
Glib::ustring localedgMethod; // fir, sec, thr
Glib::ustring localneiMethod; // none, low, high
std::vector<double> locwavcurve;
Threshold<int> csthreshold;
std::vector<double> loclevwavcurve;
std::vector<double> locconwavcurve;
std::vector<double> loccompwavcurve;
std::vector<double> loccomprewavcurve;
std::vector<double> locedgwavcurve;
std::vector<double> CCmasklccurve;
std::vector<double> LLmasklccurve;
std::vector<double> HHmasklccurve;
bool enalcMask;
int blendmasklc;
double radmasklc;
double chromasklc;
std::vector<double> Lmasklccurve;
// Contrast by detail levels
bool visicbdl;
bool expcbdl;
int complexcbdl;
double mult[6];
double chromacbdl;
double threshold;
int sensicb;
double clarityml;
int contresid;
double blurcbdl;
double softradiuscb;
bool enacbMask;
std::vector<double> CCmaskcbcurve;
std::vector<double> LLmaskcbcurve;
std::vector<double> HHmaskcbcurve;
int blendmaskcb;
double radmaskcb;
double chromaskcb;
double gammaskcb;
double slomaskcb;
double lapmaskcb;
std::vector<double> Lmaskcbcurve;
// Log encoding
bool visilog;
bool explog;
bool autocompute;
double sourceGray;
double targetGray;
bool Autogray;
bool fullimage;
double blackEv;
double whiteEv;
double detail;
int sensilog;
double baselog;
double strlog;
double anglog;
LocallabSpot();
bool operator ==(const LocallabSpot& other) const;
bool operator !=(const LocallabSpot& other) const;
};
static const double LABGRIDL_CORR_MAX;
static const double LABGRIDL_CORR_SCALE;
static const double LABGRIDL_DIRECT_SCALE;
bool enabled;
int selspot;
std::vector<LocallabSpot> spots;
LocallabParams();
bool operator ==(const LocallabParams& other) const;
bool operator !=(const LocallabParams& other) const;
};
/**
* Parameters of the post-crop vignette filter
*/
@@ -1201,7 +1694,9 @@ private:
struct WaveletParams {
std::vector<double> ccwcurve;
std::vector<double> blcurve;
std::vector<double> levelshc;
std::vector<double> opacityCurveRG;
std::vector<double> opacityCurveSH;
std::vector<double> opacityCurveBY;
std::vector<double> opacityCurveW;
std::vector<double> opacityCurveWL;
@@ -1235,6 +1730,12 @@ struct WaveletParams {
bool tmr;
int strength;
int balance;
double sigmafin;
double sigmaton;
double sigmacol;
double sigmadir;
double rangeab;
double protab;
int iter;
bool expcontrast;
bool expchroma;
@@ -1247,7 +1748,13 @@ struct WaveletParams {
bool exptoning;
bool expnoise;
bool expclari;
double labgridALow;
double labgridBLow;
double labgridAHigh;
double labgridBHigh;
static const double LABGRID_CORR_MAX;
static const double LABGRID_CORR_SCALE;
static const double LABGRIDL_DIRECT_SCALE;
int Lmethod;
Glib::ustring CLmethod;
Glib::ustring Backmethod;
@@ -1318,8 +1825,8 @@ struct WaveletParams {
void getCurves(
WavCurve& cCurve,
Wavblcurve& tCurve,
WavOpacityCurveRG&
opacityCurveLUTRG,
WavOpacityCurveRG& opacityCurveLUTRG,
WavOpacityCurveSH& opacityCurveLUTSH,
WavOpacityCurveBY& opacityCurveLUTBY,
WavOpacityCurveW& opacityCurveLUTW,
WavOpacityCurveWL& opacityCurveLUTWL
@@ -1551,6 +2058,22 @@ struct RAWParams {
// exposure before interpolation
double expos;
struct PreprocessWB {
enum class Mode {
CAMERA = 0,
AUTO
};
Mode mode;
PreprocessWB();
bool operator ==(const PreprocessWB& other) const;
bool operator !=(const PreprocessWB& other) const;
};
PreprocessWB preprocessWB;
bool hotPixelFilter;
bool deadPixelFilter;
int hotdeadpix_thresh;
@@ -1618,6 +2141,7 @@ public:
LensProfParams lensProf; ///< Lens correction profile parameters
PerspectiveParams perspective; ///< Perspective correction parameters
GradientParams gradient; ///< Gradient filter parameters
LocallabParams locallab; ///< Local lab parameters
PCVignetteParams pcvignette; ///< Post-crop vignette filter parameters
CACorrParams cacorrection; ///< Lens c/a correction parameters
VignettingParams vignetting; ///< Lens vignetting correction parameters