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 ;
@@ -1340,7 +1342,7 @@ void toneeq_process(dt_iop_module_t *self,
1340
1342
const gboolean luminance_valid = g -> luminance_valid ;
1341
1343
dt_iop_gui_leave_critical_section (self );
1342
1344
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 ,
1344
1346
luminance_valid );
1345
1347
1346
1348
if (saved_upstream_hash != current_upstream_hash || !luminance_valid )
@@ -1425,7 +1427,7 @@ void toneeq_process(dt_iop_module_t *self,
1425
1427
const gboolean luminance_valid = g -> luminance_valid ;
1426
1428
dt_iop_gui_leave_critical_section (self );
1427
1429
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 ,
1429
1431
luminance_valid );
1430
1432
1431
1433
// Re-compute if the upstream state has changed
@@ -2138,15 +2140,15 @@ void gui_changed(dt_iop_module_t *self,
2138
2140
dt_iop_toneequalizer_gui_data_t * g = self -> gui_data ;
2139
2141
dt_iop_toneequalizer_params_t * p = self -> params ;
2140
2142
2141
- if (w == g -> method
2143
+ if (w == g -> lum_estimator
2142
2144
|| w == g -> blending
2143
2145
|| w == g -> feathering
2144
2146
|| w == g -> iterations
2145
2147
|| w == g -> quantization )
2146
2148
{
2147
2149
invalidate_luminance_cache (self );
2148
2150
}
2149
- else if (w == g -> details )
2151
+ else if (w == g -> filter )
2150
2152
{
2151
2153
invalidate_luminance_cache (self );
2152
2154
show_guiding_controls (self );
@@ -3352,7 +3354,7 @@ static inline void compute_gui_curve_colors(dt_iop_module_t *self)
3352
3354
const int shadows_limit = (int )UI_HISTO_SAMPLES * 0.3333 ;
3353
3355
const int highlights_limit = (int )UI_HISTO_SAMPLES * 0.6666 ;
3354
3356
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 );
3356
3358
3357
3359
if (!g -> gui_histogram_valid || !g -> gui_curve_valid ) {
3358
3360
// the module is not completely initialized, set all colors to standard
@@ -4138,16 +4140,16 @@ void gui_init(dt_iop_module_t *self)
4138
4140
// Masking options
4139
4141
self -> widget = dt_ui_notebook_page (g -> notebook , N_ ("masking" ), NULL );
4140
4142
4141
- g -> method = dt_bauhaus_combobox_from_params (self , "method " );
4143
+ g -> lum_estimator = dt_bauhaus_combobox_from_params (self , "lum_estimator " );
4142
4144
gtk_widget_set_tooltip_text
4143
- (g -> method ,
4145
+ (g -> lum_estimator ,
4144
4146
_ ("preview the mask and chose the estimator that gives you the\n"
4145
4147
"higher contrast between areas to dodge and areas to burn" ));
4146
4148
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" ));
4149
4151
gtk_widget_set_tooltip_text
4150
- (g -> details ,
4152
+ (g -> filter ,
4151
4153
_ ("'no' affects global and local contrast (safe if you only add contrast)\n"
4152
4154
"'guided filter' only affects global contrast and tries to preserve local contrast\n"
4153
4155
"'averaged guided filter' is a geometric mean of 'no' and 'guided filter' methods\n"
0 commit comments