![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "control/control.h"#include "math/math.h"#include "system/macros.h"#include "system/openmp.h"#include "system/mem_alloc.h"#include "common/logging.h"#include "common/times.h"#include "common/glib_utils.h"#include "caches/pixelpipe_cache_alloc.h"#include "common/conf.h"#include "develop/imageop.h"#include "develop/masks/masks_distort.h"#include "develop/masks.h"#include "develop/masks_gui.h"#include "develop/blend_gui.h"#include "develop/masks/masks_functions.h"#include "develop/masks/masks_touched.h"#include "math/openmp_maths.h"#include "gui/actions/menu.h"#include "widgets/accelerators.h"#include "widgets/widget_settings.h"
Include dependency graph for develop/masks/brush.c:Go to the source code of this file.
Data Structures | |
| struct | _brush_frame_t |
| struct | _brush_walk_t |
| struct | _brush_span_t |
| struct | _brush_sample_t |
| struct | _brush_walk_state_t |
| struct | _brush_outline_t |
Macros | |
| #define | FADING_MIN 0.00001f |
| #define | FADING_MAX 1.0f |
| #define | BORDER_MIN 0.00005f |
| #define | BORDER_MAX 0.5f |
Typedefs | |
| typedef struct _brush_frame_t | _brush_frame_t |
| typedef struct _brush_walk_t | _brush_walk_t |
| typedef struct _brush_span_t | _brush_span_t |
| typedef struct _brush_sample_t | _brush_sample_t |
| typedef struct _brush_walk_state_t | _brush_walk_state_t |
| typedef struct _brush_outline_t | _brush_outline_t |
Functions | |
| static float | _brush_point_line_distance2 (int point_index, int point_count, const float *point_buffer, const float *payload_buffer) |
| Get squared distance of a point to the segment, including payload deltas. | |
| static GList * | _brush_ramer_douglas_peucker (const float *point_buffer, int point_count, const float *payload_buffer, float epsilon2) |
| Remove unneeded points (Ramer-Douglas-Peucker) and return the reduced path. | |
| static void | _brush_get_XY (float p0_x, float p0_y, float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float t, float *out_x, float *out_y) |
| Evaluate a cubic Bezier at t in [0, 1]. | |
| static gboolean | _brush_border_get_XY (float p0_x, float p0_y, float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float t, float radius, float radius_rate, float *point_x, float *point_y, float *border_x, float *border_y) |
| Evaluate a cubic Bezier and compute its offset border point. | |
| static float | _brush_radius_at (const float r1, const float r2, const double t) |
| static float | _brush_radius_rate_at (const float r1, const float r2, const double t) |
| static void | _brush_ctrl2_to_handle (float point_x, float point_y, float ctrl_x, float ctrl_y, float *handle_x, float *handle_y, gboolean clockwise) |
| Convert control point 2 into the handle position (orthonormal space). | |
| static gboolean | _brush_get_border_handle_resampled (const dt_masks_form_gui_points_t *gui_points, int node_count, int node_index, float *handle_x, float *handle_y) |
| get the border handle position corresponding to a node, by looking for the closest border point in the resampled points of the form GUI. | |
| static gboolean | _brush_get_border_handle_mirrored (const dt_masks_form_gui_points_t *gui_points, int node_count, int node_index, float *handle_x, float *handle_y) |
| static void | _brush_handle_to_ctrl (float ptx, float pty, float fx, float fy, float *ctrl1x, float *ctrl1y, float *ctrl2x, float *ctrl2y, gboolean clockwise) |
| static void | _brush_catmull_to_bezier (float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, float *bezier1_x, float *bezier1_y, float *bezier2_x, float *bezier2_y) |
| Get Bezier control points that match a Catmull-Rom segment. | |
| static void | _brush_init_ctrl_points (dt_masks_form_t *mask_form) |
| Initialize all control points to match a Catmull-Rom-like spline. | |
| static void | _brush_points_recurs_border_gaps (float *cmax, float *bmin, float *bmax, dt_masks_dynbuf_t *dpoints, dt_masks_dynbuf_t *dborder, gboolean clockwise, const int step) |
| static void | _brush_points_recurs_border_small_gaps (float *cmax, float *bmin, float *bmax, dt_masks_dynbuf_t *dpoints, dt_masks_dynbuf_t *dborder, const int step) |
| static void | _brush_points_stamp (const float *const centre, const float *const from_border, const float radius, dt_masks_dynbuf_t *dpoints, dt_masks_dynbuf_t *dborder, const int step) |
| static gboolean | _is_within_pxl_threshold (const float *const min, const float *const max, const int pixel_threshold) |
| static void | _brush_payload_sync (dt_masks_dynbuf_t *dpayload, dt_masks_dynbuf_t *dpoints, const float v0, const float v1) |
| static gboolean | _brush_span_is_leaf (const double tmin, const double tmax, const float *const points_min, const float *const points_max, const float *const border_min, const float *const border_max, const int pixel_threshold) |
| static void | _brush_leaf_borrow_border (float *const border_min, float *const border_max, const gboolean have_min, const gboolean have_max, const float *const centre, const float *const chord, const float radius) |
| static void | _brush_points_recurs (const float *const p1, const float *const p2, const _brush_span_t *const span, const _brush_walk_t *const w, _brush_sample_t *const out) |
| static void | _brush_segment_load (const dt_masks_node_brush_t *const from, const dt_masks_node_brush_t *const to, const gboolean forward, const _brush_frame_t *const frame, float p1[7], float p2[7]) |
| static void | _brush_joint_arc (const float *const centre, const float *const from, const float *const to, const gboolean forward, dt_masks_dynbuf_t *dpoints, dt_masks_dynbuf_t *dborder, const int step) |
| static void | _brush_walk_sync_payload (const _brush_walk_t *const w, const float *const payload) |
| static void | _brush_walk_node (const _brush_walk_t *const w, const _brush_walk_state_t *const s, const float *const p1, const float *const p2, const float *const c0, const float *const b0, const gboolean forward) |
| static gboolean | _brush_walk_segment (const _brush_walk_t *const w, _brush_walk_state_t *const s, const int k, const int k1, const gboolean forward) |
| static void | _brush_walk_cap (const _brush_walk_t *const w, const _brush_walk_state_t *const s) |
| static gboolean | _brush_walk_pass (const _brush_walk_t *const w, const gboolean forward) |
| static void | _brush_walk_single_dab (const _brush_walk_t *const w) |
| static gboolean | _brush_bufs_alloc (const gboolean want_border, const gboolean want_payload, dt_masks_dynbuf_t **dpoints, dt_masks_dynbuf_t **dborder, dt_masks_dynbuf_t **dpayload) |
| static gboolean | _brush_outline_transform (dt_develop_t *develop, const dt_masks_form_t *const mask_form, const double iop_order, const int transform_direction, const dt_masks_distort_t *const dist, const int use_source, const _brush_outline_t *const o) |
| static int | _brush_get_pts_border (dt_develop_t *develop, dt_masks_form_t *mask_form, const double iop_order, const int transform_direction, const dt_masks_distort_t *const dist, float **point_buffer, int *point_count, float **border_buffer, int *border_count, float **payload_buffer, int *payload_count, dt_masks_skip_range_t **border_skips, int *border_skip_count, int use_source) |
| static void | _brush_get_distance (float point_x, float point_y, float radius, dt_masks_form_gui_t *mask_gui, int form_index, int corner_count, int *inside, int *inside_border, int *near_handle, int *inside_source, float *distance) |
| Get the distance between a point and the brush path/border. | |
| static dt_masks_raster_result_t | _brush_get_points_border (dt_develop_t *develop, dt_masks_form_t *mask_form, float **point_buffer, int *point_count, float **border_buffer, int *border_count, dt_masks_skip_range_t **border_skips, int *border_skip_count, int use_source, const dt_iop_module_t *module) |
| static float | _brush_get_position_in_segment (float point_x, float point_y, dt_masks_form_t *mask_form, int segment_index) |
| static gboolean | _brush_border_handle_cb (const dt_masks_form_gui_points_t *gui_points, int node_count, int node_index, float *handle_x, float *handle_y, void *user_data) |
| Brush-specific border handle lookup. | |
| static void | _brush_curve_handle_cb (const dt_masks_form_gui_points_t *gui_points, int node_index, float *handle_x, float *handle_y, void *user_data) |
| Brush-specific curve handle lookup. | |
| static void | _brush_distance_cb (float pointer_x, float pointer_y, float cursor_radius, dt_masks_form_gui_t *mask_gui, int form_index, int node_count, int *inside, int *inside_border, int *near_handle, int *inside_source, float *dist, void *user_data) |
| Brush-specific inside/border/segment hit testing. | |
| static int | _find_closest_handle (dt_masks_form_t *mask_form, dt_masks_form_gui_t *mask_gui, int form_index) |
| static int | _init_fading (dt_masks_form_t *mask_form, int parentid, dt_masks_form_gui_t *mask_gui, const float amount, const dt_masks_increment_t increment, const int flow) |
| static int | _init_size (dt_masks_form_t *mask_form, int parentid, dt_masks_form_gui_t *mask_gui, const float amount, const dt_masks_increment_t increment, const int flow) |
| static int | _init_opacity (dt_masks_form_t *mask_form, int parentid, dt_masks_form_gui_t *mask_gui, const float amount, const dt_masks_increment_t increment, const int flow) |
| static float | _brush_get_interaction_value (const dt_masks_form_t *mask_form, dt_masks_interaction_t interaction) |
| static gboolean | _brush_get_gravity_center (dt_develop_t *dev, const dt_masks_form_t *mask_form, float center[2], float *area) |
| static int | _change_fading (dt_masks_form_t *mask_form, int parentid, dt_masks_form_gui_t *mask_gui, struct dt_iop_module_t *module, int index, const float amount, const dt_masks_increment_t increment, const int flow) |
| static int | _change_size (dt_masks_form_t *mask_form, int parentid, dt_masks_form_gui_t *mask_gui, struct dt_iop_module_t *module, int index, const float amount, const dt_masks_increment_t increment, const int flow) |
| static float | _brush_set_interaction_value (dt_masks_form_t *mask_form, dt_masks_interaction_t interaction, float value, dt_masks_increment_t increment, int flow, dt_masks_form_gui_t *mask_gui, struct dt_iop_module_t *module) |
| static int | _brush_events_mouse_scrolled (struct dt_iop_module_t *module, double widget_x, double widget_y, int scroll_up, const int flow, uint32_t state, dt_masks_form_t *mask_form, int parentid, dt_masks_form_gui_t *mask_gui, int index, dt_masks_interaction_t interaction) |
| static void | _get_pressure_sensitivity (dt_masks_form_gui_t *mask_gui) |
| static void | _add_node_to_segment (struct dt_iop_module_t *module, dt_masks_form_t *mask_form, int parentid, dt_masks_form_gui_t *mask_gui, int index) |
| static void | _brush_translate_node (dt_masks_node_brush_t *node, const float delta_x, const float delta_y) |
| static void | _brush_translate_all_nodes (dt_masks_form_t *mask_form, const float delta_x, const float delta_y) |
| static int | _brush_events_button_pressed (struct dt_iop_module_t *module, double widget_x, double widget_y, double pressure, int which, int type, uint32_t state, dt_masks_form_t *mask_form, int parentid, dt_masks_form_gui_t *mask_gui, int index) |
| static float | _get_brush_smoothing () |
| static void | _apply_pen_pressure (dt_masks_form_gui_t *mask_gui, float *payload_buffer) |
| static int | _brush_events_button_released (struct dt_iop_module_t *module, double widget_x, double widget_y, int which, uint32_t state, dt_masks_form_t *mask_form, int parentid, dt_masks_form_gui_t *mask_gui, int index) |
| static int | _brush_events_key_pressed (struct dt_iop_module_t *module, GdkEventKey *event, dt_masks_form_t *mask_form, int parentid, dt_masks_form_gui_t *mask_gui, int index) |
| static int | _brush_events_mouse_moved (struct dt_iop_module_t *module, double widget_x, double widget_y, double pressure, int which, dt_masks_form_t *mask_form, int parentid, dt_masks_form_gui_t *mask_gui, int index) |
| Brush mouse-move handler. | |
| static int | _brush_centerline_end (const int points_count, const int node_count) |
| Index (exclusive) where the centerline's forward pass ends in a brush point array. | |
| static void | _brush_draw_shape (struct dt_develop_t *dev, cairo_t *cr, const float *points, const int points_count, const int node_nb, const gboolean border, const gboolean source, const dt_masks_skip_range_t *skips, const int skip_count) |
| static float | _brush_line_length (const float *line, const int first_pt, const int last_pt) |
| static gboolean | _brush_line_point_at_length (const float *line, const int first_pt, const int last_pt, const float target_len, float *x, float *y) |
| static gboolean | _brush_get_line_midpoint (const float *line, const int first_pt, const int last_pt, float *mx, float *my) |
| static gboolean | _brush_get_source_center (const dt_masks_form_gui_points_t *gui_points, const int node_count, dt_masks_gui_center_point_t *center_pt) |
| static void | _brush_events_post_expose (cairo_t *cr, float zoom_scale, dt_masks_form_gui_t *mask_gui, int index, int node_count) |
| static void | _brush_bounding_box_raw (const float *const restrict points, const float *const restrict border, const int node_count, const int total_points, float *x_min, float *x_max, float *y_min, float *y_max) |
| Compute the bounding box (min/max) for both brush centerline and border points. | |
| static void | _brush_bounding_box (const float *const points, const float *const border, const int node_count, const int total_points, int *width, int *height, int *offset_x, int *offset_y) |
| Compute integer bounds used for buffer allocation. | |
| static int | _get_area (const dt_iop_module_t *const module, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *const piece, dt_masks_form_t *const mask_form, int *width, int *height, int *offset_x, int *offset_y, int include_source) |
| Compute the minimal bounding box for a brush (optionally including the source path). | |
| static dt_masks_raster_result_t | _brush_get_source_area (dt_iop_module_t *module, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, dt_masks_form_t *mask_form, int *width, int *height, int *offset_x, int *offset_y) |
| static dt_masks_raster_result_t | _brush_get_area (const dt_iop_module_t *const module, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *const piece, dt_masks_form_t *const mask_form, int *width, int *height, int *offset_x, int *offset_y) |
| static void | _brush_falloff (float *const restrict buffer, int segment_start[2], int segment_end[2], int offset_x, int offset_y, int buffer_width, float fading, float density) |
| static dt_masks_raster_result_t | _brush_get_mask (const dt_iop_module_t *const module, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *const piece, dt_masks_form_t *const mask_form, float **buffer, int *width, int *height, int *offset_x, int *offset_y) |
| Build a full-resolution brush mask into a newly allocated buffer. | |
| static void | _brush_falloff_roi (float *buffer, const int *segment_start, const int *segment_end, int buffer_width, int buffer_height, float fading, float density) |
| static dt_masks_raster_result_t | _brush_get_mask_roi (const dt_iop_module_t *const module, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *const piece, dt_masks_form_t *const mask_form, const dt_iop_roi_t *roi, float *buffer, dt_iop_roi_t *touched) |
| Build a brush mask directly into an ROI-sized buffer. | |
| static void | _brush_sanitize_config (dt_masks_type_t type) |
| static void | _brush_set_form_name (struct dt_masks_form_t *const mask_form, const size_t form_number) |
| static void | _brush_set_hint_message (const dt_masks_form_gui_t *const mask_gui, const dt_masks_form_t *const mask_form, char *const restrict msgbuf, const size_t msgbuf_len) |
| static void | _brush_duplicate_points (dt_develop_t *const dev, dt_masks_form_t *const base, dt_masks_form_t *const dest) |
| static void | _brush_initial_source_pos (struct dt_develop_t *dev, const float iwd, const float iht, float *x, float *y) |
| static void | _brush_switch_node_callback (GtkWidget *widget, gpointer user_data) |
| static void | _brush_reset_round_node_callback (GtkWidget *widget, gpointer user_data) |
| static void | _brush_add_node_callback (GtkWidget *menu, gpointer user_data) |
| static int | _brush_populate_context_menu (GtkWidget *menu, struct dt_masks_form_t *mask_form, struct dt_masks_form_gui_t *mask_gui, const float pointer_x, const float pointer_y) |
Variables | |
| const dt_masks_functions_t | dt_masks_functions_brush |
| #define BORDER_MAX 0.5f |
Definition at line 63 of file develop/masks/brush.c.
| #define BORDER_MIN 0.00005f |
Definition at line 62 of file develop/masks/brush.c.
| #define FADING_MAX 1.0f |
Definition at line 60 of file develop/masks/brush.c.
| #define FADING_MIN 0.00001f |
Definition at line 59 of file develop/masks/brush.c.
| typedef struct _brush_frame_t _brush_frame_t |
| typedef struct _brush_outline_t _brush_outline_t |
| typedef struct _brush_sample_t _brush_sample_t |
| typedef struct _brush_span_t _brush_span_t |
| typedef struct _brush_walk_state_t _brush_walk_state_t |
| typedef struct _brush_walk_t _brush_walk_t |
|
static |
Definition at line 1894 of file develop/masks/brush.c.
References _brush_get_position_in_segment(), _brush_init_ctrl_points(), dt_masks_node_brush_t::border, dt_masks_node_brush_t::ctrl1, dt_masks_node_brush_t::ctrl2, dt_masks_node_brush_t::density, dt_masks_form_gui_t::dev, dt_free, dt_masks_gui_cursor_to_raw_norm(), dt_masks_gui_form_create(), dt_masks_gui_selected_segment_index(), DT_MASKS_POINT_STATE_NORMAL, dt_masks_node_brush_t::fading, FALSE, g_list_next_wraparound(), IS_NULL_PTR, dt_masks_node_brush_t::node, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::node_selected_idx, dt_masks_form_t::points, dt_masks_form_gui_t::seg_hovered, dt_masks_form_gui_t::seg_selected, dt_masks_node_brush_t::state, t, and TRUE.
Referenced by _brush_add_node_callback(), and _brush_events_button_pressed().
|
static |
Definition at line 2122 of file develop/masks/brush.c.
References DT_MASKS_PRESSURE_BRUSHSIZE_REL, DT_MASKS_PRESSURE_FADING_ABS, DT_MASKS_PRESSURE_FADING_REL, DT_MASKS_PRESSURE_OFF, DT_MASKS_PRESSURE_OPACITY_ABS, DT_MASKS_PRESSURE_OPACITY_REL, FADING_MIN, dt_masks_form_gui_t::guipoints_count, i, MAX, and dt_masks_form_gui_t::pressure_sensitivity.
Referenced by _brush_events_button_released().
Definition at line 3538 of file develop/masks/brush.c.
References _add_node_to_segment(), dt_masks_form_gui_t::dev, dt_dev_add_history_item, dt_masks_form_get_selected_group(), dt_masks_get_from_id(), dt_masks_get_visible_form(), dt_masks_form_group_t::formid, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, dt_masks_form_group_t::parentid, and TRUE.
Referenced by _brush_populate_context_menu().
|
static |
Evaluate a cubic Bezier and compute its offset border point.
Evaluate the curve at t and offset it by radius along the normal.
The point is always produced. The BORDER is not: a curve collapsed to a single point has no direction, so there is nothing to offset along and the honest answer is "none". That used to be signalled by writing NaN into the border coordinates, which then had to be recognised – and repaired – by everyone downstream, and which is how a sentinel gets into a buffer that is supposed to hold geometry. It is a return value now, so the border is either written or left exactly as the caller had it. Returns TRUE when a border point was produced.
Definition at line 230 of file develop/masks/brush.c.
References _brush_get_XY(), d, dt_masks_outline_envelope_offset(), FALSE, t, and TRUE.
Referenced by _brush_points_recurs(), and _brush_walk_segment().
|
static |
Brush-specific border handle lookup.
Uses mirrored border handles computed from resampled border points.
Definition at line 1586 of file develop/masks/brush.c.
References _brush_get_border_handle_mirrored().
Referenced by _find_closest_handle().
|
static |
Compute integer bounds used for buffer allocation.
Adds a 2-pixel padding on each side to avoid rounding gaps.
Definition at line 2952 of file develop/masks/brush.c.
References _brush_bounding_box_raw(), height, and width.
Referenced by _brush_get_mask(), and _get_area().
|
static |
Compute the bounding box (min/max) for both brush centerline and border points.
Assumes point arrays contain interleaved x/y coordinates and that indices before node_count * 3 are control points which should be ignored for bounds.
Definition at line 2916 of file develop/masks/brush.c.
References __OMP_PARALLEL_FOR__, max, MAX, min, and MIN.
Referenced by _brush_bounding_box(), and _brush_get_mask_roi().
|
static |
Definition at line 1110 of file develop/masks/brush.c.
References dt_masks_dynbuf_free(), dt_masks_dynbuf_init(), FALSE, IS_NULL_PTR, and TRUE.
Referenced by _brush_get_pts_border().
|
static |
Get Bezier control points that match a Catmull-Rom segment.
Definition at line 436 of file develop/masks/brush.c.
Referenced by _brush_init_ctrl_points().
|
inlinestatic |
Index (exclusive) where the centerline's forward pass ends in a brush point array.
‘points’ holds, in this order: three header points per node (ctrl1, node, ctrl2), then the centerline sampled FORWARD from the first node to the last, then the SAME centerline sampled backward. The border wraps around the whole stroke, so the line under it is walked there and back (see _brush_get_pts_border()); only the forward half is ever drawn.
Half of the SAMPLES, not half of the array: the header belongs to neither pass, and counting it in leaves the forward half short by one and a half points per node – which is the whole last segment, since the last node's own coordinate sits at the very end of that pass.
Definition at line 2460 of file develop/masks/brush.c.
Referenced by _brush_draw_shape(), and _brush_get_source_center().
|
static |
Convert control point 2 into the handle position (orthonormal space).
Definition at line 322 of file develop/masks/brush.c.
Referenced by _brush_curve_handle_cb(), _brush_events_button_pressed(), and _brush_events_post_expose().
|
static |
Brush-specific curve handle lookup.
Converts the node's second control point into the GUI handle position.
Definition at line 1597 of file develop/masks/brush.c.
References _brush_ctrl2_to_handle(), dt_masks_form_gui_points_t::points, and TRUE.
Referenced by _find_closest_handle().
|
static |
Brush-specific inside/border/segment hit testing.
Definition at line 1608 of file develop/masks/brush.c.
References _brush_get_distance(), and dist().
Referenced by _find_closest_handle().
|
static |
Definition at line 2467 of file develop/masks/brush.c.
References _brush_centerline_end(), dt_masks_draw_outline_runs(), and void().
|
static |
Definition at line 3473 of file develop/masks/brush.c.
References dt_masks_duplicate_points().
|
static |
Definition at line 1958 of file develop/masks/brush.c.
References _add_node_to_segment(), _brush_ctrl2_to_handle(), _brush_get_border_handle_mirrored(), _get_pressure_sensitivity(), dt_masks_form_gui_t::creation, dt_masks_node_brush_t::ctrl1, dt_masks_node_brush_t::ctrl2, dt_masks_form_gui_t::delta, dt_control_mouse_is_painting(), DT_MASKS_CLONE, dt_masks_dynbuf_add_2(), dt_masks_dynbuf_init(), DT_MASKS_EDIT_FULL, dt_masks_get_set_conf_value(), dt_masks_node_is_cusp(), dt_masks_set_source_pos_initial_state(), dt_masks_set_source_pos_initial_value(), dt_masks_toggle_bezier_node_type(), dt_modifier_is(), DT_PRIMARY_MASK, dt_masks_form_gui_t::edit_mode, FADING_MAX, FADING_MIN, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::guipoints, dt_masks_form_gui_t::guipoints_count, dt_masks_form_gui_t::guipoints_payload, dt_masks_form_gui_t::handle_border_hovered, dt_masks_form_gui_t::handle_hovered, IS_NULL_PTR, k, dt_masks_node_brush_t::node, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_t::points, dt_masks_form_gui_points_t::points, dt_masks_form_gui_t::points, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::seg_hovered, dt_masks_form_t::source, dt_masks_form_gui_points_t::source, dt_masks_form_gui_t::source_selected, dt_masks_node_brush_t::state, state, TRUE, dt_masks_form_t::type, and type.
|
static |
Definition at line 2156 of file develop/masks/brush.c.
References _apply_pen_pressure(), _brush_init_ctrl_points(), _brush_ramer_douglas_peucker(), _get_brush_smoothing(), dt_masks_form_gui_t::creation, dt_masks_form_gui_t::creation_module, dt_masks_form_gui_t::dev, dt_dev_coordinates_image_abs_to_raw_norm(), dt_iop_gui_blend_masks_update(), dt_masks_change_form_gui(), DT_MASKS_CLONE, dt_masks_dynbuf_add_2(), dt_masks_dynbuf_buffer(), dt_masks_dynbuf_free(), dt_masks_dynbuf_get(), DT_MASKS_EDIT_FULL, dt_masks_get_from_id(), dt_masks_get_set_conf_value(), dt_masks_get_visible_form(), DT_MASKS_GROUP, dt_masks_gui_form_save_creation(), dt_masks_gui_is_dragging(), DT_MASKS_NON_CLONE, dt_masks_select_form(), dt_masks_set_edit_mode(), dt_modifier_is(), DT_PRIMARY_MASK, FADING_MAX, FADING_MIN, dt_develop_t::form_gui, dt_masks_form_t::formid, dt_masks_form_group_t::formid, dt_masks_form_gui_t::group_selected, dt_masks_form_gui_t::guipoints, dt_masks_form_gui_t::guipoints_count, dt_masks_form_gui_t::guipoints_payload, IS_NULL_PTR, MAX, dt_masks_form_t::points, dt_masks_form_gui_t::points, state, TRUE, dt_masks_form_t::type, and x.
|
static |
Definition at line 2277 of file develop/masks/brush.c.
|
static |
Brush mouse-move handler.
Widget-space coordinates are only used by the top-level dispatcher. Absolute output-image coordinates come from mask_gui->pos, normalized output-image coordinates come from mask_gui->rel_pos, and raw-space edits are derived locally through the appropriate backtransform helper.
Definition at line 2292 of file develop/masks/brush.c.
References _brush_get_border_handle_mirrored(), _brush_handle_to_ctrl(), _brush_init_ctrl_points(), _brush_translate_all_nodes(), _brush_translate_node(), dt_masks_node_brush_t::border, dt_masks_form_gui_t::creation, dt_masks_node_brush_t::ctrl1, dt_masks_node_brush_t::ctrl2, dt_masks_form_gui_t::dev, dt_dev_coordinates_image_abs_to_raw_norm(), dt_dev_geometry_snapshot(), dt_masks_border_from_projected_handle(), DT_MASKS_CLONE, dt_masks_dynbuf_add_2(), dt_masks_dynbuf_get(), dt_masks_gui_delta_from_raw_anchor(), dt_masks_gui_delta_to_image_abs(), dt_masks_gui_delta_to_raw_norm(), dt_masks_gui_form_create(), dt_masks_gui_form_create_throttled(), DT_MASKS_POINT_STATE_USER, dt_masks_project_on_line(), dt_masks_set_ctrl_points(), dt_masks_translate_source(), dt_masks_form_gui_t::form_dragging, g_list_next_wraparound(), geometry, dt_masks_form_gui_t::guipoints, dt_masks_form_gui_t::guipoints_count, dt_masks_form_gui_t::guipoints_payload, dt_masks_form_gui_t::handle_border_dragging, dt_masks_form_gui_t::handle_dragging, IS_NULL_PTR, dt_masks_node_brush_t::node, dt_masks_form_gui_t::node_dragging, dt_masks_form_t::points, dt_masks_form_gui_points_t::points, dt_masks_form_gui_t::points, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::seg_dragging, dt_masks_form_t::source, dt_masks_form_gui_t::source_dragging, dt_masks_node_brush_t::state, TRUE, and dt_masks_form_t::type.
|
static |
Definition at line 1817 of file develop/masks/brush.c.
References _change_fading(), _change_size(), _init_fading(), _init_opacity(), _init_size(), dt_masks_form_gui_t::creation, dt_masks_form_gui_t::dev, dt_masks_form_change_opacity(), DT_MASKS_INCREMENT_OFFSET, DT_MASKS_INCREMENT_SCALE, DT_MASKS_INTERACTION_FADING, DT_MASKS_INTERACTION_OPACITY, DT_MASKS_INTERACTION_SIZE, dt_masks_is_anything_selected(), dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::scrollx, and dt_masks_form_gui_t::scrolly.
|
static |
Definition at line 2582 of file develop/masks/brush.c.
References _brush_ctrl2_to_handle(), _brush_get_border_handle_mirrored(), _brush_get_source_center(), dt_masks_form_gui_points_t::border, dt_masks_form_gui_points_t::border_count, BORDER_MAX, BORDER_MIN, dt_masks_form_gui_t::border_selected, dt_masks_form_gui_points_t::border_skip_count, dt_masks_form_gui_points_t::border_skips, dt_masks_form_gui_t::creation, dt_masks_form_gui_t::dev, dt_masks_functions_t::draw_shape, dt_conf_get_float(), dt_dev_geometry_snapshot(), dt_draw_handle(), dt_draw_node(), dt_draw_set_dash_style(), dt_draw_shape_lines(), DT_DRAW_SIZE_LINE, dt_draw_stroke_line(), DT_GUI_COLOR_BRUSH_CURSOR, DT_GUI_COLOR_BRUSH_TRACE, DT_MASKS_CLONE, DT_MASKS_DASH_ROUND, DT_MASKS_DASH_STICK, dt_masks_draw_path_seg_by_seg(), dt_masks_draw_source(), dt_masks_draw_source_preview(), dt_masks_dynbuf_buffer(), dt_masks_functions_brush, dt_masks_get_set_conf_value(), dt_masks_get_visible_form(), dt_masks_gui_selected_handle_border_index(), dt_masks_gui_selected_handle_index(), dt_masks_gui_selected_node_index(), dt_masks_gui_selected_segment_index(), DT_MASKS_INCREMENT_SCALE, DT_MASKS_NO_DASH, dt_masks_node_is_cusp(), DT_MASKS_PRESSURE_BRUSHSIZE_REL, DT_MASKS_PRESSURE_FADING_ABS, DT_MASKS_PRESSURE_FADING_REL, DT_MASKS_PRESSURE_OFF, DT_MASKS_PRESSURE_OPACITY_ABS, DT_MASKS_PRESSURE_OPACITY_REL, DT_PIXEL_APPLY_DPI, dt_widget_set_source_rgba(), FADING_MAX, FADING_MIN, FALSE, dt_masks_form_gui_t::form_dragging, dt_masks_form_gui_t::form_selected, geometry, dt_masks_form_gui_t::group_selected, dt_masks_form_gui_t::guipoints, dt_masks_form_gui_t::guipoints_count, dt_masks_form_gui_t::guipoints_payload, dt_masks_form_gui_t::handle_border_hovered, dt_masks_form_gui_t::handle_border_selected, dt_masks_form_gui_t::handle_hovered, dt_masks_form_gui_t::handle_selected, i, IS_NULL_PTR, k, M_PI, MAX, MIN, n, dt_masks_form_gui_t::node_dragging, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_points_t::points, dt_masks_form_gui_t::points, dt_masks_form_gui_points_t::points_count, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::pressure_sensitivity, dt_masks_form_gui_t::seg_selected, selected, dt_masks_form_gui_points_t::source, dt_masks_form_gui_points_t::source_count, TRUE, dt_masks_form_t::type, and x.
|
static |
we write a falloff segment
Definition at line 3030 of file develop/masks/brush.c.
Referenced by _brush_get_mask().
|
inlinestatic |
we write a falloff segment respecting limits of buffer
Definition at line 3193 of file develop/masks/brush.c.
Referenced by _brush_get_mask_roi().
|
static |
Definition at line 3016 of file develop/masks/brush.c.
References _get_area(), dt_masks_raster_from_status(), height, and width.
|
static |
Definition at line 396 of file develop/masks/brush.c.
References _brush_get_border_handle_resampled(), FALSE, dt_masks_form_gui_points_t::points, and TRUE.
Referenced by _brush_border_handle_cb(), _brush_events_button_pressed(), _brush_events_mouse_moved(), and _brush_events_post_expose().
|
static |
get the border handle position corresponding to a node, by looking for the closest border point in the resampled points of the form GUI.
This is used when we have to initialize control points for a node that has been set manually by the user, so we want to get the corresponding handle position to eventually match a catmull-rom like spline. The values should be in orthonormal space.
| gui_points | the form GUI points |
| node_count | the number of nodes in the form |
| node_index | the index of the node for which we want to get the border handle position |
| x | the x coordinate of the border handle position (output) |
| y | the y coordinate of the border handle position (output) |
Definition at line 351 of file develop/masks/brush.c.
References dt_masks_form_gui_points_t::border, dt_masks_form_gui_points_t::border_count, dt_masks_form_gui_points_t::border_skip_count, dt_masks_form_gui_points_t::border_skips, dt_masks_skip_contains(), FALSE, i, IS_NULL_PTR, MIN, dt_masks_form_gui_points_t::points, dt_masks_form_gui_points_t::points_count, and TRUE.
Referenced by _brush_get_border_handle_mirrored().
|
static |
Get the distance between a point and the brush path/border.
Definition at line 1355 of file develop/masks/brush.c.
References dt_masks_form_gui_points_t::border, dt_masks_form_gui_points_t::border_count, dt_masks_gui_points_reach(), i, IS_NULL_PTR, MIN, dt_masks_form_gui_points_t::points, dt_masks_form_gui_t::points, dt_masks_form_gui_points_t::points_count, dt_masks_form_gui_points_t::source, and dt_masks_form_gui_points_t::source_count.
Referenced by _brush_distance_cb().
|
static |
Definition at line 1686 of file develop/masks/brush.c.
References dt_alloc_align_float(), dt_free_align, dt_masks_center_of_gravity_from_points(), FALSE, i, IS_NULL_PTR, and dt_masks_form_t::points.
|
static |
Definition at line 1654 of file develop/masks/brush.c.
References dt_masks_get_form_size_from_nodes(), DT_MASKS_INTERACTION_FADING, DT_MASKS_INTERACTION_SIZE, dt_masks_node_brush_t::fading, IS_NULL_PTR, dt_masks_form_t::points, and size.
Referenced by _brush_set_interaction_value().
|
static |
Definition at line 2543 of file develop/masks/brush.c.
References _brush_line_length(), _brush_line_point_at_length(), FALSE, and IS_NULL_PTR.
Referenced by _brush_get_source_center().
|
static |
Build a full-resolution brush mask into a newly allocated buffer.
The buffer is returned zero-initialized and filled only in the falloff region.
Definition at line 3065 of file develop/masks/brush.c.
References _brush_bounding_box(), _brush_falloff(), _brush_get_pts_border(), dt_iop_module_t::dev, DT_DEBUG_MASKS, DT_DEBUG_PERF, DT_DEV_TRANSFORM_DIR_BACK_INCL, dt_get_debug_flags(), dt_get_wtime(), dt_masks_distort_for_pipe(), DT_MASKS_RASTER_EMPTY, DT_MASKS_RASTER_ERROR, DT_MASKS_RASTER_OK, dt_pixelpipe_cache_alloc_align_float_cache, dt_pixelpipe_cache_free_align, dt_print(), FALSE, height, dt_iop_module_t::iop_order, IS_NULL_PTR, dt_dev_pixelpipe_t::mask_rasterization_step, dt_masks_form_t::name, dt_masks_form_t::points, t, TRUE, and width.
|
static |
Build a brush mask directly into an ROI-sized buffer.
The buffer is assumed pre-zeroed. Points are scaled/shifted into ROI space before stamping.
Definition at line 3253 of file develop/masks/brush.c.
References __OMP_PARALLEL_FOR__, _brush_bounding_box_raw(), _brush_falloff_roi(), _brush_get_pts_border(), dt_iop_module_t::dev, DT_DEBUG_MASKS, DT_DEBUG_PERF, DT_DEV_TRANSFORM_DIR_BACK_INCL, dt_get_debug_flags(), dt_get_wtime(), dt_masks_distort_for_pipe(), DT_MASKS_RASTER_EMPTY, DT_MASKS_RASTER_ERROR, DT_MASKS_RASTER_OK, dt_masks_touched_none(), dt_masks_touched_set(), dt_pixelpipe_cache_free_align, dt_print(), FALSE, dt_iop_roi_t::height, dt_iop_module_t::iop_order, IS_NULL_PTR, dt_dev_pixelpipe_t::mask_rasterization_step, MAX, MIN, dt_masks_form_t::name, dt_masks_form_t::points, dt_iop_roi_t::scale, t, TRUE, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
|
static |
longest span first; ties broken by position so the order is deterministic
Definition at line 1506 of file develop/masks/brush.c.
References _brush_get_pts_border(), DT_DEV_TRANSFORM_DIR_ALL, dt_masks_distort_for_gui(), dt_masks_outline_boundary_skips(), DT_MASKS_RASTER_ERROR, dt_masks_raster_from_status(), dt_pixelpipe_cache_free_align, dt_iop_module_t::iop_order, IS_NULL_PTR, dt_masks_form_t::points, and status.
|
static |
find relative position within a brush segment that is closest to the point given by coordinates x and y; we only need to find the minimum with a resolution of 1%, so we just do an exhaustive search without any frills
Definition at line 1544 of file develop/masks/brush.c.
References _brush_get_XY(), g_list_next_bounded(), IS_NULL_PTR, dt_masks_node_brush_t::node, dt_masks_form_t::points, and t.
Referenced by _add_node_to_segment().
|
static |
get all points of the brush and the border this takes care of gaps and iop distortions
Definition at line 1186 of file develop/masks/brush.c.
References _brush_bufs_alloc(), _brush_outline_transform(), _brush_walk_pass(), _brush_walk_single_dab(), dt_masks_node_brush_t::ctrl1, dt_masks_node_brush_t::ctrl2, dist(), dt_alloc_align(), DT_DEBUG_MASKS, DT_DEBUG_PERF, DT_DEV_TRANSFORM_DIR_ALL, dt_free_align, dt_get_debug_flags(), dt_get_wtime(), dt_masks_dynbuf_add_zeros(), dt_masks_dynbuf_free(), dt_masks_dynbuf_harvest(), dt_masks_dynbuf_position(), dt_masks_dynbuf_reserve_n(), dt_pixelpipe_cache_free_align, dt_print(), FALSE, IS_NULL_PTR, dt_masks_form_t::name, dt_masks_node_brush_t::node, _brush_walk_t::nodes, dt_masks_form_t::points, _brush_outline_t::points, dt_masks_form_t::source, and TRUE.
Referenced by _brush_get_mask(), _brush_get_mask_roi(), _brush_get_points_border(), and _get_area().
|
static |
Definition at line 3004 of file develop/masks/brush.c.
References _get_area(), dt_masks_raster_from_status(), height, and width.
|
static |
Definition at line 2554 of file develop/masks/brush.c.
References _brush_centerline_end(), _brush_get_line_midpoint(), FALSE, IS_NULL_PTR, dt_masks_gui_center_point_t::main, MIN, dt_masks_form_gui_points_t::points, dt_masks_form_gui_points_t::points_count, dt_masks_form_gui_points_t::source, dt_masks_gui_center_point_t::source, dt_masks_form_gui_points_t::source_count, TRUE, dt_masks_gui_center_point_t::x, and dt_masks_gui_center_point_t::y.
Referenced by _brush_events_post_expose().
|
static |
Evaluate a cubic Bezier at t in [0, 1].
Definition at line 207 of file develop/masks/brush.c.
Referenced by _brush_border_get_XY(), and _brush_get_position_in_segment().
|
static |
get bezier control points from feather extremity the values should be in orthonormal space
Definition at line 413 of file develop/masks/brush.c.
References fx.
Referenced by _brush_events_mouse_moved().
|
static |
Initialize all control points to match a Catmull-Rom-like spline.
Only nodes in DT_MASKS_POINT_STATE_NORMAL are regenerated.
Definition at line 451 of file develop/masks/brush.c.
References _brush_catmull_to_bezier(), dt_masks_node_brush_t::ctrl1, dt_masks_node_brush_t::ctrl2, DT_MASKS_POINT_STATE_NORMAL, g_list_shorter_than(), IS_NULL_PTR, dt_masks_node_brush_t::node, dt_masks_form_t::points, and dt_masks_node_brush_t::state.
Referenced by _add_node_to_segment(), _brush_events_button_released(), and _brush_events_mouse_moved().
|
static |
Definition at line 3479 of file develop/masks/brush.c.
References dt_dev_coordinates_raw_norm_to_raw_abs(), and x.
|
static |
Definition at line 947 of file develop/masks/brush.c.
References _brush_points_recurs_border_gaps(), dt_masks_outline_short_way(), f, and t.
Referenced by _brush_walk_node().
|
inlinestatic |
Definition at line 736 of file develop/masks/brush.c.
References dt_masks_outline_offset_along().
Referenced by _brush_points_recurs().
|
static |
Definition at line 2480 of file develop/masks/brush.c.
References i.
Referenced by _brush_get_line_midpoint().
|
static |
Definition at line 2499 of file develop/masks/brush.c.
References FALSE, i, IS_NULL_PTR, t, TRUE, and x.
Referenced by _brush_get_line_midpoint().
|
static |
Definition at line 1143 of file develop/masks/brush.c.
References __OMP_PARALLEL_FOR_SIMD__, _brush_outline_t::border, _brush_outline_t::border_count, dist(), dt_dev_coordinates_raw_norm_to_raw_abs(), DT_DEV_TRANSFORM_DIR_ALL, DT_DEV_TRANSFORM_DIR_BACK_EXCL, DT_DEV_TRANSFORM_DIR_FORW_INCL, dt_masks_distort_transform(), FALSE, i, IS_NULL_PTR, _brush_outline_t::point_count, _brush_outline_t::points, dt_masks_form_t::source, and TRUE.
Referenced by _brush_get_pts_border().
|
inlinestatic |
Definition at line 701 of file develop/masks/brush.c.
References dt_masks_dynbuf_add_2(), and dt_masks_dynbuf_position().
Referenced by _brush_points_recurs(), and _brush_walk_sync_payload().
|
static |
Get squared distance of a point to the segment, including payload deltas.
Uses the first and last points as segment endpoints and adds weighted distance in border/fading/density space to preserve brush dynamics.
Definition at line 71 of file develop/masks/brush.c.
References t.
Referenced by _brush_ramer_douglas_peucker().
|
static |
recursive function to get all points of the brush AND all point of the border the function takes care to avoid big gaps between points
Definition at line 839 of file develop/masks/brush.c.
References _brush_border_get_XY(), _brush_leaf_borrow_border(), _brush_payload_sync(), _brush_points_recurs(), _brush_points_recurs_border_small_gaps(), _brush_radius_at(), _brush_radius_rate_at(), _brush_span_is_leaf(), _brush_walk_t::arc_step, _brush_sample_t::border, _brush_span_t::border_max, _brush_span_t::border_min, _brush_walk_t::dborder, _brush_walk_t::dpayload, _brush_walk_t::dpoints, dt_masks_dynbuf_add_2(), FALSE, _brush_span_t::have_border_max, _brush_span_t::have_border_min, _brush_span_t::have_max, _brush_span_t::have_min, IS_NULL_PTR, out, _brush_walk_t::pixel_threshold, _brush_sample_t::point, _brush_span_t::points_max, _brush_span_t::points_min, _brush_span_t::tmax, _brush_span_t::tmin, and TRUE.
Referenced by _brush_points_recurs(), and _brush_walk_segment().
|
static |
fill the gap between 2 points with an arc of circle this function is here because we can have gap in border, esp. if the corner is very sharp
Definition at line 529 of file develop/masks/brush.c.
References dt_masks_dynbuf_reserve_n(), i, IS_NULL_PTR, and M_PI.
Referenced by _brush_joint_arc(), and _brush_walk_cap().
|
static |
fill small gap between 2 points with an arc of circle in contrast to the previous function it will always run the shortest path (max. PI) and does not consider clock or anti-clockwise action
Definition at line 595 of file develop/masks/brush.c.
References delta, dt_masks_dynbuf_reserve_n(), i, IS_NULL_PTR, and M_PI.
Referenced by _brush_points_recurs().
|
static |
Stamp a full disc: one spoke per pixel of circumference, all from centre, at radius.
The radius is an ARGUMENT. It used to be measured as the distance from the centre to the border sample last written to the buffer, on the assumption that the two belonged to the same spoke. Issue #1360 is what happens when they do not: a degenerate segment had left the image origin in the border buffer, the "radius" came out as the distance from the stroke to the corner of the frame – 2058 px on the reporter's file – and ten of these discs were stamped at that size. Every radius in this file now comes from the node data, and no geometry is ever derived from what happens to sit at the end of a buffer.
from_border only chooses the start angle, so the first sample continues from the border sample the caller just wrote; any angle is geometrically right.
Definition at line 665 of file develop/masks/brush.c.
References dt_masks_dynbuf_reserve_n(), i, IS_NULL_PTR, and M_PI.
Referenced by _brush_walk_node(), and _brush_walk_single_dab().
|
static |
Definition at line 3559 of file develop/masks/brush.c.
References _brush_add_node_callback(), _brush_reset_round_node_callback(), _brush_switch_node_callback(), ctx_gtk_menu_item_new_with_icon_and_shortcut(), ctx_gtk_menu_item_new_with_markup(), ctx_gtk_menu_item_new_with_markup_and_shortcut(), dt_accels_display_mods(), dt_free, dt_masks_node_is_cusp(), DT_MASKS_POINT_STATE_NORMAL, DT_MENU_ICON_CIRCLE, DT_MENU_ICON_SQUARE, DT_PRIMARY_MASK, FALSE, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, dt_masks_form_gui_t::node_hovered, dt_masks_form_t::points, dt_masks_form_gui_t::points, dt_masks_form_gui_t::seg_selected, dt_masks_node_brush_t::state, and TRUE.
|
inlinestatic |
Definition at line 309 of file develop/masks/brush.c.
References t.
Referenced by _brush_points_recurs().
|
inlinestatic |
Definition at line 314 of file develop/masks/brush.c.
References t.
Referenced by _brush_points_recurs().
|
static |
Remove unneeded points (Ramer-Douglas-Peucker) and return the reduced path.
Definition at line 144 of file develop/masks/brush.c.
References _brush_point_line_distance2(), _brush_ramer_douglas_peucker(), dt_masks_node_brush_t::border, dt_masks_node_brush_t::ctrl1, dt_masks_node_brush_t::ctrl2, dt_masks_node_brush_t::density, dt_free, DT_MASKS_POINT_STATE_NORMAL, dt_masks_node_brush_t::fading, dt_masks_node_brush_t::node, and dt_masks_node_brush_t::state.
Referenced by _brush_events_button_released(), and _brush_ramer_douglas_peucker().
Definition at line 3513 of file develop/masks/brush.c.
References dt_masks_form_gui_t::dev, dt_masks_get_from_id(), dt_masks_gui_selected_handle_index(), dt_masks_reset_bezier_ctrl_points(), dt_masks_form_gui_t::formid, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, MAX, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::node_selected_idx, dt_masks_form_t::points, dt_masks_form_gui_t::points, dt_masks_node_brush_t::state, and TRUE.
Referenced by _brush_populate_context_menu().
|
static |
Definition at line 3432 of file develop/masks/brush.c.
|
static |
Definition at line 920 of file develop/masks/brush.c.
References dt_masks_node_brush_t::border, dt_masks_node_brush_t::ctrl1, dt_masks_node_brush_t::ctrl2, dt_masks_node_brush_t::density, _brush_frame_t::dx, _brush_frame_t::dy, dt_masks_node_brush_t::fading, _brush_frame_t::iht, _brush_frame_t::iwd, MIN, and dt_masks_node_brush_t::node.
Referenced by _brush_walk_segment().
|
static |
Definition at line 3437 of file develop/masks/brush.c.
References dt_masks_form_t::name.
|
static |
Definition at line 3442 of file develop/masks/brush.c.
References dt_masks_form_gui_t::border_selected, dt_masks_form_gui_t::creation, dt_masks_form_is_clone(), dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::handle_border_hovered, dt_masks_form_gui_t::handle_hovered, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::seg_hovered, dt_masks_form_gui_t::seg_selected, and dt_masks_form_gui_t::source_selected.
|
static |
Definition at line 1718 of file develop/masks/brush.c.
References _brush_get_interaction_value(), _change_fading(), _change_size(), DT_MASKS_INTERACTION_FADING, DT_MASKS_INTERACTION_SIZE, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, and value.
|
inlinestatic |
Definition at line 716 of file develop/masks/brush.c.
References _is_within_pxl_threshold(), FALSE, IS_NULL_PTR, and TRUE.
Referenced by _brush_points_recurs().
Definition at line 3489 of file develop/masks/brush.c.
References dt_masks_node_brush_t::ctrl1, dt_masks_node_brush_t::ctrl2, dt_masks_form_gui_t::dev, dt_masks_get_from_id(), dt_masks_gui_selected_node_index(), dt_masks_toggle_bezier_node_type(), dt_masks_form_gui_t::formid, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, dt_masks_node_brush_t::node, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::node_selected_idx, dt_masks_form_t::points, dt_masks_form_gui_t::points, dt_masks_node_brush_t::state, and TRUE.
Referenced by _brush_populate_context_menu().
|
static |
Definition at line 1952 of file develop/masks/brush.c.
References _brush_translate_node(), and dt_masks_form_t::points.
Referenced by _brush_events_mouse_moved().
|
inlinestatic |
Definition at line 1947 of file develop/masks/brush.c.
References dt_masks_node_brush_t::ctrl1, dt_masks_node_brush_t::ctrl2, dt_masks_translate_ctrl_node(), and dt_masks_node_brush_t::node.
Referenced by _brush_events_mouse_moved(), and _brush_translate_all_nodes().
|
static |
Definition at line 1064 of file develop/masks/brush.c.
References _brush_points_recurs_border_gaps(), _brush_walk_sync_payload(), _brush_walk_t::arc_step, _brush_walk_state_t::b, _brush_walk_state_t::c, _brush_walk_t::dborder, _brush_walk_t::dpoints, IS_NULL_PTR, _brush_walk_state_t::payload, and TRUE.
Referenced by _brush_walk_pass().
|
static |
Definition at line 977 of file develop/masks/brush.c.
References _brush_joint_arc(), _brush_points_stamp(), _brush_walk_sync_payload(), _brush_walk_t::arc_step, _brush_walk_state_t::b, _brush_walk_state_t::c, _brush_walk_t::dborder, _brush_walk_t::dpoints, IS_NULL_PTR, _brush_walk_state_t::payload, and _brush_walk_state_t::r.
Referenced by _brush_walk_segment().
|
static |
Definition at line 1076 of file develop/masks/brush.c.
References _brush_walk_cap(), _brush_walk_segment(), _brush_walk_state_t::have_prev, k, and _brush_walk_t::node_count.
Referenced by _brush_get_pts_border().
|
static |
Definition at line 1011 of file develop/masks/brush.c.
References _brush_border_get_XY(), _brush_points_recurs(), _brush_segment_load(), _brush_walk_node(), _brush_walk_state_t::b, _brush_sample_t::border, _brush_walk_state_t::c, c1, _brush_walk_t::dborder, _brush_walk_t::dpayload, _brush_walk_t::dpoints, dt_masks_dynbuf_add_2(), dt_masks_outline_offset_along(), FALSE, _brush_walk_t::frame, _brush_sample_t::have_border, _brush_walk_state_t::have_prev, IS_NULL_PTR, k, _brush_walk_t::nodes, _brush_sample_t::payload, _brush_walk_state_t::payload, _brush_sample_t::point, _brush_walk_state_t::r, and TRUE.
Referenced by _brush_walk_pass().
|
static |
Definition at line 1092 of file develop/masks/brush.c.
References _brush_points_stamp(), _brush_walk_sync_payload(), _brush_walk_t::arc_step, dt_masks_node_brush_t::border, _brush_walk_t::dborder, dt_masks_node_brush_t::density, _brush_walk_t::dpoints, dt_masks_dynbuf_add_2(), _brush_frame_t::dx, _brush_frame_t::dy, dt_masks_node_brush_t::fading, _brush_walk_t::frame, _brush_frame_t::iht, IS_NULL_PTR, _brush_frame_t::iwd, MIN, dt_masks_node_brush_t::node, and _brush_walk_t::nodes.
Referenced by _brush_get_pts_border().
|
inlinestatic |
Definition at line 969 of file develop/masks/brush.c.
References _brush_payload_sync(), _brush_walk_t::dpayload, _brush_walk_t::dpoints, and IS_NULL_PTR.
Referenced by _brush_walk_cap(), _brush_walk_node(), and _brush_walk_single_dab().
|
static |
Definition at line 1741 of file develop/masks/brush.c.
References CLAMPF, dt_masks_apply_increment_precomputed(), dt_masks_get_set_conf_value(), dt_masks_gui_change_affects_selected_node_or_all(), dt_masks_gui_form_create(), dt_masks_node_brush_t::fading, FADING_MAX, FADING_MIN, IS_NULL_PTR, and dt_masks_form_t::points.
Referenced by _brush_events_mouse_scrolled(), and _brush_set_interaction_value().
|
static |
Definition at line 1770 of file develop/masks/brush.c.
References dt_masks_node_brush_t::border, dt_masks_apply_increment_precomputed(), dt_masks_get_set_conf_value(), dt_masks_gui_change_affects_selected_node_or_all(), dt_masks_gui_form_create(), FADING_MAX, FADING_MIN, IS_NULL_PTR, and dt_masks_form_t::points.
Referenced by _brush_events_mouse_scrolled(), and _brush_set_interaction_value().
|
static |
Definition at line 1616 of file develop/masks/brush.c.
References _brush_border_handle_cb(), _brush_curve_handle_cb(), _brush_distance_cb(), and dt_masks_find_closest_handle_common().
|
static |
Compute the minimal bounding box for a brush (optionally including the source path).
Used by both ROI and full-frame paths to size temporary buffers.
Definition at line 2968 of file develop/masks/brush.c.
References _brush_bounding_box(), _brush_get_pts_border(), dt_iop_module_t::dev, DT_DEV_TRANSFORM_DIR_BACK_INCL, dt_masks_distort_for_pipe(), dt_pixelpipe_cache_free_align, height, dt_iop_module_t::iop_order, IS_NULL_PTR, dt_masks_form_t::points, and width.
Referenced by _brush_get_area(), and _brush_get_source_area().
|
static |
Definition at line 2109 of file develop/masks/brush.c.
References dt_conf_get_string_const(), and factor.
Referenced by _brush_events_button_released().
|
static |
Definition at line 1875 of file develop/masks/brush.c.
References dt_conf_get_string_const(), DT_MASKS_PRESSURE_BRUSHSIZE_REL, DT_MASKS_PRESSURE_FADING_ABS, DT_MASKS_PRESSURE_FADING_REL, DT_MASKS_PRESSURE_OFF, DT_MASKS_PRESSURE_OPACITY_ABS, DT_MASKS_PRESSURE_OPACITY_REL, IS_NULL_PTR, and dt_masks_form_gui_t::pressure_sensitivity.
Referenced by _brush_events_button_pressed().
|
static |
Definition at line 1624 of file develop/masks/brush.c.
References dt_masks_dynbuf_set(), dt_masks_get_set_conf_value_with_toast(), FADING_MAX, FADING_MIN, dt_masks_form_gui_t::guipoints_count, and dt_masks_form_gui_t::guipoints_payload.
Referenced by _brush_events_mouse_scrolled().
|
static |
Definition at line 1646 of file develop/masks/brush.c.
References dt_masks_get_set_conf_value_with_toast().
Referenced by _brush_events_mouse_scrolled().
|
static |
Definition at line 1635 of file develop/masks/brush.c.
References dt_masks_dynbuf_set(), dt_masks_get_set_conf_value_with_toast(), FADING_MAX, FADING_MIN, dt_masks_form_gui_t::guipoints_count, and dt_masks_form_gui_t::guipoints_payload.
Referenced by _brush_events_mouse_scrolled().
|
inlinestatic |
Definition at line 695 of file develop/masks/brush.c.
Referenced by _brush_span_is_leaf().
| const dt_masks_functions_t dt_masks_functions_brush |
Definition at line 3609 of file develop/masks/brush.c.
Referenced by _brush_events_post_expose(), _run_brush_nodes_at(), _time_overlay_brush(), _time_overlay_group(), and dt_masks_create().