110 return _(
"fill light");
120 return _(
"this module is deprecated. please use the tone equalizer module instead.");
133#define GAUSS(a, b, c, x) (a * powf(2.718281828f, (-powf((x - b), 2) / (powf(c, 2)))))
145 const float b = -1.0 + (data->
center * 2);
146 const float c = (data->
width / 10.0) / 2.0;
150 float *in = ((
float *)ivoid) + (size_t)
ch *
k * roi_out->
width;
152 for(
int j = 0; j < roi_out->
width; j++, in +=
ch,
out +=
ch)
154 const float lightness = in[0] / 100.0;
155 const float x = -1.0 + (lightness * 2.0);
156 float gauss =
GAUSS(a, b, c,
x);
158 if(isnan(gauss) || !isfinite(gauss)) gauss = 0.0;
160 float relight = 1.0 / exp2f(-data->
ev *
CLIP(gauss));
162 if(isnan(relight) || !isfinite(relight)) relight = 1.0;
164 out[0] = 100.0 *
CLIP(lightness * relight);
191 d->center =
p->center;
220 mean = fmin(fmax(self->
picked_color[0] / 100.0f, 0.0f), 1.0f);
238 gtk_widget_set_tooltip_text(
g->exposure, _(
"the fill-light in EV"));
241 GtkBox *sliderbox = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL,
DT_GUI_BOX_SPACING));
242#define NEUTRAL_GRAY 0.5
247 gtk_widget_set_tooltip_text(GTK_WIDGET(
g->center), _(
"select the center of fill-light\nctrl+click to select an area"));
248 g_signal_connect(G_OBJECT(
g->center),
"value-changed", G_CALLBACK(
center_callback), self);
249 gtk_box_pack_start(sliderbox, GTK_WIDGET(
g->center),
TRUE,
TRUE, 0);
251 gtk_widget_set_tooltip_text(GTK_WIDGET(
g->colorpicker), _(
"toggle tool for picking median lightness in image"));
252 gtk_box_pack_start(GTK_BOX(self->
gui->
widget), GTK_WIDGET(sliderbox),
TRUE,
FALSE, 0);
255 gtk_widget_set_tooltip_text(
g->width, _(
"width of fill-light area defined in zones"));
void dt_bauhaus_slider_set_format(GtkWidget *widget, const char *format)
const dt_iop_gui_blendif_colorstop_t _gradient_L[]
void dt_iop_color_picker_reset(dt_iop_module_t *module, gboolean keep)
GtkWidget * dt_color_picker_new(dt_iop_module_t *module, dt_iop_color_picker_kind_t kind, GtkWidget *w)
@ DT_COLOR_PICKER_POINT_AREA
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
static const float const float const float min
const dt_colormatrix_t dt_aligned_pixel_t out
#define dt_database_start_transaction()
#define dt_database_release_transaction()
#define dt_dev_add_history_item(dev, module, enable, redraw)
GtkWidget * dtgtk_gradient_slider_new_with_color_and_name(GdkRGBA start, GdkRGBA end, gchar *name)
void dtgtk_gradient_slider_set_value(GtkDarktableGradientSlider *gslider, gdouble value)
gdouble dtgtk_gradient_slider_get_value(GtkDarktableGradientSlider *gslider)
void dtgtk_gradient_slider_set_picker_meanminmax(GtkDarktableGradientSlider *gslider, gdouble mean, gdouble min, gdouble max)
#define DTGTK_GRADIENT_SLIDER(obj)
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)
@ IOP_FLAGS_INCLUDE_IN_STYLES
@ IOP_FLAGS_SUPPORTS_BLENDING
GtkWidget * dt_bauhaus_slider_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)
float *const restrict const size_t k
float *const restrict const size_t const size_t ch
#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_MODULE_INTROSPECTION(MODVER, PARAMSTYPE)
DT_MODULE() for a module whose params struct is introspected.
#define __OMP_PARALLEL_FOR__(...)
static void center_callback(GtkDarktableGradientSlider *slider, gpointer user_data)
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)
__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 ivoid, void *const ovoid)
void init_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
void gui_update(struct dt_iop_module_t *self)
Refresh GUI controls from current params and configuration.
void gui_init(struct dt_iop_module_t *self)
int default_colorspace(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece)
void init_presets(dt_iop_module_so_t *self)
#define GAUSS(a, b, c, x)
void cleanup_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
const char * deprecated_msg()
void color_picker_apply(dt_iop_module_t *self, GtkWidget *picker, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
dt_iop_buffer_dsc_t dsc_in
struct dt_iop_module_t *void * data
struct dt_iop_module_gui_t * gui
struct dt_develop_t * dev
dt_aligned_pixel_t picked_color_min
dt_aligned_pixel_t picked_color_max
dt_aligned_pixel_t picked_color
GtkDarktableGradientSlider * center
Region of interest passed through the pixelpipe.
#define __DT_CLONE_TARGETS__