110 return _(
"global tonemap");
115 return _(
"this module is deprecated. please use the filmic rgb module instead.");
142 void *new_params,
const int new_version)
144 if(old_version < 3 && new_version == 3)
159 const void *
const ivoid,
void *
const ovoid,
163 float *in = (
float *)ivoid;
167 for(
size_t k = 0;
k < (size_t)roi_out->
width * roi_out->
height;
k++)
169 float *inp = in +
ch *
k;
170 float *outp =
out +
ch *
k;
171 float l = inp[0] / 100.0;
172 outp[0] = 100.0 * (l / (1.0f + l));
181 const void *
const ivoid,
void *
const ovoid,
186 float *in = (
float *)ivoid;
191 const float eps = 0.0001f;
193 float tmp_lwmax = NAN;
212 tmp_lwmax =
g->lwmax;
221 for(
size_t k = 0;
k < (size_t)roi_out->
width * roi_out->
height;
k++)
223 const float *inp = in +
ch *
k;
224 lwmax = fmaxf(lwmax, (inp[0] * 0.01f));
242 const float ldc = data->
drago.
max_light * 0.01 / log10f(lwmax + 1);
243 const float bl = logf(fmaxf(
eps, data->
drago.
bias)) / logf(0.5);
245 for(
size_t k = 0;
k < (size_t)roi_out->
width * roi_out->
height;
k++)
247 float *inp = in +
ch *
k;
248 float *outp =
out +
ch *
k;
249 float lw = inp[0] * 0.01f;
251 * (ldc * logf(fmaxf(
eps,
lw + 1.0f)) / logf(fmaxf(
eps, 2.0f + (powf(
lw / lwmax, bl)) * 8.0f)));
259 const void *
const ivoid,
void *
const ovoid,
263 float *in = (
float *)ivoid;
267 for(
size_t k = 0;
k < (size_t)roi_out->
width * roi_out->
height;
k++)
269 float *inp = in +
ch *
k;
270 float *outp =
out +
ch *
k;
271 float l = inp[0] / 100.0;
272 float x = fmaxf(0.0f, l - 0.004f);
273 outp[0] = 100.0 * ((
x * (6.2 *
x + .5)) / (
x * (6.2 *
x + 1.7) + 0.06));
289 const float sigma_s = fminf(iw, ih) * 0.03f;
332 const float sigma_s = fminf(iw, ih) * 0.03f;
334 const int detail = (
d->detail != 0.0f);
338 const int channels = 4;
340 const size_t basebuffer =
sizeof(float) * channels *
width *
height;
358 d->operator=
p->operator;
359 d->drago.bias =
p->drago.bias;
360 d->drago.max_light =
p->drago.max_light;
361 d->detail =
p->detail;
411 gtk_widget_set_tooltip_text(
g->operator, _(
"the global tonemap operator"));
414 gtk_widget_set_tooltip_text(
g->drago.bias, _(
"the bias for tonemapper controls the linearity, "
415 "the higher the more details in blacks"));
418 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)
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
const dt_colormatrix_t dt_aligned_pixel_t out
void dt_control_log(const char *msg,...)
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)
void dt_iop_gui_leave_critical_section(dt_iop_module_t *const module)
Release what dt_iop_gui_enter_critical_section() took. Also a no-op headless.
@ IOP_FLAGS_INCLUDE_IN_STYLES
@ IOP_FLAGS_SUPPORTS_BLENDING
void dt_iop_gui_enter_critical_section(dt_iop_module_t *const module)
Take the module's GUI lock, serialising access to its dt_iop_gui_data_t.
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)
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 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.
#define __OMP_PARALLEL_FOR__(...)
unsigned __int64 uint64_t
struct dt_iop_module_t *void * data
dt_iop_buffer_type_t datatype
struct dt_iop_global_tonemap_data_t::@43 drago
struct dt_iop_global_tonemap_gui_data_t::@44 drago
struct dt_iop_global_tonemap_params_t::@42 drago
struct dt_develop_t * dev
Region of interest passed through the pixelpipe.
#define __DT_CLONE_TARGETS__
Telling the user something happened.