122 return _(
"local contrast");
129 _(
"non-linear, Lab, display-referred"),
130 _(
"non-linear, Lab"),
131 _(
"non-linear, Lab, display-referred"));
152 dt_iop_module_t *self,
const void *
const old_params,
const int old_version,
153 void *new_params,
const int new_version)
155 if(old_version == 2 && new_version == 3)
166 else if(old_version == 1 && new_version == 3)
183 memset(&
p, 0,
sizeof(
p));
192 self->version(), &
p,
sizeof(
p), 1);
201 self->version(), &
p,
sizeof(
p), 1);
217 const float sigma_s =
d->sigma_s / scale;
224 if(err != CL_SUCCESS)
goto error;
226 if(err != CL_SUCCESS)
goto error;
228 if(err != CL_SUCCESS)
goto error;
239 d->midtone,
d->sigma_s,
d->sigma_r,
d->detail);
264 const float sigma_s =
d->sigma_s / scale;
270 const size_t basebuffer =
sizeof(float) * channels *
width *
height;
286 const size_t basebuffer =
sizeof(float) * channels *
width *
height;
341 const float sigma_s =
d->sigma_s / scale;
367 if(w ==
g->highlights || w ==
g->shadows || w ==
g->midtone)
371 else if(w ==
g->range || w ==
g->spatial)
375 else if(w ==
g->mode)
430 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."));
435 gtk_widget_set_tooltip_text(
g->detail, _(
"changes the local contrast"));
446 gtk_widget_set_tooltip_text(
g->spatial, _(
"feature size of local details (spatial sigma of bilateral filter)"));
452 gtk_widget_set_tooltip_text(
g->range, _(
"L difference to detect edges (range sigma of bilateral filter)"));
457 gtk_widget_set_tooltip_text(
g->highlights, _(
"changes the local contrast of highlights"));
462 gtk_widget_set_tooltip_text(
g->shadows, _(
"changes the local contrast of shadows"));
466 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"));
469 g_object_set(G_OBJECT(
g->highlights),
"no-show-all",
TRUE, NULL);
470 g_object_set(G_OBJECT(
g->shadows),
"no-show-all",
TRUE, NULL);
471 g_object_set(G_OBJECT(
g->midtone),
"no-show-all",
TRUE, NULL);
472 g_object_set(G_OBJECT(
g->range),
"no-show-all",
TRUE, NULL);
473 g_object_set(G_OBJECT(
g->spatial),
"no-show-all",
TRUE, NULL);
static void error(char *msg)
void dt_bauhaus_slider_set_digits(GtkWidget *widget, int val)
void dt_bauhaus_slider_set_hard_max(GtkWidget *widget, float val)
void dt_bauhaus_slider_set_default(GtkWidget *widget, float def)
float dt_bauhaus_slider_get(GtkWidget *widget)
void dt_bauhaus_slider_set_offset(GtkWidget *widget, float offset)
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)
void dt_bauhaus_slider_set_hard_min(GtkWidget *widget, float val)
void dt_bauhaus_slider_set_format(GtkWidget *widget, const char *format)
dt_iop_bilat_params_t dt_iop_bilat_data_t
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)
const char ** description(struct dt_iop_module_t *self)
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)
void gui_update(dt_iop_module_t *self)
void init_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
void gui_init(dt_iop_module_t *self)
void gui_changed(dt_iop_module_t *self, GtkWidget *w, void *previous)
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)
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)
void cleanup_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
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)
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_bilateral_free(dt_bilateral_t *b)
__DT_CLONE_TARGETS__ void dt_bilateral_splat(const dt_bilateral_t *b, const float *const in)
size_t dt_bilateral_memory_use(const int width, const int height, const float sigma_s, const float sigma_r)
dt_bilateral_t * dt_bilateral_init(const int width, const int height, const float sigma_s, const float sigma_r)
size_t dt_bilateral_singlebuffer_size(const int width, const int height, const float sigma_s, const float sigma_r)
__DT_CLONE_TARGETS__ void dt_bilateral_slice(const dt_bilateral_t *const b, const float *const in, float *out, const float detail)
void dt_bilateral_blur(const dt_bilateral_t *b)
void dt_bilateral_free_cl(dt_bilateral_cl_t *b)
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)
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)
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
@ DT_DEV_PIXELPIPE_DISPLAY_MASK
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 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)
float dt_dev_get_module_scale(const dt_dev_pixelpipe_t *const pipe, const dt_iop_roi_t *const roi_in)
@ IOP_FLAGS_INCLUDE_IN_STYLES
@ IOP_FLAGS_SUPPORTS_BLENDING
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)
size_t local_laplacian_memory_use(const int width, const int height)
size_t local_laplacian_singlebuffer_size(const int width, const int height)
static 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)
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.
#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_MODULE_INTROSPECTION(MODVER, PARAMSTYPE)
DT_MODULE() for a module whose params struct is introspected.
int dt_opencl_avoid_atomics(const int devid)
dt_iop_buffer_dsc_t dsc_in
struct dt_iop_module_t *void * data
gboolean cache_output_on_ram
Region of interest passed through the pixelpipe.