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 ;
@@ -1380,7 +1382,7 @@ void toneeq_process(dt_iop_module_t *self,
13801382 const gboolean luminance_valid = g -> luminance_valid ;
13811383 dt_iop_gui_leave_critical_section (self );
13821384
1383- printf ("toneeq_process PIXELPIPE_PREVIEW: hash=%ld saved_hash=%ld luminance_valid=%d\n" , current_upstream_hash , saved_upstream_hash ,
1385+ printf ("toneeq_process PIXELPIPE_PREVIEW: hash=%" PRIu64 " saved_hash=%" PRIu64 " luminance_valid=%d\n" , current_upstream_hash , saved_upstream_hash ,
13841386 luminance_valid );
13851387
13861388 if (saved_upstream_hash != current_upstream_hash || !luminance_valid )
@@ -1465,7 +1467,7 @@ void toneeq_process(dt_iop_module_t *self,
14651467 const gboolean luminance_valid = g -> luminance_valid ;
14661468 dt_iop_gui_leave_critical_section (self );
14671469
1468- printf ("toneeq_process GUI FULL: hash=%ld saved_hash=%ld luminance_valid=%d\n" , current_upstream_hash , saved_upstream_hash ,
1470+ printf ("toneeq_process GUI FULL: hash=%" PRIu64 " saved_hash=%" PRIu64 " luminance_valid=%d\n" , current_upstream_hash , saved_upstream_hash ,
14691471 luminance_valid );
14701472
14711473 // Re-compute if the upstream state has changed
@@ -2183,15 +2185,15 @@ void gui_changed(dt_iop_module_t *self,
21832185 dt_iop_toneequalizer_gui_data_t * g = self -> gui_data ;
21842186 dt_iop_toneequalizer_params_t * p = self -> params ;
21852187
2186- if (w == g -> method
2188+ if (w == g -> lum_estimator
21872189 || w == g -> blending
21882190 || w == g -> feathering
21892191 || w == g -> iterations
21902192 || w == g -> quantization )
21912193 {
21922194 invalidate_luminance_cache (self );
21932195 }
2194- else if (w == g -> details )
2196+ else if (w == g -> filter )
21952197 {
21962198 invalidate_luminance_cache (self );
21972199 show_guiding_controls (self );
@@ -3397,7 +3399,7 @@ static inline void compute_gui_curve_colors(dt_iop_module_t *self)
33973399 const int shadows_limit = (int )UI_HISTO_SAMPLES * 0.3333 ;
33983400 const int highlights_limit = (int )UI_HISTO_SAMPLES * 0.6666 ;
33993401
3400- // printf("ev_dx=%f filter_active=%d details =%d\n", ev_dx, filter_active, p->details );
3402+ // printf("ev_dx=%f filter_active=%d filter =%d\n", ev_dx, filter_active, p->filter );
34013403
34023404 if (!g -> gui_histogram_valid || !g -> gui_curve_valid ) {
34033405 // the module is not completely initialized, set all colors to standard
@@ -4183,16 +4185,16 @@ void gui_init(dt_iop_module_t *self)
41834185 // Masking options
41844186 self -> widget = dt_ui_notebook_page (g -> notebook , N_ ("masking" ), NULL );
41854187
4186- g -> method = dt_bauhaus_combobox_from_params (self , "method " );
4188+ g -> lum_estimator = dt_bauhaus_combobox_from_params (self , "lum_estimator " );
41874189 gtk_widget_set_tooltip_text
4188- (g -> method ,
4190+ (g -> lum_estimator ,
41894191 _ ("preview the mask and chose the estimator that gives you the\n"
41904192 "higher contrast between areas to dodge and areas to burn" ));
41914193
4192- g -> details = dt_bauhaus_combobox_from_params (self , N_ ("details " ));
4193- dt_bauhaus_widget_set_label (g -> details , NULL , N_ ("preserve details" ));
4194+ g -> filter = dt_bauhaus_combobox_from_params (self , N_ ("filter " ));
4195+ dt_bauhaus_widget_set_label (g -> filter , NULL , N_ ("preserve details" ));
41944196 gtk_widget_set_tooltip_text
4195- (g -> details ,
4197+ (g -> filter ,
41964198 _ ("'no' affects global and local contrast (safe if you only add contrast)\n"
41974199 "'guided filter' only affects global contrast and tries to preserve local contrast\n"
41984200 "'averaged guided filter' is a geometric mean of 'no' and 'guided filter' methods\n"
0 commit comments