Re-open Generalized Hyperbolic Stretch (#7251)
* GHS GUI first step * GHS GUI first step * GUI step 3 * Hide show ghsmethod * Siril functions for ghs * Init ghs in iplocallab * ghs step 2 * ghs step 4 * Comment copyright Pixlnsight 2021 * Smooth highlights and tooltips * Enabled saturation and luminance ghs mode * First tooltip * Ghs tooltips * Remove wrong packstart inverssh * Change labels and tooltips * Disabled mask in global and other improvments * Comment code * appimage and windows yml ghs * Change tooltip * Ghsmethod hue and change tolltips * Change tooltip * Inverse Stretch step 1 * Inverse GHS * GHS tooltips * Change tooltips * Change tooltip * Linear black point * Small change to blackpoint * Change tooltip * Clean and comment code * forgotten GHS highlight attenuation msg in history * Comment code with Transformation equations * Change tooltip * Wrong default value balck point * Comment code iplocallab * Ghs curve step 1 * GHS curve step 2 * Show GHS setting in a Curve Box * Tooltip for ghs S curve * Disabled warning in compilation simpleprocess * Simplified code part 1 * Simplified code GHS graph part 2 * Improve black point with negatives values * Improve BP and tooltip * Listener enable only with GHS * White point for GHS * Change label and tooltip * Improve behavior white point and black point * Link sliders ghs_SP ghs_LP ghs_HP and change code to avoid balck screen * hide unused button in diagonal curve GHS * prevents the GHS representation in S from displaying artifacts if ghs-d=0 * Change tooltips * Improvment and tooltips * Forgotten tooltip * Improve GUI GHS S curve - change tooltips * Set transition gray areas in S curve GHS with values of the RT-spot * Change label GHS * setlogscale blackpoint and symmetry * Set recursive reference enable by default in controlspotpanel * Change lastlocalCurvesDir Dirghs in locallabtools and options - change labels * Added in converttonormal ghsMode.. not sure if this is useful * DIY to make GHS curve work without the choices * Change RGB calculation with luminance function working profile * 5 modes GHS method * Label to show datas clipped Black point and White point * Various change white point tooltips * Bad behavior wp bp labels * Small change to improccordinator call to ghschanged ghsbwchanged * Set log scale ghs_D * Hide Graduated filter if GHS enable * Luminance Lab in ghsmethod * Lab slope factor step 1 * Slope and Chromaticity GHS improvments * Fixed bad sqrt line 17477 iplocallab * Workaround linear GHS - re-enable Graduated filer GHS * Change limits slope lab factor * Ghs chromaticity Lab (Lch) * Improve ghs chromaticity * Change labels and tooltips Lab chroma * Slope Lab to 100 * Noise and saturation RGB * Saturation RGB standard and labels * Change histogram and navigator panel without gamma when using working profile * Remove gray in GHS curve * Local contrast a minima * Regularization stretch * Improve Graduated Filter in all cases GHS Color and Light etc. * Improves nlmeans to reduce noise after GHS * Change to GF - tooltip Nlmeans * Added oW oH tW tH etc. * Added call GF * tX tY for previewProps * Comment code GF * Improve local contrast ghs * Change norm to norm2 * Improve GUI mode complexity and Lab GHS * Show values BP WP in GUI * Labgrid ghs step 1 * Labgrid for simulation GHS - step 2 * More points for Labgrid ghs * Clean and comment code * Fixed crash in inverse GHS white point - set to 10 points for GSH simulation * Change to black point in inverse GHS * Intilialize simulation with nothing if new spot * Remove curve GHS - optimize code simulation - improve GUI * set ghs default - fixed crash is case HP SP LP * Fixed crash - I hope in inverse GHS * Simplify WP and BP limits to avoid crash in inverse GHS * Clean code with ghscurve - ghsshape * Change tooltips * Change to D - GUI - comment code * Simulation with 4 more points * Best simulation with point 0.05 and 0.95 * Clean code - change for crsah in Inverse GHS * Show values WP and BP * Change tooltips * Midtones after GHS * Modification code WP BP * Tests changes in settings for transition and Shape detection - see Preferences * Change order labels luma chroma hue * Fixed bad behavior localllistener denchanged in dcrop.cc * Save work * Work on graduated filter * Improve a little graduated filter SH and others... * 3 configurations tests graduated filter SH plain image - color more sk - exposure normal * Forgotten code ... * Change improccordinator parameter * Save work printf parameters GF * New test for GF * Hide plain image calculation GF * Small chnages and comment code * Change tooltip exp graduated filter * Change tooltip exp graduated filter * Save work * Change GF for some tools only in Global and Fullimage - test for GF SH mode plain image * Fixed crash and GUI part 1 * Others change GF * Change label - allow GF plain image in SH * Change GF with cx cy sk * Adapt locallabtool and locallabtools2 to GF * Clean code * GF wavelet only in fullimage and global * GF - Empirical correction to cx and cy in function of sk * Change label GHS and position in GUI * Fixed Black point bad behavior history - an oversight may be age * Change real strength of GF - to look like GF main * Include ksk - Skip correction in all code GF * Passed other parameters to try * New parameter for GF * Change position graph-curv ghs and labels black and white point * Change behavior and default value white point * Save provisory work * Save provisory work * Curve GHS with 21 points including 0 and 1 * Two prameters added to change behavior GF - rationalize their using * Change Black point direction * Change range black-point for negatives values - chnage tooltips * Change tooltips * Various change to avoid crash and settings defaults * Disabled showmùaskmethod - set max white point to 5 * Fixed bad behavior when change fullimage to global for mask * Clean comment code * Fixed - I hope - bad behavior when we go from Fullimage to Global and vice versa * Fixed crash in output tif and show time to calculate WP and BP * Change tooltip BP and WP * Change tooltips BP WP * move GF after GHS so as not to influence BP and WP * Clean code * Disable all mask and modifications in Global but remain active in fullimage and normal * Change tooltip graduated filter * Restore GF in normal mode - and increases GF strength as before * Clean code locallabtools 1 2 * Comment in calclocalGradientParams in iplocallab for changes in Graduated F * Change convention labels - tooltips * Change tooltips * improves (I hope) the readability of the tooltips * Remove with comment change complexity in Settings * Improve settings BP WP - improve tooltips * Refactor GHS curve and increase resolution Simplify how the curve parameters are passed to the drawing area. Use up to 400 line segments to draw the curve. * Update GHS curve tooltip Remove statement regarding the number of points used because it is no longer accurate. * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Change Luma with Lightness * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Update rtdata/languages/default Co-authored-by: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> * Remove warnings in icmpanel * Changes suggested by Lawrence37 * GHS - Hide inverse always show in some cases - improve tooltip BP WP * Change tooltip * Change tooltip * Small changes * Change tootip suggested by Lawrence37 - set midtones and LC set_sensitive in function of D * Add tooltip as suggest by Lawrence37 for LC and midtones * Remove tooltip on Frame LC and Midtones * Remove all traces toottips frame LD and Midtones * set sensitive BLP and HLP to false if stretch = 0 * Change Beep6581 to Rawtherapee in appimage.yml and Windows.yml * Hide LC and midtones when Stretch = 0 * Clean up Generalized Hyperbolic Stretch code Convert some ints into enum classes. Replace new/delete with std::unique_ptr for image. Remove unused GHS parameters in ProcParams and ParamsEdited which were used to draw the curve. Revert changes to the curve editors because they are not needed. Simplify the drawing of the curve background for efficiency. Restore the const-ness of some variables. * Change appimage.yml and windows.yml --------- Co-authored-by: Lawrence Lee <45837045+Lawrence37@users.noreply.github.com>
This commit is contained in:
@@ -107,6 +107,32 @@ struct WaveletParams;
|
||||
|
||||
enum RenderingIntent : int;
|
||||
|
||||
// From Siril.
|
||||
struct ght_compute_params {
|
||||
float qlp;//protect shadows
|
||||
float q0;
|
||||
float qwp;//protect highlights - white point
|
||||
float q1;
|
||||
float q;
|
||||
float b1;
|
||||
float a1;
|
||||
float a2;
|
||||
float b2;
|
||||
float c2;
|
||||
float d2;
|
||||
float e2;
|
||||
float a3;
|
||||
float b3;
|
||||
float c3;
|
||||
float d3;
|
||||
float e3;
|
||||
float a4;
|
||||
float b4;
|
||||
float LPT;//inverse protect shadow
|
||||
float SPT;//inverse symmetric point
|
||||
float HPT;//inverse protect highlight
|
||||
};
|
||||
|
||||
class ImProcFunctions
|
||||
{
|
||||
cmsHTRANSFORM monitorTransform;
|
||||
@@ -273,7 +299,7 @@ enum class BlurType {
|
||||
void idirpyr(LabImage* data_coarse, LabImage* data_fine, int level, LUTf &rangefn_L, LUTf & nrwt_l, LUTf & nrwt_ab,
|
||||
int pitch, int scale, const int luma, const int chroma/*, LUTf & Lcurve, LUTf & abcurve*/);
|
||||
//locallab Local adjustments
|
||||
void maskcalccol(bool invmask, bool pde, int bfw, int bfh, int xstart, int ystart, int sk, int cx, int cy, LabImage* bufcolorig, LabImage* bufmaskblurcol, LabImage* originalmaskcol, LabImage* original, LabImage* reserved, int inv, struct local_params & lp,
|
||||
void maskcalccol(int call, bool invmask, bool pde, int bfw, int bfh, int oW, int oH, int tX, int tY, int tW, int tH, int xstart, int ystart, int xend, int yend, int sk, int cx, int cy, LabImage* bufcolorig, LabImage* bufmaskblurcol, LabImage* originalmaskcol, LabImage* original, LabImage* reserved, int inv, struct local_params & lp,
|
||||
float strumask, bool astool,
|
||||
const LocCCmaskCurve & locccmasCurve, bool lcmasutili,
|
||||
const LocLLmaskCurve & locllmasCurve, bool llmasutili,
|
||||
@@ -282,7 +308,7 @@ enum class BlurType {
|
||||
const LUTf& lmasklocalcurve, bool localmaskutili,
|
||||
const LocwavCurve & loclmasCurvecolwav, bool lmasutilicolwav, int level_bl, int level_hl, int level_br, int level_hr,
|
||||
int shortcu, bool delt, const float hueref, const float chromaref, const float lumaref,
|
||||
float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, bool fftt, float blu_ma, float cont_ma, int indic, float &fab);
|
||||
float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, bool fftt, float blu_ma, float cont_ma, int indic, float &fab, int fw, int fh, float ksk, float kskx, float kbh, float kbw);
|
||||
|
||||
void avoidcolshi(const struct local_params& lp, int sp, LabImage *transformed, LabImage *reserved, int cy, int cx, int sk);
|
||||
|
||||
@@ -332,7 +358,7 @@ enum class BlurType {
|
||||
void calc_ref(int sp, LabImage* original, LabImage* transformed, int cx, int cy, int oW, int oH, int sk, double &huerefblur, double &chromarefblur, double &lumarefblur, double &hueref, double &chromaref, double &lumaref, double &sobelref, float &avg, const LocwavCurve & locwavCurveden, bool locwavdenutili);
|
||||
void copy_ref(LabImage* spotbuffer, LabImage* original, LabImage* transformed, int cx, int cy, int sk, const struct local_params & lp, double &huerefspot, double &chromarefspot, double &lumarefspot);
|
||||
void paste_ref(LabImage* spotbuffer, LabImage* transformed, int cx, int cy, int sk, const struct local_params & lp);
|
||||
void Lab_Local(int call, int sp, float** shbuffer, LabImage* original, LabImage* transformed, LabImage* reserved, LabImage * savenormtm, LabImage * savenormreti, LabImage* lastorig, int fw, int fh, int cx, int cy, int oW, int oH, int sk, const LocretigainCurve& locRETgainCcurve, const LocretitransCurve &locRETtransCcurve,
|
||||
void Lab_Local(int call, int sp, float** shbuffer, LabImage* original, LabImage* transformed, LabImage* reserved, LabImage * savenormtm, LabImage * savenormreti, LabImage* lastorig, int fw, int fh, int cx, int cy, int oW, int oH, int tX, int tY, int tW, int tH, int sk, const LocretigainCurve& locRETgainCcurve, const LocretitransCurve &locRETtransCcurve,
|
||||
const LUTf& lllocalcurve, bool locallutili,
|
||||
const LUTf& cllocalcurve, bool localclutili,
|
||||
const LUTf& lclocalcurve, bool locallcutili,
|
||||
@@ -341,6 +367,7 @@ enum class BlurType {
|
||||
const LUTf& lmasklocalcurve, bool localmaskutili,
|
||||
const LUTf& lmaskexplocalcurve, bool localmaskexputili,
|
||||
const LUTf& lmaskSHlocalcurve, bool localmaskSHutili,
|
||||
// const LUTf& ghslocalcurve, bool localghsutili,
|
||||
const LUTf& lmaskviblocalcurve, bool localmaskvibutili,
|
||||
const LUTf& lmasktmlocalcurve, bool localmasktmutili,
|
||||
LUTf& lmaskretilocalcurve, bool localmaskretiutili,
|
||||
@@ -389,7 +416,16 @@ enum class BlurType {
|
||||
bool prevDeltaE, int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llvibMask, int lllcMask, int llsharMask, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask, int lllogMask, int ll_Mask, int llcieMask,
|
||||
float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax,
|
||||
float& meantm, float& stdtm, float& meanreti, float& stdreti, float &fab, float &maxicam, float &rdx, float &rdy, float &grx, float &gry, float &blx, float &bly, float &meanx, float &meany, float &meanxe, float &meanye, int &prim, int &ill, float &contsig, float &lightsig,
|
||||
float &highresi, float &nresi, float &highresi46, float &nresi46, float &Lhighresi, float &Lnresi, float &Lhighresi46, float &Lnresi46, float &slopeg, bool &linkrgb);
|
||||
float &highresi, float &nresi, float &highresi46, float &nresi46, float &Lhighresi, float &Lnresi, float &Lhighresi46, float &Lnresi46, float &slopeg, bool &linkrgb,
|
||||
int *ghsbpwp, float *ghsbpwpvalue);
|
||||
|
||||
enum class GHTStrType {
|
||||
NORMAL,
|
||||
INVERSE,
|
||||
};
|
||||
|
||||
static ght_compute_params GHT_setup(float in_B, float D, float LP, float SP, float HP, GHTStrType strtype);
|
||||
static float GHT(float x, float B, float D, float LP, float SP, float HP, ght_compute_params c, GHTStrType strtype);
|
||||
|
||||
void tone_eqcam2(ImProcFunctions *ipf, Imagefloat *rgb, int whits, int blacks, const Glib::ustring &workingProfile, double scale, bool multithread);
|
||||
void tone_eqdehaz(ImProcFunctions *ipf, Imagefloat *rgb, int whits, int blacks, const Glib::ustring &workingProfile, double scale, bool multithread);
|
||||
@@ -411,13 +447,13 @@ enum class BlurType {
|
||||
static void strcurv_data(std::string retistr, int *s_datc, int &siz);
|
||||
void blendstruc(int bfw, int bfh, LabImage* bufcolorig, float radius, float stru, array2D<float> & blend2, int sk, bool multiThread);
|
||||
|
||||
void wavcontrast4(struct local_params& lp, float ** tmp, float ** tmpa, float ** tmpb, float contrast, float radblur, float radlevblur, int bfw, int bfh, int level_bl, int level_hl, int level_br, int level_hr, int sk, int numThreads, const LocwavCurve & locwavCurve, bool locwavutili, bool wavcurve,
|
||||
void wavcontrast4(int call, struct local_params& lp, float ** tmp, float ** tmpa, float ** tmpb, float contrast, float radblur, float radlevblur, int bfw, int bfh, int oW, int oH, int tX, int tY, int tW, int tH, int level_bl, int level_hl, int level_br, int level_hr, int sk, int numThreads, const LocwavCurve & locwavCurve, bool locwavutili, bool wavcurve,
|
||||
const LocwavCurve & loclevwavCurve, bool loclevwavutili, bool wavcurvelev,
|
||||
const LocwavCurve & locconwavCurve, bool locconwavutili, bool wavcurvecon,
|
||||
const LocwavCurve & loccompwavCurve, bool loccompwavutili, bool wavcurvecomp,
|
||||
const LocwavCurve & loccomprewavCurve, bool loccomprewavutili, bool wavcurvecompre,
|
||||
const LocwavCurve & locedgwavCurve, bool locedgwavutili,
|
||||
float sigm, float offs,int & maxlvl, float sigmadc, float deltad, float chromalev, float chromablu, bool blurlc, bool blurena, bool levelena, bool comprena, bool compreena, float compress, float thres);
|
||||
float sigm, float offs,int & maxlvl, float sigmadc, float deltad, float chromalev, float chromablu, bool blurlc, bool blurena, bool levelena, bool comprena, bool compreena, float compress, float thres, int fw, int fh, int cx, int cy, float ksk, float kskx, float kbh, float kbw);
|
||||
|
||||
void wavcont(const struct local_params& lp, float ** tmp, wavelet_decomposition &wdspot, int level_bl, int maxlvl,
|
||||
const LocwavCurve & loclevwavCurve, bool loclevwavutili,
|
||||
@@ -430,7 +466,12 @@ enum class BlurType {
|
||||
void wavcbd(wavelet_decomposition &wdspot, int level_bl, int maxlvl,
|
||||
const LocwavCurve& locconwavCurve, bool locconwavutili, float sigm, float offs, float chromalev, int sk);
|
||||
|
||||
void transit_shapedetect2(int sp, float meantm, float stdtm, int call, int senstype, const LabImage * bufexporig, const LabImage * bufexpfin, LabImage * originalmask, const float hueref, const float chromaref, const float lumaref, float sobelref, float meansobel, float ** blend2, struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk);
|
||||
enum class LocalLabGradientMode {
|
||||
STANDARD,
|
||||
PLAIN_IMAGE,
|
||||
};
|
||||
|
||||
void transit_shapedetect2(int sp, float meantm, float stdtm, int call, int senstype, const LabImage * bufexporig, const LabImage * bufexpfin, LabImage * originalmask, const float hueref, const float chromaref, const float lumaref, float sobelref, float meansobel, float ** blend2, struct local_params & lp, LabImage * original, LabImage * transformed, const LabImage *tmp1, LocalLabGradientMode grad, int cx, int cy, int sk);
|
||||
|
||||
void transit_shapedetect_retinex(int call, int senstype, LabImage * bufexporig, LabImage * bufexpfin, LabImage * bufmask, LabImage * buforigmas, float **buflight, float **bufchro, const float hueref, const float chromaref, const float lumaref, struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk);
|
||||
void transit_shapedetect(int senstype, const LabImage *bufexporig, LabImage * originalmask, float **bufchro, bool HHutili, const float hueref, const float chromaref, const float lumaref, float sobelref, float meansobel, float ** blend2, const struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk);
|
||||
|
||||
Reference in New Issue
Block a user