6969 * smooth contiguous region (quantization parameter), but also to 
7070 * translate (exposure boost) and dilate (contrast boost) the exposure 
7171 * histogram through the control octaves, to center it on the control 
72-  * view and make maximum use of the available NUM_SLIDERS . 
72+  * view and make maximum use of the available channels . 
7373 * 
7474 * Users should be aware that not all the available octaves will be 
7575 * useful on every pictures.  Some automatic options will help them to 
9191#include  <stdio.h> 
9292#include  <string.h> 
9393#include  <time.h> 
94+ #include  <inttypes.h>  // Only needed for debug printf of hashes, TODO remove 
95+ 
9496
9597#include  "bauhaus/bauhaus.h" 
9698#include  "common/darktable.h" 
@@ -306,8 +308,8 @@ typedef struct dt_iop_toneequalizer_gui_data_t
306308  GtkDrawingArea  * area , * bar ;
307309  GtkWidget  * blending , * smoothing , * quantization ;
308310  GtkWidget  * post_auto_align ;
309-   GtkWidget  * method ;
310-   GtkWidget  * details , * feathering , * contrast_boost , * iterations , * exposure_boost , * post_scale , * post_shift ;
311+   GtkWidget  * lum_estimator ;
312+   GtkWidget  * filter , * feathering , * contrast_boost , * iterations , * exposure_boost , * post_scale , * post_shift ;
311313  GtkNotebook  * notebook ;
312314  dt_gui_collapsible_section_t  sliders_section , advanced_masking_section ;
313315  GtkWidget  * show_luminance_mask ;
@@ -449,8 +451,8 @@ int legacy_params(dt_iop_module_t *self,
449451    float  quantization ;
450452    float  contrast_boost ;
451453    float  exposure_boost ;
452-     dt_iop_toneequalizer_filter_t  details ;
453-     dt_iop_luminance_mask_method_t  method ;
454+     dt_iop_toneequalizer_filter_t  filter ;
455+     dt_iop_luminance_mask_method_t  lum_estimator ;
454456    int  iterations ;
455457    float  post_scale ;
456458    float  post_shift ;
@@ -464,9 +466,9 @@ int legacy_params(dt_iop_module_t *self,
464466      float  noise , ultra_deep_blacks , deep_blacks , blacks ;
465467      float  shadows , midtones , highlights , whites , speculars ;
466468      float  blending , feathering , contrast_boost , exposure_boost ;
467-       dt_iop_toneequalizer_filter_t  details ;
469+       dt_iop_toneequalizer_filter_t  filter ;
468470      int  iterations ;
469-       dt_iop_luminance_mask_method_t  method ;
471+       dt_iop_luminance_mask_method_t  lum_estimator ;
470472    } dt_iop_toneequalizer_params_v1_t ;
471473
472474    const  dt_iop_toneequalizer_params_v1_t  * o  =  old_params ;
@@ -488,9 +490,9 @@ int legacy_params(dt_iop_module_t *self,
488490    n -> contrast_boost  =  o -> contrast_boost ;
489491    n -> exposure_boost  =  o -> exposure_boost ;
490492
491-     n -> details  =  o -> details ;
493+     n -> filter  =  o -> filter ;
492494    n -> iterations  =  o -> iterations ;
493-     n -> method  =  o -> method ;
495+     n -> lum_estimator  =  o -> lum_estimator ;
494496
495497    // V2 params 
496498    n -> quantization  =  0.0f ;
@@ -515,8 +517,8 @@ int legacy_params(dt_iop_module_t *self,
515517      float  shadows ; float  midtones ; float  highlights ; float  whites ;
516518      float  speculars ; float  blending ; float  smoothing ; float  feathering ;
517519      float  quantization ; float  contrast_boost ; float  exposure_boost ;
518-       dt_iop_toneequalizer_filter_t  details ;
519-       dt_iop_luminance_mask_method_t  method ;
520+       dt_iop_toneequalizer_filter_t  filter ;
521+       dt_iop_luminance_mask_method_t  lum_estimator ;
520522      int  iterations ;
521523    } dt_iop_toneequalizer_params_v2_t ;
522524
@@ -539,9 +541,9 @@ int legacy_params(dt_iop_module_t *self,
539541    n -> contrast_boost  =  o -> contrast_boost ;
540542    n -> exposure_boost  =  o -> exposure_boost ;
541543
542-     n -> details  =  o -> details ;
544+     n -> filter  =  o -> filter ;
543545    n -> iterations  =  o -> iterations ;
544-     n -> method  =  o -> method ;
546+     n -> lum_estimator  =  o -> lum_estimator ;
545547
546548    // V2 params 
547549    n -> quantization  =  o -> quantization ;
@@ -1340,7 +1342,7 @@ void toneeq_process(dt_iop_module_t *self,
13401342    const  gboolean  luminance_valid  =  g -> luminance_valid ;
13411343    dt_iop_gui_leave_critical_section (self );
13421344
1343-     printf ("toneeq_process PIXELPIPE_PREVIEW: hash=%ld  saved_hash=%ld  luminance_valid=%d\n" , current_upstream_hash , saved_upstream_hash ,
1345+     printf ("toneeq_process PIXELPIPE_PREVIEW: hash=%"  PRIu64 "  saved_hash=%" PRIu64 "  luminance_valid=%d\n"current_upstream_hash , saved_upstream_hash ,
13441346           luminance_valid );
13451347
13461348    if (saved_upstream_hash  !=  current_upstream_hash  ||  !luminance_valid )
@@ -1425,7 +1427,7 @@ void toneeq_process(dt_iop_module_t *self,
14251427    const  gboolean  luminance_valid  =  g -> luminance_valid ;
14261428    dt_iop_gui_leave_critical_section (self );
14271429
1428-     printf ("toneeq_process GUI FULL: hash=%ld  saved_hash=%ld  luminance_valid=%d\n" , current_upstream_hash , saved_upstream_hash ,
1430+     printf ("toneeq_process GUI FULL: hash=%"  PRIu64 "  saved_hash=%" PRIu64 "  luminance_valid=%d\n"current_upstream_hash , saved_upstream_hash ,
14291431           luminance_valid );
14301432
14311433    // Re-compute if the upstream state has changed 
@@ -2138,15 +2140,15 @@ void gui_changed(dt_iop_module_t *self,
21382140  dt_iop_toneequalizer_gui_data_t  * g  =  self -> gui_data ;
21392141  dt_iop_toneequalizer_params_t  * p  =  self -> params ;
21402142
2141-   if (w  ==  g -> method 
2143+   if (w  ==  g -> lum_estimator 
21422144     ||  w  ==  g -> blending 
21432145     ||  w  ==  g -> feathering 
21442146     ||  w  ==  g -> iterations 
21452147     ||  w  ==  g -> quantization )
21462148  {
21472149    invalidate_luminance_cache (self );
21482150  }
2149-   else  if (w  ==  g -> details )
2151+   else  if (w  ==  g -> filter )
21502152  {
21512153    invalidate_luminance_cache (self );
21522154    show_guiding_controls (self );
@@ -3352,7 +3354,7 @@ static inline void compute_gui_curve_colors(dt_iop_module_t *self)
33523354  const  int  shadows_limit  =  (int )UI_HISTO_SAMPLES  *  0.3333 ;
33533355  const  int  highlights_limit  =  (int )UI_HISTO_SAMPLES  *  0.6666 ;
33543356
3355-   // printf("ev_dx=%f filter_active=%d details =%d\n", ev_dx, filter_active, p->details ); 
3357+   // printf("ev_dx=%f filter_active=%d filter =%d\n", ev_dx, filter_active, p->filter ); 
33563358
33573359  if  (!g -> gui_histogram_valid  ||  !g -> gui_curve_valid ) {
33583360    // the module is not completely initialized, set all colors to standard 
@@ -4138,16 +4140,16 @@ void gui_init(dt_iop_module_t *self)
41384140  // Masking options 
41394141  self -> widget  =  dt_ui_notebook_page (g -> notebook , N_ ("masking" ), NULL );
41404142
4141-   g -> method  =  dt_bauhaus_combobox_from_params (self , "method " );
4143+   g -> lum_estimator  =  dt_bauhaus_combobox_from_params (self , "lum_estimator " );
41424144  gtk_widget_set_tooltip_text 
4143-     (g -> method ,
4145+     (g -> lum_estimator ,
41444146     _ ("preview the mask and chose the estimator that gives you the\n" 
41454147       "higher contrast between areas to dodge and areas to burn" ));
41464148
4147-   g -> details  =  dt_bauhaus_combobox_from_params (self , N_ ("details " ));
4148-   dt_bauhaus_widget_set_label (g -> details , NULL , N_ ("preserve details" ));
4149+   g -> filter  =  dt_bauhaus_combobox_from_params (self , N_ ("filter " ));
4150+   dt_bauhaus_widget_set_label (g -> filter , NULL , N_ ("preserve details" ));
41494151  gtk_widget_set_tooltip_text 
4150-     (g -> details ,
4152+     (g -> filter ,
41514153     _ ("'no' affects global and local contrast (safe if you only add contrast)\n" 
41524154       "'guided filter' only affects global contrast and tries to preserve local contrast\n" 
41534155       "'averaged guided filter' is a geometric mean of 'no' and 'guided filter' methods\n" 
0 commit comments