112 return _(
"global tonemap");
117 return _(
"this module is deprecated. please use the filmic rgb module instead.");
144 void *new_params,
const int new_version)
146 if(old_version < 3 && new_version == 3)
161 const void *
const ivoid,
void *
const ovoid,
165 float *in = (
float *)ivoid;
169 for(
size_t k = 0;
k < (size_t)roi_out->
width * roi_out->
height;
k++)
171 float *inp = in +
ch *
k;
172 float *outp =
out +
ch *
k;
173 float l = inp[0] / 100.0;
174 outp[0] = 100.0 * (l / (1.0f + l));
183 const void *
const ivoid,
void *
const ovoid,
188 float *in = (
float *)ivoid;
193 const float eps = 0.0001f;
195 float tmp_lwmax = NAN;
214 tmp_lwmax =
g->lwmax;
223 for(
size_t k = 0;
k < (size_t)roi_out->
width * roi_out->
height;
k++)
225 const float *inp = in +
ch *
k;
226 lwmax = fmaxf(lwmax, (inp[0] * 0.01f));
244 const float ldc = data->
drago.
max_light * 0.01 / log10f(lwmax + 1);
245 const float bl = logf(fmaxf(
eps, data->
drago.
bias)) / logf(0.5);
247 for(
size_t k = 0;
k < (size_t)roi_out->
width * roi_out->
height;
k++)
249 float *inp = in +
ch *
k;
250 float *outp =
out +
ch *
k;
251 float lw = inp[0] * 0.01f;
253 * (ldc * logf(fmaxf(
eps,
lw + 1.0f)) / logf(fmaxf(
eps, 2.0f + (powf(
lw / lwmax, bl)) * 8.0f)));
261 const void *
const ivoid,
void *
const ovoid,
265 float *in = (
float *)ivoid;
269 for(
size_t k = 0;
k < (size_t)roi_out->
width * roi_out->
height;
k++)
271 float *inp = in +
ch *
k;
272 float *outp =
out +
ch *
k;
273 float l = inp[0] / 100.0;
274 float x = fmaxf(0.0f, l - 0.004f);
275 outp[0] = 100.0 * ((
x * (6.2 *
x + .5)) / (
x * (6.2 *
x + 1.7) + 0.06));
291 const float sigma_s = fminf(iw, ih) * 0.03f;
334 const float sigma_s = fminf(iw, ih) * 0.03f;
336 const int detail = (
d->detail != 0.0f);
340 const int channels = 4;
342 const size_t basebuffer =
sizeof(float) * channels *
width *
height;
360 d->operator=
p->operator;
361 d->drago.bias =
p->drago.bias;
362 d->drago.max_light =
p->drago.max_light;
363 d->detail =
p->detail;
413 gtk_widget_set_tooltip_text(
g->operator, _(
"the global tonemap operator"));
416 gtk_widget_set_tooltip_text(
g->drago.bias, _(
"the bias for tonemapper controls the linearity, "
417 "the higher the more details in blacks"));
420 gtk_widget_set_tooltip_text(
g->drago.max_light, _(
"the target light for tonemapper specified as cd/m2"));
void dt_bauhaus_slider_set_digits(GtkWidget *widget, int val)
void dt_bilateral_free(dt_bilateral_t *b)
__DT_CLONE_TARGETS__ void dt_bilateral_splat(const dt_bilateral_t *b, const float *const in)
dt_bilateral_t * dt_bilateral_init(const int width, const int height, const float sigma_s, const float sigma_r)
__DT_CLONE_TARGETS__ void dt_bilateral_slice_to_output(const dt_bilateral_t *const b, const float *const in, float *out, const float detail)
void dt_bilateral_blur(const dt_bilateral_t *b)
size_t dt_bilateral_memory_use2(const int width, const int height, const float sigma_s, const float sigma_r)
size_t dt_bilateral_singlebuffer_size2(const int width, const int height, const float sigma_s, const float sigma_r)
static const dt_aligned_pixel_simd_t const dt_adaptation_t const float p
const dt_colormatrix_t dt_aligned_pixel_t out
void dt_control_log(const char *msg,...)
#define dt_free_align(ptr)
static void * dt_calloc_align(size_t size)
#define DT_MODULE_INTROSPECTION(MODVER, PARAMSTYPE)
#define __DT_CLONE_TARGETS__
#define __OMP_PARALLEL_FOR__(...)
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
gboolean dt_dev_pixelpipe_has_preview_output(const dt_develop_t *dev, const dt_dev_pixelpipe_t *pipe, const dt_iop_roi_t *roi)
@ DT_DEV_PIXELPIPE_DISPLAY_MASK
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)
static __DT_CLONE_TARGETS__ void process_reinhard(struct dt_iop_module_t *self, const dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out, dt_iop_global_tonemap_data_t *data)
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)
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 input_format(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, dt_iop_buffer_dsc_t *dsc)
void gui_cleanup(struct dt_iop_module_t *self)
static __DT_CLONE_TARGETS__ void process_drago(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, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out, dt_iop_global_tonemap_data_t *data)
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 cleanup_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
const char * deprecated_msg()
static __DT_CLONE_TARGETS__ void process_filmic(struct dt_iop_module_t *self, const dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out, dt_iop_global_tonemap_data_t *data)
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 dt_dev_get_module_scale(const dt_dev_pixelpipe_t *const pipe, const dt_iop_roi_t *const roi_in)
static void dt_iop_gui_enter_critical_section(dt_iop_module_t *const module) ACQUIRE(&module -> gui_lock)
@ IOP_FLAGS_INCLUDE_IN_STYLES
@ IOP_FLAGS_SUPPORTS_BLENDING
static void dt_iop_gui_leave_critical_section(dt_iop_module_t *const module) RELEASE(&module -> gui_lock)
#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)
float *const restrict const size_t k
float *const restrict const size_t const size_t ch
struct _GtkWidget GtkWidget
unsigned __int64 uint64_t
struct dt_iop_module_t *void * data
dt_iop_buffer_type_t datatype
struct dt_iop_global_tonemap_data_t::@57 drago
struct dt_iop_global_tonemap_gui_data_t::@58 drago
struct dt_iop_global_tonemap_params_t::@56 drago
struct dt_develop_t * dev
dt_iop_gui_data_t * gui_data
Region of interest passed through the pixelpipe.