![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/curve_tools.h"#include "common/darktable.h"#include "common/splines.h"#include "control/conf.h"#include "develop/develop.h"#include <cairo.h>#include <glib.h>#include <math.h>#include <stdint.h>#include <stdlib.h>#include <gui/gtk.h>
Include dependency graph for draw.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | dt_draw_curve_t |
Typedefs | |
| typedef enum dt_draw_dash_type_t | dt_draw_dash_type_t |
| typedef struct dt_draw_curve_t | dt_draw_curve_t |
| typedef void(* | shape_draw_function_t) (cairo_t *cr, const float *points, const int points_count, const int nb, const gboolean border, const gboolean source) |
Enumerations | |
| enum | dt_draw_dash_type_t { DT_MASKS_NO_DASH = 0 , DT_MASKS_DASH_STICK = 1 , DT_MASKS_DASH_ROUND = 2 } |
Functions | |
| static void | dt_draw_set_color_overlay (cairo_t *cr, gboolean bright, double alpha) |
| static void | dt_draw_star (cairo_t *cr, float x, float y, float r1, float r2) |
| static void | dt_draw_line (cairo_t *cr, float left, float top, float right, float bottom) |
| static void | dt_draw_grid (cairo_t *cr, const int num, const int left, const int top, const int right, const int bottom) |
| static float | dt_curve_to_mouse (const float x, const float zoom_factor, const float offset) |
| 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 float | dt_log_scale_axis (const float x, const float base) |
| 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 | 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_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 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 | dt_draw_horizontal_lines (cairo_t *cr, const int num, const int left, const int top, const int right, const int bottom) |
| static dt_draw_curve_t * | dt_draw_curve_new (const float min, const float max, unsigned int type) |
| static void | dt_draw_curve_destroy (dt_draw_curve_t *c) |
| static void | dt_draw_curve_set_point (dt_draw_curve_t *c, const int num, const float x, const float y) |
| 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_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_curve_calc_values_V2_nonperiodic (dt_draw_curve_t *c, const float min, const float max, const int res, float *x, float *y) |
| 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_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) |
| static float | dt_draw_curve_calc_value (dt_draw_curve_t *c, const float x) |
| static int | dt_draw_curve_add_point (dt_draw_curve_t *c, const float x, const 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_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_histogram_8_logxliny (cairo_t *cr, const uint32_t *hist, int32_t channels, int32_t channel, float base_log) |
| static void | dt_draw_histogram_8_logxlogy (cairo_t *cr, const uint32_t *hist, int32_t channels, int32_t channel, float base_log) |
| static void | dt_draw_histogram_8_linxlogy (cairo_t *cr, const uint32_t *hist, int32_t channels, int32_t channel) |
| 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) |
| static void | dt_draw_histogram_8 (cairo_t *cr, const uint32_t *hist, int32_t channels, int32_t channel, const gboolean linear) |
| static void | dt_draw_cairo_to_gdk_pixbuf (uint8_t *data, unsigned int width, unsigned int height) |
| static void | dt_cairo_perceptual_gradient (cairo_pattern_t *grad, double alpha) |
| 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 | _draw_fill_clear (cairo_t *cr, gboolean preserve) |
| static void | _fill_clear (cairo_t *cr) |
| static void | _fill_clear_preserve (cairo_t *cr) |
| static void | dt_draw_set_dash_style (cairo_t *cr, dt_draw_dash_type_t type, float zoom_scale) |
| 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 | 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. | |
| static void | dt_draw_shape_lines (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) |
| Draw the lines of a mask shape. | |
| 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) |
| Stroke a line with style. | |
| 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 | _draw_arrow_tail (cairo_t *cr, const float arrow_bud_x, const float arrow_bud_y, const float tail[2], const gboolean draw_tail) |
| 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_SCALE_ARROW. This is used for the clone mask source indicator. | |
| static void | dt_draw_cross (cairo_t *cr, const float zoom_scale, const float x, const float y) |
| static void | dt_draw_source_shape (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 GdkPixbuf * | dt_draw_get_pixbuf_from_cairo (DTGTKCairoPaintIconFunc paint, const int width, const int height) |
| #define DT_DRAW_RADIUS_NODE DT_PIXEL_APPLY_DPI_DPP(5.0f * DT_DRAW_SIZE_GLOBAL_FACTOR) |
| #define DT_DRAW_RADIUS_NODE_SELECTED (1.25f * DT_DRAW_RADIUS_NODE) |
| #define DT_DRAW_SCALE_ARROW DT_PIXEL_APPLY_DPI_DPP(18.0f * DT_DRAW_SIZE_GLOBAL_FACTOR) |
| #define DT_DRAW_SCALE_DASH DT_PIXEL_APPLY_DPI_DPP(12.0f * DT_DRAW_SIZE_GLOBAL_FACTOR) |
stuff's scale
| #define DT_DRAW_SELECTION_ROTATION_AREA DT_PIXEL_APPLY_DPI_DPP(50.0f) |
| #define DT_DRAW_SELECTION_ROTATION_RADIUS | ( | dev | ) | (DT_DRAW_SELECTION_ROTATION_AREA / dt_dev_get_zoom_level((dt_develop_t *)dev)) |
| #define DT_DRAW_SIZE_CROSS DT_PIXEL_APPLY_DPI_DPP(7.0f * DT_DRAW_SIZE_GLOBAL_FACTOR) |
| #define DT_DRAW_SIZE_GLOBAL_FACTOR 0.75f |
| #define DT_DRAW_SIZE_LINE DT_PIXEL_APPLY_DPI_DPP(1.5f * DT_DRAW_SIZE_GLOBAL_FACTOR) |
line sizes for drawing
| #define DT_DRAW_SIZE_LINE_HIGHLIGHT (DT_PIXEL_APPLY_DPI_DPP(4.0f * DT_DRAW_SIZE_GLOBAL_FACTOR) + DT_DRAW_SIZE_LINE) |
| #define DT_DRAW_SIZE_LINE_HIGHLIGHT_SELECTED (DT_PIXEL_APPLY_DPI_DPP(5.0f * DT_DRAW_SIZE_GLOBAL_FACTOR) + DT_DRAW_SIZE_LINE_SELECTED) |
| #define DT_DRAW_SIZE_LINE_SELECTED DT_PIXEL_APPLY_DPI_DPP(3.0f * DT_DRAW_SIZE_GLOBAL_FACTOR) |
| #define M_PI 3.141592654 |
some common drawing routines.
| typedef struct dt_draw_curve_t dt_draw_curve_t |
wrapper around nikon curve.
| typedef enum dt_draw_dash_type_t dt_draw_dash_type_t |
dash type
| typedef void(* shape_draw_function_t) (cairo_t *cr, const float *points, const int points_count, const int nb, const gboolean border, const gboolean source) |
| enum dt_draw_dash_type_t |
|
static |
Referenced by dt_draw_arrow().
|
static |
References dt_draw_line().
Referenced by dt_draw_arrow().
|
static |
Referenced by _fill_clear(), and _fill_clear_preserve().
|
static |
References _draw_fill_clear(), and FALSE.
Referenced by dt_draw_handle().
|
static |
References _draw_fill_clear(), and TRUE.
Referenced by dt_draw_arrow(), and dt_draw_node().
Referenced by _init_drawing(), and dt_iop_tonecurve_draw().
|
inlinestatic |
References x.
Referenced by dt_draw_grid_zoomed().
|
inlinestatic |
Draw an arrow with head and, if needed, tail. The length of the arrow head is defined by DT_DRAW_SCALE_ARROW. This is used for the clone mask source indicator.
| cr | the cairo context to draw into |
| zoom_scale | the current zoom scale of the image |
| selected | TRUE if the shape needs to be highlighted |
| draw_tail | TRUE to draw the tail line |
| dash_style | the dash style to use for the tail line |
| arrow | the position of the arrow tip |
| tail | the position of the tail point |
References _draw_arrow_head(), _draw_arrow_tail(), _fill_clear_preserve(), DT_DRAW_SCALE_ARROW, dt_draw_set_color_overlay(), dt_draw_set_dash_style(), DT_DRAW_SIZE_LINE, DT_DRAW_SIZE_LINE_HIGHLIGHT, DT_DRAW_SIZE_LINE_HIGHLIGHT_SELECTED, DT_MASKS_NO_DASH, FALSE, and TRUE.
Referenced by dt_masks_draw_source().
|
inlinestatic |
transform a data blob from cairo's premultiplied rgba/bgra to GdkPixbuf's un-premultiplied bgra/rgba
References a, b, g, height, r, width, and x.
Referenced by _draw_ellipse(), _draw_rectangle(), _init_image_pin(), _init_place_pin(), _view_map_images_count(), dt_draw_get_pixbuf_from_cairo(), dt_draw_paint_to_pixbuf(), and tree_insert_presets().
|
inlinestatic |
References dt_draw_set_color_overlay(), dt_draw_set_dash_style(), DT_DRAW_SIZE_CROSS, DT_DRAW_SIZE_LINE, DT_DRAW_SIZE_LINE_HIGHLIGHT, DT_MASKS_NO_DASH, FALSE, TRUE, and x.
Referenced by dt_masks_draw_source_preview().
|
inlinestatic |
|
inlinestatic |
References c, dt_free, i, interpolate_set(), interpolate_val(), MAX, MIN, and x.
Referenced by _area_button_press_callback(), _area_button_press_callback(), area_button_press(), denoiseprofile_button_press(), dt_iop_basecurve_button_press(), dt_iop_tonecurve_button_press(), get_scales(), lowlight_button_press(), process(), and rawdenoise_button_press().
|
inlinestatic |
References c, CurveDataSample(), dt_draw_curve_smaple_values(), max, min, and x.
Referenced by _area_draw_callback(), _area_draw_callback(), _generate_curve_lut(), area_draw(), commit_params(), commit_params(), compute_curve_lut(), denoiseprofile_draw(), dt_iop_basecurve_draw(), dt_iop_tonecurve_draw(), lowlight_draw(), and rawdenoise_draw().
|
inlinestatic |
References c, dt_draw_curve_calc_values_V2_nonperiodic(), dt_draw_curve_calc_values_V2_periodic(), max, min, and x.
Referenced by _area_draw_callback(), and commit_params().
|
inlinestatic |
References c, CurveDataSampleV2(), dt_draw_curve_smaple_values(), max, min, and x.
Referenced by dt_draw_curve_calc_values_V2().
|
inlinestatic |
References c, CurveDataSampleV2Periodic(), dt_draw_curve_smaple_values(), max, min, and x.
Referenced by dt_draw_curve_calc_values_V2().
|
inlinestatic |
|
inlinestatic |
References c, dt_draw_curve_t::csample, CurveSample::m_samplingRes, and type.
Referenced by _area_draw_callback(), _area_draw_callback(), _generate_curve_lut(), commit_params(), compute_curve_lut(), dt_iop_basecurve_draw(), dt_iop_tonecurve_draw(), gui_init(), gui_init(), and init_pipe().
|
inlinestatic |
|
inlinestatic |
References c, max, min, and x.
Referenced by dt_draw_curve_calc_values(), dt_draw_curve_calc_values_V2_nonperiodic(), and dt_draw_curve_calc_values_V2_periodic().
|
inlinestatic |
References dt_draw_cairo_to_gdk_pixbuf(), DT_GUI_COLOR_BUTTON_FG, dt_gui_gtk_set_source_rgba(), height, TRUE, and width.
Referenced by _blendop_masks_init_icons(), dt_masks_create_menu(), and gui_init().
|
inlinestatic |
References dt_draw_line(), height, top, and width.
Referenced by _process_histogram(), _process_waveform(), area_draw(), area_draw(), denoiseprofile_draw(), dt_iop_basecurve_draw(), dt_iop_tonecurve_draw(), dt_iop_tonecurve_draw(), dt_iop_tonecurve_draw(), lowlight_draw(), and rawdenoise_draw().
|
inlinestatic |
References dt_curve_to_mouse(), dt_draw_line(), height, top, and width.
Referenced by _area_draw_callback().
|
inlinestatic |
Draw a control handle attached to a point with a tail between the node and the handle.
| cr | the cairo context to draw into |
| pt | the node point position (pt[0]=x, pt[1]=y, use NULL if no tail should be drawn) |
| zoom_scale | the current zoom scale of the image |
| handle | the handle point position (handle[0]=x, handle[1]=y) |
| selected | TRUE if the shape is selected |
| square | TRUE to draw a square handle, FALSE to draw a round handle |
References _fill_clear(), DT_DRAW_RADIUS_NODE, DT_DRAW_RADIUS_NODE_SELECTED, dt_draw_set_color_overlay(), DT_DRAW_SIZE_LINE, DT_DRAW_SIZE_LINE_HIGHLIGHT, DT_DRAW_SIZE_LINE_HIGHLIGHT_SELECTED, DT_DRAW_SIZE_LINE_SELECTED, FALSE, M_PI, and TRUE.
Referenced by _brush_events_post_expose(), and _polygon_events_post_expose().
|
inlinestatic |
References dt_draw_histogram_8_linxliny(), dt_draw_histogram_8_linxlogy(), and linear.
Referenced by _area_draw_callback(), _process_histogram(), dt_iop_levels_area_draw(), and dt_iop_tonecurve_draw().
|
inlinestatic |
Referenced by dt_draw_histogram_8().
|
inlinestatic |
Referenced by dt_draw_histogram_8().
|
inlinestatic |
References dt_draw_histogram_8_logxliny(), dt_draw_histogram_8_logxlogy(), and linear.
Referenced by dt_iop_tonecurve_draw().
|
inlinestatic |
References x.
Referenced by dt_draw_histogram_8_log_base().
|
inlinestatic |
References x.
Referenced by dt_draw_histogram_8_log_base().
|
inlinestatic |
Referenced by _area_draw_callback(), and _area_draw_callback().
|
inlinestatic |
Referenced by dt_guides_draw_grid().
|
inlinestatic |
References top.
Referenced by _draw_arrow_tail(), _draw_line(), dt_draw_grid(), dt_draw_grid_zoomed(), dt_draw_loglog_grid(), dt_draw_semilog_x_grid(), dt_draw_semilog_y_grid(), dt_guides_draw_diagonal_method(), dt_guides_draw_golden_mean(), dt_guides_draw_harmonious_triangles(), dt_guides_draw_metering(), dt_guides_draw_perspective(), and dt_guides_draw_rules_of_thirds().
|
inlinestatic |
References dt_draw_line(), dt_log_scale_axis(), height, top, width, and x.
Referenced by dt_iop_basecurve_draw(), dt_iop_tonecurve_draw(), and dt_iop_tonecurve_draw().
|
inlinestatic |
Draw an node point of a mask.
| cr | the cairo context to draw into |
| square | TRUE to draw a square node, FALSE to draw a round node |
| point_action | TRUE if the point is selected or dragged |
| selected | TRUE if the shape is selected |
| zoom_scale | the current zoom scale of the image |
| x | the center x position of the anchor |
| y | the center y position of the anchor |
References _fill_clear_preserve(), darktable, DT_DEBUG_MASKS, DT_DRAW_RADIUS_NODE, DT_DRAW_RADIUS_NODE_SELECTED, dt_draw_set_color_overlay(), DT_DRAW_SIZE_LINE, DT_DRAW_SIZE_LINE_SELECTED, DT_GUI_MOUSE_EFFECT_RADIUS_SCALED, FALSE, M_PI, TRUE, darktable_t::unmuted, and x.
Referenced by _brush_events_post_expose(), _ellipse_draw_node(), _ellipse_events_post_expose(), _gradient_draw_arrow(), and _polygon_events_post_expose().
|
inlinestatic |
References dt_draw_cairo_to_gdk_pixbuf(), DT_PIXEL_APPLY_DPI, flags, size, and TRUE.
Referenced by _gui_styles_dialog_run(), and dt_gui_hist_dialog_new().
|
inlinestatic |
References dt_draw_line(), dt_log_scale_axis(), height, top, width, and x.
Referenced by dt_iop_tonecurve_draw().
|
inlinestatic |
References dt_draw_line(), dt_log_scale_axis(), height, top, width, and x.
Referenced by dt_iop_tonecurve_draw().
set color based on gui overlay preference
References darktable, darktable_t::gui, dt_gui_gtk_t::overlay_blue, dt_gui_gtk_t::overlay_contrast, dt_gui_gtk_t::overlay_green, and dt_gui_gtk_t::overlay_red.
Referenced by _draw_sym(), _gradient_draw_arrow(), dt_draw_arrow(), dt_draw_cross(), dt_draw_handle(), dt_draw_node(), dt_draw_shape_lines(), dt_draw_source_shape(), dt_guides_draw(), dt_guides_draw_grid(), gui_draw_sym(), gui_post_expose(), and gui_post_expose().
|
inlinestatic |
References DT_DRAW_SCALE_DASH, DT_MASKS_DASH_ROUND, DT_MASKS_DASH_STICK, DT_MASKS_NO_DASH, and type.
Referenced by _brush_events_post_expose(), dt_draw_arrow(), dt_draw_cross(), dt_draw_shape_lines(), and dt_draw_source_shape().
|
inlinestatic |
Draw the lines of a mask shape.
| dash_type | the dash type to use |
| source | TRUE if we draw the source shape (clone mask) |
| cr | the cairo context to draw into |
| nb | the number of coord by node |
| selected | TRUE if the shape is selected |
| zoom_scale | the current zoom scale of the image |
| points | the points of the shape to draw |
| points_count | the number of points in the shape |
| functions | the functions table of the shape |
References dt_draw_set_color_overlay(), dt_draw_set_dash_style(), DT_DRAW_SIZE_LINE, DT_DRAW_SIZE_LINE_HIGHLIGHT, DT_DRAW_SIZE_LINE_HIGHLIGHT_SELECTED, DT_DRAW_SIZE_LINE_SELECTED, DT_MASKS_NO_DASH, FALSE, and TRUE.
Referenced by _brush_events_post_expose(), _circle_events_post_expose(), _ellipse_events_post_expose(), _gradient_events_post_expose(), _polygon_events_post_expose(), dt_draw_stroke_line(), and dt_masks_draw_preview_shape().
|
inlinestatic |
|
inlinestatic |
draws a rating star
Referenced by dtgtk_cairo_paint_overlays(), dtgtk_cairo_paint_star(), and dtgtk_cairo_paint_unratestar().
|
inlinestatic |
Stroke a line with style.
| dash_type | the dash type to use |
| source | TRUE if we draw the source shape (clone mask) |
| cr | the cairo context to draw into |
| selected | TRUE if the shape is selected |
| zoom_scale | the current zoom scale of the image |
References dt_draw_shape_lines().
Referenced by _brush_events_post_expose(), _gradient_draw_arrow(), and dt_masks_draw_path_seg_by_seg().
|
inlinestatic |
Referenced by _area_draw_callback(), dt_guides_draw_grid(), and dt_iop_levels_area_draw().
|
inlinestatic |
References x.
Referenced by dt_draw_loglog_grid(), dt_draw_semilog_x_grid(), dt_draw_semilog_y_grid(), and dt_iop_tonecurve_draw().