Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
bilat.c
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2010 Bruce Guenter.
4 Copyright (C) 2010-2013, 2016-2017 johannes hanika.
5 Copyright (C) 2011 Henrik Andersson.
6 Copyright (C) 2011 Jérémy Rosen.
7 Copyright (C) 2011-2014, 2016, 2018-2019 Tobias Ellinghaus.
8 Copyright (C) 2012 Richard Wonka.
9 Copyright (C) 2012, 2017 Ulrich Pegelow.
10 Copyright (C) 2013 Pascal de Bruijn.
11 Copyright (C) 2013, 2018-2020, 2022 Pascal Obry.
12 Copyright (C) 2014-2016 Roman Lebedev.
13 Copyright (C) 2015 Pedro Côrte-Real.
14 Copyright (C) 2017 Heiko Bauke.
15 Copyright (C) 2018-2021, 2023, 2025-2026 Aurélien PIERRE.
16 Copyright (C) 2018 Edgardo Hoszowski.
17 Copyright (C) 2018 Matthieu Moy.
18 Copyright (C) 2018 Maurizio Paglia.
19 Copyright (C) 2018 rawfiner.
20 Copyright (C) 2019 Diederik ter Rahe.
21 Copyright (C) 2020 Aldric Renaudin.
22 Copyright (C) 2020-2021 Chris Elston.
23 Copyright (C) 2020, 2022 Diederik Ter Rahe.
24 Copyright (C) 2020, 2022 Hanno Schwalm.
25 Copyright (C) 2020 Ralf Brown.
26 Copyright (C) 2021 Hubert Kowalski.
27 Copyright (C) 2022 Martin Bařinka.
28 Copyright (C) 2022 Philipp Lutz.
29
30 darktable is free software: you can redistribute it and/or modify
31 it under the terms of the GNU General Public License as published by
32 the Free Software Foundation, either version 3 of the License, or
33 (at your option) any later version.
34
35 darktable is distributed in the hope that it will be useful,
36 but WITHOUT ANY WARRANTY; without even the implied warranty of
37 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38 GNU General Public License for more details.
39
40 You should have received a copy of the GNU General Public License
41 along with darktable. If not, see <http://www.gnu.org/licenses/>.
42*/
43#ifdef HAVE_CONFIG_H
44#include "config.h"
45#endif
46// our includes go first:
47#include "bauhaus/bauhaus.h"
48#include "common/bilateral.h"
49#include "common/bilateralcl.h"
52#include "develop/imageop.h"
54#include "develop/imageop_gui.h"
55#include "develop/tiling.h"
56#include "gui/gtk.h"
57#include "gui/presets.h"
58#include "iop/iop_api.h"
59
60#include <gtk/gtk.h>
61#include <stdlib.h>
62
63
64// this is the version of the modules parameters,
65// and includes version information about compile-time dt
67
69{
70 s_mode_bilateral = 0, // $DESCRIPTION: "bilateral grid"
71 s_mode_local_laplacian = 1, // $DESCRIPTION: "local laplacian filter"
72}
74
75typedef struct dt_iop_bilat_params_t
76{
77 dt_iop_bilat_mode_t mode; // $DEFAULT: 1
78 float sigma_r; // $MIN: 0.0 $MAX: 100.0 $DEFAULT: 0.5 highlights 100 & range
79 float sigma_s; // $MIN: 0.0 $MAX: 100.0 $DEFAULT: 0.5 shadows 100 & spatial 1 100 50
80 float detail; // $MIN: -1.0 $MAX: 4.0 $DEFAULT: 0.25
81 float midtone; // $MIN: 0.001 $MAX: 1.0 $DEFAULT: 0.5 $DESCRIPTION: "midtone range"
82}
84
86{
87 uint32_t mode;
88 float sigma_r;
89 float sigma_s;
90 float detail;
91}
93
95{
96 float sigma_r;
97 float sigma_s;
98 float detail;
99}
101
103
115
116// this returns a translatable name
117const char *name()
118{
119 return _("local contrast");
120}
121
122const char **description(struct dt_iop_module_t *self)
123{
124 return dt_iop_set_description(self, _("manipulate local and global contrast separately"),
125 _("creative"),
126 _("non-linear, Lab, display-referred"),
127 _("non-linear, Lab"),
128 _("non-linear, Lab, display-referred"));
129}
130
131// some additional flags (self explanatory i think):
136
137// where does it appear in the gui?
139{
140 return IOP_GROUP_SHARPNESS;
141}
142
144{
145 return IOP_CS_LAB;
146}
147
149 dt_iop_module_t *self, const void *const old_params, const int old_version,
150 void *new_params, const int new_version)
151{
152 if(old_version == 2 && new_version == 3)
153 {
154 const dt_iop_bilat_params_v2_t *p2 = old_params;
155 dt_iop_bilat_params_t *p = new_params;
156 p->detail = p2->detail;
157 p->sigma_r = p2->sigma_r;
158 p->sigma_s = p2->sigma_s;
159 p->midtone = 0.2f;
160 p->mode = p2->mode;
161 return 0;
162 }
163 else if(old_version == 1 && new_version == 3)
164 {
165 const dt_iop_bilat_params_v1_t *p1 = old_params;
166 dt_iop_bilat_params_t *p = new_params;
167 p->detail = p1->detail;
168 p->sigma_r = p1->sigma_r;
169 p->sigma_s = p1->sigma_s;
170 p->midtone = 0.2f;
171 p->mode = s_mode_bilateral;
172 return 0;
173 }
174 return 1;
175}
176
178{
180 memset(&p, 0, sizeof(p));
181
183 p.sigma_r = 0.f;
184 p.sigma_s = 0.f;
185 p.detail = 0.33f;
186 p.midtone = 0.5f;
187
188 dt_gui_presets_add_generic(_("clarity"), self->op,
189 self->version(), &p, sizeof(p), 1, DEVELOP_BLEND_CS_RGB_SCENE);
190
192 p.sigma_r = 0.f;
193 p.sigma_s = 0.f;
194 p.detail = 1.f;
195 p.midtone = 0.25f;
196
197 dt_gui_presets_add_generic(_("HDR local tone-mapping"), self->op,
198 self->version(), &p, sizeof(p), 1, DEVELOP_BLEND_CS_RGB_SCENE);
199}
200
201
202#ifdef HAVE_OPENCL
203int 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)
204{
205 const dt_iop_roi_t *const roi_in = &piece->roi_in;
207
208 if(d->mode == s_mode_bilateral)
209 {
210 // the total scale is composed of scale before input to the pipeline (iscale),
211 // and the scale of the roi.
212 const float scale = dt_dev_get_module_scale(pipe, roi_in);
213 const float sigma_r = d->sigma_r; // does not depend on scale
214 const float sigma_s = d->sigma_s / scale;
215 cl_int err = -666;
216
218 = dt_bilateral_init_cl(pipe->devid, roi_in->width, roi_in->height, sigma_s, sigma_r);
219 if(IS_NULL_PTR(b)) goto error;
220 err = dt_bilateral_splat_cl(b, dev_in);
221 if(err != CL_SUCCESS) goto error;
222 err = dt_bilateral_blur_cl(b);
223 if(err != CL_SUCCESS) goto error;
224 err = dt_bilateral_slice_cl(b, dev_in, dev_out, d->detail);
225 if(err != CL_SUCCESS) goto error;
227 return TRUE;
228error:
230 dt_print(DT_DEBUG_OPENCL, "[opencl_bilateral] couldn't enqueue kernel! %d\n", err);
231 return FALSE;
232 }
233 else // mode == s_mode_local_laplacian
234 {
236 d->midtone, d->sigma_s, d->sigma_r, d->detail);
237 if(IS_NULL_PTR(b)) goto error_ll;
238 if(dt_local_laplacian_cl(b, dev_in, dev_out) != CL_SUCCESS) goto error_ll;
240 return TRUE;
241error_ll:
243 return FALSE;
244 }
245}
246#endif
247
248
249void tiling_callback(struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, struct dt_develop_tiling_t *tiling)
250{
251 const dt_iop_roi_t *const roi_in = &piece->roi_in;
253 // the total scale is composed of scale before input to the pipeline (iscale),
254 // and the scale of the roi.
255
256 if(d->mode == s_mode_bilateral)
257 {
258 // used to adjuste blur level depending on size. Don't amplify noise if magnified > 100%
259 const float scale = dt_dev_get_module_scale(pipe, roi_in);
260 const float sigma_r = d->sigma_r;
261 const float sigma_s = d->sigma_s / scale;
262
263 const int width = roi_in->width;
264 const int height = roi_in->height;
265 const int channels = piece->dsc_in.channels;
266
267 const size_t basebuffer = sizeof(float) * channels * width * height;
268
269 tiling->factor = 2.0f + (float)dt_bilateral_memory_use(width, height, sigma_s, sigma_r) / basebuffer;
270 tiling->maxbuf
271 = fmax(1.0f, (float)dt_bilateral_singlebuffer_size(width, height, sigma_s, sigma_r) / basebuffer);
272 tiling->overhead = 0;
273 tiling->overlap = ceilf(4 * sigma_s);
274 tiling->xalign = 1;
275 tiling->yalign = 1;
276 }
277 else // mode == s_mode_local_laplacian
278 {
279 const int width = roi_in->width;
280 const int height = roi_in->height;
281 const int channels = piece->dsc_in.channels;
282
283 const size_t basebuffer = sizeof(float) * channels * width * height;
284 const int rad = MIN(roi_in->width, ceilf(256.0f / dt_dev_get_module_scale(pipe, roi_in)));
285
286 tiling->factor = 2.0f + (float)local_laplacian_memory_use(width, height) / basebuffer;
287 tiling->maxbuf
288 = fmax(1.0f, (float)local_laplacian_singlebuffer_size(width, height) / basebuffer);
289 tiling->overhead = 0;
290 tiling->overlap = rad;
291 tiling->xalign = 1;
292 tiling->yalign = 1;
293 }
294}
295
298{
301 *d = *p;
302
303#ifdef HAVE_OPENCL
304 if(d->mode == s_mode_bilateral)
306#endif
307 if(d->mode == s_mode_local_laplacian)
308 piece->process_tiling_ready = 0; // can't deal with tiles, sorry.
309
310 piece->cache_output_on_ram = TRUE;
311}
312
313
315{
316 piece->data = dt_calloc_align(sizeof(dt_iop_bilat_data_t));
317 piece->data_size = sizeof(dt_iop_bilat_data_t);
318}
319
320
322{
323 dt_free_align(piece->data);
324 piece->data = NULL;
325}
326
327int 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)
328{
329 const dt_iop_roi_t *const roi_in = &piece->roi_in;
330 // this is called for preview and full pipe separately, each with its own pixelpipe piece.
331 // get our data struct:
333 // the total scale is composed of scale before input to the pipeline (iscale),
334 // and the scale of the roi.
335 // used to adjuste blur level depending on size. Don't amplify noise if magnified > 100%
336 const float scale = dt_dev_get_module_scale(pipe, roi_in);
337 const float sigma_r = d->sigma_r; // does not depend on scale
338 const float sigma_s = d->sigma_s / scale;
339
340 if(d->mode == s_mode_bilateral)
341 {
343 if(IS_NULL_PTR(b)) return 1;
344 dt_bilateral_splat(b, (float *)i);
346 dt_bilateral_slice(b, (float *)i, (float *)o, d->detail);
348 }
349 else // s_mode_local_laplacian
350 {
351 if(local_laplacian(i, o, roi_in->width, roi_in->height, d->midtone, d->sigma_s, d->sigma_r,
352 d->detail, 0) != 0)
353 return 1;
354 }
355
356 if(pipe->mask_display & DT_DEV_PIXELPIPE_DISPLAY_MASK) dt_iop_alpha_copy(i, o, roi_in->width, roi_in->height);
357 return 0;
358}
359
360void gui_changed(dt_iop_module_t *self, GtkWidget *w, void *previous)
361{
364 if(w == g->highlights || w == g->shadows || w == g->midtone)
365 {
367 }
368 else if(w == g->range || w == g->spatial)
369 {
371 }
372 else if(w == g->mode)
373 {
374 if(p->mode == s_mode_local_laplacian)
375 {
376 p->sigma_r = dt_bauhaus_slider_get(g->highlights);
377 p->sigma_s = dt_bauhaus_slider_get(g->shadows);
378 }
379 else
380 {
381 p->sigma_r = dt_bauhaus_slider_get(g->range);
382 p->sigma_s = dt_bauhaus_slider_get(g->spatial);
383 }
384 }
385
386 if(IS_NULL_PTR(w) || w == g->mode)
387 {
388 gtk_widget_set_visible(g->highlights, p->mode == s_mode_local_laplacian);
389 gtk_widget_set_visible(g->shadows, p->mode == s_mode_local_laplacian);
390 gtk_widget_set_visible(g->midtone, p->mode == s_mode_local_laplacian);
391 gtk_widget_set_visible(g->range, p->mode != s_mode_local_laplacian);
392 gtk_widget_set_visible(g->spatial, p->mode != s_mode_local_laplacian);
393 }
394}
395
397{
400
401 if(p->mode == s_mode_local_laplacian)
402 {
403 dt_bauhaus_slider_set(g->highlights, p->sigma_r);
404 dt_bauhaus_slider_set(g->shadows, p->sigma_s);
405 dt_bauhaus_slider_set(g->midtone, p->midtone);
406 dt_bauhaus_slider_set(g->range, 20.0f);
407 dt_bauhaus_slider_set(g->spatial, 50.0f);
408 }
409 else
410 {
411 dt_bauhaus_slider_set(g->range, p->sigma_r);
412 dt_bauhaus_slider_set(g->spatial, p->sigma_s);
413 dt_bauhaus_slider_set(g->midtone, p->midtone);
414 dt_bauhaus_slider_set(g->highlights, 0.5f);
415 dt_bauhaus_slider_set(g->shadows, 0.5f);
416 }
417
418 gui_changed(self, NULL, NULL);
419}
420
422{
423 // init the slider (more sophisticated layouts are possible with gtk tables and boxes):
425
426 g->mode = dt_bauhaus_combobox_from_params(self, N_("mode"));
427 gtk_widget_set_tooltip_text(g->mode, _("the filter used for local contrast enhancement. bilateral is faster but can lead to artifacts around edges for extreme settings."));
428
429 g->detail = dt_bauhaus_slider_from_params(self, N_("detail"));
430 dt_bauhaus_slider_set_offset(g->detail, 100);
431 dt_bauhaus_slider_set_format(g->detail, "%");
432 gtk_widget_set_tooltip_text(g->detail, _("changes the local contrast"));
433
434 g->spatial = dt_bauhaus_slider_from_params(self, "sigma_s");
435 g->range = dt_bauhaus_slider_from_params(self, "sigma_r");
436 g->highlights = dt_bauhaus_slider_from_params(self, "sigma_r");
437 g->shadows = dt_bauhaus_slider_from_params(self, "sigma_s");
438
439 dt_bauhaus_slider_set_hard_min(g->spatial, 3.0);
440 dt_bauhaus_slider_set_default(g->spatial, 50.0);
441 dt_bauhaus_slider_set_digits(g->spatial, 0);
442 dt_bauhaus_widget_set_label(g->spatial, N_("coarseness"));
443 gtk_widget_set_tooltip_text(g->spatial, _("feature size of local details (spatial sigma of bilateral filter)"));
444
446 dt_bauhaus_slider_set_default(g->range, 20.0);
448 dt_bauhaus_widget_set_label(g->range, N_("contrast"));
449 gtk_widget_set_tooltip_text(g->range, _("L difference to detect edges (range sigma of bilateral filter)"));
450
451 dt_bauhaus_widget_set_label(g->highlights, N_("highlights"));
452 dt_bauhaus_slider_set_hard_max(g->highlights, 2.0);
453 dt_bauhaus_slider_set_format(g->highlights, "%");
454 gtk_widget_set_tooltip_text(g->highlights, _("changes the local contrast of highlights"));
455
456 dt_bauhaus_widget_set_label(g->shadows, N_("shadows"));
457 dt_bauhaus_slider_set_hard_max(g->shadows, 2.0);
458 dt_bauhaus_slider_set_format(g->shadows, "%");
459 gtk_widget_set_tooltip_text(g->shadows, _("changes the local contrast of shadows"));
460
461 g->midtone = dt_bauhaus_slider_from_params(self, "midtone");
462 dt_bauhaus_slider_set_digits(g->midtone, 3);
463 gtk_widget_set_tooltip_text(g->midtone, _("defines what counts as mid-tones. lower for better dynamic range compression (reduce shadow and highlight contrast), increase for more powerful local contrast"));
464
465 // work around multi-instance issue which calls show all a fair bit:
466 g_object_set(G_OBJECT(g->highlights), "no-show-all", TRUE, NULL);
467 g_object_set(G_OBJECT(g->shadows), "no-show-all", TRUE, NULL);
468 g_object_set(G_OBJECT(g->midtone), "no-show-all", TRUE, NULL);
469 g_object_set(G_OBJECT(g->range), "no-show-all", TRUE, NULL);
470 g_object_set(G_OBJECT(g->spatial), "no-show-all", TRUE, NULL);
471
472}
473
474// clang-format off
475// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
476// vim: shiftwidth=2 expandtab tabstop=2 cindent
477// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
478// clang-format on
static void error(char *msg)
Definition ashift_lsd.c:202
#define TRUE
Definition ashift_lsd.c:162
#define FALSE
Definition ashift_lsd.c:158
void dt_bauhaus_slider_set_digits(GtkWidget *widget, int val)
Definition bauhaus.c:3534
void dt_bauhaus_slider_set_hard_max(GtkWidget *widget, float val)
Definition bauhaus.c:1583
void dt_bauhaus_slider_set_default(GtkWidget *widget, float def)
Definition bauhaus.c:1640
float dt_bauhaus_slider_get(GtkWidget *widget)
Definition bauhaus.c:3483
void dt_bauhaus_slider_set_offset(GtkWidget *widget, float offset)
Definition bauhaus.c:3618
void dt_bauhaus_slider_set(GtkWidget *widget, float pos)
Definition bauhaus.c:3506
void dt_bauhaus_combobox_set(GtkWidget *widget, const int pos)
Definition bauhaus.c:2301
void dt_bauhaus_widget_set_label(GtkWidget *widget, const char *label)
Definition bauhaus.c:1653
void dt_bauhaus_slider_set_hard_min(GtkWidget *widget, float val)
Definition bauhaus.c:1559
void dt_bauhaus_slider_set_format(GtkWidget *widget, const char *format)
Definition bauhaus.c:3598
dt_iop_bilat_params_t dt_iop_bilat_data_t
Definition bilat.c:102
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)
Definition bilat.c:296
const char ** description(struct dt_iop_module_t *self)
Definition bilat.c:122
int default_group()
Definition bilat.c:138
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)
Definition bilat.c:327
void gui_update(dt_iop_module_t *self)
Definition bilat.c:396
void init_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
Definition bilat.c:314
const char * name()
Definition bilat.c:117
void gui_init(dt_iop_module_t *self)
Definition bilat.c:421
void gui_changed(dt_iop_module_t *self, GtkWidget *w, void *previous)
Definition bilat.c:360
void tiling_callback(struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, struct dt_develop_tiling_t *tiling)
Definition bilat.c:249
dt_iop_bilat_mode_t
Definition bilat.c:69
@ s_mode_local_laplacian
Definition bilat.c:71
@ s_mode_bilateral
Definition bilat.c:70
int default_colorspace(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece)
Definition bilat.c:143
int flags()
Definition bilat.c:132
void init_presets(dt_iop_module_so_t *self)
Definition bilat.c:177
void cleanup_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
Definition bilat.c:321
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)
Definition bilat.c:203
int legacy_params(dt_iop_module_t *self, const void *const old_params, const int old_version, void *new_params, const int new_version)
Definition bilat.c:148
void dt_bilateral_free(dt_bilateral_t *b)
Definition bilateral.c:426
__DT_CLONE_TARGETS__ void dt_bilateral_splat(const dt_bilateral_t *b, const float *const in)
Definition bilateral.c:177
size_t dt_bilateral_memory_use(const int width, const int height, const float sigma_s, const float sigma_r)
Definition bilateral.c:74
dt_bilateral_t * dt_bilateral_init(const int width, const int height, const float sigma_s, const float sigma_r)
Definition bilateral.c:151
size_t dt_bilateral_singlebuffer_size(const int width, const int height, const float sigma_s, const float sigma_r)
Definition bilateral.c:102
__DT_CLONE_TARGETS__ void dt_bilateral_slice(const dt_bilateral_t *const b, const float *const in, float *out, const float detail)
Definition bilateral.c:350
void dt_bilateral_blur(const dt_bilateral_t *b)
Definition bilateral.c:335
int width
Definition bilateral.h:1
float sigma_s
Definition bilateral.h:3
int height
Definition bilateral.h:1
float sigma_r
Definition bilateral.h:3
void dt_bilateral_free_cl(dt_bilateral_cl_t *b)
Definition bilateralcl.c:52
cl_int dt_bilateral_slice_cl(dt_bilateral_cl_t *b, cl_mem in, cl_mem out, const float detail)
dt_bilateral_cl_t * dt_bilateral_init_cl(const int devid, const int width, const int height, const float sigma_s, const float sigma_r)
Definition bilateralcl.c:83
cl_int dt_bilateral_blur_cl(dt_bilateral_cl_t *b)
cl_int dt_bilateral_splat_cl(dt_bilateral_cl_t *b, cl_mem in)
@ DEVELOP_BLEND_CS_RGB_SCENE
Definition blend.h:60
static const dt_aligned_pixel_simd_t const dt_adaptation_t const float p
@ IOP_CS_LAB
void dt_print(dt_debug_thread_t thread, const char *msg,...)
Definition darktable.c:1542
#define dt_free_align(ptr)
Definition darktable.h:481
static void * dt_calloc_align(size_t size)
Definition darktable.h:488
@ DT_DEBUG_OPENCL
Definition darktable.h:722
#define DT_MODULE_INTROSPECTION(MODVER, PARAMSTYPE)
Definition darktable.h:151
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
Definition darktable.h:281
void dt_iop_params_t
Definition dev_history.h:41
@ DT_DEV_PIXELPIPE_DISPLAY_MASK
Definition develop.h:118
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, const dt_develop_blend_colorspace_t blend_cst)
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)
Definition imageop.c:3141
float dt_dev_get_module_scale(const dt_dev_pixelpipe_t *const pipe, const dt_iop_roi_t *const roi_in)
Definition imageop.c:131
@ IOP_FLAGS_INCLUDE_IN_STYLES
Definition imageop.h:166
@ IOP_FLAGS_SUPPORTS_BLENDING
Definition imageop.h:167
@ IOP_FLAGS_ALLOW_TILING
Definition imageop.h:169
@ IOP_GROUP_SHARPNESS
Definition imageop.h:141
#define IOP_GUI_ALLOC(module)
Definition imageop.h:599
GtkWidget * dt_bauhaus_slider_from_params(dt_iop_module_t *self, const char *param)
Definition imageop_gui.c:77
GtkWidget * dt_bauhaus_combobox_from_params(dt_iop_module_t *self, const char *param)
size_t local_laplacian_memory_use(const int width, const int height)
size_t local_laplacian_singlebuffer_size(const int width, const int height)
int local_laplacian(const float *const input, float *const out, const int wd, const int ht, const float sigma, const float shadows, const float highlights, const float clarity, local_laplacian_boundary_t *b)
cl_int dt_local_laplacian_cl(dt_local_laplacian_cl_t *b, cl_mem input, cl_mem output)
dt_local_laplacian_cl_t * dt_local_laplacian_init_cl(const int devid, const int width, const int height, const float sigma, const float shadows, const float highlights, const float clarity)
void dt_local_laplacian_free_cl(dt_local_laplacian_cl_t *g)
int dt_opencl_avoid_atomics(const int devid)
Definition opencl.c:171
struct _GtkWidget GtkWidget
Definition splash.h:29
dt_iop_buffer_dsc_t dsc_in
struct dt_iop_module_t *void * data
GtkWidget * detail
Definition bilat.c:111
GtkWidget * highlights
Definition bilat.c:106
GtkWidget * shadows
Definition bilat.c:107
GtkWidget * mode
Definition bilat.c:112
GtkWidget * midtone
Definition bilat.c:108
GtkWidget * range
Definition bilat.c:110
GtkWidget * spatial
Definition bilat.c:109
dt_iop_bilat_mode_t mode
Definition bilat.c:77
unsigned int channels
Definition format.h:54
GModule *dt_dev_operation_t op
Definition imageop.h:230
dt_iop_gui_data_t * gui_data
Definition imageop.h:311
dt_iop_params_t * params
Definition imageop.h:307
Region of interest passed through the pixelpipe.
Definition imageop.h:72
#define MIN(a, b)
Definition thinplate.c:32