![]() |
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 |
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.
|
static |
Definition at line 1894 of file develop/masks/brush.c.
References _brush_get_position_in_segment(), _brush_init_ctrl_points(), 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, FALSE, g_list_next_wraparound(), IS_NULL_PTR, L, 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, i, L, and MAX.
Referenced by _brush_events_button_released().
Definition at line 3538 of file develop/masks/brush.c.
References _add_node_to_segment(), dt_dev_add_history_item, dt_masks_form_get_selected_group(), dt_masks_get_from_id(), dt_masks_get_visible_form(), IS_NULL_PTR, L, 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, L, 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(), and L.
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, L, 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__, L, 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, L, 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.
References L.
Referenced by _brush_init_ctrl_points().
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.
References L.
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(), L, 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(), dist(), and L.
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(), L, 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_node_brush_t::ctrl1, dt_masks_node_brush_t::ctrl2, 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, FADING_MAX, FADING_MIN, IS_NULL_PTR, k, L, dt_masks_node_brush_t::node, dt_masks_node_brush_t::state, state, TRUE, 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::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_gui_t::group_selected, IS_NULL_PTR, L, MAX, state, TRUE, 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_node_brush_t::ctrl1, dt_masks_node_brush_t::ctrl2, 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(), g_list_next_wraparound(), geometry, IS_NULL_PTR, L, dt_masks_node_brush_t::node, dt_masks_node_brush_t::state, and TRUE.
|
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_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(), and L.
|
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(), BORDER_MAX, BORDER_MIN, 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, geometry, i, IS_NULL_PTR, k, L, M_PI, MAX, MIN, n, selected, TRUE, 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, L, piece, pipe, and width.
|
static |
Definition at line 396 of file develop/masks/brush.c.
References _brush_get_border_handle_resampled(), FALSE, L, 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_skip_contains(), FALSE, i, IS_NULL_PTR, L, MIN, 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_gui_points_reach(), i, IS_NULL_PTR, L, MIN, and dt_masks_form_gui_points_t::points.
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 L.
|
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, L, 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, IS_NULL_PTR, and L.
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_dev_pixelpipe_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, IS_NULL_PTR, L, dt_dev_pixelpipe_t::mask_rasterization_step, pipe, 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_dev_pixelpipe_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, IS_NULL_PTR, L, dt_dev_pixelpipe_t::mask_rasterization_step, MAX, MIN, pipe, 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, IS_NULL_PTR, L, 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, L, 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(), 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, L, _brush_walk_t::nodes, _brush_outline_t::points, 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, L, piece, pipe, 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, L, MIN, and TRUE.
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.
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_POINT_STATE_NORMAL, g_list_shorter_than(), IS_NULL_PTR, L, and dt_masks_node_brush_t::node.
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, L, and t.
Referenced by _brush_walk_node().
|
inlinestatic |
Definition at line 736 of file develop/masks/brush.c.
References dt_masks_outline_offset_along(), and L.
Referenced by _brush_points_recurs().
|
static |
Definition at line 2480 of file develop/masks/brush.c.
Referenced by _brush_get_line_midpoint().
|
static |
Definition at line 2499 of file develop/masks/brush.c.
References FALSE, i, IS_NULL_PTR, L, 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, L, _brush_outline_t::point_count, _brush_outline_t::points, 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(), dt_masks_dynbuf_position(), and L.
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.
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_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, L, out, _brush_walk_t::pixel_threshold, _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, L, 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, L, 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, L, 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, IS_NULL_PTR, L, dt_masks_node_brush_t::state, and TRUE.
Definition at line 309 of file develop/masks/brush.c.
Referenced by _brush_points_recurs().
Definition at line 314 of file develop/masks/brush.c.
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_free, DT_MASKS_POINT_STATE_NORMAL, and L.
Referenced by _brush_events_button_released(), and _brush_ramer_douglas_peucker().
Definition at line 3513 of file develop/masks/brush.c.
References dt_masks_get_from_id(), dt_masks_gui_selected_handle_index(), dt_masks_reset_bezier_ctrl_points(), IS_NULL_PTR, L, MAX, 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 _brush_frame_t::dx, _brush_frame_t::dy, _brush_frame_t::iht, _brush_frame_t::iwd, L, and MIN.
Referenced by _brush_walk_segment().
|
static |
Definition at line 3437 of file develop/masks/brush.c.
References L.
|
static |
Definition at line 3442 of file develop/masks/brush.c.
References dt_masks_form_is_clone(), and L.
|
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, IS_NULL_PTR, L, 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_get_from_id(), dt_masks_gui_selected_node_index(), dt_masks_toggle_bezier_node_type(), IS_NULL_PTR, L, dt_masks_node_brush_t::node, 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 L.
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(), L, 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, L, _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, L, _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, L, 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, L, _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, _brush_walk_t::dborder, _brush_walk_t::dpoints, dt_masks_dynbuf_add_2(), _brush_frame_t::dx, _brush_frame_t::dy, _brush_walk_t::frame, _brush_frame_t::iht, IS_NULL_PTR, _brush_frame_t::iwd, L, 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 L.
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 L.
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(), dt_masks_find_closest_handle_common(), and L.
|
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_dev_pixelpipe_t::dev, DT_DEV_TRANSFORM_DIR_BACK_INCL, dt_masks_distort_for_pipe(), dt_pixelpipe_cache_free_align, height, IS_NULL_PTR, L, pipe, 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(), factor, and L.
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 L.
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, and L.
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(), and L.
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, and L.
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().