Ansel 0.0
A darktable fork - bloat + design vision
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
draw.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2009-2022 darktable developers.
4
5 darktable is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 darktable is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with darktable. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#pragma once
20
23#ifdef HAVE_CONFIG_H
24#include "config.h"
25#endif
26
27#include "common/curve_tools.h"
28#include "common/darktable.h"
29#include "common/splines.h"
30#include "control/conf.h"
31#include "develop/develop.h"
32#include <cairo.h>
33#include <glib.h>
34#include <math.h>
35#include <stdint.h>
36#include <stdlib.h>
37#include <gui/gtk.h>
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43#ifndef M_PI
44#define M_PI 3.141592654
45#endif
46
53
55static inline void dt_draw_set_color_overlay(cairo_t *cr, gboolean bright, double alpha)
56{
57 double amt;
58
59 if(bright)
60 amt = 0.5 + darktable.gui->overlay_contrast * 0.5;
61 else
62 amt = (1.0 - darktable.gui->overlay_contrast) * 0.5;
63
64 cairo_set_source_rgba(cr, darktable.gui->overlay_red * amt, darktable.gui->overlay_green * amt, darktable.gui->overlay_blue * amt, alpha);
65}
66
69static inline void dt_draw_star(cairo_t *cr, float x, float y, float r1, float r2)
70{
71 const float d = 2.0 * M_PI * 0.1f;
72 const float dx[10] = { sinf(0.0), sinf(d), sinf(2 * d), sinf(3 * d), sinf(4 * d),
73 sinf(5 * d), sinf(6 * d), sinf(7 * d), sinf(8 * d), sinf(9 * d) };
74 const float dy[10] = { cosf(0.0), cosf(d), cosf(2 * d), cosf(3 * d), cosf(4 * d),
75 cosf(5 * d), cosf(6 * d), cosf(7 * d), cosf(8 * d), cosf(9 * d) };
76
77 cairo_move_to(cr, x + r1 * dx[0], y - r1 * dy[0]);
78 for(int k = 1; k < 10; k++)
79 if(k & 1)
80 cairo_line_to(cr, x + r2 * dx[k], y - r2 * dy[k]);
81 else
82 cairo_line_to(cr, x + r1 * dx[k], y - r1 * dy[k]);
83 cairo_close_path(cr);
84}
85
86static inline void dt_draw_line(cairo_t *cr, float left, float top, float right, float bottom)
87{
88 cairo_move_to(cr, left, top);
89 cairo_line_to(cr, right, bottom);
90}
91
92static inline void dt_draw_grid(cairo_t *cr, const int num, const int left, const int top, const int right,
93 const int bottom)
94{
95 float width = right - left;
96 float height = bottom - top;
97
98 for(int k = 1; k < num; k++)
99 {
100 dt_draw_line(cr, left + k / (float)num * width, top, left + k / (float)num * width, bottom);
101 cairo_stroke(cr);
102 dt_draw_line(cr, left, top + k / (float)num * height, right, top + k / (float)num * height);
103 cairo_stroke(cr);
104 }
105}
106
107static inline float dt_curve_to_mouse(const float x, const float zoom_factor, const float offset)
108{
109 return (x - offset) * zoom_factor;
110}
111
112/* left, right, top, bottom are in curve coordinates [0..1] */
113static inline void dt_draw_grid_zoomed(cairo_t *cr, const int num, const float left, const float top,
114 const float right, const float bottom, const float width,
115 const float height, const float zoom_factor, const float zoom_offset_x,
116 const float zoom_offset_y)
117{
118 for(int k = 1; k < num; k++)
119 {
120 dt_draw_line(cr, dt_curve_to_mouse(left + k / (float)num, zoom_factor, zoom_offset_x) * width,
121 dt_curve_to_mouse(top, zoom_factor, zoom_offset_y) * -height,
122 dt_curve_to_mouse(left + k / (float)num, zoom_factor, zoom_offset_x) * width,
123 dt_curve_to_mouse(bottom, zoom_factor, zoom_offset_y) * -height);
124 cairo_stroke(cr);
125
126 dt_draw_line(cr, dt_curve_to_mouse(left, zoom_factor, zoom_offset_x) * width,
127 dt_curve_to_mouse(top + k / (float)num, zoom_factor, zoom_offset_y) * -height,
128 dt_curve_to_mouse(right, zoom_factor, zoom_offset_x) * width,
129 dt_curve_to_mouse(top + k / (float)num, zoom_factor, zoom_offset_y) * -height);
130 cairo_stroke(cr);
131 }
132}
133
134#ifdef _OPENMP
135#pragma omp declare simd uniform(base)
136#endif
137static inline float dt_log_scale_axis(const float x, const float base)
138{
139 return logf(x * (base - 1.0f) + 1.f) / logf(base);
140}
141
142static inline void dt_draw_loglog_grid(cairo_t *cr, const int num, const int left, const int top, const int right,
143 const int bottom, const float base)
144{
145 float width = right - left;
146 float height = bottom - top;
147
148 for(int k = 1; k < num; k++)
149 {
150 const float x = dt_log_scale_axis(k / (float)num, base);
151 dt_draw_line(cr, left + x * width, top, left + x * width, bottom);
152 cairo_stroke(cr);
153 dt_draw_line(cr, left, top + x * height, right, top + x * height);
154 cairo_stroke(cr);
155 }
156}
157
158static inline void dt_draw_semilog_x_grid(cairo_t *cr, const int num, const int left, const int top,
159 const int right, const int bottom, const float base)
160{
161 float width = right - left;
162 float height = bottom - top;
163
164 for(int k = 1; k < num; k++)
165 {
166 const float x = dt_log_scale_axis(k / (float)num, base);
167 dt_draw_line(cr, left + x * width, top, left + x * width, bottom);
168 cairo_stroke(cr);
169 dt_draw_line(cr, left, top + k / (float)num * height, right, top + k / (float)num * height);
170 cairo_stroke(cr);
171 }
172}
173
174static inline void dt_draw_semilog_y_grid(cairo_t *cr, const int num, const int left, const int top,
175 const int right, const int bottom, const float base)
176{
177 float width = right - left;
178 float height = bottom - top;
179
180 for(int k = 1; k < num; k++)
181 {
182 const float x = dt_log_scale_axis(k / (float)num, base);
183 dt_draw_line(cr, left + k / (float)num * width, top, left + k / (float)num * width, bottom);
184 cairo_stroke(cr);
185 dt_draw_line(cr, left, top + x * height, right, top + x * height);
186 cairo_stroke(cr);
187 }
188}
189
190
191static inline void dt_draw_vertical_lines(cairo_t *cr, const int num, const int left, const int top,
192 const int right, const int bottom)
193{
194 float width = right - left;
195
196 for(int k = 1; k < num; k++)
197 {
198 cairo_move_to(cr, left + k / (float)num * width, top);
199 cairo_line_to(cr, left + k / (float)num * width, bottom);
200 cairo_stroke(cr);
201 }
202}
203
204static inline void dt_draw_horizontal_lines(cairo_t *cr, const int num, const int left, const int top,
205 const int right, const int bottom)
206{
207 float height = bottom - top;
208
209 for(int k = 1; k < num; k++)
210 {
211 cairo_move_to(cr, left, top + k / (float)num * height);
212 cairo_line_to(cr, right, top + k / (float)num * height);
213 cairo_stroke(cr);
214 }
215}
216
217static inline dt_draw_curve_t *dt_draw_curve_new(const float min, const float max, unsigned int type)
218{
219 dt_draw_curve_t *c = (dt_draw_curve_t *)malloc(sizeof(dt_draw_curve_t));
220 c->csample.m_samplingRes = 0x10000;
221 c->csample.m_outputRes = 0x10000;
222 c->csample.m_Samples = (uint16_t *)malloc(sizeof(uint16_t) * 0x10000);
223
224 c->c.m_spline_type = type;
225 c->c.m_numAnchors = 0;
226 c->c.m_min_x = 0.0;
227 c->c.m_max_x = 1.0;
228 c->c.m_min_y = 0.0;
229 c->c.m_max_y = 1.0;
230 return c;
231}
232
234{
235 free(c->csample.m_Samples);
236 free(c);
237}
238
239static inline void dt_draw_curve_set_point(dt_draw_curve_t *c, const int num, const float x, const float y)
240{
241 c->c.m_anchors[num].x = x;
242 c->c.m_anchors[num].y = y;
243}
244
245static inline void dt_draw_curve_smaple_values(dt_draw_curve_t *c, const float min, const float max, const int res,
246 float *x, float *y)
247{
248 if(x)
249 {
250#ifdef _OPENMP
251#pragma omp parallel for SIMD() default(none) dt_omp_firstprivate(res) shared(x) schedule(static)
252#endif
253 for(int k = 0; k < res; k++) x[k] = k * (1.0f / res);
254 }
255 if(y)
256 {
257#ifdef _OPENMP
258#pragma omp parallel for SIMD() default(none) dt_omp_firstprivate(min, max, res) shared(y, c) schedule(static)
259#endif
260 for(int k = 0; k < res; k++) y[k] = min + (max - min) * c->csample.m_Samples[k] * (1.0f / 0x10000);
261 }
262}
263
264static inline void dt_draw_curve_calc_values(dt_draw_curve_t *c, const float min, const float max, const int res,
265 float *x, float *y)
266{
267 c->csample.m_samplingRes = res;
268 c->csample.m_outputRes = 0x10000;
269 CurveDataSample(&c->c, &c->csample);
270 dt_draw_curve_smaple_values(c, min, max, res, x, y);
271}
272
273static inline void dt_draw_curve_calc_values_V2_nonperiodic(dt_draw_curve_t *c, const float min, const float max,
274 const int res, float *x, float *y)
275{
276 c->csample.m_samplingRes = res;
277 c->csample.m_outputRes = 0x10000;
278 CurveDataSampleV2(&c->c, &c->csample);
279 dt_draw_curve_smaple_values(c, min, max, res, x, y);
280}
281
282static inline void dt_draw_curve_calc_values_V2_periodic(dt_draw_curve_t *c, const float min, const float max,
283 const int res, float *x, float *y)
284{
285 c->csample.m_samplingRes = res;
286 c->csample.m_outputRes = 0x10000;
287 CurveDataSampleV2Periodic(&c->c, &c->csample);
288 dt_draw_curve_smaple_values(c, min, max, res, x, y);
289}
290
291static inline void dt_draw_curve_calc_values_V2(dt_draw_curve_t *c, const float min, const float max,
292 const int res, float *x, float *y, const gboolean periodic)
293{
294 if(periodic)
295 dt_draw_curve_calc_values_V2_periodic(c, min, max, res, x, y);
296 else
297 dt_draw_curve_calc_values_V2_nonperiodic(c, min, max, res, x, y);
298 }
299
300static inline float dt_draw_curve_calc_value(dt_draw_curve_t *c, const float x)
301{
302 float xa[20], ya[20];
303 float val = 0.f;
304 float *ypp = NULL;
305 for(int i = 0; i < c->c.m_numAnchors; i++)
306 {
307 xa[i] = c->c.m_anchors[i].x;
308 ya[i] = c->c.m_anchors[i].y;
309 }
310 ypp = interpolate_set(c->c.m_numAnchors, xa, ya, c->c.m_spline_type);
311 if(ypp)
312 {
313 val = interpolate_val(c->c.m_numAnchors, xa, x, ya, ypp, c->c.m_spline_type);
314 free(ypp);
315 }
316 return MIN(MAX(val, c->c.m_min_y), c->c.m_max_y);
317}
318
319static inline int dt_draw_curve_add_point(dt_draw_curve_t *c, const float x, const float y)
320{
321 c->c.m_anchors[c->c.m_numAnchors].x = x;
322 c->c.m_anchors[c->c.m_numAnchors].y = y;
323 c->c.m_numAnchors++;
324 return 0;
325}
326
327// linear x linear y
328static inline void dt_draw_histogram_8_linxliny(cairo_t *cr, const uint32_t *hist, int32_t channels,
329 int32_t channel)
330{
331 cairo_move_to(cr, 0, 0);
332 for(int k = 0; k < 256; k++) cairo_line_to(cr, k, hist[channels * k + channel]);
333 cairo_line_to(cr, 255, 0);
334 cairo_close_path(cr);
335 cairo_fill(cr);
336}
337
338static inline void dt_draw_histogram_8_zoomed(cairo_t *cr, const uint32_t *hist, int32_t channels, int32_t channel,
339 const float zoom_factor, const float zoom_offset_x,
340 const float zoom_offset_y, gboolean linear)
341{
342 cairo_move_to(cr, -zoom_offset_x, -zoom_offset_y);
343 for(int k = 0; k < 256; k++)
344 {
345 const float value = ((float)hist[channels * k + channel] - zoom_offset_y) * zoom_factor;
346 const float hist_value = value < 0 ? 0.f : value;
347 cairo_line_to(cr, ((float)k - zoom_offset_x) * zoom_factor, linear ? hist_value : logf(1.0f + hist_value));
348 }
349 cairo_line_to(cr, (255.f - zoom_offset_x), -zoom_offset_y * zoom_factor);
350 cairo_close_path(cr);
351 cairo_fill(cr);
352}
353
354// log x (scalable) & linear y
355static inline void dt_draw_histogram_8_logxliny(cairo_t *cr, const uint32_t *hist, int32_t channels,
356 int32_t channel, float base_log)
357{
358 cairo_move_to(cr, 0, 0);
359 for(int k = 0; k < 256; k++)
360 {
361 const float x = logf((float)k / 255.0f * (base_log - 1.0f) + 1.0f) / logf(base_log) * 255.0f;
362 const float y = hist[channels * k + channel];
363 cairo_line_to(cr, x, y);
364 }
365 cairo_line_to(cr, 255, 0);
366 cairo_close_path(cr);
367 cairo_fill(cr);
368}
369
370// log x (scalable) & log y
371static inline void dt_draw_histogram_8_logxlogy(cairo_t *cr, const uint32_t *hist, int32_t channels,
372 int32_t channel, float base_log)
373{
374 cairo_move_to(cr, 0, 0);
375 for(int k = 0; k < 256; k++)
376 {
377 const float x = logf((float)k / 255.0f * (base_log - 1.0f) + 1.0f) / logf(base_log) * 255.0f;
378 const float y = logf(1.0 + hist[channels * k + channel]);
379 cairo_line_to(cr, x, y);
380 }
381 cairo_line_to(cr, 255, 0);
382 cairo_close_path(cr);
383 cairo_fill(cr);
384}
385
386// linear x log y
387static inline void dt_draw_histogram_8_linxlogy(cairo_t *cr, const uint32_t *hist, int32_t channels,
388 int32_t channel)
389{
390 cairo_move_to(cr, 0, 0);
391 for(int k = 0; k < 256; k++) cairo_line_to(cr, k, logf(1.0 + hist[channels * k + channel]));
392 cairo_line_to(cr, 255, 0);
393 cairo_close_path(cr);
394 cairo_fill(cr);
395}
396
397// log x (scalable)
398static inline void dt_draw_histogram_8_log_base(cairo_t *cr, const uint32_t *hist, int32_t channels,
399 int32_t channel, const gboolean linear, float base_log)
400{
401
402 if(linear) // linear y
403 dt_draw_histogram_8_logxliny(cr, hist, channels, channel, base_log);
404 else // log y
405 dt_draw_histogram_8_logxlogy(cr, hist, channels, channel, base_log);
406}
407
408// linear x
409static inline void dt_draw_histogram_8(cairo_t *cr, const uint32_t *hist, int32_t channels, int32_t channel,
410 const gboolean linear)
411{
412 if(linear) // linear y
413 dt_draw_histogram_8_linxliny(cr, hist, channels, channel);
414 else // log y
415 dt_draw_histogram_8_linxlogy(cr, hist, channels, channel);
416}
417
419static inline void dt_draw_cairo_to_gdk_pixbuf(uint8_t *data, unsigned int width, unsigned int height)
420{
421 for(uint32_t y = 0; y < height; y++)
422 for(uint32_t x = 0; x < width; x++)
423 {
424 uint8_t *r, *g, *b, *a, tmp;
425 r = &data[(y * width + x) * 4 + 0];
426 g = &data[(y * width + x) * 4 + 1];
427 b = &data[(y * width + x) * 4 + 2];
428 a = &data[(y * width + x) * 4 + 3];
429
430 // switch r and b
431 tmp = *r;
432 *r = *b;
433 *b = tmp;
434
435 // cairo uses premultiplied alpha, reverse that
436 if(*a != 0)
437 {
438 float inv_a = 255.0 / *a;
439 *r *= inv_a;
440 *g *= inv_a;
441 *b *= inv_a;
442 }
443 }
444}
445
446static inline void dt_cairo_perceptual_gradient(cairo_pattern_t *grad, double alpha)
447{
448 // Create a linear gradient from black to white
449 cairo_pattern_add_color_stop_rgba(grad, 0.0, 0.0, 0.0, 0.0, alpha);
450 cairo_pattern_add_color_stop_rgba(grad, 1.0, 1.0, 1.0, 1.0, alpha);
451}
452
453static inline GdkPixbuf *dt_draw_paint_to_pixbuf
454 (GtkWidget *widget, const guint pixbuf_size, const int flags,
455 void (*dtgtk_cairo_paint_fct)(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data))
456{
457 GdkRGBA fg_color;
458 GtkStyleContext *context = gtk_widget_get_style_context(widget);
459 GtkStateFlags state = gtk_widget_get_state_flags(widget);
460 gtk_style_context_get_color(context, state, &fg_color);
461
462 const int dim = DT_PIXEL_APPLY_DPI(pixbuf_size);
463 cairo_surface_t *cst = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, dim, dim);
464 cairo_t *cr = cairo_create(cst);
465 gdk_cairo_set_source_rgba(cr, &fg_color);
466 (*dtgtk_cairo_paint_fct)(cr, 0, 0, dim, dim, flags, NULL);
467 cairo_destroy(cr);
468 uint8_t *data = cairo_image_surface_get_data(cst);
469 dt_draw_cairo_to_gdk_pixbuf(data, dim, dim);
470 const size_t size = (size_t)dim * dim * 4;
471 uint8_t *buf = (uint8_t *)malloc(size);
472 memcpy(buf, data, size);
473 GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data(buf, GDK_COLORSPACE_RGB, TRUE, 8, dim, dim, dim * 4,
474 (GdkPixbufDestroyNotify)free, NULL);
475 cairo_surface_destroy(cst);
476 return pixbuf;
477}
478
479#ifdef __cplusplus
480}
481#endif
482
483// clang-format off
484// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
485// vim: shiftwidth=2 expandtab tabstop=2 cindent
486// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
487// clang-format on
#define TRUE
Definition ashift_lsd.c:151
int width
Definition bilateral.h:1
int height
Definition bilateral.h:1
int type
Definition common/metadata.c:42
float * interpolate_set(int n, float x[], float y[], unsigned int type)
Definition curve_tools.c:502
int CurveDataSample(CurveData *curve, CurveSample *sample)
Definition curve_tools.c:665
float interpolate_val(int n, float x[], float xval, float y[], float tangents[], unsigned int type)
Definition curve_tools.c:507
darktable_t darktable
Definition darktable.c:111
static float dt_curve_to_mouse(const float x, const float zoom_factor, const float offset)
Definition draw.h:107
static GdkPixbuf * dt_draw_paint_to_pixbuf(GtkWidget *widget, const guint pixbuf_size, const int flags, void(*dtgtk_cairo_paint_fct)(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data))
Definition draw.h:454
static void dt_draw_curve_calc_values(dt_draw_curve_t *c, const float min, const float max, const int res, float *x, float *y)
Definition draw.h:264
static void dt_draw_horizontal_lines(cairo_t *cr, const int num, const int left, const int top, const int right, const int bottom)
Definition draw.h:204
static void dt_draw_histogram_8_zoomed(cairo_t *cr, const uint32_t *hist, int32_t channels, int32_t channel, const float zoom_factor, const float zoom_offset_x, const float zoom_offset_y, gboolean linear)
Definition draw.h:338
static void dt_draw_histogram_8_logxlogy(cairo_t *cr, const uint32_t *hist, int32_t channels, int32_t channel, float base_log)
Definition draw.h:371
static void dt_draw_cairo_to_gdk_pixbuf(uint8_t *data, unsigned int width, unsigned int height)
Definition draw.h:419
static void dt_draw_histogram_8_linxlogy(cairo_t *cr, const uint32_t *hist, int32_t channels, int32_t channel)
Definition draw.h:387
static float dt_log_scale_axis(const float x, const float base)
Definition draw.h:137
static void dt_draw_set_color_overlay(cairo_t *cr, gboolean bright, double alpha)
Definition draw.h:55
static void dt_draw_line(cairo_t *cr, float left, float top, float right, float bottom)
Definition draw.h:86
static void dt_draw_curve_smaple_values(dt_draw_curve_t *c, const float min, const float max, const int res, float *x, float *y)
Definition draw.h:245
static void dt_draw_histogram_8_linxliny(cairo_t *cr, const uint32_t *hist, int32_t channels, int32_t channel)
Definition draw.h:328
static void dt_draw_vertical_lines(cairo_t *cr, const int num, const int left, const int top, const int right, const int bottom)
Definition draw.h:191
static void dt_draw_grid(cairo_t *cr, const int num, const int left, const int top, const int right, const int bottom)
Definition draw.h:92
static void dt_draw_semilog_y_grid(cairo_t *cr, const int num, const int left, const int top, const int right, const int bottom, const float base)
Definition draw.h:174
static float dt_draw_curve_calc_value(dt_draw_curve_t *c, const float x)
Definition draw.h:300
static void dt_cairo_perceptual_gradient(cairo_pattern_t *grad, double alpha)
Definition draw.h:446
static void dt_draw_star(cairo_t *cr, float x, float y, float r1, float r2)
Definition draw.h:69
static void dt_draw_curve_calc_values_V2_nonperiodic(dt_draw_curve_t *c, const float min, const float max, const int res, float *x, float *y)
Definition draw.h:273
static void dt_draw_curve_destroy(dt_draw_curve_t *c)
Definition draw.h:233
static void dt_draw_curve_calc_values_V2(dt_draw_curve_t *c, const float min, const float max, const int res, float *x, float *y, const gboolean periodic)
Definition draw.h:291
static void dt_draw_histogram_8_log_base(cairo_t *cr, const uint32_t *hist, int32_t channels, int32_t channel, const gboolean linear, float base_log)
Definition draw.h:398
static void dt_draw_curve_set_point(dt_draw_curve_t *c, const int num, const float x, const float y)
Definition draw.h:239
static int dt_draw_curve_add_point(dt_draw_curve_t *c, const float x, const float y)
Definition draw.h:319
static void dt_draw_histogram_8_logxliny(cairo_t *cr, const uint32_t *hist, int32_t channels, int32_t channel, float base_log)
Definition draw.h:355
static void dt_draw_semilog_x_grid(cairo_t *cr, const int num, const int left, const int top, const int right, const int bottom, const float base)
Definition draw.h:158
static void dt_draw_histogram_8(cairo_t *cr, const uint32_t *hist, int32_t channels, int32_t channel, const gboolean linear)
Definition draw.h:409
static dt_draw_curve_t * dt_draw_curve_new(const float min, const float max, unsigned int type)
Definition draw.h:217
#define M_PI
Definition draw.h:44
static void dt_draw_loglog_grid(cairo_t *cr, const int num, const int left, const int top, const int right, const int bottom, const float base)
Definition draw.h:142
static void dt_draw_curve_calc_values_V2_periodic(dt_draw_curve_t *c, const float min, const float max, const int res, float *x, float *y)
Definition draw.h:282
static void dt_draw_grid_zoomed(cairo_t *cr, const int num, const float left, const float top, const float right, const float bottom, const float width, const float height, const float zoom_factor, const float zoom_offset_x, const float zoom_offset_y)
Definition draw.h:113
#define DT_PIXEL_APPLY_DPI(value)
Definition gtk.h:38
@ linear
Definition lightroom.c:388
size_t size
Definition mipmap_cache.c:3
dt_mipmap_buffer_dsc_flags flags
Definition mipmap_cache.c:4
int CurveDataSampleV2Periodic(CurveData *curve, CurveSample *sample)
Definition splines.cpp:845
int CurveDataSampleV2(CurveData *curve, CurveSample *sample)
Definition splines.cpp:749
Definition curve_tools.h:56
Definition curve_tools.h:76
struct dt_gui_gtk_t * gui
Definition darktable.h:541
Definition draw.h:49
CurveSample csample
Definition draw.h:51
CurveData c
Definition draw.h:50
double overlay_contrast
Definition gtk.h:115
double overlay_red
Definition gtk.h:115
double overlay_green
Definition gtk.h:115
double overlay_blue
Definition gtk.h:115
#define MIN(a, b)
Definition thinplate.c:23
#define MAX(a, b)
Definition thinplate.c:20