119 return _(
"local contrast");
126 _(
"non-linear, Lab, display-referred"),
127 _(
"non-linear, Lab"),
128 _(
"non-linear, Lab, display-referred"));
149 dt_iop_module_t *self,
const void *
const old_params,
const int old_version,
150 void *new_params,
const int new_version)
152 if(old_version == 2 && new_version == 3)
163 else if(old_version == 1 && new_version == 3)
180 memset(&
p, 0,
sizeof(
p));
214 const float sigma_s =
d->sigma_s / scale;
221 if(err != CL_SUCCESS)
goto error;
223 if(err != CL_SUCCESS)
goto error;
225 if(err != CL_SUCCESS)
goto error;
236 d->midtone,
d->sigma_s,
d->sigma_r,
d->detail);
261 const float sigma_s =
d->sigma_s / scale;
267 const size_t basebuffer =
sizeof(float) * channels *
width *
height;
283 const size_t basebuffer =
sizeof(float) * channels *
width *
height;
338 const float sigma_s =
d->sigma_s / scale;
364 if(w ==
g->highlights || w ==
g->shadows || w ==
g->midtone)
368 else if(w ==
g->range || w ==
g->spatial)
372 else if(w ==
g->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."));
432 gtk_widget_set_tooltip_text(
g->detail, _(
"changes the local contrast"));
443 gtk_widget_set_tooltip_text(
g->spatial, _(
"feature size of local details (spatial sigma of bilateral filter)"));
449 gtk_widget_set_tooltip_text(
g->range, _(
"L difference to detect edges (range sigma of bilateral filter)"));
454 gtk_widget_set_tooltip_text(
g->highlights, _(
"changes the local contrast of highlights"));
459 gtk_widget_set_tooltip_text(
g->shadows, _(
"changes the local contrast of shadows"));
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"));
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);
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)
@ DEVELOP_BLEND_CS_RGB_SCENE
static const dt_aligned_pixel_simd_t const dt_adaptation_t const float p
void dt_print(dt_debug_thread_t thread, const char *msg,...)
#define dt_free_align(ptr)
static void * dt_calloc_align(size_t size)
#define DT_MODULE_INTROSPECTION(MODVER, PARAMSTYPE)
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
@ 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 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)
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
#define IOP_GUI_ALLOC(module)
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)
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)
struct _GtkWidget GtkWidget
dt_iop_buffer_dsc_t dsc_in
struct dt_iop_module_t *void * data
gboolean cache_output_on_ram
GModule *dt_dev_operation_t op
dt_iop_gui_data_t * gui_data
Region of interest passed through the pixelpipe.