94#define exposure2white(x) exp2f(-(x))
95#define white2exposure(x) -dt_log2f(fmaxf(1e-20f, x))
114#define DEFLICKER_BINS_COUNT (UINT16_MAX + 1)
167 return _(
"exp_osure");
173 _(
"redo the exposure of the shot as if you were still in-camera\n"
174 "using a color-safe brightening similar to increasing ISO setting"),
175 _(
"corrective and creative"),
176 _(
"linear, RGB, scene-referred"),
178 _(
"linear, RGB, scene-referred"));
209 void *new_params,
const int new_version)
211 if(old_version == 2 && new_version == 6)
213 typedef struct dt_iop_exposure_params_v2_t
215 float black, exposure, gain;
216 } dt_iop_exposure_params_v2_t;
218 dt_iop_exposure_params_v2_t *
o = (dt_iop_exposure_params_v2_t *)old_params;
225 n->exposure =
o->exposure;
226 n->compensate_exposure_bias =
FALSE;
229 if(old_version == 3 && new_version == 6)
231 typedef struct dt_iop_exposure_params_v3_t
233 float black, exposure;
235 float deflicker_percentile, deflicker_target_level;
236 } dt_iop_exposure_params_v3_t;
238 dt_iop_exposure_params_v3_t *
o = (dt_iop_exposure_params_v3_t *)old_params;
246 n->exposure =
o->exposure;
247 n->deflicker_percentile =
o->deflicker_percentile;
248 n->deflicker_target_level =
o->deflicker_target_level;
249 n->compensate_exposure_bias =
FALSE;
252 if(old_version == 4 && new_version == 6)
254 typedef enum dt_iop_exposure_deflicker_histogram_source_t {
255 DEFLICKER_HISTOGRAM_SOURCE_THUMBNAIL,
256 DEFLICKER_HISTOGRAM_SOURCE_SOURCEFILE
257 } dt_iop_exposure_deflicker_histogram_source_t;
259 typedef struct dt_iop_exposure_params_v4_t
264 float deflicker_percentile, deflicker_target_level;
265 dt_iop_exposure_deflicker_histogram_source_t deflicker_histogram_source;
266 } dt_iop_exposure_params_v4_t;
268 dt_iop_exposure_params_v4_t *
o = (dt_iop_exposure_params_v4_t *)old_params;
276 n->exposure =
o->exposure;
277 n->deflicker_percentile =
o->deflicker_percentile;
278 n->deflicker_target_level =
o->deflicker_target_level;
281 n->compensate_exposure_bias =
FALSE;
284 if(old_version == 5 && new_version == 6)
286 typedef struct dt_iop_exposure_params_v5_t
291 float deflicker_percentile, deflicker_target_level;
292 } dt_iop_exposure_params_v5_t;
294 dt_iop_exposure_params_v5_t *
o = (dt_iop_exposure_params_v5_t *)old_params;
302 n->exposure =
o->exposure;
303 n->deflicker_percentile =
o->deflicker_percentile;
304 n->deflicker_target_level =
o->deflicker_target_level;
305 n->compensate_exposure_bias =
FALSE;
318 .deflicker_percentile = 50.0f,
319 .deflicker_target_level = -4.0f,
320 .compensate_exposure_bias = FALSE},
329 .black = -0.000244140625f,
331 .deflicker_percentile = 50.0f,
332 .deflicker_target_level = -4.0f,
333 .compensate_exposure_bias = TRUE},
371 histogram_params.
roi = &histogram_roi;
376 histogram_stats->
ch = 1u;
383static double _raw_to_ev(uint32_t raw, uint32_t black_level, uint32_t white_level)
385 const uint32_t raw_max = white_level - black_level;
389 const int64_t raw_val =
MAX((int64_t)raw - (int64_t)black_level, 1);
391 const double raw_ev = -log2(raw_max) + log2(raw_val);
398 const uint32_t *
const histogram,
407 const size_t total = (size_t)histogram_stats->
ch * histogram_stats->
pixels;
410 = CLAMP(((
double)total * (
double)
p->deflicker_percentile / (
double)100.0), 0.0, (
double)total);
417 for(uint32_t
k = 0;
k < histogram_stats->
ch;
k++)
418 n += histogram[4 *
i +
k];
429 piece->dsc_in.rawprepare.raw_white_point);
431 *correction =
p->deflicker_target_level - ev;
440 d->black =
d->params.black;
441 float exposure =
d->params.exposure;
453 uint32_t *histogram = NULL;
464 g->deflicker_computed_exposure = exposure;
470 d->scale = 1.0 / (white -
d->black);
493 if(err != CL_SUCCESS)
goto error;
509 const int ch =
piece->dsc_in.channels;
511 const float *
const restrict in = (
float*)
i;
512 float *
const restrict
out = (
float*)
o;
513 const float black =
d->black;
514 const float scale =
d->scale;
515 const size_t npixels = (size_t)roi_out->
width * roi_out->
height;
516 const gboolean use_stream = (
ch == 4);
520 const dt_aligned_pixel_simd_t black_v =
dt_simd_set1(black);
521 const dt_aligned_pixel_simd_t scale_v =
dt_simd_set1(scale);
523 for(
size_t k = 0;
k < npixels;
k++)
525 const size_t p = 4 *
k;
526 const dt_aligned_pixel_simd_t in_v = dt_load_simd_aligned(in +
p);
527 dt_store_simd_nontemporal(
out +
p, (in_v - black_v) * scale_v);
533 for(
size_t k = 0;
k <
ch * npixels;
k++)
535 out[
k] = (in[
k] - black) * scale;
557 return CLAMP(bias, -5.0f, 5.0f);
566 if(
piece->dsc_in.channels != 4)
return;
571 const float *
const restrict in = (
float*)
i;
572 float average_luminance = 0.f;
573 const float norm = 1.f / (float)(roi_out->
width * roi_out->
height);
576 for(
size_t k = 0;
k < roi_out->
width * roi_out->
height * 4;
k += 4)
581 input_profile->unbounded_coeffs_in, input_profile->
lutsize,
583 average_luminance +=
XYZ[1] * norm;
587 const float target_lightness =
dt_conf_get_float(
"darkroom/modules/exposure/lightness");
591 const float target_luminance =
XYZ[1];
592 const float white =
p->black + fmaxf(average_luminance -
p->black, 1e-6f) / target_luminance;
595 p->exposure = exposure;
597 if(
p->compensate_exposure_bias)
608 d->params.black =
p->black;
609 d->params.exposure =
p->exposure;
610 d->params.deflicker_percentile =
p->deflicker_percentile;
611 d->params.deflicker_target_level =
p->deflicker_target_level;
614 if(
p->compensate_exposure_bias)
626 dt_iop_fmt_log(self,
"commit: class=%s needs_rawprepare=%d channels=%i datatype=%i mode=%d -> deflicker=%d",
630 p->mode,
d->deflicker);
633 for(
int k = 0;
k < 3;
k++)
piece->dsc_out.processed_maximum[
k] =
piece->dsc_in.processed_maximum[
k] *
d->scale;
662 gtk_widget_set_sensitive(GTK_WIDGET(
g->mode),
FALSE);
666 gtk_widget_set_sensitive(GTK_WIDGET(
g->mode),
TRUE);
671 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(
g->compensate_exposure_bias),
p->compensate_exposure_bias);
673 gchar *label = g_strdup_printf(_(
"compensate camera exposure (%+.1f EV)"),
_get_exposure_bias(self));
674 gtk_button_set_label(GTK_BUTTON(
g->compensate_exposure_bias), label);
675 gtk_label_set_ellipsize(GTK_LABEL(gtk_bin_get_child(GTK_BIN(
g->compensate_exposure_bias))), PANGO_ELLIPSIZE_MIDDLE);
678 g->spot_RGB[0] = 0.f;
679 g->spot_RGB[1] = 0.f;
680 g->spot_RGB[2] = 0.f;
681 g->spot_RGB[3] = 0.f;
686 const float lightness =
dt_conf_get_float(
"darkroom/modules/exposure/lightness");
693 gtk_label_set_text(
g->deflicker_used_EC,
"");
695 g->deflicker_computed_exposure = NAN;
702 gtk_stack_set_visible_child_name(GTK_STACK(
g->mode_stack),
"deflicker");
707 gtk_stack_set_visible_child_name(GTK_STACK(
g->mode_stack),
"manual");
716 const int program = 2;
735 if(
p->exposure == exposure)
return;
737 p->exposure = exposure;
752 if(
p->black == black)
return;
801 input_profile->unbounded_coeffs_in, input_profile->
lutsize,
814 gtk_label_set_text(GTK_LABEL(
g->Lch_origin),
815 g_strdup_printf(_(
"L : \t%.1f %%"),
Lch[0]));
816 gtk_widget_queue_draw(
g->origin_spot);
824 float expo =
p->exposure;
827 if(
p->compensate_exposure_bias)
834 for(
int c = 0; c < 3; c++)
835 XYZ_out[c] =
XYZ[c] * white;
840 Lab_out[1] = Lab_out[2] = 0.f;
859 dt_LCH_2_Lab(Lch_target, Lab_target);
865 float white =
XYZ[1] / XYZ_target[1];
869 if(
p->compensate_exposure_bias)
912 gtk_widget_set_sensitive(GTK_WIDGET(
g->mode),
FALSE);
915 gtk_stack_set_visible_child_name(GTK_STACK(
g->mode_stack),
"deflicker");
920 gtk_stack_set_visible_child_name(GTK_STACK(
g->mode_stack),
"manual");
924 else if(w ==
g->exposure)
927 if(
p->black >= white)
930 else if(w ==
g->black)
933 if(
p->black >= white)
946 if(!isnan(
g->deflicker_computed_exposure))
948 gchar *str = g_strdup_printf(_(
"%.2f EV"),
g->deflicker_computed_exposure);
951 gtk_label_set_text(
g->deflicker_used_EC, str);
967 GtkAllocation allocation;
968 gtk_widget_get_allocation(widget, &allocation);
969 int width = allocation.width,
height = allocation.height;
971 cairo_t *cr = cairo_create(cst);
990 cairo_set_source_rgb(cr,
RGB[0],
RGB[1],
RGB[2]);
997 cairo_set_source_surface(crf, cst, 0, 0);
999 cairo_surface_destroy(cst);
1010 GtkAllocation allocation;
1011 gtk_widget_get_allocation(widget, &allocation);
1012 int width = allocation.width;
1013 int height = allocation.height;
1015 cairo_t *cr = cairo_create(cst);
1022 cairo_set_source_rgb(cr,
g->spot_RGB[0],
g->spot_RGB[1],
g->spot_RGB[2]);
1029 cairo_set_source_surface(crf, cst, 0, 0);
1031 cairo_surface_destroy(cst);
1043 const float lightness_range = lightness_max - lightness_min;
1048 const float x = lightness_min + stop * lightness_range;
1061 gtk_widget_queue_draw(
g->lightness_spot);
1062 gtk_widget_queue_draw(
g->target_spot);
1100 g->deflicker_histogram = NULL;
1112 g->mode_stack = GTK_STACK(gtk_stack_new());
1113 gtk_stack_set_homogeneous(GTK_STACK(
g->mode_stack),
FALSE);
1114 gtk_box_pack_start(GTK_BOX(self->
gui->
widget), GTK_WIDGET(
g->mode_stack),
TRUE,
TRUE, 0);
1117 gtk_stack_add_named(GTK_STACK(
g->mode_stack), vbox_manual,
"manual");
1120 gtk_widget_set_tooltip_text(
g->compensate_exposure_bias, _(
"automatically remove the camera exposure bias\n"
1121 "this is useful if you exposed the image to the right."));
1125 gtk_widget_set_tooltip_text(
g->exposure, _(
"adjust the exposure correction"));
1131 gtk_widget_set_tooltip_text(
g->black, _(
"adjust the black level to unclip negative RGB values.\n"
1132 "you should never use it to add more density in blacks!\n"
1133 "if poorly set, it will clip near-black colors out of gamut\n"
1134 "by pushing RGB values into negatives."));
1139 gtk_stack_add_named(GTK_STACK(
g->mode_stack), vbox_deflicker,
"deflicker");
1143 gtk_widget_set_tooltip_text(
g->deflicker_percentile,
1145 _(
"where in the histogram to meter for deflicking. E.g. 50% is median"));
1149 gtk_widget_set_tooltip_text(
g->deflicker_target_level,
1150 _(
"where to place the exposure level for processed pics, EV below overexposure."));
1152 GtkBox *hbox1 = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL,
DT_GUI_BOX_SPACING));
1155 gtk_widget_set_tooltip_text(GTK_WIDGET(
g->deflicker_used_EC), _(
"what exposure correction has actually been used"));
1156 gtk_box_pack_start(GTK_BOX(hbox1), GTK_WIDGET(
g->deflicker_used_EC),
FALSE,
FALSE, 0);
1159 g->deflicker_computed_exposure = NAN;
1166 "plugins/darkroom/exposure/mapping",
1167 _(
"spot exposure mapping"),
1168 GTK_BOX(self->
gui->
widget), GTK_PACK_END);
1171 _(
"\"correction\" automatically adjust exposure\n"
1172 "such that the input lightness is mapped to the target.\n"
1173 "\"measure\" simply shows how an input color is mapped by the exposure compensation\n"
1174 "and can be used to define a target."),
1178 gtk_box_pack_start(GTK_BOX(
g->cs.container), GTK_WIDGET(
g->spot_mode),
TRUE,
TRUE, 0);
1186 g->origin_spot = GTK_WIDGET(gtk_drawing_area_new());
1189 gtk_widget_set_tooltip_text(GTK_WIDGET(
g->origin_spot),
1190 _(
"the input color that should be mapped to the target"));
1193 gtk_box_pack_start(GTK_BOX(vvbox),
g->origin_spot,
TRUE,
TRUE, 0);
1195 g->Lch_origin = gtk_label_new(_(
"L : \tN/A"));
1196 gtk_widget_set_tooltip_text(GTK_WIDGET(
g->Lch_origin),
1197 _(
"these LCh coordinates are computed from CIE Lab 1976 coordinates"));
1198 gtk_box_pack_start(GTK_BOX(vvbox), GTK_WIDGET(
g->Lch_origin),
FALSE,
FALSE, 0);
1206 g->target_spot = GTK_WIDGET(gtk_drawing_area_new());
1209 gtk_widget_set_tooltip_text(GTK_WIDGET(
g->target_spot),
1210 _(
"the desired target exposure after mapping"));
1213 gtk_box_pack_start(GTK_BOX(vvbox),
g->target_spot,
TRUE,
TRUE, 0);
1219 gtk_box_pack_start(GTK_BOX(vvbox), GTK_WIDGET(
g->lightness_spot),
TRUE,
TRUE, 0);
1224 gtk_box_pack_start(GTK_BOX(
g->cs.container), GTK_WIDGET(hhbox),
FALSE,
FALSE, 0);
1226 g_signal_connect(G_OBJECT(self->
gui->
widget),
"draw", G_CALLBACK(
_draw), self);
static void error(char *msg)
void dt_bauhaus_slider_set_soft_range(GtkWidget *widget, float soft_min, float soft_max)
void dt_bauhaus_slider_set_digits(GtkWidget *widget, int val)
void dt_bauhaus_slider_set_default(GtkWidget *widget, float def)
void dt_bauhaus_slider_set_stop(GtkWidget *widget, float stop, float r, float g, float b)
float dt_bauhaus_slider_get(GtkWidget *widget)
int dt_bauhaus_combobox_get(GtkWidget *widget)
float dt_bauhaus_slider_get_hard_min(GtkWidget *widget)
void dt_bauhaus_slider_set(GtkWidget *widget, float pos)
void dt_bauhaus_combobox_set(GtkWidget *widget, const int pos)
void dt_bauhaus_widget_set_label(GtkWidget *widget, const char *label)
GtkWidget * dt_bauhaus_slider_new_with_range(dt_bauhaus_t *bh, dt_gui_module_t *self, float min, float max, float step, float defval, int digits)
void dt_bauhaus_slider_set_format(GtkWidget *widget, const char *format)
float dt_bauhaus_slider_get_hard_max(GtkWidget *widget)
#define DT_BAUHAUS_COMBOBOX_NEW_FULL(bauhaus, widget, action, label, tip, pos, callback, data,...)
#define DT_BAUHAUS_SLIDER_MAX_STOPS
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
return vector dt_simd_set1(valid ?(scaling+NORM_MIN) :NORM_MIN)
void dt_gui_new_collapsible_section(dt_gui_collapsible_section_t *cs, const char *confname, const char *label, GtkBox *parent, GtkPackType pack)
Create a collapsible section and pack it into the parent box.
void dt_gui_update_collapsible_section(dt_gui_collapsible_section_t *cs)
void dt_iop_color_picker_reset(dt_iop_module_t *module, gboolean keep)
gboolean dt_iop_color_picker_is_active_module(const dt_iop_module_t *module)
Tell whether one module currently owns the active darkroom picker.
GtkWidget * dt_color_picker_new(dt_iop_module_t *module, dt_iop_color_picker_kind_t kind, GtkWidget *w)
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
dt_XYZ_to_sRGB(XYZ, result)
static dt_aligned_pixel_t XYZ
static dt_aligned_pixel_t Lab
const dt_colormatrix_t dt_aligned_pixel_t out
static dt_aligned_pixel_t RGB
static dt_aligned_pixel_t Lch
void dt_conf_set_float(const char *name, float val)
float dt_conf_get_float(const char *name)
Float for name, clamped to its declared bounds.
void dt_histogram_worker(dt_dev_histogram_collection_params_t *const histogram_params, dt_dev_histogram_stats_t *histogram_stats, const void *const pixel, uint32_t **histogram, const dt_worker Worker, const dt_iop_order_iccprofile_info_t *const profile_info)
void dt_histogram_helper_cs_RAW_uint16(const dt_dev_histogram_collection_params_t *const histogram_params, const void *pixel, uint32_t *histogram, int j, const dt_iop_order_iccprofile_info_t *const profile_info)
dt_image_pipe_class_t dt_image_pipe_class(const dt_image_t *img)
const char * dt_image_pipe_class_name(const dt_image_pipe_class_t klass)
gboolean dt_image_needs_rawprepare(const dt_image_t *img)
void dt_control_log(const char *msg,...)
struct dt_bauhaus_t * dt_bauhaus_get_global(void)
#define dt_dev_add_history_item(dev, module, enable, redraw)
dt_iop_order_iccprofile_info_t * dt_ioppr_get_pipe_current_profile_info(dt_iop_module_t *module, const struct dt_dev_pixelpipe_t *pipe)
gboolean dt_dev_pixelpipe_has_preview_output(const dt_develop_t *dev, const dt_dev_pixelpipe_t *pipe, const dt_iop_roi_t *roi)
@ DT_DEV_PIXELPIPE_DISPLAY_MASK
static float _get_exposure_bias(const struct dt_iop_module_t *self)
void commit_params(struct dt_iop_module_t *self, dt_iop_params_t *p1, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
static gboolean _draw(GtkWidget *widget, cairo_t *cr, dt_iop_module_t *self)
const char ** description(struct dt_iop_module_t *self)
static void _spot_settings_changed_callback(GtkWidget *slider, dt_iop_module_t *self)
static gboolean _origin_color_draw(GtkWidget *widget, cairo_t *crf, gpointer user_data)
#define DEFLICKER_BINS_COUNT
static double _raw_to_ev(uint32_t raw, uint32_t black_level, uint32_t white_level)
#define exposure2white(x)
static void _auto_set_exposure(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe)
void init_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
static void _exposure_set_black(struct dt_iop_module_t *self, const float black)
void output_format(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, dt_iop_buffer_dsc_t *dsc)
void gui_reset(struct dt_iop_module_t *self)
void gui_update(struct dt_iop_module_t *self)
Refresh GUI controls from current params and configuration.
static void _exposure_set_white(struct dt_iop_module_t *self, const float white)
void gui_init(struct dt_iop_module_t *self)
void gui_changed(dt_iop_module_t *self, GtkWidget *w, void *previous)
static void _autoexp_disable(dt_iop_module_t *self)
#define white2exposure(x)
void cleanup_global(dt_iop_module_so_t *module)
static void _compute_correction(dt_iop_module_t *self, dt_iop_params_t *p1, const dt_dev_pixelpipe_iop_t *piece, const uint32_t *const histogram, const dt_dev_histogram_stats_t *const histogram_stats, float *correction)
int default_colorspace(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece)
static void _process_common_setup(dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece)
void gui_cleanup(struct dt_iop_module_t *self)
void init_presets(dt_iop_module_so_t *self)
static void _deflicker_prepare_histogram(dt_iop_module_t *self, uint32_t **histogram, dt_dev_histogram_stats_t *histogram_stats)
__DT_CLONE_TARGETS__ int process(struct dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, const void *const i, void *const o)
static void _paint_hue(dt_iop_module_t *self)
void cleanup_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
void init_global(dt_iop_module_so_t *module)
@ EXPOSURE_MODE_DEFLICKER
void autoset(struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, const void *i)
int process_cl(struct dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, cl_mem dev_in, cl_mem dev_out)
static gboolean _target_color_draw(GtkWidget *widget, cairo_t *crf, gpointer user_data)
void color_picker_apply(dt_iop_module_t *self, GtkWidget *picker, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
int legacy_params(dt_iop_module_t *self, const void *const old_params, const int old_version, void *new_params, const int new_version)
void dt_gui_presets_update_ldr(const char *name, dt_dev_operation_t op, const int32_t version, const int ldrflag)
void dt_gui_presets_add_generic(const char *name, dt_dev_operation_t op, const int32_t version, const void *params, const int32_t params_size, const int32_t enabled)
dt_image_t * dt_image_cache_get(const int32_t imgid, char mode)
void dt_image_cache_read_release(const dt_image_t *img)
const char ** dt_iop_set_description(dt_iop_module_t *module, const char *main_text, const char *purpose, const char *input, const char *process, const char *output)
void dt_iop_gui_leave_critical_section(dt_iop_module_t *const module)
Release what dt_iop_gui_enter_critical_section() took. Also a no-op headless.
#define dt_iop_fmt_log(module, fmt,...)
Debug helper to trace a module's input-format-driven decisions on the -d pipe channel (DT_DEBUG_PIPE)...
@ IOP_FLAGS_SUPPORTS_BLENDING
void dt_iop_gui_enter_critical_section(dt_iop_module_t *const module)
Take the module's GUI lock, serialising access to its dt_iop_gui_data_t.
GtkWidget * dt_bauhaus_toggle_from_params(dt_iop_module_t *self, const char *param)
GtkWidget * dt_bauhaus_slider_from_params(dt_iop_module_t *self, const char *param)
GtkWidget * dt_bauhaus_combobox_from_params(dt_iop_module_t *self, const char *param)
static dt_iop_gui_data_t * dt_iop_gui_data(const struct dt_iop_module_t *m)
The module's GUI data blob, NULL-safe for headless callers: IOP process() implementations read it for...
#define IOP_GUI_ALLOC(module)
GtkWidget * dt_ui_section_label_new(const gchar *str)
GtkWidget * dt_ui_label_new(const gchar *str)
static const dt_dev_pixelpipe_t * pipe
static const dt_dev_pixelpipe_t const dt_dev_pixelpipe_iop_t * piece
void dt_print(dt_debug_thread_t thread, const char *msg,...) __attribute__((format(printf
Print to stdout when thread is enabled, prefixed with seconds since startup.
float *const restrict const size_t k
float *const restrict const size_t const size_t ch
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
#define dt_free_align(ptr)
Release memory from dt_alloc_align() and set ptr to NULL.
static void * dt_calloc_align(size_t size)
dt_alloc_align() followed by a zero fill.
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
#define dt_mipmap_cache_get(B, C, D, E, F)
#define dt_mipmap_cache_release(B)
#define DT_MODULE_INTROSPECTION(MODVER, PARAMSTYPE)
DT_MODULE() for a module whose params struct is introspected.
int dt_opencl_enqueue_kernel_2d(const int dev, const int kernel, const size_t *sizes)
int dt_opencl_create_kernel(const int prog, const char *name)
void dt_opencl_free_kernel(const int kernel)
int dt_opencl_set_kernel_arg(const int dev, const int kernel, const int num, const size_t size, const void *arg)
#define dt_omploop_sfence()
#define __OMP_PARALLEL_FOR__(...)
#define __OMP_PARALLEL_FOR_SIMD__(...)
static cairo_surface_t * dt_cairo_image_surface_create(cairo_format_t format, int width, int height)
DT_ALIGNED_PIXEL float dt_aligned_pixel_t[4]
const struct dt_histogram_roi_t * roi
struct dt_dev_pixelpipe_t * pipe
char filename[DT_MAX_FILENAME_LEN]
dt_iop_buffer_type_t datatype
dt_iop_exposure_params_t params
GtkWidget * compensate_exposure_bias
GtkWidget * deflicker_percentile
dt_gui_collapsible_section_t cs
dt_dev_histogram_stats_t deflicker_histogram_stats
uint32_t * deflicker_histogram
dt_aligned_pixel_t spot_RGB
GtkWidget * deflicker_target_level
GtkWidget * lightness_spot
float deflicker_computed_exposure
GtkLabel * deflicker_used_EC
float deflicker_target_level
dt_iop_exposure_mode_t mode
float deflicker_percentile
gboolean compensate_exposure_bias
dt_iop_global_data_t * data
dt_iop_params_t * default_params
struct dt_iop_module_gui_t * gui
struct dt_develop_t * dev
dt_iop_global_data_t * global_data
dt_aligned_pixel_t picked_color_min
dt_aligned_pixel_t picked_color_max
dt_aligned_pixel_t picked_color
A profile reduced to the arithmetic the pixel loop can run: two matrices and six tone-curve LUTs,...
int nonlinearlut
Non-zero when the profile has tone curves at all; tested as a boolean everywhere, but it is really th...
int lutsize
Entry count of each of the six LUTs. Always 65536 in practice: both callers of dt_ioppr_init_profile_...
float * lut_in[3]
Per-channel encoded -> linear tone curve, lutsize entries each, sampled over [0,1]....
dt_colormatrix_t matrix_in_transposed
Region of interest passed through the pixelpipe.
#define __DT_CLONE_TARGETS__
Telling the user something happened.