Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
splittoning.c
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2010 Alexandre Prokoudine.
4 Copyright (C) 2010-2011 Bruce Guenter.
5 Copyright (C) 2010-2011 Henrik Andersson.
6 Copyright (C) 2010-2013, 2016 johannes hanika.
7 Copyright (C) 2010 José Carlos García Sogo.
8 Copyright (C) 2010 Milan Knížek.
9 Copyright (C) 2010 Stuart Henderson.
10 Copyright (C) 2011 Antony Dovgal.
11 Copyright (C) 2011 Brian Teague.
12 Copyright (C) 2011 Ger Siemerink.
13 Copyright (C) 2011 Jérémy Rosen.
14 Copyright (C) 2011 Olivier Tribout.
15 Copyright (C) 2011 Pascal de Bruijn.
16 Copyright (C) 2011 Robert Bieber.
17 Copyright (C) 2011-2016, 2019 Tobias Ellinghaus.
18 Copyright (C) 2012-2013 Edouard Gomez.
19 Copyright (C) 2012 Richard Wonka.
20 Copyright (C) 2012, 2014 Ulrich Pegelow.
21 Copyright (C) 2013 Dennis Gnad.
22 Copyright (C) 2013, 2018-2022 Pascal Obry.
23 Copyright (C) 2013-2016 Roman Lebedev.
24 Copyright (C) 2013 Simon Spannagel.
25 Copyright (C) 2015 Pedro Côrte-Real.
26 Copyright (C) 2017 Heiko Bauke.
27 Copyright (C) 2017 luzpaz.
28 Copyright (C) 2018-2020, 2022-2023, 2025-2026 Aurélien PIERRE.
29 Copyright (C) 2018-2019 Edgardo Hoszowski.
30 Copyright (C) 2018 Maurizio Paglia.
31 Copyright (C) 2018 rawfiner.
32 Copyright (C) 2019 Andreas Schneider.
33 Copyright (C) 2019-2020, 2022 Diederik Ter Rahe.
34 Copyright (C) 2019 Diederik ter Rahe.
35 Copyright (C) 2019 Felipe Contreras.
36 Copyright (C) 2019 mepi0011.
37 Copyright (C) 2020 Aldric Renaudin.
38 Copyright (C) 2020-2021 Chris Elston.
39 Copyright (C) 2020 Hubert Kowalski.
40 Copyright (C) 2020-2021 Ralf Brown.
41 Copyright (C) 2021 Marco Carrarini.
42 Copyright (C) 2022 Hanno Schwalm.
43 Copyright (C) 2022 Martin Bařinka.
44 Copyright (C) 2022 Nicolas Auffray.
45 Copyright (C) 2022 Philipp Lutz.
46 Copyright (C) 2023 Luca Zulberti.
47
48 darktable is free software: you can redistribute it and/or modify
49 it under the terms of the GNU General Public License as published by
50 the Free Software Foundation, either version 3 of the License, or
51 (at your option) any later version.
52
53 darktable is distributed in the hope that it will be useful,
54 but WITHOUT ANY WARRANTY; without even the implied warranty of
55 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
56 GNU General Public License for more details.
57
58 You should have received a copy of the GNU General Public License
59 along with darktable. If not, see <http://www.gnu.org/licenses/>.
60*/
61#ifdef HAVE_CONFIG_H
62#include "config.h"
63#endif
64#include "bauhaus/bauhaus.h"
65#include "common/colorspaces.h"
66#include "common/debug.h"
67#include "common/math.h"
68#include "common/opencl.h"
69#include "control/control.h"
70#include "develop/develop.h"
71#include "develop/imageop.h"
72#include "develop/imageop_gui.h"
73#include "dtgtk/button.h"
75#include "dtgtk/resetlabel.h"
76
77#include "gui/gtk.h"
78#include "gui/presets.h"
80#include "iop/iop_api.h"
81#include <assert.h>
82#include <gtk/gtk.h>
83#include <inttypes.h>
84#include <stdlib.h>
85#include <string.h>
86
88
89typedef struct dt_iop_splittoning_params_t
90{
91 float shadow_hue; // $MIN: 0.0 $MAX: 1.0 $DEFAULT: 0.0 $DESCRIPTION: "hue"
92 float shadow_saturation; // $MIN: 0.0 $MAX: 1.0 $DEFAULT: 0.5 $DESCRIPTION: "saturation"
93 float highlight_hue; // $MIN: 0.0 $MAX: 1.0 $DEFAULT: 0.2 $DESCRIPTION: "hue"
94 float highlight_saturation; // $MIN: 0.0 $MAX: 1.0 $DEFAULT: 0.5 $DESCRIPTION: "saturation"
95 float balance; // $MIN: 0.0 $MAX: 1.0 $DEFAULT: 0.5 center luminance of gradient
96 float compress; // $MIN: 0.0 $MAX: 100.0 $DEFAULT: 33.0 Compress range
98
106
108{
113 float balance; // center luminance of gradient}
114 float compress; // Compress range
116
117const char *name()
118{
119 return _("split-toning (legacy)");
120}
121
126
128{
129 return IOP_GROUP_EFFECTS;
130}
131
133{
134 return IOP_CS_RGB;
135}
136
137const char **description(struct dt_iop_module_t *self)
138{
139 return dt_iop_set_description(self, _("use two specific colors for shadows and highlights and\n"
140 "create a linear toning effect between them up to a pivot."),
141 _("creative"),
142 _("linear, RGB, scene-referred"),
143 _("linear, RGB"),
144 _("linear, RGB, scene-referred"));
145}
146
148{
150
151 // shadows: #ED7212
152 // highlights: #ECA413
153 // balance : 63
154 // compress : 0
156 _("authentic sepia"), self->op, self->version(),
157 &(dt_iop_splittoning_params_t){ 26.0 / 360.0, 92.0 / 100.0, 40.0 / 360.0, 92.0 / 100.0, 0.63, 0.0 },
159
160 // shadows: #446CBB
161 // highlights: #446CBB
162 // balance : 0
163 // compress : 5.22
165 _("authentic cyanotype"), self->op, self->version(),
166 &(dt_iop_splittoning_params_t){ 220.0 / 360.0, 64.0 / 100.0, 220.0 / 360.0, 64.0 / 100.0, 0.0, 5.22 },
168
169 // shadows : #A16C5E
170 // highlights : #A16C5E
171 // balance : 100
172 // compress : 0
174 _("authentic platinotype"), self->op, self->version(),
175 &(dt_iop_splittoning_params_t){ 13.0 / 360.0, 42.0 / 100.0, 13.0 / 360.0, 42.0 / 100.0, 100.0, 0.0 },
177
178 // shadows: #211A14
179 // highlights: #D9D0C7
180 // balance : 60
181 // compress : 0
183 _("chocolate brown"), self->op, self->version(),
184 &(dt_iop_splittoning_params_t){ 28.0 / 360.0, 39.0 / 100.0, 28.0 / 360.0, 8.0 / 100.0, 0.60, 0.0 },
186
188}
189
191int process(struct dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, const void *const ivoid,
192 void *const ovoid)
193{
194 const dt_iop_roi_t *const roi_out = &piece->roi_out;
195
196 const dt_iop_splittoning_data_t *const data = (dt_iop_splittoning_data_t *)piece->data;
197 const float compress = (data->compress / 110.0) / 2.0; // Don't allow 100% compression..
198
199 const float *const restrict in = DT_IS_ALIGNED((float*)ivoid);
200 float *const restrict out = DT_IS_ALIGNED((float*)ovoid);
201 const int npixels = roi_out->width * roi_out->height;
203 for(int k = 0; k < 4 * npixels; k += 4)
204 {
205 float h, s, l;
206 rgb2hsl(in+k, &h, &s, &l);
207 if(l < data->balance - compress)
208 {
209 dt_aligned_pixel_t mixrgb;
210 hsl2rgb(mixrgb, data->shadow_hue, data->shadow_saturation, l);
211
212 const float ra = CLIP((data->balance - compress - l) * 2.0f);
213 const float la = (1.0f - ra);
214
215 for_each_channel(c,aligned(in,out))
216 out[k+c] = CLIP(in[k+c] * la + mixrgb[c] * ra);
217 }
218 else if(l > data->balance + compress)
219 {
220 dt_aligned_pixel_t mixrgb;
221 hsl2rgb(mixrgb, data->highlight_hue, data->highlight_saturation, l);
222
223 const float ra = CLIP((l - (data->balance + compress)) * 2.0f);
224 const float la = (1.0f - ra);
225
226 for_each_channel(c,aligned(in,out))
227 out[k+c] = CLIP(in[k+c] * la + mixrgb[c] * ra);
228 }
229 else
230 {
231 copy_pixel(out + k, in +k);
232 }
233
234 }
235
236 return 0;
237}
238
239static inline void update_colorpicker_color(GtkWidget *colorpicker, float hue, float sat)
240{
242 hsl2rgb(rgb, hue, sat, 0.5);
243
244 GdkRGBA color = (GdkRGBA){.red = rgb[0], .green = rgb[1], .blue = rgb[2], .alpha = 1.0 };
245 gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(colorpicker), &color);
246}
247
248static inline void update_saturation_slider_end_color(GtkWidget *slider, float hue)
249{
251 hsl2rgb(rgb, hue, 1.0, 0.5);
252 dt_bauhaus_slider_set_stop(slider, 1.0, rgb[0], rgb[1], rgb[2]);
253}
254
256 GtkWidget *slider,
257 float shadow_hue,
258 float highlight_hue)
259{
261 if(shadow_hue != -1)
262 {
263 hsl2rgb(rgb, shadow_hue, 1.0, 0.5);
264 dt_bauhaus_slider_set_stop(slider, 0.0, rgb[0], rgb[1], rgb[2]);
265 }
266 if(highlight_hue != -1)
267 {
268 hsl2rgb(rgb, highlight_hue, 1.0, 0.5);
269 dt_bauhaus_slider_set_stop(slider, 1.0, rgb[0], rgb[1], rgb[2]);
270 }
271
272 gtk_widget_queue_draw(GTK_WIDGET(slider));
273}
274
275void gui_changed(dt_iop_module_t *self, GtkWidget *w, void *previous)
276{
279
280 if(w == g->shadow_sat_gslider || w == g->shadow_hue_gslider)
281 {
282 update_colorpicker_color(g->shadow_colorpick, p->shadow_hue, p->shadow_saturation);
283
284 if(w == g->shadow_hue_gslider)
285 {
286 update_balance_slider_colors(g->balance_scale, p->shadow_hue, -1);
287 update_saturation_slider_end_color(g->shadow_sat_gslider, p->shadow_hue);
288
289 gtk_widget_queue_draw(GTK_WIDGET(g->shadow_sat_gslider));
290 }
291 }
292 else if(w == g->highlight_sat_gslider || w == g->highlight_hue_gslider)
293 {
294 update_colorpicker_color(g->highlight_colorpick, p->highlight_hue, p->highlight_saturation);
295
296 if(w == g->highlight_hue_gslider)
297 {
298 update_balance_slider_colors(g->balance_scale, -1, p->highlight_hue);
299 update_saturation_slider_end_color(g->highlight_sat_gslider, p->highlight_hue);
300
301 gtk_widget_queue_draw(GTK_WIDGET(g->highlight_sat_gslider));
302 }
303 }
304}
305
306static void colorpick_callback(GtkColorButton *widget, dt_iop_module_t *self)
307{
308 if(darktable.gui->reset) return;
309
311
312 dt_aligned_pixel_t color;
313 float h, s, l;
314
315 GdkRGBA c;
316 gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(widget), &c);
317 color[0] = c.red;
318 color[1] = c.green;
319 color[2] = c.blue;
320 rgb2hsl(color, &h, &s, &l);
321
322 if (GTK_WIDGET(widget) == g->shadow_colorpick)
323 {
324 dt_bauhaus_slider_set(g->shadow_hue_gslider, h);
325 dt_bauhaus_slider_set(g->shadow_sat_gslider, s);
326 update_balance_slider_colors(g->balance_scale, h, -1);
327 }
328 else
329 {
330 dt_bauhaus_slider_set(g->highlight_hue_gslider, h);
331 dt_bauhaus_slider_set(g->highlight_sat_gslider, s);
332 update_balance_slider_colors(g->balance_scale, -1, h);
333 }
334
335 gtk_widget_queue_draw(GTK_WIDGET(g->balance_scale));
336
338}
339
341{
344
345 float *p_hue, *p_saturation;
346 GtkWidget *sat, *hue, *colorpicker;
347
348 // convert picker RGB 2 HSL
349 float H = .0f, S = .0f, L = .0f;
350 rgb2hsl(self->picked_color, &H, &S, &L);
351
352 if(picker == g->highlight_hue_gslider)
353 {
354 p_hue = &p->highlight_hue;
355 p_saturation = &p->highlight_saturation;
356 hue = g->highlight_hue_gslider;
357 sat = g->highlight_sat_gslider;
358 colorpicker = g->highlight_colorpick;
359 update_balance_slider_colors(g->balance_scale, -1, H);
360 }
361 else
362 {
363 p_hue = &p->shadow_hue;
364 p_saturation = &p->shadow_saturation;
365 hue = g->shadow_hue_gslider;
366 sat = g->shadow_sat_gslider;
367 colorpicker = g->shadow_colorpick;
368 update_balance_slider_colors(g->balance_scale, H, -1);
369 }
370
371 if(fabsf(*p_hue - H) < 0.0001f && fabsf(*p_saturation - S) < 0.0001f)
372 {
373 // interrupt infinite loops
374 return;
375 }
376
377 *p_hue = H;
378 *p_saturation = S;
379
383 update_colorpicker_color(colorpicker, H, S);
386
387 gtk_widget_queue_draw(GTK_WIDGET(g->balance_scale));
388
390}
391
394{
397
398 d->shadow_hue = p->shadow_hue;
399 d->highlight_hue = p->highlight_hue;
400 d->shadow_saturation = p->shadow_saturation;
401 d->highlight_saturation = p->highlight_saturation;
402 d->balance = p->balance;
403 d->compress = p->compress;
404}
405
407{
409 piece->data_size = sizeof(dt_iop_splittoning_data_t);
410}
411
413{
414 dt_free_align(piece->data);
415 piece->data = NULL;
416}
417
418void gui_update(struct dt_iop_module_t *self)
419{
422
423 dt_bauhaus_slider_set(g->shadow_hue_gslider, p->shadow_hue);
424 dt_bauhaus_slider_set(g->shadow_sat_gslider, p->shadow_saturation);
425 dt_bauhaus_slider_set(g->highlight_hue_gslider, p->highlight_hue);
426 dt_bauhaus_slider_set(g->highlight_sat_gslider, p->highlight_saturation);
427 dt_bauhaus_slider_set(g->balance_scale, p->balance);
428 dt_bauhaus_slider_set(g->compress_scale, p->compress);
429
430 update_colorpicker_color(GTK_WIDGET(g->shadow_colorpick), p->shadow_hue, p->shadow_saturation);
431 update_colorpicker_color(GTK_WIDGET(g->highlight_colorpick), p->highlight_hue, p->highlight_saturation);
432 update_saturation_slider_end_color(g->shadow_sat_gslider, p->shadow_hue);
433 update_saturation_slider_end_color(g->highlight_sat_gslider, p->highlight_hue);
434
435 update_balance_slider_colors(g->balance_scale, p->shadow_hue, p->highlight_hue);
436}
437
438static inline void gui_init_section(struct dt_iop_module_t *self, char *section, GtkWidget *slider_box,
439 GtkWidget *hue, GtkWidget *saturation, GtkWidget **picker, gboolean top)
440{
441 GtkWidget *label = dt_ui_section_label_new(_(section));
442
443 gtk_box_pack_start(GTK_BOX(self->widget), label, FALSE, FALSE, 0);
444
445 dt_bauhaus_widget_set_label(hue, N_("hue"));
447 dt_bauhaus_slider_set_stop(hue, 0.0f , 1.0f, 0.0f, 0.0f);
448 dt_bauhaus_slider_set_stop(hue, 0.166f, 1.0f, 1.0f, 0.0f);
449 dt_bauhaus_slider_set_stop(hue, 0.322f, 0.0f, 1.0f, 0.0f);
450 dt_bauhaus_slider_set_stop(hue, 0.498f, 0.0f, 1.0f, 1.0f);
451 dt_bauhaus_slider_set_stop(hue, 0.664f, 0.0f, 0.0f, 1.0f);
452 dt_bauhaus_slider_set_stop(hue, 0.830f, 1.0f, 0.0f, 1.0f);
453 dt_bauhaus_slider_set_stop(hue, 1.0f , 1.0f, 0.0f, 0.0f);
454 gtk_widget_set_tooltip_text(hue, _("select the hue tone"));
456
457 dt_bauhaus_widget_set_label(saturation, N_("saturation"));
458 dt_bauhaus_slider_set_stop(saturation, 0.0f, 0.2f, 0.2f, 0.2f);
459 dt_bauhaus_slider_set_stop(saturation, 1.0f, 1.0f, 1.0f, 1.0f);
460 gtk_widget_set_tooltip_text(saturation, _("select the saturation tone"));
461
462 *picker = gtk_color_button_new();
463 gtk_color_chooser_set_use_alpha(GTK_COLOR_CHOOSER(*picker), FALSE);
464 gtk_color_button_set_title(GTK_COLOR_BUTTON(*picker), _("select tone color"));
465 g_signal_connect(G_OBJECT(*picker), "color-set", G_CALLBACK(colorpick_callback), self);
466
467 GtkWidget *hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, DT_GUI_BOX_SPACING);
468 gtk_box_pack_start(GTK_BOX(hbox), slider_box, TRUE, TRUE, 0);
469 gtk_box_pack_end(GTK_BOX(hbox), *picker, FALSE, FALSE, 0);
470 gtk_box_pack_start(GTK_BOX(self->widget), hbox, FALSE, FALSE, 0);
471}
472
473void gui_init(struct dt_iop_module_t *self)
474{
476
477 GtkWidget *shadows_box = self->widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, DT_GUI_BOX_SPACING);
478 g->shadow_hue_gslider = dt_bauhaus_slider_from_params(self, "shadow_hue");
479 dt_bauhaus_slider_set_factor(g->shadow_hue_gslider, 360.0f);
480 dt_bauhaus_slider_set_format(g->shadow_hue_gslider, "\302\260");
481 g->shadow_sat_gslider = dt_bauhaus_slider_from_params(self, "shadow_saturation");
482
483 GtkWidget *highlights_box = self->widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, DT_GUI_BOX_SPACING);
484 g->highlight_hue_gslider = dt_bauhaus_slider_from_params(self, "highlight_hue");
485 dt_bauhaus_slider_set_factor(g->highlight_hue_gslider, 360.0f);
486 dt_bauhaus_slider_set_format(g->highlight_hue_gslider, "\302\260");
487 g->highlight_sat_gslider = dt_bauhaus_slider_from_params(self, "highlight_saturation");
488
489 // start building top level widget
490 self->widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, DT_GUI_BOX_SPACING);
491
492 gui_init_section(self, N_("shadows"), shadows_box, g->shadow_hue_gslider, g->shadow_sat_gslider, &g->shadow_colorpick, TRUE);
493
494 gui_init_section(self, N_("highlights"), highlights_box, g->highlight_hue_gslider, g->highlight_sat_gslider, &g->highlight_colorpick, FALSE);
495
496 // Additional parameters
497 gtk_box_pack_start(GTK_BOX(self->widget), dt_ui_section_label_new(_("properties")), FALSE, FALSE, 0);
498
499 g->balance_scale = dt_bauhaus_slider_from_params(self, N_("balance"));
500 dt_bauhaus_slider_set_feedback(g->balance_scale, 0);
501 dt_bauhaus_slider_set_digits(g->balance_scale, 4);
502 dt_bauhaus_slider_set_factor(g->balance_scale, -100.0);
503 dt_bauhaus_slider_set_offset(g->balance_scale, +100.0);
504 dt_bauhaus_slider_set_stop(g->balance_scale, 0.0f, 0.5f, 0.5f, 0.5f);
505 dt_bauhaus_slider_set_stop(g->balance_scale, 1.0f, 0.5f, 0.5f, 0.5f);
506 gtk_widget_set_tooltip_text(g->balance_scale, _("the balance of center of split-toning"));
507
508 g->compress_scale = dt_bauhaus_slider_from_params(self, N_("compress"));
509 dt_bauhaus_slider_set_format(g->compress_scale, "%");
510 gtk_widget_set_tooltip_text(g->compress_scale, _("compress the effect on highlights/shadows and\npreserve mid-tones"));
511}
512
513// clang-format off
514// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
515// vim: shiftwidth=2 expandtab tabstop=2 cindent
516// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
517// clang-format on
#define TRUE
Definition ashift_lsd.c:162
#define FALSE
Definition ashift_lsd.c:158
void dt_bauhaus_slider_set_digits(GtkWidget *widget, int val)
Definition bauhaus.c:3534
void dt_bauhaus_slider_set_stop(GtkWidget *widget, float stop, float r, float g, float b)
Definition bauhaus.c:2372
void dt_bauhaus_slider_set_feedback(GtkWidget *widget, int feedback)
Definition bauhaus.c:3580
void dt_bauhaus_slider_set_offset(GtkWidget *widget, float offset)
Definition bauhaus.c:3618
void dt_bauhaus_slider_set(GtkWidget *widget, float pos)
Definition bauhaus.c:3506
void dt_bauhaus_widget_set_label(GtkWidget *widget, const char *label)
Definition bauhaus.c:1653
void dt_bauhaus_slider_set_format(GtkWidget *widget, const char *format)
Definition bauhaus.c:3598
void dt_bauhaus_slider_set_factor(GtkWidget *widget, float factor)
Definition bauhaus.c:3611
@ DEVELOP_BLEND_CS_RGB_DISPLAY
Definition blend.h:59
static const dt_aligned_pixel_simd_t const dt_adaptation_t const float p
@ IOP_CS_RGB
GtkWidget * dt_color_picker_new(dt_iop_module_t *module, dt_iop_color_picker_kind_t kind, GtkWidget *w)
@ DT_COLOR_PICKER_POINT
void rgb2hsl(const dt_aligned_pixel_t rgb, float *h, float *s, float *l)
void hsl2rgb(dt_aligned_pixel_t rgb, float h, float s, float l)
static dt_aligned_pixel_t rgb
const dt_colormatrix_t dt_aligned_pixel_t out
const float top
#define S(V, params)
darktable_t darktable
Definition darktable.c:181
#define dt_free_align(ptr)
Definition darktable.h:481
static void * dt_calloc_align(size_t size)
Definition darktable.h:488
#define DT_IS_ALIGNED(x)
Definition darktable.h:371
static void copy_pixel(float *const __restrict__ out, const float *const __restrict__ in)
Definition darktable.h:688
#define for_each_channel(_var,...)
Definition darktable.h:662
#define DT_MODULE_INTROSPECTION(MODVER, PARAMSTYPE)
Definition darktable.h:151
#define __DT_CLONE_TARGETS__
Definition darktable.h:367
#define __OMP_PARALLEL_FOR__(...)
Definition darktable.h:258
#define dt_database_start_transaction(db)
Definition database.h:77
#define dt_database_release_transaction(db)
Definition database.h:78
#define dt_dev_add_history_item(dev, module, enable, redraw)
void dt_iop_params_t
Definition dev_history.h:41
#define H
Definition diffuse.c:613
static GtkWidget * dt_ui_section_label_new(const gchar *str)
Definition gtk.h:451
#define DT_GUI_BOX_SPACING
Definition gtk.h:109
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)
Definition imageop.c:3141
@ IOP_FLAGS_INCLUDE_IN_STYLES
Definition imageop.h:166
@ IOP_FLAGS_DEPRECATED
Definition imageop.h:168
@ IOP_FLAGS_SUPPORTS_BLENDING
Definition imageop.h:167
@ IOP_FLAGS_ALLOW_TILING
Definition imageop.h:169
@ IOP_GROUP_EFFECTS
Definition imageop.h:142
#define IOP_GUI_ALLOC(module)
Definition imageop.h:599
GtkWidget * dt_bauhaus_slider_from_params(dt_iop_module_t *self, const char *param)
Definition imageop_gui.c:77
void *const ovoid
float *const restrict const size_t k
#define CLIP(x)
Definition math.h:81
float dt_aligned_pixel_t[4]
struct _GtkWidget GtkWidget
Definition splash.h:29
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 default_group()
__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)
static void update_colorpicker_color(GtkWidget *colorpicker, float hue, float sat)
static void colorpick_callback(GtkColorButton *widget, 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)
const char * name()
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)
static void update_balance_slider_colors(GtkWidget *slider, float shadow_hue, float highlight_hue)
int default_colorspace(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece)
int flags()
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)
static void gui_init_section(struct dt_iop_module_t *self, char *section, GtkWidget *slider_box, GtkWidget *hue, GtkWidget *saturation, GtkWidget **picker, gboolean top)
static void update_saturation_slider_end_color(GtkWidget *slider, float hue)
void color_picker_apply(dt_iop_module_t *self, GtkWidget *picker, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
struct dt_gui_gtk_t * gui
Definition darktable.h:775
const struct dt_database_t * db
Definition darktable.h:779
struct dt_develop_t * develop
Definition darktable.h:770
struct dt_iop_module_t *void * data
int32_t reset
Definition gtk.h:172
GModule *dt_dev_operation_t op
Definition imageop.h:230
GtkWidget * widget
Definition imageop.h:337
dt_iop_gui_data_t * gui_data
Definition imageop.h:311
dt_aligned_pixel_t picked_color
Definition imageop.h:272
dt_iop_params_t * params
Definition imageop.h:307
Region of interest passed through the pixelpipe.
Definition imageop.h:72