69
69
* smooth contiguous region (quantization parameter), but also to
70
70
* translate (exposure boost) and dilate (contrast boost) the exposure
71
71
* 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 .
73
73
*
74
74
* Users should be aware that not all the available octaves will be
75
75
* useful on every pictures. Some automatic options will help them to
91
91
#include <stdio.h>
92
92
#include <string.h>
93
93
#include <time.h>
94
+ #include <inttypes.h> // Only needed for debug printf of hashes, TODO remove
95
+
94
96
95
97
#include "bauhaus/bauhaus.h"
96
98
#include "common/darktable.h"
@@ -306,8 +308,8 @@ typedef struct dt_iop_toneequalizer_gui_data_t
306
308
GtkDrawingArea * area , * bar ;
307
309
GtkWidget * blending , * smoothing , * quantization ;
308
310
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 ;
311
313
GtkNotebook * notebook ;
312
314
dt_gui_collapsible_section_t sliders_section , advanced_masking_section ;
313
315
GtkWidget * show_luminance_mask ;
@@ -449,8 +451,8 @@ int legacy_params(dt_iop_module_t *self,
449
451
float quantization ;
450
452
float contrast_boost ;
451
453
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 ;
454
456
int iterations ;
455
457
float post_scale ;
456
458
float post_shift ;
@@ -464,9 +466,9 @@ int legacy_params(dt_iop_module_t *self,
464
466
float noise , ultra_deep_blacks , deep_blacks , blacks ;
465
467
float shadows , midtones , highlights , whites , speculars ;
466
468
float blending , feathering , contrast_boost , exposure_boost ;
467
- dt_iop_toneequalizer_filter_t details ;
469
+ dt_iop_toneequalizer_filter_t filter ;
468
470
int iterations ;
469
- dt_iop_luminance_mask_method_t method ;
471
+ dt_iop_luminance_mask_method_t lum_estimator ;
470
472
} dt_iop_toneequalizer_params_v1_t ;
471
473
472
474
const dt_iop_toneequalizer_params_v1_t * o = old_params ;
@@ -488,9 +490,9 @@ int legacy_params(dt_iop_module_t *self,
488
490
n -> contrast_boost = o -> contrast_boost ;
489
491
n -> exposure_boost = o -> exposure_boost ;
490
492
491
- n -> details = o -> details ;
493
+ n -> filter = o -> filter ;
492
494
n -> iterations = o -> iterations ;
493
- n -> method = o -> method ;
495
+ n -> lum_estimator = o -> lum_estimator ;
494
496
495
497
// V2 params
496
498
n -> quantization = 0.0f ;
@@ -515,8 +517,8 @@ int legacy_params(dt_iop_module_t *self,
515
517
float shadows ; float midtones ; float highlights ; float whites ;
516
518
float speculars ; float blending ; float smoothing ; float feathering ;
517
519
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 ;
520
522
int iterations ;
521
523
} dt_iop_toneequalizer_params_v2_t ;
522
524
@@ -539,9 +541,9 @@ int legacy_params(dt_iop_module_t *self,
539
541
n -> contrast_boost = o -> contrast_boost ;
540
542
n -> exposure_boost = o -> exposure_boost ;
541
543
542
- n -> details = o -> details ;
544
+ n -> filter = o -> filter ;
543
545
n -> iterations = o -> iterations ;
544
- n -> method = o -> method ;
546
+ n -> lum_estimator = o -> lum_estimator ;
545
547
546
548
// V2 params
547
549
n -> quantization = o -> quantization ;
@@ -1380,7 +1382,7 @@ void toneeq_process(dt_iop_module_t *self,
1380
1382
const gboolean luminance_valid = g -> luminance_valid ;
1381
1383
dt_iop_gui_leave_critical_section (self );
1382
1384
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 ,
1384
1386
luminance_valid );
1385
1387
1386
1388
if (saved_upstream_hash != current_upstream_hash || !luminance_valid )
@@ -1465,7 +1467,7 @@ void toneeq_process(dt_iop_module_t *self,
1465
1467
const gboolean luminance_valid = g -> luminance_valid ;
1466
1468
dt_iop_gui_leave_critical_section (self );
1467
1469
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 ,
1469
1471
luminance_valid );
1470
1472
1471
1473
// Re-compute if the upstream state has changed
@@ -2183,15 +2185,15 @@ void gui_changed(dt_iop_module_t *self,
2183
2185
dt_iop_toneequalizer_gui_data_t * g = self -> gui_data ;
2184
2186
dt_iop_toneequalizer_params_t * p = self -> params ;
2185
2187
2186
- if (w == g -> method
2188
+ if (w == g -> lum_estimator
2187
2189
|| w == g -> blending
2188
2190
|| w == g -> feathering
2189
2191
|| w == g -> iterations
2190
2192
|| w == g -> quantization )
2191
2193
{
2192
2194
invalidate_luminance_cache (self );
2193
2195
}
2194
- else if (w == g -> details )
2196
+ else if (w == g -> filter )
2195
2197
{
2196
2198
invalidate_luminance_cache (self );
2197
2199
show_guiding_controls (self );
@@ -3397,7 +3399,7 @@ static inline void compute_gui_curve_colors(dt_iop_module_t *self)
3397
3399
const int shadows_limit = (int )UI_HISTO_SAMPLES * 0.3333 ;
3398
3400
const int highlights_limit = (int )UI_HISTO_SAMPLES * 0.6666 ;
3399
3401
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 );
3401
3403
3402
3404
if (!g -> gui_histogram_valid || !g -> gui_curve_valid ) {
3403
3405
// the module is not completely initialized, set all colors to standard
@@ -4183,16 +4185,16 @@ void gui_init(dt_iop_module_t *self)
4183
4185
// Masking options
4184
4186
self -> widget = dt_ui_notebook_page (g -> notebook , N_ ("masking" ), NULL );
4185
4187
4186
- g -> method = dt_bauhaus_combobox_from_params (self , "method " );
4188
+ g -> lum_estimator = dt_bauhaus_combobox_from_params (self , "lum_estimator " );
4187
4189
gtk_widget_set_tooltip_text
4188
- (g -> method ,
4190
+ (g -> lum_estimator ,
4189
4191
_ ("preview the mask and chose the estimator that gives you the\n"
4190
4192
"higher contrast between areas to dodge and areas to burn" ));
4191
4193
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" ));
4194
4196
gtk_widget_set_tooltip_text
4195
- (g -> details ,
4197
+ (g -> filter ,
4196
4198
_ ("'no' affects global and local contrast (safe if you only add contrast)\n"
4197
4199
"'guided filter' only affects global contrast and tries to preserve local contrast\n"
4198
4200
"'averaged guided filter' is a geometric mean of 'no' and 'guided filter' methods\n"
0 commit comments