Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
rawoverexposed.c
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2016 Roman Lebedev.
4 Copyright (C) 2016-2017 Ulrich Pegelow.
5 Copyright (C) 2017, 2019 Heiko Bauke.
6 Copyright (C) 2018-2021, 2023, 2025-2026 Aurélien PIERRE.
7 Copyright (C) 2018 Edgardo Hoszowski.
8 Copyright (C) 2019 Andreas Schneider.
9 Copyright (C) 2019 Tobias Ellinghaus.
10 Copyright (C) 2020 Aldric Renaudin.
11 Copyright (C) 2020 Diederik Ter Rahe.
12 Copyright (C) 2020 Hubert Kowalski.
13 Copyright (C) 2020-2021 Pascal Obry.
14 Copyright (C) 2020-2021 Ralf Brown.
15 Copyright (C) 2022 Hanno Schwalm.
16 Copyright (C) 2022 jandren.
17 Copyright (C) 2022 Martin Bařinka.
18 Copyright (C) 2022 Philipp Lutz.
19 Copyright (C) 2024 Alynx Zhou.
20
21 darktable is free software: you can redistribute it and/or modify
22 it under the terms of the GNU General Public License as published by
23 the Free Software Foundation, either version 3 of the License, or
24 (at your option) any later version.
25
26 darktable is distributed in the hope that it will be useful,
27 but WITHOUT ANY WARRANTY; without even the implied warranty of
28 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 GNU General Public License for more details.
30
31 You should have received a copy of the GNU General Public License
32 along with darktable. If not, see <http://www.gnu.org/licenses/>.
33 */
34
35#ifdef HAVE_CONFIG_H
36#include "config.h"
37#endif
38#include "develop/imageop_gui.h"
39
40#include "system/macros.h"
41#include "system/openmp.h"
43#include "system/mem_alloc.h"
44#include "common/logging.h"
47#include "common/image.h" // for dt_image_t, ::DT_IMAGE_4BAYER
48#include "common/imagebuf.h" // for dt_iop_image_copy_by_size
49#include "caches/mipmap_cache.h" // for dt_mipmap_buffer_t, dt_mipmap_cach...
50#include "common/opencl.h"
52#include "develop/develop.h" // for dt_develop_t, dt_develop_t::(anony...
53#include "develop/imageop.h" // for dt_iop_module_t, dt_iop_roi_t, dt_...
54#include "develop/imageop_math.h" // for FC, FCxtrans
55#include "develop/pixelpipe.h" // for dt_dev_pixelpipe_type_t::DT_DEV_PI...
56#include "develop/tiling.h"
57#include "iop/iop_api.h" // for dt_iop_params_t
58#include <glib/gi18n.h> // for _
59#include <gtk/gtktypes.h> // for GtkWidget
60#include <stdint.h> // for uint16_t, uint8_t, uint32_t
61#include <stdlib.h> // for size_t, free, NULL, calloc, malloc
62#include <string.h> // for memcpy
63
64DT_MODULE(1)
65
70
71static const float dt_iop_rawoverexposed_colors[][4] __attribute__((aligned(64))) = {
72 { 1.0f, 0.0f, 0.0f, 1.0f }, // red
73 { 0.0f, 1.0f, 0.0f, 1.0f }, // green
74 { 0.0f, 0.0f, 1.0f, 1.0f }, // blue
75 { 0.0f, 0.0f, 0.0f, 1.0f } // black
76};
77
78/* The indicator settings, sealed by commit_params() from the darkroom's GUI state and folded into
79 * the pipeline cache key by runtime_data_hash(); process()/process_cl() render from them rather
80 * than re-reading dev->rawoverexposed. The per-channel raw thresholds are derived from `threshold`
81 * at process time, into a local, and never written back here: whatever piece->data holds at the
82 * next commit is hashed as if it were a setting. */
89
96
97const char *name()
98{
99 return _("raw overexposed");
100}
101
103{
104 return IOP_GROUP_TECHNICAL;
105}
106
111
116
119 unsigned int threshold[4])
120{
121 const dt_develop_t *dev = self->dev;
122 const dt_iop_rawoverexposed_data_t *const d = piece->data;
123
124 // 4BAYER is not supported by this module yet anyway.
125 const int ch = (dev->image_storage.flags & DT_IMAGE_4BAYER) ? 4 : 3;
126
127 for(int k = 0; k < ch; k++)
128 {
129 // here is our threshold: the clipping is detected as (raw value > threshold)
130 float chthr = d->threshold;
131
132 // "undo" rawprepare iop
133 chthr *= piece->dsc_in.rawprepare.raw_white_point - piece->dsc_in.rawprepare.raw_black_level;
134 chthr += piece->dsc_in.rawprepare.raw_black_level;
135
136 // and this is that threshold, but in raw input buffer values
137 threshold[k] = (unsigned int)chthr;
138 }
139}
140
143 const void *const ivoid, void *const ovoid)
144{
145 const dt_iop_roi_t *const roi_in = &piece->roi_in;
146 const dt_iop_roi_t *const roi_out = &piece->roi_out;
147 const dt_iop_rawoverexposed_data_t *const d = piece->data;
148
149 unsigned int threshold[4] = { 0 };
151
152 dt_develop_t *dev = self->dev;
153 const dt_image_t *const image = &(dev->image_storage);
154 dt_dev_pixelpipe_t *const runtime_pipe = (dt_dev_pixelpipe_t *)pipe;
155
156 const int ch = piece->dsc_in.channels;
157 const double iop_order = self->iop_order;
158
159 const dt_dev_rawoverexposed_mode_t mode = d->mode;
160 const int colorscheme = d->colorscheme;
161 const float *const color = dt_iop_rawoverexposed_colors[colorscheme];
162
163 dt_iop_image_copy_by_size(ovoid, ivoid, roi_out->width, roi_out->height, ch);
164
167 if(IS_NULL_PTR(buf.buf))
168 {
169 dt_control_log(_("failed to get raw buffer from image `%s'"), image->filename);
171 return 0;
172 }
173
174#if 0
175 const float in_scale = roi_in->scale;
176 dt_boundingbox_t pts = {(float)(roi_out->x) / in_scale, (float)(roi_out->y) / in_scale,
177 (float)(roi_out->x + roi_out->width) / in_scale, (float)(roi_out->y + roi_out->height) / in_scale};
178 printf("in %f %f %f %f\n", pts[0], pts[1], pts[2], pts[3]);
179 dt_dev_distort_backtransform_plus(dev->pipe, 0, priority, pts, 2);
180 printf("out %f %f %f %f\n\n", pts[0], pts[1], pts[2], pts[3]);
181#endif
182
183 const uint16_t *const raw = (const uint16_t *const)buf.buf;
184 float *const restrict out = DT_IS_ALIGNED((float *const)ovoid);
185
186 // NOT FROM THE PIPE !!!
187 const uint32_t filters = image->dsc.filters;
188 const uint8_t(*const xtrans)[6] = (const uint8_t(*const)[6])image->dsc.xtrans;
189
190 // acquire temp memory for distorted pixel coords
191 size_t coordbufsize;
192 float *const restrict coordbuf = dt_pixelpipe_cache_alloc_perthread_float(2*roi_out->width, &coordbufsize);
193 if(IS_NULL_PTR(coordbuf))
194 {
196 return 1;
197 }
198 __OMP_PARALLEL_FOR_SIMD__(firstprivate(dt_iop_rawoverexposed_colors))
199 for(int j = 0; j < roi_out->height; j++)
200 {
201 float *const restrict bufptr = dt_get_perthread(coordbuf, coordbufsize);
202
203 // here are all the pixels of this row
204 for(int i = 0; i < roi_out->width; i++)
205 {
206 bufptr[2 * i] = (float)(roi_out->x + i) / roi_in->scale;
207 bufptr[2 * i + 1] = (float)(roi_out->y + j) / roi_in->scale;
208 }
209
210 // where did they come from?
211 dt_dev_distort_backtransform_plus(runtime_pipe, iop_order,
212 DT_DEV_TRANSFORM_DIR_BACK_INCL, bufptr, roi_out->width);
213
214 for(int i = 0; i < roi_out->width; i++)
215 {
216 const size_t pout = (size_t)ch * (j * roi_out->width + i);
217
218 // not sure which float -> int to use here
219 const int i_raw = (int)bufptr[2 * i];
220 const int j_raw = (int)bufptr[2 * i + 1];
221
222 if(i_raw < 0 || j_raw < 0 || i_raw >= buf.width || j_raw >= buf.height) continue;
223
224 int c;
225 if(filters == 9u)
226 {
227 c = FCxtrans(j_raw, i_raw, NULL, xtrans);
228 }
229 else // if(filters)
230 {
231 c = FC(j_raw, i_raw, filters);
232 }
233
234 const size_t pin = (size_t)j_raw * buf.width + i_raw;
235 const float in = raw[pin];
236
237 // was the raw pixel clipped?
238 if(in < threshold[c]) continue;
239
240 switch(mode)
241 {
243 memcpy(out + pout, dt_iop_rawoverexposed_colors[c], sizeof(float) * 4);
244 break;
246 memcpy(out + pout, color, sizeof(float) * 4);
247 break;
249 out[pout + c] = 0.0;
250 break;
251 }
252 }
253 }
254
256
258
259 if(pipe->mask_display & DT_DEV_PIXELPIPE_DISPLAY_MASK) dt_iop_alpha_copy(ivoid, ovoid, roi_out->width, roi_out->height);
260 return 0;
261}
262
263#ifdef HAVE_OPENCL
264int 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)
265{
266 const dt_iop_roi_t *const roi_in = &piece->roi_in;
267 const dt_iop_roi_t *const roi_out = &piece->roi_out;
268 const dt_iop_rawoverexposed_data_t *const d = piece->data;
269 dt_develop_t *dev = self->dev;
271
272 cl_mem dev_raw = NULL;
273 float *coordbuf = NULL;
274 cl_mem dev_coord = NULL;
275 cl_mem dev_thresholds = NULL;
276 cl_mem dev_colors = NULL;
277 cl_mem dev_xtrans = NULL;
278
279 cl_int err = -999;
280
281 const dt_image_t *const image = &(dev->image_storage);
282
285 if(IS_NULL_PTR(buf.buf))
286 {
287 dt_control_log(_("failed to get raw buffer from image `%s'"), image->filename);
289 goto error;
290 }
291
292 const int devid = pipe->devid;
293
294 const int width = roi_out->width;
295 const int height = roi_out->height;
296
297 size_t origin[] = { 0, 0, 0 };
298 size_t region[] = { width, height, 1 };
299
300 unsigned int threshold[4] = { 0 };
302
303 err = dt_opencl_enqueue_copy_image(devid, dev_in, dev_out, origin, origin, region);
304 if(err != CL_SUCCESS) goto error;
305
306 const int colorscheme = d->colorscheme;
307 const float *const color = dt_iop_rawoverexposed_colors[colorscheme];
308
309 // NOT FROM THE PIPE !!!
310 const uint32_t filters = image->dsc.filters;
311
312 const int raw_width = buf.width;
313 const int raw_height = buf.height;
314
315 dev_raw = dt_opencl_copy_host_to_device(devid, buf.buf, raw_width, raw_height, sizeof(uint16_t));
316 if(IS_NULL_PTR(dev_raw)) goto error;
317
318 const size_t coordbufsize = (size_t)height * width * 2 * sizeof(float);
319
320 coordbuf = dt_pixelpipe_cache_alloc_align_cache(coordbufsize, pipe->type);
321 if(IS_NULL_PTR(coordbuf)) goto error;
323 for(int j = 0; j < height; j++)
324 {
325 float *bufptr = ((float *)coordbuf) + (size_t)2 * j * width;
326
327 // here are all the pixels of this row
328 for(int i = 0; i < roi_out->width; i++)
329 {
330 bufptr[2 * i] = (float)(roi_out->x + i) / roi_in->scale;
331 bufptr[2 * i + 1] = (float)(roi_out->y + j) / roi_in->scale;
332 }
333
334 // where did they come from?
336 }
337
338 dev_coord = dt_opencl_alloc_device_buffer(devid, coordbufsize);
339 if(IS_NULL_PTR(dev_coord)) goto error;
340
341 /* _blocking_ memory transfer: host coordbuf buffer -> opencl dev_coordbuf */
342 err = dt_opencl_write_buffer_to_device(devid, coordbuf, dev_coord, 0, coordbufsize, CL_TRUE);
343 if(err != CL_SUCCESS) goto error;
344
345 int kernel;
346 switch(d->mode)
347 {
350
351 dev_colors = dt_opencl_alloc_device_buffer(devid, sizeof(dt_iop_rawoverexposed_colors));
352 if(IS_NULL_PTR(dev_colors)) goto error;
353
354 /* _blocking_ memory transfer: host coordbuf buffer -> opencl dev_colors */
355 err = dt_opencl_write_buffer_to_device(devid, (void *)dt_iop_rawoverexposed_colors, dev_colors, 0,
356 sizeof(dt_iop_rawoverexposed_colors), CL_TRUE);
357 if(err != CL_SUCCESS) goto error;
358
359 break;
362 break;
364 default:
366 break;
367 }
368
369 if(filters == 9u)
370 {
371 dev_xtrans
372 = dt_opencl_copy_host_to_device_constant(devid, sizeof(image->dsc.xtrans), (void *)image->dsc.xtrans);
373 if(IS_NULL_PTR(dev_xtrans)) goto error;
374 }
375
376 dev_thresholds = dt_opencl_copy_host_to_device_constant(devid, sizeof(threshold), (void *)threshold);
377 if(IS_NULL_PTR(dev_thresholds)) goto error;
378
379 size_t sizes[2] = { ROUNDUPDWD(width, devid), ROUNDUPDHT(height, devid) };
380 dt_opencl_set_kernel_arg(devid, kernel, 0, sizeof(cl_mem), &dev_in);
381 dt_opencl_set_kernel_arg(devid, kernel, 1, sizeof(cl_mem), &dev_out);
382 dt_opencl_set_kernel_arg(devid, kernel, 2, sizeof(cl_mem), &dev_coord);
383 dt_opencl_set_kernel_arg(devid, kernel, 3, sizeof(int), &width);
384 dt_opencl_set_kernel_arg(devid, kernel, 4, sizeof(int), &height);
385 dt_opencl_set_kernel_arg(devid, kernel, 5, sizeof(cl_mem), &dev_raw);
386 dt_opencl_set_kernel_arg(devid, kernel, 6, sizeof(int), &raw_width);
387 dt_opencl_set_kernel_arg(devid, kernel, 7, sizeof(int), &raw_height);
388 dt_opencl_set_kernel_arg(devid, kernel, 8, sizeof(uint32_t), &filters);
389 dt_opencl_set_kernel_arg(devid, kernel, 9, sizeof(cl_mem), &dev_xtrans);
390 dt_opencl_set_kernel_arg(devid, kernel, 10, sizeof(cl_mem), &dev_thresholds);
391
393 dt_opencl_set_kernel_arg(devid, kernel, 11, sizeof(cl_mem), &dev_colors);
395 dt_opencl_set_kernel_arg(devid, kernel, 11, 4 * sizeof(float), color);
396
397 err = dt_opencl_enqueue_kernel_2d(devid, kernel, sizes);
398 if(err != CL_SUCCESS) goto error;
399
402 dt_opencl_release_mem_object(dev_thresholds);
407
408 return TRUE;
409
410error:
413 dt_opencl_release_mem_object(dev_thresholds);
418 dt_print(DT_DEBUG_OPENCL, "[opencl_rawoverexposed] couldn't enqueue kernel! %d\n", err);
419 return FALSE;
420}
421#endif
422
424{
425 dt_develop_t *dev = self->dev;
426 const dt_image_t *const image = &(dev->image_storage);
427
428 // the module needs access to the full raw image which adds to the memory footprint
429 // on OpenCL devices. We take account in tiling->overhead.
430
432 int raw_width = 0;
433 int raw_height = 0;
434
436
437 if(buf.buf)
438 {
439 raw_width = buf.width;
440 raw_height = buf.height;
441 }
442
444
445 tiling->factor = 2.5f; // in + out + coordinates
446 tiling->maxbuf = 1.0f;
447 tiling->overhead = (size_t)raw_width * raw_height * sizeof(uint16_t);
448 tiling->overlap = 0;
449 tiling->xalign = 1;
450 tiling->yalign = 1;
451 return;
452}
453
456{
457 dt_develop_t *dev = self->dev;
459 d->mode = dev->rawoverexposed.mode;
460 d->colorscheme = dev->rawoverexposed.colorscheme;
461 d->threshold = dev->rawoverexposed.threshold;
462
463 if(pipe->type != DT_DEV_PIXELPIPE_FULL || !dev->rawoverexposed.enabled || !dev->gui_attached) piece->enabled = 0;
464
465 const dt_image_t *const image = &(dev->image_storage);
466
467 if(image->flags & DT_IMAGE_4BAYER) piece->enabled = 0;
468
469 if(image->dsc.datatype != TYPE_UINT16 || !image->dsc.filters) piece->enabled = 0;
470}
471
475{
476 return TRUE;
477}
478
480{
481 const int program = 2; // basic.cl from programs.conf
482 module->data = malloc(sizeof(dt_iop_rawoverexposed_global_data_t));
483 dt_iop_rawoverexposed_global_data_t *gd = module->data;
484 gd->kernel_rawoverexposed_mark_cfa = dt_opencl_create_kernel(program, "rawoverexposed_mark_cfa");
485 gd->kernel_rawoverexposed_mark_solid = dt_opencl_create_kernel(program, "rawoverexposed_mark_solid");
486 gd->kernel_rawoverexposed_falsecolor = dt_opencl_create_kernel(program, "rawoverexposed_falsecolor");
487}
488
489
498
504
510
512{
513 module->params = calloc(1, sizeof(dt_iop_rawoverexposed_t));
514 module->default_params = calloc(1, sizeof(dt_iop_rawoverexposed_t));
515 module->hide_enable_button = 1;
516 module->default_enabled = 1;
517 module->params_size = sizeof(dt_iop_rawoverexposed_t);
518
519 // Bypasses the cache from here down while the indicator is shown. What keeps a changed setting
520 // from being served the previous frame is runtime_data_hash(), not this: a bypass leaves the
521 // hash unchanged, so the last module found the displayed cacheline under it and reused it.
523}
524
525// clang-format off
526// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
527// vim: shiftwidth=2 expandtab tabstop=2 cindent
528// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
529// clang-format on
static void error(char *msg)
Definition ashift_lsd.c:202
#define TRUE
Definition ashift_lsd.c:162
#define FALSE
Definition ashift_lsd.c:158
@ IOP_CS_RGB
const float threshold
const dt_colormatrix_t dt_aligned_pixel_t out
void dt_control_log(const char *msg,...)
Definition control.c:839
static int FCxtrans(const int row, const int col, global const unsigned char(*const xtrans)[6])
static int FC(const int row, const int col, const unsigned int filters)
void dt_iop_params_t
Definition dev_history.h:43
int dt_dev_distort_backtransform_plus(const dt_dev_pixelpipe_t *pipe, const double iop_order, const int transf_direction, float *points, size_t points_count)
Definition develop.c:1893
@ DT_DEV_PIXELPIPE_DISPLAY_MASK
Definition develop.h:123
@ DT_DEV_TRANSFORM_DIR_BACK_INCL
Definition develop.h:110
dt_dev_rawoverexposed_mode_t
Definition develop.h:92
@ DT_DEV_RAWOVEREXPOSED_MODE_FALSECOLOR
Definition develop.h:95
@ DT_DEV_RAWOVEREXPOSED_MODE_MARK_CFA
Definition develop.h:93
@ DT_DEV_RAWOVEREXPOSED_MODE_MARK_SOLID
Definition develop.h:94
dt_dev_rawoverexposed_colorscheme_t
Definition develop.h:98
@ TYPE_UINT16
Definition format.h:57
GdkRGBA color[]
Definition geotagging.c:541
float dt_boundingbox_t[4]
Definition image.h:83
@ DT_IMAGE_4BAYER
Definition image.h:149
static void dt_iop_image_copy_by_size(float *const __restrict__ out, const float *const __restrict__ in, const size_t width, const size_t height, const size_t ch)
Definition imagebuf.h:91
void dt_iop_set_cache_bypass(dt_iop_module_t *module, gboolean state)
Definition imageop.c:1685
@ IOP_FLAGS_HIDDEN
Definition imageop.h:189
@ IOP_FLAGS_ALLOW_TILING
Definition imageop.h:188
@ IOP_FLAGS_ONE_INSTANCE
Definition imageop.h:191
@ IOP_FLAGS_NO_HISTORY_STACK
Definition imageop.h:193
@ IOP_GROUP_TECHNICAL
Definition imageop.h:162
void *const ovoid
static float kernel(const float *x, const float *y)
static const dt_dev_pixelpipe_t * pipe
Definition layers.h:49
static const dt_dev_pixelpipe_t const dt_dev_pixelpipe_iop_t * piece
Definition layers.h:50
@ DT_DEBUG_OPENCL
Definition logging.h:57
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.
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...
Definition macros.h:96
#define dt_free_align(ptr)
Release memory from dt_alloc_align() and set ptr to NULL.
Definition mem_alloc.h:214
static void * dt_calloc_align(size_t size)
dt_alloc_align() followed by a zero fill.
Definition mem_alloc.h:225
#define DT_IS_ALIGNED(x)
Promise the compiler that x is already cacheline-aligned, and return it.
Definition mem_alloc.h:51
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
Definition mem_alloc.h:171
uint32_t width
Definition mipmap_cache.c:0
uint32_t height
Definition mipmap_cache.c:1
@ DT_MIPMAP_BLOCKING
@ DT_MIPMAP_FULL
#define dt_mipmap_cache_get(B, C, D, E, F)
#define dt_mipmap_cache_release(B)
#define DT_MODULE(MODVER)
Instantiate the version handshake every module must export. Use once, at file scope,...
int dt_opencl_enqueue_kernel_2d(const int dev, const int kernel, const size_t *sizes)
Definition opencl.c:2612
void * dt_opencl_alloc_device_buffer(const int devid, const size_t size)
Definition opencl.c:3028
int dt_opencl_create_kernel(const int prog, const char *name)
Definition opencl.c:2506
void * dt_opencl_copy_host_to_device_constant(const int devid, const size_t size, void *host)
Definition opencl.c:2808
int dt_opencl_write_buffer_to_device(const int devid, void *host, void *device, const size_t offset, const size_t size, const int blocking)
Definition opencl.c:2796
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)
Definition opencl.c:2737
void dt_opencl_free_kernel(const int kernel)
Definition opencl.c:2549
int dt_opencl_set_kernel_arg(const int dev, const int kernel, const int num, const size_t size, const void *arg)
Definition opencl.c:2603
void * dt_opencl_copy_host_to_device(const int devid, void *host, const int width, const int height, const int bpp)
Definition opencl.c:2823
void dt_opencl_release_mem_object(cl_mem mem)
Definition opencl.c:2863
#define ROUNDUPDHT(a, b)
Definition opencl.h:86
#define ROUNDUPDWD(a, b)
Definition opencl.h:85
#define __OMP_PARALLEL_FOR_SIMD__(...)
Definition openmp.h:96
@ DT_DEV_PIXELPIPE_FULL
Definition pixelpipe.h:43
#define dt_pixelpipe_cache_alloc_align_cache(size, id)
#define dt_pixelpipe_cache_free_align(mem)
#define dt_get_perthread(buf, padsize)
#define dt_pixelpipe_cache_alloc_perthread_float(n, padded_size)
void init(dt_iop_module_t *module)
int default_group()
__DT_CLONE_TARGETS__ int process(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 char * name()
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 commit_params(dt_iop_module_t *self, dt_iop_params_t *p1, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
void cleanup_global(dt_iop_module_so_t *module)
gboolean runtime_data_hash(dt_iop_module_t *self __attribute__((unused)), dt_dev_pixelpipe_t *pipe __attribute__((unused)), const dt_dev_pixelpipe_iop_t *piece __attribute__((unused)))
void cleanup_pipe(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
int default_colorspace(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece)
int flags()
static __DT_CLONE_TARGETS__ void process_common_setup(const dt_iop_module_t *self, const dt_dev_pixelpipe_iop_t *piece, unsigned int threshold[4])
void init_pipe(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)
float dt_aligned_pixel_simd_t __attribute__((vector_size(16), aligned(16)))
Apply one channel's tone curve to each of the three colour channels, or pass the channel through unto...
Definition simd.h:55
dt_dev_pixelpipe_type_t type
int32_t gui_attached
Definition develop.h:167
dt_image_t image_storage
Definition develop.h:225
dt_clipping_preview_mode_t mode
Definition develop.h:441
dt_dev_overexposed_colorscheme_t colorscheme
Definition develop.h:438
gboolean enabled
Definition develop.h:370
struct dt_develop_t::@16 rawoverexposed
float threshold
Definition develop.h:452
struct dt_dev_pixelpipe_t * pipe
Definition develop.h:214
int32_t flags
Definition image.h:410
dt_iop_buffer_dsc_t dsc
Definition image.h:428
char filename[DT_MAX_FILENAME_LEN]
Definition image.h:395
int32_t id
Definition image.h:410
uint32_t filters
Definition format.h:89
uint8_t xtrans[6][6]
Definition format.h:99
dt_iop_buffer_type_t datatype
Definition format.h:85
dt_iop_global_data_t * data
Definition imageop.h:238
struct dt_develop_t * dev
Definition imageop.h:311
dt_iop_global_data_t * global_data
Definition imageop.h:337
dt_dev_rawoverexposed_mode_t mode
dt_dev_rawoverexposed_colorscheme_t colorscheme
Region of interest passed through the pixelpipe.
Definition format.h:49
double scale
Definition format.h:51
int width
Definition format.h:50
int height
Definition format.h:50
#define __DT_CLONE_TARGETS__
Telling the user something happened.