![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "bauhaus/bauhaus.h"
#include "common/debug.h"
#include "common/imagebuf.h"
#include "common/undo.h"
#include "control/conf.h"
#include "develop/blend.h"
#include "develop/imageop.h"
#include "develop/masks.h"
#include "develop/openmp_maths.h"
Macros | |
#define | HARDNESS_MIN 0.0005f |
#define | HARDNESS_MAX 1.0f |
#define | BORDER_MIN 0.00005f |
#define | BORDER_MAX 0.5f |
Functions | |
static float | _brush_point_line_distance2 (int index, int pointscount, const float *points, const float *payload) |
static GList * | _brush_ramer_douglas_peucker (const float *points, int points_count, const float *payload, float epsilon2) |
static void | _brush_get_XY (float p0x, float p0y, float p1x, float p1y, float p2x, float p2y, float p3x, float p3y, float t, float *x, float *y) |
static void | _brush_border_get_XY (float p0x, float p0y, float p1x, float p1y, float p2x, float p2y, float p3x, float p3y, float t, float rad, float *xc, float *yc, float *xb, float *yb) |
static void | _brush_ctrl2_to_feather (float ptx, float pty, float ctrlx, float ctrly, float *fx, float *fy, gboolean clockwise) |
static void | _brush_feather_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 *bx1, float *by1, float *bx2, float *by2) |
static void | _brush_init_ctrl_points (dt_masks_form_t *form) |
static void | _brush_points_recurs_border_gaps (float *cmax, float *bmin, float *bmin2, float *bmax, dt_masks_dynbuf_t *dpoints, dt_masks_dynbuf_t *dborder, gboolean clockwise) |
static void | _brush_points_recurs_border_small_gaps (float *cmax, float *bmin, float *bmin2, float *bmax, dt_masks_dynbuf_t *dpoints, dt_masks_dynbuf_t *dborder) |
static void | _brush_points_stamp (float *cmax, float *bmin, dt_masks_dynbuf_t *dpoints, dt_masks_dynbuf_t *dborder, gboolean clockwise) |
static void | _brush_points_recurs (float *p1, float *p2, double tmin, double tmax, float *points_min, float *points_max, float *border_min, float *border_max, float *rpoints, float *rborder, float *rpayload, dt_masks_dynbuf_t *dpoints, dt_masks_dynbuf_t *dborder, dt_masks_dynbuf_t *dpayload) |
static int | _brush_cyclic_cursor (int n, int nb) |
static int | _brush_get_pts_border (dt_develop_t *dev, dt_masks_form_t *form, const double iop_order, const int transf_direction, dt_dev_pixelpipe_t *pipe, float **points, int *points_count, float **border, int *border_count, float **payload, int *payload_count, int source) |
static void | _brush_get_distance (float x, float y, float as, dt_masks_form_gui_t *gui, int index, int corner_count, int *inside, int *inside_border, int *near, int *inside_source, float *dist) |
static int | _brush_get_points_border (dt_develop_t *dev, dt_masks_form_t *form, float **points, int *points_count, float **border, int *border_count, int source, const dt_iop_module_t *module) |
static float | _brush_get_position_in_segment (float x, float y, dt_masks_form_t *form, int segment) |
static int | _find_closest_handle (struct dt_iop_module_t *module, float pzx, float pzy, dt_masks_form_t *form, int parentid, dt_masks_form_gui_t *gui, int index) |
static int | _init_hardness (dt_masks_form_t *form, int parentid, dt_masks_form_gui_t *gui, const float amount, const dt_masks_increment_t increment) |
static int | _init_size (dt_masks_form_t *form, int parentid, dt_masks_form_gui_t *gui, const float amount, const dt_masks_increment_t increment) |
static int | _init_opacity (dt_masks_form_t *form, int parentid, dt_masks_form_gui_t *gui, const float amount, const dt_masks_increment_t increment) |
static int | _change_hardness (dt_masks_form_t *form, int parentid, dt_masks_form_gui_t *gui, struct dt_iop_module_t *module, int index, const float amount, const dt_masks_increment_t increment) |
static int | _change_size (dt_masks_form_t *form, int parentid, dt_masks_form_gui_t *gui, struct dt_iop_module_t *module, int index, const float amount, const dt_masks_increment_t increment) |
static int | _brush_events_mouse_scrolled (struct dt_iop_module_t *module, float pzx, float pzy, int up, uint32_t state, dt_masks_form_t *form, int parentid, dt_masks_form_gui_t *gui, int index, dt_masks_interaction_t interaction) |
static void | _get_pressure_sensitivity (dt_masks_form_gui_t *gui) |
static void | _change_point_type (struct dt_iop_module_t *module, dt_masks_form_t *form, int parentid, dt_masks_form_gui_t *gui, int index) |
static void | _add_point_to_segment (struct dt_iop_module_t *module, float pzx, float pzy, dt_masks_form_t *form, int parentid, dt_masks_form_gui_t *gui, int index) |
static void | _remove_shape (struct dt_iop_module_t *module, dt_masks_form_t *form, int parentid, dt_masks_form_gui_t *gui, int index) |
static void | _remove_point (struct dt_iop_module_t *module, dt_masks_form_t *form, int parentid, dt_masks_form_gui_t *gui, int index) |
static int | _brush_events_button_pressed (struct dt_iop_module_t *module, float pzx, float pzy, double pressure, int which, int type, uint32_t state, dt_masks_form_t *form, int parentid, dt_masks_form_gui_t *gui, int index) |
static float | _get_brush_smoothing () |
static void | _apply_pen_pressure (dt_masks_form_gui_t *gui, float *guipoints_payload) |
static int | _brush_events_button_released (struct dt_iop_module_t *module, float pzx, float pzy, int which, uint32_t state, dt_masks_form_t *form, int parentid, dt_masks_form_gui_t *gui, int index) |
static int | _brush_events_mouse_moved (struct dt_iop_module_t *module, float pzx, float pzy, double pressure, int which, dt_masks_form_t *form, int parentid, dt_masks_form_gui_t *gui, int index) |
static void | _brush_events_post_expose (cairo_t *cr, float zoom_scale, dt_masks_form_gui_t *gui, int index, int nb) |
static void | _brush_bounding_box_raw (const float *const points, const float *const border, const int nb_corner, const int num_points, float *x_min, float *x_max, float *y_min, float *y_max) |
static void | _brush_bounding_box (const float *const points, const float *const border, const int nb_corner, const int num_points, int *width, int *height, int *posx, int *posy) |
static int | _get_area (const dt_iop_module_t *const module, const dt_dev_pixelpipe_iop_t *const piece, dt_masks_form_t *const form, int *width, int *height, int *posx, int *posy, int get_source) |
static int | _brush_get_source_area (dt_iop_module_t *module, dt_dev_pixelpipe_iop_t *piece, dt_masks_form_t *form, int *width, int *height, int *posx, int *posy) |
static int | _brush_get_area (const dt_iop_module_t *const module, const dt_dev_pixelpipe_iop_t *const piece, dt_masks_form_t *const form, int *width, int *height, int *posx, int *posy) |
static void | _brush_falloff (float *const restrict buffer, int p0[2], int p1[2], int posx, int posy, int bw, float hardness, float density) |
static int | _brush_get_mask (const dt_iop_module_t *const module, const dt_dev_pixelpipe_iop_t *const piece, dt_masks_form_t *const form, float **buffer, int *width, int *height, int *posx, int *posy) |
static void | _brush_falloff_roi (float *buffer, const int *p0, const int *p1, int bw, int bh, float hardness, float density) |
static int | _brush_get_mask_roi (const dt_iop_module_t *const module, const dt_dev_pixelpipe_iop_t *const piece, dt_masks_form_t *const form, const dt_iop_roi_t *roi, float *buffer) |
static void | _brush_sanitize_config (dt_masks_type_t type) |
static void | _brush_set_form_name (struct dt_masks_form_t *const form, const size_t nb) |
static void | _brush_set_hint_message (const dt_masks_form_gui_t *const gui, const dt_masks_form_t *const form, const int opacity, 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 (const float iwd, const float iht, float *x, float *y) |
Variables | |
const dt_masks_functions_t | dt_masks_functions_brush |
#define BORDER_MAX 0.5f |
#define BORDER_MIN 0.00005f |
#define HARDNESS_MAX 1.0f |
#define HARDNESS_MIN 0.0005f |
|
static |
References _brush_get_position_in_segment(), _brush_init_ctrl_points(), dt_dev_pixelpipe_t::backbuf_height, dt_dev_pixelpipe_t::backbuf_width, dt_masks_point_brush_t::border, dt_masks_point_brush_t::corner, dt_masks_point_brush_t::ctrl1, dt_masks_point_brush_t::ctrl2, darktable, dt_masks_point_brush_t::density, darktable_t::develop, dt_dev_distort_backtransform(), dt_masks_gui_form_create(), dt_masks_gui_form_remove(), DT_MASKS_POINT_STATE_NORMAL, dt_masks_point_brush_t::hardness, dt_dev_pixelpipe_t::iheight, dt_dev_pixelpipe_t::iwidth, dt_masks_form_gui_t::point_dragging, dt_masks_form_gui_t::point_edited, dt_masks_form_gui_t::point_selected, dt_masks_form_t::points, dt_develop_t::preview_pipe, dt_masks_form_gui_t::seg_selected, and dt_masks_point_brush_t::state.
Referenced by _brush_events_button_pressed().
|
static |
References BORDER_MIN, DT_MASKS_PRESSURE_BRUSHSIZE_REL, DT_MASKS_PRESSURE_HARDNESS_ABS, DT_MASKS_PRESSURE_HARDNESS_REL, DT_MASKS_PRESSURE_OFF, DT_MASKS_PRESSURE_OPACITY_ABS, DT_MASKS_PRESSURE_OPACITY_REL, dt_masks_form_gui_t::guipoints_count, HARDNESS_MIN, MAX, and dt_masks_form_gui_t::pressure_sensitivity.
Referenced by _brush_events_button_released().
|
static |
get the point of the brush at pos t [0,1] AND the corresponding border point
References _brush_get_XY(), and sqf().
Referenced by _brush_get_pts_border(), and _brush_points_recurs().
|
static |
References _brush_bounding_box_raw(), height, and width.
Referenced by _brush_get_mask(), and _get_area().
|
static |
Referenced by _brush_bounding_box(), and _brush_get_mask_roi().
|
static |
Get the control points of a segment to match exactly a catmull-rom spline
Referenced by _brush_init_ctrl_points().
|
static |
get feather extremity from the control point n°2 the values should be in orthonormal space
Referenced by _brush_events_post_expose(), and _find_closest_handle().
|
inlinestatic |
converts n into a cyclical sequence counting upwards from 0 to nb-1 and back down again, counting endpoints twice
Referenced by _brush_get_pts_border().
|
static |
References dt_masks_form_t::points, and void().
|
static |
References _add_point_to_segment(), _brush_init_ctrl_points(), _change_point_type(), _find_closest_handle(), _get_pressure_sensitivity(), _remove_point(), _remove_shape(), dt_dev_pixelpipe_t::backbuf_height, dt_dev_pixelpipe_t::backbuf_width, BORDER_MAX, BORDER_MIN, dt_masks_form_gui_t::creation, darktable, darktable_t::develop, DT_MASKS_BRUSH, DT_MASKS_CLONE, dt_masks_dynbuf_add_2(), dt_masks_dynbuf_free(), dt_masks_dynbuf_init(), DT_MASKS_EDIT_FULL, dt_masks_get_set_conf_value(), dt_masks_gui_form_create(), dt_masks_gui_form_remove(), dt_masks_iop_update(), DT_MASKS_POINT_STATE_NORMAL, dt_masks_set_edit_mode(), dt_masks_set_source_pos_initial_state(), dt_masks_set_source_pos_initial_value(), dt_modifier_is(), dt_masks_form_gui_t::dx, dt_masks_form_gui_t::dy, dt_masks_form_gui_t::edit_mode, dt_masks_form_gui_t::feather_dragging, dt_masks_form_gui_t::feather_selected, dt_masks_form_gui_t::form_dragging, dt_masks_form_gui_t::form_selected, g_list_shorter_than(), dt_masks_form_gui_t::guipoints, dt_masks_form_gui_t::guipoints_count, dt_masks_form_gui_t::guipoints_payload, HARDNESS_MAX, HARDNESS_MIN, dt_masks_form_gui_t::point_border_dragging, dt_masks_form_gui_t::point_border_selected, dt_masks_form_gui_t::point_dragging, dt_masks_form_gui_t::point_edited, dt_masks_form_gui_t::point_selected, dt_masks_form_t::points, dt_masks_form_gui_points_t::points, dt_masks_form_gui_t::points, dt_masks_form_gui_t::posx, dt_masks_form_gui_t::posy, dt_develop_t::preview_pipe, dt_masks_form_gui_t::scrollx, dt_masks_form_gui_t::scrolly, dt_masks_form_gui_t::seg_dragging, dt_masks_form_gui_t::seg_selected, dt_masks_form_t::source, dt_masks_form_gui_points_t::source, dt_masks_form_gui_t::source_dragging, dt_masks_form_gui_t::source_selected, TRUE, type, and dt_masks_form_t::type.
|
static |
References _apply_pen_pressure(), _brush_feather_to_ctrl(), _brush_init_ctrl_points(), _brush_ramer_douglas_peucker(), _get_brush_smoothing(), dt_dev_pixelpipe_t::backbuf_height, dt_dev_pixelpipe_t::backbuf_width, BORDER_MAX, BORDER_MIN, dt_masks_form_gui_t::creation, dt_masks_form_gui_t::creation_module, darktable, darktable_t::develop, dt_dev_distort_backtransform(), dt_dev_masks_selection_change(), 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_GROUP, dt_masks_gui_form_create(), dt_masks_gui_form_remove(), dt_masks_gui_form_save_creation(), dt_masks_iop_update(), DT_MASKS_NON_CLONE, DT_MASKS_POINT_STATE_USER, dt_masks_select_form(), dt_masks_set_edit_mode(), dt_modifier_is(), dt_masks_form_gui_t::dx, dt_masks_form_gui_t::dy, FALSE, dt_masks_form_gui_t::feather_dragging, dt_masks_form_gui_t::form_dragging, dt_develop_t::form_gui, dt_develop_t::form_visible, dt_masks_point_group_t::formid, dt_masks_form_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, dt_dev_pixelpipe_t::iheight, dt_dev_pixelpipe_t::iwidth, MAX, dt_masks_form_gui_t::point_border_dragging, dt_masks_form_gui_t::point_dragging, dt_masks_form_t::points, dt_masks_form_gui_t::points, dt_develop_t::preview_pipe, dt_masks_form_gui_t::scrollx, dt_masks_form_gui_t::scrolly, dt_masks_form_gui_t::seg_dragging, dt_masks_form_t::source, dt_masks_form_gui_t::source_dragging, sqf(), TRUE, and dt_masks_form_t::type.
|
static |
References _brush_feather_to_ctrl(), _brush_init_ctrl_points(), _find_closest_handle(), dt_dev_pixelpipe_t::backbuf_height, dt_dev_pixelpipe_t::backbuf_width, dt_masks_form_gui_points_t::border, dt_masks_point_brush_t::corner, dt_masks_form_gui_t::creation, dt_masks_point_brush_t::ctrl1, dt_masks_point_brush_t::ctrl2, darktable, darktable_t::develop, dt_dev_distort_backtransform(), dt_masks_dynbuf_add_2(), dt_masks_dynbuf_get(), DT_MASKS_EDIT_FULL, dt_masks_gui_form_create(), dt_masks_gui_form_remove(), DT_MASKS_POINT_STATE_USER, dt_masks_form_gui_t::dx, dt_masks_form_gui_t::dy, dt_masks_form_gui_t::edit_mode, dt_masks_form_gui_t::feather_dragging, dt_masks_form_gui_t::form_dragging, g_list_next_wraparound(), dt_masks_form_gui_t::guipoints, dt_masks_form_gui_t::guipoints_count, dt_masks_form_gui_t::guipoints_payload, dt_dev_pixelpipe_t::iheight, dt_dev_pixelpipe_t::iwidth, dt_masks_form_gui_t::point_border_dragging, dt_masks_form_gui_t::point_dragging, dt_masks_form_t::points, dt_masks_form_gui_points_t::points, dt_masks_form_gui_t::points, dt_develop_t::preview_pipe, dt_masks_form_gui_t::seg_dragging, dt_masks_form_t::source, dt_masks_form_gui_t::source_dragging, and TRUE.
|
static |
References _change_hardness(), _change_size(), _init_hardness(), _init_opacity(), _init_size(), dt_masks_form_gui_t::creation, dt_masks_form_set_opacity(), DT_MASKS_INCREMENT_OFFSET, DT_MASKS_INCREMENT_SCALE, dt_modifier_is(), dt_masks_form_gui_t::feather_selected, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::point_selected, dt_masks_form_gui_t::scrollx, dt_masks_form_gui_t::scrolly, and dt_masks_form_gui_t::seg_selected.
|
static |
References _brush_ctrl2_to_feather(), dt_dev_pixelpipe_t::backbuf_height, dt_dev_pixelpipe_t::backbuf_width, 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_t::creation, dt_masks_form_gui_t::creation_closing_form, darktable, darktable_t::develop, dt_conf_get_float(), dt_control_get_dev_zoom_x(), dt_control_get_dev_zoom_y(), dt_draw_set_color_overlay(), DT_GUI_COLOR_BRUSH_CURSOR, DT_GUI_COLOR_BRUSH_TRACE, dt_gui_gtk_set_source_rgba(), DT_MASKS_BRUSH, dt_masks_calculate_source_pos_value(), DT_MASKS_CLONE, dt_masks_draw_clone_source_pos(), dt_masks_dynbuf_buffer(), dt_masks_get_set_conf_value(), DT_MASKS_INCREMENT_SCALE, DT_MASKS_PRESSURE_BRUSHSIZE_REL, DT_MASKS_PRESSURE_HARDNESS_ABS, DT_MASKS_PRESSURE_HARDNESS_REL, DT_MASKS_PRESSURE_OFF, DT_MASKS_PRESSURE_OPACITY_ABS, DT_MASKS_PRESSURE_OPACITY_REL, DT_PIXEL_APPLY_DPI, FALSE, dt_masks_form_gui_t::feather_dragging, dt_masks_form_gui_t::feather_selected, dt_masks_form_gui_t::form_dragging, dt_masks_form_gui_t::form_selected, dt_develop_t::form_visible, 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, HARDNESS_MAX, HARDNESS_MIN, dt_dev_pixelpipe_t::iheight, dt_dev_pixelpipe_t::iwidth, M_PI, MAX, MIN, dt_masks_form_gui_t::mouse_leaved_center, dt_masks_form_gui_t::point_border_selected, dt_masks_form_gui_t::point_dragging, dt_masks_form_gui_t::point_edited, dt_masks_form_gui_t::point_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::posx, dt_masks_form_gui_t::posy, dt_masks_form_gui_t::pressure_sensitivity, dt_develop_t::preview_pipe, dt_masks_form_gui_t::seg_selected, dt_masks_form_gui_points_t::source, dt_masks_form_gui_points_t::source_count, TRUE, and dt_masks_form_t::type.
|
static |
|
inlinestatic |
we write a falloff segment respecting limits of buffer
References MAX.
Referenced by _brush_get_mask_roi().
|
static |
get bezier control points from feather extremity the values should be in orthonormal space
Referenced by _brush_events_button_released(), and _brush_events_mouse_moved().
|
static |
References _get_area(), height, and width.
|
static |
get the distance between point (x,y) and the brush
References dt_masks_form_gui_points_t::border, dt_masks_form_gui_points_t::border_count, dist(), 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 _find_closest_handle().
|
static |
References _brush_bounding_box(), _brush_falloff(), _brush_get_pts_border(), darktable, dt_iop_module_t::dev, dt_calloc_align_float(), DT_DEBUG_MASKS, DT_DEBUG_PERF, DT_DEV_TRANSFORM_DIR_BACK_INCL, dt_free_align, dt_get_wtime(), dt_print(), height, dt_iop_module_t::iop_order, dt_masks_form_t::name, dt_dev_pixelpipe_iop_t::pipe, dt_masks_form_t::points, darktable_t::unmuted, and width.
|
static |
References _brush_bounding_box_raw(), _brush_falloff_roi(), _brush_get_pts_border(), darktable, dt_iop_module_t::dev, DT_DEBUG_MASKS, DT_DEBUG_PERF, DT_DEV_TRANSFORM_DIR_BACK_INCL, dt_free_align, dt_get_wtime(), dt_print(), height, dt_iop_roi_t::height, dt_iop_module_t::iop_order, MAX, MIN, dt_masks_form_t::name, dt_dev_pixelpipe_iop_t::pipe, dt_masks_form_t::points, dt_iop_roi_t::scale, darktable_t::unmuted, width, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
|
static |
|
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
References _brush_get_XY(), dt_masks_point_brush_t::corner, g_list_next_bounded(), and dt_masks_form_t::points.
Referenced by _add_point_to_segment().
|
static |
get all points of the brush and the border this takes care of gaps and iop distortions
References _brush_border_get_XY(), _brush_cyclic_cursor(), _brush_points_recurs(), _brush_points_recurs_border_gaps(), _brush_points_stamp(), dt_masks_point_brush_t::border, dt_masks_point_brush_t::corner, dt_masks_point_brush_t::ctrl1, dt_masks_point_brush_t::ctrl2, darktable, dt_masks_point_brush_t::density, DT_DEBUG_MASKS, DT_DEBUG_PERF, dt_dev_distort_transform_plus(), DT_DEV_TRANSFORM_DIR_ALL, DT_DEV_TRANSFORM_DIR_BACK_EXCL, DT_DEV_TRANSFORM_DIR_FORW_INCL, dt_free_align, dt_get_wtime(), dt_masks_dynbuf_add_2(), dt_masks_dynbuf_add_zeros(), dt_masks_dynbuf_free(), dt_masks_dynbuf_get(), dt_masks_dynbuf_harvest(), dt_masks_dynbuf_init(), dt_masks_dynbuf_position(), dt_masks_dynbuf_reserve_n(), dt_masks_dynbuf_set(), dt_print(), dt_masks_point_brush_t::hardness, dt_dev_pixelpipe_t::iheight, dt_dev_pixelpipe_t::iwidth, MIN, dt_masks_form_t::name, dt_masks_form_t::points, dt_masks_form_t::source, TRUE, and darktable_t::unmuted.
Referenced by _brush_get_mask(), _brush_get_mask_roi(), _brush_get_points_border(), and _get_area().
|
static |
References _get_area(), height, and width.
|
static |
get the point of the brush at pos t [0,1]
References sqf().
Referenced by _brush_border_get_XY(), and _brush_get_position_in_segment().
|
static |
initialise all control points to eventually match a catmull-rom like spline
References _brush_catmull_to_bezier(), dt_masks_point_brush_t::corner, dt_masks_point_brush_t::ctrl1, dt_masks_point_brush_t::ctrl2, DT_MASKS_POINT_STATE_NORMAL, g_list_shorter_than(), dt_masks_form_t::points, and dt_masks_point_brush_t::state.
Referenced by _add_point_to_segment(), _brush_events_button_pressed(), _brush_events_button_released(), _brush_events_mouse_moved(), _change_point_type(), and _remove_point().
|
static |
|
static |
get squared distance of indexed point to line segment, taking weighted payload data into account
References sqf().
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
References _brush_border_get_XY(), _brush_points_recurs(), _brush_points_recurs_border_small_gaps(), dt_masks_dynbuf_add_2(), and dt_masks_dynbuf_position().
Referenced by _brush_get_pts_border(), and _brush_points_recurs().
|
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
References dt_masks_dynbuf_reserve_n(), and M_PI.
Referenced by _brush_get_pts_border().
|
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
References dt_masks_dynbuf_reserve_n(), and M_PI.
Referenced by _brush_points_recurs().
|
static |
draw a circle with given radius. can be used to terminate a stroke and to draw junctions where attributes (opacity) change
References dt_masks_dynbuf_reserve_n(), and M_PI.
Referenced by _brush_get_pts_border().
|
static |
remove unneeded points (Ramer-Douglas-Peucker algorithm) and return resulting path as linked list
References _brush_point_line_distance2(), _brush_ramer_douglas_peucker(), dt_masks_point_brush_t::border, dt_masks_point_brush_t::corner, dt_masks_point_brush_t::ctrl1, dt_masks_point_brush_t::ctrl2, dt_masks_point_brush_t::density, DT_MASKS_POINT_STATE_NORMAL, dt_masks_point_brush_t::hardness, and dt_masks_point_brush_t::state.
Referenced by _brush_events_button_released(), and _brush_ramer_douglas_peucker().
|
static |
|
static |
References dt_masks_form_t::name.
|
static |
References dt_masks_form_gui_t::border_selected, dt_masks_form_gui_t::creation, and dt_masks_form_gui_t::form_selected.
|
static |
|
static |
|
static |
References BORDER_MAX, BORDER_MIN, dt_masks_get_set_conf_value(), dt_masks_gui_form_create(), dt_masks_gui_form_remove(), DT_MASKS_INCREMENT_ABSOLUTE, DT_MASKS_INCREMENT_OFFSET, DT_MASKS_INCREMENT_SCALE, dt_masks_form_gui_t::point_selected, and dt_masks_form_t::points.
Referenced by _brush_events_mouse_scrolled().
|
static |
References _brush_ctrl2_to_feather(), _brush_get_distance(), dt_dev_pixelpipe_t::backbuf_height, dt_dev_pixelpipe_t::backbuf_width, dt_masks_form_gui_points_t::border, dt_masks_form_gui_t::border_selected, darktable, darktable_t::develop, dist(), DT_PIXEL_APPLY_DPI, FALSE, dt_masks_form_gui_t::feather_selected, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::group_selected, dt_masks_form_gui_t::point_border_selected, dt_masks_form_gui_t::point_edited, dt_masks_form_gui_t::point_selected, dt_masks_form_t::points, dt_masks_form_gui_points_t::points, dt_masks_form_gui_t::points, dt_develop_t::preview_pipe, dt_masks_form_gui_t::seg_selected, dt_masks_form_gui_t::source_selected, and TRUE.
Referenced by _brush_events_button_pressed(), and _brush_events_mouse_moved().
|
static |
|
static |
References dt_conf_get_string_const(), and factor.
Referenced by _brush_events_button_released().
|
static |
References dt_conf_get_string_const(), DT_MASKS_PRESSURE_BRUSHSIZE_REL, DT_MASKS_PRESSURE_HARDNESS_ABS, DT_MASKS_PRESSURE_HARDNESS_REL, DT_MASKS_PRESSURE_OFF, DT_MASKS_PRESSURE_OPACITY_ABS, DT_MASKS_PRESSURE_OPACITY_REL, and dt_masks_form_gui_t::pressure_sensitivity.
Referenced by _brush_events_button_pressed().
|
static |
|
static |
References dt_masks_get_set_conf_value(), and dt_toast_log().
Referenced by _brush_events_mouse_scrolled().
|
static |
|
static |
|
static |
References darktable, darktable_t::develop, dt_masks_change_form_gui(), dt_masks_clear_form_gui(), dt_masks_form_remove(), dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_form_gui_t::edit_mode, dt_develop_t::form_visible, dt_masks_point_group_t::formid, dt_masks_form_t::formid, g_list_shorter_than(), dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by _brush_events_button_pressed().
const dt_masks_functions_t dt_masks_functions_brush |
Referenced by dt_masks_calculate_source_pos_value(), and dt_masks_create().