39#ifndef DT_WIDGETS_DRAW_H
40#define DT_WIDGETS_DRAW_H
75#define M_PI 3.141592654
80#define DT_DRAW_SIZE_GLOBAL_FACTOR 0.75f
83#define DT_DRAW_SIZE_LINE DT_PIXEL_APPLY_DPI_DPP(1.5f * DT_DRAW_SIZE_GLOBAL_FACTOR)
84#define DT_DRAW_SIZE_LINE_SELECTED DT_PIXEL_APPLY_DPI_DPP(3.0f * DT_DRAW_SIZE_GLOBAL_FACTOR)
85#define DT_DRAW_SIZE_LINE_HIGHLIGHT (DT_PIXEL_APPLY_DPI_DPP(4.0f * DT_DRAW_SIZE_GLOBAL_FACTOR) + DT_DRAW_SIZE_LINE)
86#define DT_DRAW_SIZE_LINE_HIGHLIGHT_SELECTED (DT_PIXEL_APPLY_DPI_DPP(5.0f * DT_DRAW_SIZE_GLOBAL_FACTOR) + DT_DRAW_SIZE_LINE_SELECTED)
87#define DT_DRAW_SIZE_CROSS DT_PIXEL_APPLY_DPI_DPP(7.0f * DT_DRAW_SIZE_GLOBAL_FACTOR)
90#define DT_DRAW_SCALE_DASH DT_PIXEL_APPLY_DPI_DPP(12.0f * DT_DRAW_SIZE_GLOBAL_FACTOR)
91#define DT_DRAW_SCALE_ARROW DT_PIXEL_APPLY_DPI_DPP(18.0f * DT_DRAW_SIZE_GLOBAL_FACTOR)
94#define DT_DRAW_RADIUS_NODE DT_PIXEL_APPLY_DPI_DPP(5.0f * DT_DRAW_SIZE_GLOBAL_FACTOR)
95#define DT_DRAW_RADIUS_NODE_SELECTED (1.25f * DT_DRAW_RADIUS_NODE)
100static inline void dt_draw_star(cairo_t *cr,
float x,
float y,
float r1,
float r2)
102 const float d = 2.0 *
M_PI * 0.1f;
103 const float dx[10] = { sinf(0.0), sinf(
d), sinf(2 *
d), sinf(3 *
d), sinf(4 *
d),
104 sinf(5 *
d), sinf(6 *
d), sinf(7 *
d), sinf(8 *
d), sinf(9 *
d) };
105 const float dy[10] = { cosf(0.0), cosf(
d), cosf(2 *
d), cosf(3 *
d), cosf(4 *
d),
106 cosf(5 *
d), cosf(6 *
d), cosf(7 *
d), cosf(8 *
d), cosf(9 *
d) };
108 cairo_move_to(cr,
x + r1 * dx[0], y - r1 * dy[0]);
109 for(
int k = 1;
k < 10;
k++)
111 cairo_line_to(cr,
x + r2 * dx[
k], y - r2 * dy[
k]);
113 cairo_line_to(cr,
x + r1 * dx[
k], y - r1 * dy[
k]);
114 cairo_close_path(cr);
118static inline void dt_draw_line(cairo_t *cr,
float left,
float top,
float right,
float bottom)
120 cairo_move_to(cr, left,
top);
121 cairo_line_to(cr, right, bottom);
150 const double amt = bright ? 0.5 + overlay->
contrast * 0.5
153 cairo_set_source_rgba(cr, overlay->
red * amt, overlay->
green * amt, overlay->
blue * amt, alpha);
158static inline void dt_draw_grid(cairo_t *cr,
const int num,
const int left,
const int top,
const int right,
161 float width = right - left;
164 for(
int k = 1;
k < num;
k++)
175 return (
x - offset) * zoom_factor;
180 const float right,
const float bottom,
const float width,
181 const float height,
const float zoom_factor,
const float zoom_offset_x,
182 const float zoom_offset_y)
184 for(
int k = 1;
k < num;
k++)
203 return logf(
x * (base - 1.0f) + 1.f) / logf(base);
207 const int bottom,
const float base)
209 float width = right - left;
212 for(
int k = 1;
k < num;
k++)
223 const int right,
const int bottom,
const float base)
225 float width = right - left;
228 for(
int k = 1;
k < num;
k++)
239 const int right,
const int bottom,
const float base)
241 float width = right - left;
244 for(
int k = 1;
k < num;
k++)
256 const int right,
const int bottom)
258 float width = right - left;
260 for(
int k = 1;
k < num;
k++)
262 cairo_move_to(cr, left +
k / (
float)num *
width,
top);
263 cairo_line_to(cr, left +
k / (
float)num *
width, bottom);
269 const int right,
const int bottom)
273 for(
int k = 1;
k < num;
k++)
275 cairo_move_to(cr, left,
top +
k / (
float)num *
height);
276 cairo_line_to(cr, right,
top +
k / (
float)num *
height);
284 c->csample.m_samplingRes = 0x10000;
285 c->csample.m_outputRes = 0x10000;
286 c->csample.m_Samples = (uint16_t *)malloc(
sizeof(uint16_t) * 0x10000);
288 c->c.m_spline_type =
type;
289 c->c.m_numAnchors = 0;
305 c->c.m_anchors[num].x =
x;
306 c->c.m_anchors[num].y = y;
320 for(
int k = 0;
k <
res;
k++) y[
k] =
min + (
max -
min) * c->csample.m_Samples[
k] * (1.0f / 0x10000);
327 c->csample.m_samplingRes =
res;
328 c->csample.m_outputRes = 0x10000;
334 const int res,
float *
x,
float *y)
336 c->csample.m_samplingRes =
res;
337 c->csample.m_outputRes = 0x10000;
343 const int res,
float *
x,
float *y)
345 c->csample.m_samplingRes =
res;
346 c->csample.m_outputRes = 0x10000;
352 const int res,
float *
x,
float *y,
const gboolean periodic)
362 float xa[20], ya[20];
365 for(
int i = 0;
i < c->c.m_numAnchors;
i++)
367 xa[
i] = c->c.m_anchors[
i].x;
368 ya[
i] = c->c.m_anchors[
i].y;
373 val =
interpolate_val(c->c.m_numAnchors, xa,
x, ya, ypp, c->c.m_spline_type);
376 return MIN(
MAX(val, c->c.m_min_y), c->c.m_max_y);
381 c->c.m_anchors[c->c.m_numAnchors].x =
x;
382 c->c.m_anchors[c->c.m_numAnchors].y = y;
391 cairo_move_to(cr, 0, 0);
392 for(
int k = 0;
k < 256;
k++) cairo_line_to(cr,
k, hist[channels *
k + channel]);
393 cairo_line_to(cr, 255, 0);
394 cairo_close_path(cr);
399 const float zoom_factor,
const float zoom_offset_x,
400 const float zoom_offset_y, gboolean
linear)
402 cairo_move_to(cr, -zoom_offset_x, -zoom_offset_y);
403 for(
int k = 0;
k < 256;
k++)
405 const float value = ((float)hist[channels *
k + channel] - zoom_offset_y) * zoom_factor;
406 const float hist_value =
value < 0 ? 0.f :
value;
407 cairo_line_to(cr, ((
float)
k - zoom_offset_x) * zoom_factor,
linear ? hist_value : logf(1.0f + hist_value));
409 cairo_line_to(cr, (255.f - zoom_offset_x), -zoom_offset_y * zoom_factor);
410 cairo_close_path(cr);
416 int32_t channel,
float base_log)
418 cairo_move_to(cr, 0, 0);
419 for(
int k = 0;
k < 256;
k++)
421 const float x = logf((
float)
k / 255.0f * (base_log - 1.0f) + 1.0f) / logf(base_log) * 255.0f;
422 const float y = hist[channels *
k + channel];
423 cairo_line_to(cr,
x, y);
425 cairo_line_to(cr, 255, 0);
426 cairo_close_path(cr);
432 int32_t channel,
float base_log)
434 cairo_move_to(cr, 0, 0);
435 for(
int k = 0;
k < 256;
k++)
437 const float x = logf((
float)
k / 255.0f * (base_log - 1.0f) + 1.0f) / logf(base_log) * 255.0f;
438 const float y = logf(1.0 + hist[channels *
k + channel]);
439 cairo_line_to(cr,
x, y);
441 cairo_line_to(cr, 255, 0);
442 cairo_close_path(cr);
450 cairo_move_to(cr, 0, 0);
451 for(
int k = 0;
k < 256;
k++) cairo_line_to(cr,
k, logf(1.0 + hist[channels *
k + channel]));
452 cairo_line_to(cr, 255, 0);
453 cairo_close_path(cr);
459 int32_t channel,
const gboolean
linear,
float base_log)
469static inline void dt_draw_histogram_8(cairo_t *cr,
const uint32_t *hist, int32_t channels, int32_t channel,
481 for(uint32_t y = 0; y <
height; y++)
484 uint8_t *
r, *
g, *b, *a, tmp;
485 r = &data[(y *
width +
x) * 4 + 0];
486 g = &data[(y *
width +
x) * 4 + 1];
487 b = &data[(y *
width +
x) * 4 + 2];
488 a = &data[(y *
width +
x) * 4 + 3];
498 float inv_a = 255.0 / *a;
509 cairo_pattern_add_color_stop_rgba(grad, 0.0, 0.0, 0.0, 0.0, alpha);
510 cairo_pattern_add_color_stop_rgba(grad, 1.0, 1.0, 1.0, 1.0, alpha);
515 void (*dtgtk_cairo_paint_fct)(cairo_t *cr, gint
x, gint y, gint w, gint h, gint
flags,
void *data))
518 GtkStyleContext *context = gtk_widget_get_style_context(widget);
519 GtkStateFlags
state = gtk_widget_get_state_flags(widget);
520 gtk_style_context_get_color(context,
state, &fg_color);
523 cairo_surface_t *cst = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, dim, dim);
524 cairo_t *cr = cairo_create(cst);
525 gdk_cairo_set_source_rgba(cr, &fg_color);
526 (*dtgtk_cairo_paint_fct)(cr, 0, 0, dim, dim,
flags, NULL);
528 uint8_t *data = cairo_image_surface_get_data(cst);
530 const size_t size = (size_t)dim * dim * 4;
531 uint8_t *buf = (uint8_t *)malloc(
size);
532 memcpy(buf, data,
size);
533 GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data(buf, GDK_COLORSPACE_RGB,
TRUE, 8, dim, dim, dim * 4,
534 (GdkPixbufDestroyNotify)free, NULL);
535 cairo_surface_destroy(cst);
544 const float degrees =
M_PI / 180.0;
545 cairo_new_sub_path(cr);
546 cairo_arc(cr,
x +
width - radius, y + radius, radius, -90 * degrees, 0 * degrees);
547 cairo_arc(cr,
x +
width - radius, y +
height - radius, radius, 0 * degrees, 90 * degrees);
548 cairo_arc(cr,
x + radius, y +
height - radius, radius, 90 * degrees, 180 * degrees);
549 cairo_arc(cr,
x + radius, y + radius, radius, 180 * degrees, 270 * degrees);
550 cairo_close_path(cr);
564 const float base_line_width = cairo_get_line_width(cr);
565 cairo_set_line_width(cr, base_line_width * line_width_scale);
567 cairo_move_to(cr,
x, y -
size);
568 cairo_line_to(cr,
x, y +
size);
569 cairo_move_to(cr,
x -
size, y);
570 cairo_line_to(cr,
x +
size, y);
573 cairo_set_line_width(cr, base_line_width);
583 cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
585 cairo_fill_preserve(cr);
588 cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
626 cairo_set_dash(cr, NULL, 0, 0);
650 cairo_set_dash(cr, NULL, 0, 0);
654 const int pattern_len = 2;
655 cairo_set_dash(cr, pattern, pattern_len, 0);
669static inline void dt_draw_node(cairo_t *cr,
const gboolean square,
const gboolean point_action,
const gboolean
selected,
const float zoom_scale,
const float x,
const float y)
676 cairo_new_sub_path(cr);
682 const float pos = node_width * 0.7071f;
683 cairo_rectangle(cr,
x - pos, y - pos, node_width * 2.f, node_width * 2.f);
686 cairo_arc(cr,
x, y, node_width * 1.2f, 0.0, 2.0 *
M_PI);
694 cairo_set_line_width(cr, line_width);
696 cairo_fill_preserve(cr);
699 cairo_set_line_width(cr, (
selected && !point_action) ? line_width * 2. : line_width);
706 cairo_arc(cr,
x, y, debug_radius, 0.0, 2.0 *
M_PI);
707 cairo_set_line_width(cr, line_width);
708 cairo_set_source_rgba(cr, 0.0, 1.0, 0.0, 1.0);
725static inline void dt_draw_handle(cairo_t *cr,
const float pt[2],
const float zoom_scale,
726 const float handle[2],
const gboolean
selected,
const gboolean square)
737 float delta_x = handle[0] - pt[0];
738 float delta_y = handle[1] - pt[1];
739 float start_x = pt[0] + delta_x;
740 float start_y = pt[1] + delta_y;
741 float end_x = handle[0] - delta_x;
742 float end_y = handle[1] - delta_y;
743 cairo_move_to(cr, start_x, start_y);
744 cairo_line_to(cr, end_x, end_y);
748 cairo_stroke_preserve(cr);
760 cairo_new_sub_path(cr);
764 const float square_width = handle_radius * 0.7071f;
765 cairo_rectangle(cr, handle[0] - square_width, handle[1] - square_width, square_width * 2.f, square_width * 2.f);
768 cairo_arc(cr, handle[0], handle[1], handle_radius, 0, 2.0 *
M_PI);
770 const float line_width_dark =
selected
773 const float line_width_bright =
selected
778 cairo_set_line_width(cr, line_width_dark * 1.125);
780 cairo_stroke_preserve(cr);
782 cairo_set_line_width(cr, line_width_bright * 1.5);
784 cairo_stroke_preserve(cr);
832 const float zoom_scale,
const float *points,
const int points_count,
const shape_draw_function_t *draw_shape_func,
const cairo_line_cap_t line_cap,
843 cairo_set_antialias(cr, CAIRO_ANTIALIAS_FAST);
845 cairo_set_line_cap(cr, line_cap);
850 if(points && points_count >= 2 && draw_shape_func)
851 (*draw_shape_func)(dev, cr, points, points_count, nb, border,
FALSE, skips, skip_count);
858 const float line_width_dark =
selected
861 const float line_width_bright =
selected
865 float alpha = dash_type ? 0.3f : 0.9f;
866 if(source) alpha *= 0.5f;
867 const float alpha_bright = source ? 0.4f : 0.8f;
876 const double dark_amount = (1.0 - overlay->
contrast) * 0.5;
877 const double bright_amount = 0.5 + overlay->
contrast * 0.5;
879 .red = overlay->
red * dark_amount,
880 .green = overlay->
green * dark_amount,
881 .blue = overlay->
blue * dark_amount,
884 .red = overlay->
red * bright_amount,
885 .green = overlay->
green * bright_amount,
886 .blue = overlay->
blue * bright_amount,
887 .alpha = alpha_bright };
889 style.
round_caps = (line_cap == CAIRO_LINE_CAP_ROUND);
897 cairo_set_line_width(cr, line_width_dark);
899 cairo_stroke_preserve(cr);
902 cairo_set_line_width(cr, line_width_bright);
946 double dx = 1.0, dy = 1.0;
947 cairo_device_to_user_distance(cr, &dx, &dy);
948 const double step = fmin(fabs(dx), fabs(dy));
949 return isfinite(step) ? step : 0.0;
953 const gboolean
selected,
const float zoom_scale,
const cairo_line_cap_t line_cap)
955 dt_draw_shape_lines(NULL, dash_type, source, cr, 0,
selected, zoom_scale, NULL, 0, NULL, line_cap, NULL, 0);
958static void _draw_arrow_head(cairo_t *cr,
const float arrow[2],
const float arrow_x_a,
const float arrow_y_a,
959 const float arrow_x_b,
const float arrow_y_b)
962 cairo_move_to(cr, arrow_x_a, arrow_y_a);
963 cairo_line_to(cr, arrow[0], arrow[1]);
964 cairo_line_to(cr, arrow_x_b, arrow_y_b);
966 cairo_close_path(cr);
970 const float tail[2],
const gboolean draw_tail)
972 if(draw_tail)
dt_draw_line(cr, arrow_bud_x, arrow_bud_y, tail[0], tail[1]);
988static inline void dt_draw_arrow(cairo_t *cr,
const float zoom_scale,
const gboolean
selected,
const gboolean draw_tail,
989 const dt_draw_dash_type_t dash_style,
const float arrow[2],
const float tail[2],
const float angle)
992 const float arrow_x_a = arrow[0] + (
DT_DRAW_SCALE_ARROW / zoom_scale) * cosf(angle + (0.4f));
993 const float arrow_y_a = arrow[1] + (
DT_DRAW_SCALE_ARROW / zoom_scale) * sinf(angle + (0.4f));
994 const float arrow_x_b = arrow[0] + (
DT_DRAW_SCALE_ARROW / zoom_scale) * cosf(angle - (0.4f));
995 const float arrow_y_b = arrow[1] + (
DT_DRAW_SCALE_ARROW / zoom_scale) * sinf(angle - (0.4f));
997 const float arrow_bud_x = (arrow_x_a + arrow_x_b) * 0.5f;
998 const float arrow_bud_y = (arrow_y_a + arrow_y_b) * 0.5f;
1001 cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);
1037 cairo_set_source_rgba(cr, 0., 0., 0., 0.);
1038 cairo_fill_preserve(cr);
1061static inline void dt_draw_cross(cairo_t *cr,
const float zoom_scale,
const float x,
const float y)
1067 cairo_set_line_cap(cr, CAIRO_LINE_CAP_SQUARE);
1072 cairo_move_to(cr,
x + dx, y);
1073 cairo_line_to(cr,
x - dx, y);
1074 cairo_move_to(cr,
x, y + dy);
1075 cairo_line_to(cr,
x, y - dy);
1076 cairo_stroke_preserve(cr);
1086 const float *source_pts,
const int source_pts_count,
const int nodes_nb,
const shape_draw_function_t *draw_shape_func)
1090 cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);
1095 (*draw_shape_func)(dev, cr, source_pts, source_pts_count, nodes_nb,
FALSE,
TRUE, NULL, 0);
1103 cairo_stroke_preserve(cr);
1118 cairo_surface_t *cst = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
width,
height);
1119 cairo_t *cr = cairo_create(cst);
1124 guchar *data = cairo_image_surface_get_data(cst);
1126 const int stride = cairo_image_surface_get_stride(cst);
1128 guchar *buf = (guchar *)malloc(
size);
1129 memcpy(buf, data,
size);
1130 cairo_surface_destroy(cst);
1132 return gdk_pixbuf_new_from_data(buf, GDK_COLORSPACE_RGB,
TRUE, 8,
width,
height,
1133 stride, (GdkPixbufDestroyNotify)free, NULL);
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
static const float const float const float min
GHashTable * selected
set of checked row labels, mirrored to conf on every change
static float dt_curve_to_mouse(const float x, const float zoom_factor, const float offset)
#define DT_DRAW_SCALE_DASH
#define DT_DRAW_SIZE_LINE
static void _draw_fill_clear(cairo_t *cr, gboolean preserve)
#define DT_DRAW_RADIUS_NODE_SELECTED
static void dt_draw_set_dash_style(cairo_t *cr, dt_draw_dash_type_t type, float zoom_scale)
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))
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)
static void dt_draw_stroke_line(const dt_draw_dash_type_t dash_type, const gboolean source, cairo_t *cr, const gboolean selected, const float zoom_scale, const cairo_line_cap_t line_cap)
static void dt_draw_horizontal_lines(cairo_t *cr, const int num, const int left, const int top, const int right, const int bottom)
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)
static void dt_draw_rounded_rectangle_path(cairo_t *cr, float x, float y, float width, float height, float radius)
static void dt_draw_handle(cairo_t *cr, const float pt[2], const float zoom_scale, const float handle[2], const gboolean selected, const gboolean square)
Draw a control handle attached to a point with a tail between the node and the handle.
#define DT_DRAW_SIZE_LINE_HIGHLIGHT
static void dt_draw_cross(cairo_t *cr, const float zoom_scale, const float x, const float y)
#define DT_DRAW_SIZE_LINE_SELECTED
static void dt_draw_histogram_8_logxlogy(cairo_t *cr, const uint32_t *hist, int32_t channels, int32_t channel, float base_log)
void(* shape_draw_function_t)(struct dt_develop_t *dev, cairo_t *cr, const float *points, const int points_count, const int nb, const gboolean border, const gboolean source, const struct dt_masks_skip_range_t *skips, const int skip_count)
static void dt_draw_cairo_to_gdk_pixbuf(uint8_t *data, unsigned int width, unsigned int height)
static void dt_draw_plus_sign(cairo_t *cr, float x, float y, float size, float line_width_scale)
static void dt_draw_histogram_8_linxlogy(cairo_t *cr, const uint32_t *hist, int32_t channels, int32_t channel)
static float dt_log_scale_axis(const float x, const float base)
static double dt_draw_min_emit_step(cairo_t *cr)
Stroke a line with style.
static void _fill_clear_preserve(cairo_t *cr)
static void dt_draw_dash_lengths(const dt_draw_dash_type_t type, const float zoom_scale, double *on, double *off)
static void dt_draw_set_color_overlay(cairo_t *cr, gboolean bright, double alpha)
static void dt_draw_line(cairo_t *cr, float left, float top, float right, float bottom)
static void dt_draw_source_shape(struct dt_develop_t *dev, cairo_t *cr, const float zoom_scale, const gboolean selected, const float *source_pts, const int source_pts_count, const int nodes_nb, const shape_draw_function_t *draw_shape_func)
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)
static void dt_draw_histogram_8_linxliny(cairo_t *cr, const uint32_t *hist, int32_t channels, int32_t channel)
static void dt_draw_vertical_lines(cairo_t *cr, const int num, const int left, const int top, const int right, const int bottom)
static void set_color(cairo_t *cr, GdkRGBA color)
static void dt_draw_grid(cairo_t *cr, const int num, const int left, const int top, const int right, const int bottom)
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)
static float dt_draw_curve_calc_value(dt_draw_curve_t *c, const float x)
static void dt_cairo_perceptual_gradient(cairo_pattern_t *grad, double alpha)
static void dt_draw_star(cairo_t *cr, float x, float y, float r1, float r2)
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)
#define DT_DRAW_SCALE_ARROW
static void dt_draw_curve_destroy(dt_draw_curve_t *c)
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)
#define DT_DRAW_SIZE_CROSS
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)
#define DT_DRAW_RADIUS_NODE
static void dt_draw_curve_set_point(dt_draw_curve_t *c, const int num, const float x, const float y)
static void dt_gui_draw_rounded_rectangle(cairo_t *cr, float width, float height, float x, float y)
static void dt_draw_arrow(cairo_t *cr, const float zoom_scale, const gboolean selected, const gboolean draw_tail, const dt_draw_dash_type_t dash_style, const float arrow[2], const float tail[2], const float angle)
Draw an arrow with head and, if needed, tail. The length of the arrow head is defined by DT_DRAW_SCAL...
static int dt_draw_curve_add_point(dt_draw_curve_t *c, const float x, const float y)
static void dt_draw_histogram_8_logxliny(cairo_t *cr, const uint32_t *hist, int32_t channels, int32_t channel, float base_log)
static GdkPixbuf * dt_draw_get_pixbuf_from_cairo(DTGTKCairoPaintIconFunc paint, const int width, const int height)
static void dt_draw_shape_lines(struct dt_develop_t *dev, const dt_draw_dash_type_t dash_type, const gboolean source, cairo_t *cr, const int nb, const gboolean selected, const float zoom_scale, const float *points, const int points_count, const shape_draw_function_t *draw_shape_func, const cairo_line_cap_t line_cap, const struct dt_masks_skip_range_t *skips, const int skip_count)
Draw the lines of a mask shape.
static void _fill_clear(cairo_t *cr)
#define DT_DRAW_SIZE_LINE_HIGHLIGHT_SELECTED
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)
static void dt_draw_histogram_8(cairo_t *cr, const uint32_t *hist, int32_t channels, int32_t channel, const gboolean linear)
static dt_draw_curve_t * dt_draw_curve_new(const float min, const float max, unsigned int type)
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)
static void _draw_arrow_head(cairo_t *cr, const float arrow[2], const float arrow_x_a, const float arrow_y_a, const float arrow_x_b, const float arrow_y_b)
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)
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)
static void dt_draw_node(cairo_t *cr, const gboolean square, const gboolean point_action, const gboolean selected, const float zoom_scale, const float x, const float y)
Draw an node point of a mask.
static void _draw_arrow_tail(cairo_t *cr, const float arrow_bud_x, const float arrow_bud_y, const float tail[2], const gboolean draw_tail)
_lib_location_type_t type
float *const restrict const size_t k
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
dt_mipmap_buffer_dsc_flags flags
#define __OMP_DECLARE_SIMD__(...)
#define __OMP_PARALLEL_FOR_SIMD__(...)
static const dt_aligned_pixel_simd_t value
int CurveDataSampleV2Periodic(CurveData *curve, CurveSample *sample)
int CurveDataSampleV2(CurveData *curve, CurveSample *sample)
const float uint32_t state[4]
gboolean dt_stroke_raster_path(cairo_t *cr, const dt_stroke_style_t *style)
One cut in a shape's border outline: while walking the border buffer forward, on reaching index jump_...