162 _(
"linear or non-linear, Lab, scene-referred"),
163 _(
"frequential, Lab"),
164 _(
"special, Lab, scene-referred"));
190 new->radius =
fabs(
old->radius);
191 new->contrast =
old->contrast;
192 new->saturation =
old->saturation;
193 new->brightness = 0.0f;
204 new->radius =
fabs(
old->radius);
205 new->contrast =
old->contrast;
206 new->saturation =
old->saturation;
207 new->brightness =
old->brightness;
218 new->radius =
fabs(
old->radius);
219 new->contrast =
old->contrast;
220 new->saturation =
old->saturation;
221 new->brightness =
old->brightness;
223 new->unbound =
old->unbound;
244 const int channels =
piece->dsc_in.channels;
246 const float radius =
fmax(0.1f,
d->radius);
248 const float saturation =
d->saturation;
249 const int order =
d->order;
250 const int unbound =
d->unbound;
261 float Labmax[] = { 100.0f, 128.0f, 128.0f, 1.0f };
262 float Labmin[] = { 0.0f, -128.0f, -128.0f, 0.0f };
283 const float detail = -1.0f;
312 size_t origin[] = { 0, 0, 0 };
360 const float radius =
fmax(0.1f,
d->radius);
367 const int channels =
piece->dsc_in.channels;
401 float *in = (
float *)
ivoid;
407 const int ch =
piece->dsc_in.channels;
409 const float radius =
fmax(0.1f, data->
radius);
411 const int order = data->
order;
412 const int unbound = data->
unbound;
414 float Labmax[] = { 100.0f, 128.0f, 128.0f, 1.0f };
415 float Labmin[] = { 0.0f, -128.0f, -128.0f, 0.0f };
434 const float detail = -1.0f;
448 for(
size_t k = 0;
k < (size_t)roi_out->
width * roi_out->
height;
k++)
483 d->radius =
p->radius;
484 d->contrast =
p->contrast;
485 d->brightness =
p->brightness;
486 d->saturation =
p->saturation;
487 d->lowpass_algo =
p->lowpass_algo;
488 d->unbound =
p->unbound;
497 if(
fabs(
d->contrast) <= 1.0f)
500 for(
int k = 0;
k < 0x10000;
k++)
d->ctable[
k] =
d->contrast * (100.0f *
k / 0x10000 - 50.0f) + 50.0f;
506 const float boost = 5.0f;
510 for(
int k = 0;
k < 0x10000;
k++)
512 float kx2m1 = 2.0f * (float)
k / 0x10000 - 1.0f;
518 const float xc[4] = { 0.7f, 0.8f, 0.9f, 1.0f };
519 const float yc[4] = {
d->ctable[
CLAMP((
int)(xc[0] * 0x10000ul), 0, 0xffff)],
520 d->ctable[
CLAMP((
int)(xc[1] * 0x10000ul), 0, 0xffff)],
521 d->ctable[
CLAMP((
int)(xc[2] * 0x10000ul), 0, 0xffff)],
522 d->ctable[
CLAMP((
int)(xc[3] * 0x10000ul), 0, 0xffff)] };
527 const float gamma = (
d->brightness >= 0.0f) ? 1.0f / (1.0f +
d->brightness) : (1.0f -
d->brightness);
529 for(
int k = 0;
k < 0x10000;
k++)
531 d->ltable[
k] = 100.0f *
powf((
float)
k / 0x10000, gamma);
535 const float xl[4] = { 0.7f, 0.8f, 0.9f, 1.0f };
536 const float yl[4] = {
d->ltable[
CLAMP((
int)(
xl[0] * 0x10000ul), 0, 0xffff)],
537 d->ltable[
CLAMP((
int)(
xl[1] * 0x10000ul), 0, 0xffff)],
538 d->ltable[
CLAMP((
int)(
xl[2] * 0x10000ul), 0, 0xffff)],
539 d->ltable[
CLAMP((
int)(
xl[3] * 0x10000ul), 0, 0xffff)] };
554 for(
int k = 0;
k < 0x10000;
k++)
d->ctable[
k] =
d->ltable[
k] = 100.0f *
k / 0x10000;
565 const int program = 6;
static void error(char *msg)
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)
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
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)
void dt_gaussian_free(dt_gaussian_t *g)
void dt_gaussian_free_cl(dt_gaussian_cl_t *g)
size_t dt_gaussian_memory_use_cl(const int width, const int height, const int channels)
size_t dt_gaussian_singlebuffer_size(const int width, const int height, const int channels)
cl_int dt_gaussian_blur_cl(dt_gaussian_cl_t *g, cl_mem dev_in, cl_mem dev_out)
void dt_gaussian_blur_4c(dt_gaussian_t *g, const float *const in, float *const out)
dt_gaussian_cl_t * dt_gaussian_init_cl(const int devid, const int width, const int height, const int channels, const float *max, const float *min, const float sigma, const int order)
dt_gaussian_t * dt_gaussian_init(const int width, const int height, const int channels, const float *max, const float *min, const float sigma, const int order)
size_t dt_gaussian_memory_use(const int width, const int height, const int channels)
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)
@ 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)
#define IOP_GUI_ALLOC(module)
static void dt_iop_estimate_exp(const float *const x, const float *const y, const int num, float *coeff)
static float dt_iop_eval_exp(const float *const coeff, const float x)
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.
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)
__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_init(struct dt_iop_module_t *self)
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)
void cleanup_global(dt_iop_module_so_t *module)
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)
void init_global(dt_iop_module_so_t *module)
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)
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 CLAMPF(a, mn, mx)
#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_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)
void * dt_opencl_alloc_device(const int devid, const int width, const int height, const int bpp)
int dt_opencl_create_kernel(const int prog, const char *name)
void * dt_opencl_copy_host_to_device_constant(const int devid, const size_t size, void *host)
int dt_opencl_enqueue_copy_image(const int devid, cl_mem src, cl_mem dst, size_t *orig_src, size_t *orig_dst, size_t *region)
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)
void * dt_opencl_copy_host_to_device(const int devid, void *host, const int width, const int height, const int bpp)
void dt_opencl_release_mem_object(cl_mem mem)
int dt_opencl_avoid_atomics(const int devid)
#define __OMP_PARALLEL_FOR__(...)
dt_gaussian_order_t order
dt_iop_lowpass_algo_t lowpass_algo
float lunbounded_coeffs[3]
float cunbounded_coeffs[3]
dt_gaussian_order_t order
dt_gaussian_order_t order
dt_gaussian_order_t order
dt_iop_lowpass_algo_t lowpass_algo
dt_gaussian_order_t order
struct dt_develop_t * dev
dt_iop_global_data_t * global_data
Region of interest passed through the pixelpipe.
#define __DT_CLONE_TARGETS__