![]() |
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"#include <assert.h>
Include dependency graph for polygon.c:Macros | |
| #define | HARDNESS_MIN 0.0005f |
| #define | HARDNESS_MAX 1.0f |
| #define | BORDER_MIN 0.00005f |
| #define | BORDER_MAX 0.5f |
| #define | POLYGON_MAX_SELF_INTERSECTIONS(nb_nodes) ((nb_nodes) * 4) |
Functions | |
| static void | _polygon_bounding_box_raw (const float *const points, const float *border, const int nb_corner, const int num_points, int num_borders, float *x_min, float *x_max, float *y_min, float *y_max) |
| static void | _polygon_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 | _polygon_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 | _polygon_ctrl2_to_handle (const float ptx, const float pty, const float ctrlx, const float ctrly, float *fx, float *fy, const gboolean clockwise) |
| static void | _polygon_handle_to_ctrl (float ptx, float pty, float fx, float fy, float *ctrl1x, float *ctrl1y, float *ctrl2x, float *ctrl2y, gboolean clockwise) |
| static void | _polygon_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 | _polygon_init_ctrl_points (dt_masks_form_t *form) |
| static gboolean | _polygon_is_clockwise (dt_masks_form_t *form) |
| static int | _polygon_fill_gaps (int lastx, int lasty, int x, int y, dt_masks_dynbuf_t *points) |
| static void | _polygon_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 | _polygon_points_recurs (float *p1, float *p2, double tmin, double tmax, float *polygon_min, float *polygon_max, float *border_min, float *border_max, float *rpolygon, float *rborder, dt_masks_dynbuf_t *dpoints, dt_masks_dynbuf_t *dborder, int withborder) |
| static int | _polygon_find_self_intersection (dt_masks_dynbuf_t *inter, int nb_nodes, float *border, int border_count) |
| static int | _polygon_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, gboolean source) |
| static float | _polygon_get_position_in_segment (float x, float y, dt_masks_form_t *form, int segment) |
| static void | _add_node_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 | _change_node_type (struct dt_iop_module_t *module, dt_masks_form_t *form, int parentid, dt_masks_form_gui_t *gui, int index) |
| static int | _polygon_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 void | _polygon_get_sizes (struct dt_iop_module_t *module, dt_masks_form_t *form, dt_masks_form_gui_t *gui, int index, float *masks_size, float *border_size) |
| static void | _polygon_get_distance (float x, float y, float as, dt_masks_form_gui_t *gui, int index, int node_count, int *inside, int *inside_border, int *near, int *inside_source, float *dist) |
| 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 void | _polygon_gravity_center (dt_masks_form_t *form, float *gx, float *gy, float *surf) |
| static int | _init_hardness (dt_masks_form_t *form, const float amount, const dt_masks_increment_t increment, const int flow, const float masks_size, const float border_size) |
| 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, const int flow) |
| 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, int flow) |
| static int | _polygon_events_mouse_scrolled (struct dt_iop_module_t *module, float pzx, float pzy, int up, int flow, uint32_t state, dt_masks_form_t *form, int parentid, dt_masks_form_gui_t *gui, int index, dt_masks_interaction_t interaction) |
| static int | _polygon_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 int | _polygon_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 | _polygon_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 | _polygon_draw_shape (cairo_t *cr, const float *points, const int points_count, const int node_nb, const gboolean border, const gboolean source) |
| static void | _polygon_events_post_expose (cairo_t *cr, float zoom_scale, dt_masks_form_gui_t *gui, int index, int node_count) |
| static void | _polygon_bounding_box (const float *const points, const float *border, const int nb_corner, const int num_points, int num_borders, 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, gboolean get_source) |
| static int | _polygon_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 | _polygon_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) |
| void | _polygon_falloff (float *const restrict buffer, int *p0, int *p1, int posx, int posy, int bw) |
| static int | _polygon_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 int | _polygon_crop_to_roi (float *polygon, const int point_count, float xmin, float xmax, float ymin, float ymax) |
| static void | _polygon_falloff_roi (float *buffer, int *p0, int *p1, int bw, int bh) |
| static int | _polygon_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 | _polygon_sanitize_config (dt_masks_type_t type) |
| static void | _polygon_set_form_name (struct dt_masks_form_t *const form, const size_t nb) |
| static void | _polygon_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 | _polygon_duplicate_points (dt_develop_t *const dev, dt_masks_form_t *const base, dt_masks_form_t *const dest) |
| static void | _polygon_initial_source_pos (const float iwd, const float iht, float *x, float *y) |
Variables | |
| const dt_masks_functions_t | dt_masks_functions_polygon |
| #define BORDER_MAX 0.5f |
| #define BORDER_MIN 0.00005f |
| #define HARDNESS_MAX 1.0f |
| #define HARDNESS_MIN 0.0005f |
| #define POLYGON_MAX_SELF_INTERSECTIONS | ( | nb_nodes | ) | ((nb_nodes) * 4) |
|
static |
References _polygon_get_position_in_segment(), _polygon_init_ctrl_points(), dt_dev_pixelpipe_t::backbuf_height, dt_dev_pixelpipe_t::backbuf_width, dt_masks_node_polygon_t::border, dt_masks_node_polygon_t::ctrl1, dt_masks_node_polygon_t::ctrl2, darktable, darktable_t::develop, dt_dev_distort_backtransform(), dt_dev_roi_to_input_space(), dt_masks_gui_form_create(), dt_masks_gui_form_remove(), DT_MASKS_POINT_STATE_NORMAL, g_list_next_wraparound(), dt_masks_node_polygon_t::node, dt_masks_form_gui_t::node_dragging, dt_masks_form_gui_t::node_edited, dt_masks_form_gui_t::node_selected, dt_masks_form_t::points, dt_develop_t::preview_pipe, dt_masks_form_gui_t::seg_selected, dt_masks_node_polygon_t::state, and TRUE.
Referenced by _polygon_events_button_pressed().
|
static |
|
static |
References _polygon_init_ctrl_points(), dt_masks_node_polygon_t::ctrl1, dt_masks_node_polygon_t::ctrl2, dt_masks_gui_form_create(), dt_masks_gui_form_remove(), DT_MASKS_POINT_STATE_NORMAL, DT_MASKS_POINT_STATE_USER, dt_masks_node_polygon_t::node, dt_masks_form_gui_t::node_edited, dt_masks_form_t::points, and dt_masks_node_polygon_t::state.
Referenced by _polygon_events_button_pressed().
|
static |
References _polygon_get_sizes(), _polygon_gravity_center(), dt_masks_node_polygon_t::ctrl1, dt_masks_node_polygon_t::ctrl2, dt_masks_gui_form_create(), dt_masks_gui_form_remove(), dt_toast_log(), dt_masks_node_polygon_t::node, and dt_masks_form_t::points.
Referenced by _polygon_events_mouse_scrolled().
|
static |
References _polygon_ctrl2_to_handle(), _polygon_get_distance(), dt_dev_pixelpipe_t::backbuf_height, dt_dev_pixelpipe_t::backbuf_width, dt_masks_form_gui_t::border_selected, dt_masks_form_gui_points_t::clockwise, darktable, darktable_t::develop, dist(), DT_DRAW_SELECTION_RADIUS, dt_masks_is_corner_node(), dt_masks_is_within_radius(), FALSE, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::group_selected, dt_masks_form_gui_t::handle_border_selected, dt_masks_form_gui_t::handle_selected, dt_develop_t::natural_scale, dt_masks_form_gui_t::node_edited, 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_develop_t::preview_pipe, dt_masks_form_gui_t::seg_selected, dt_masks_form_gui_t::source_selected, and TRUE.
Referenced by _polygon_events_button_pressed(), and _polygon_events_mouse_moved().
|
static |
References _polygon_bounding_box(), _polygon_get_pts_border(), dt_iop_module_t::dev, DT_DEV_TRANSFORM_DIR_BACK_INCL, dt_free_align, height, dt_iop_module_t::iop_order, dt_dev_pixelpipe_iop_t::pipe, dt_masks_form_t::points, and width.
Referenced by _polygon_get_area(), and _polygon_get_source_area().
|
static |
References dt_masks_get_set_conf_value(), dt_toast_log(), HARDNESS_MAX, and HARDNESS_MIN.
Referenced by _change_hardness().
|
static |
get the point of the polygon at pos t [0,1] AND the corresponding border point
References _polygon_get_XY(), and double().
Referenced by _polygon_get_pts_border(), and _polygon_points_recurs().
|
static |
References _polygon_bounding_box_raw(), height, and width.
Referenced by _get_area(), and _polygon_get_mask().
|
static |
Referenced by _polygon_bounding_box(), and _polygon_get_mask_roi().
|
static |
Get the control points of a segment to match exactly a catmull-rom spline
Referenced by _polygon_init_ctrl_points().
|
static |
crop polygon to roi given by xmin, xmax, ymin, ymax. polygon segments outside of roi are replaced by nodes lying on roi borders.
Referenced by _polygon_get_mask_roi().
|
static |
get handle extremity from the control point n°2 the values should be in orthonormal space
Referenced by _find_closest_handle(), _polygon_events_button_pressed(), and _polygon_events_post_expose().
|
static |
|
static |
References dt_masks_form_t::points, and void().
|
static |
References _add_node_to_segment(), _change_node_type(), _find_closest_handle(), _polygon_ctrl2_to_handle(), _polygon_init_ctrl_points(), _polygon_is_clockwise(), dt_masks_node_polygon_t::border, dt_masks_form_gui_points_t::clockwise, dt_masks_form_gui_t::creation, dt_masks_form_gui_t::creation_closing_form, dt_masks_form_gui_t::creation_module, dt_masks_node_polygon_t::ctrl1, dt_masks_node_polygon_t::ctrl2, darktable, dt_masks_form_gui_t::delta, darktable_t::develop, dt_conf_get_float(), dt_dev_masks_selection_change(), dt_dev_roi_to_input_space(), DT_MASKS_CLONE, DT_MASKS_EDIT_FULL, dt_masks_get_from_id(), 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_is_corner_node(), DT_MASKS_NON_CLONE, DT_MASKS_POINT_STATE_NORMAL, DT_MASKS_POINT_STATE_USER, dt_masks_select_form(), dt_masks_set_edit_mode(), dt_masks_set_source_pos_initial_state(), dt_masks_set_source_pos_initial_value(), dt_modifier_is(), dt_toast_log(), dt_masks_form_gui_t::edit_mode, dt_masks_form_gui_t::form_dragging, dt_develop_t::form_gui, dt_masks_form_gui_t::form_selected, dt_develop_t::form_visible, dt_masks_form_group_t::formid, dt_masks_form_t::formid, g_list_shorter_than(), dt_masks_form_gui_t::group_selected, dt_masks_form_gui_t::handle_dragging, dt_masks_form_gui_t::handle_selected, HARDNESS_MAX, HARDNESS_MIN, MAX, MIN, dt_masks_node_polygon_t::node, dt_masks_form_gui_t::node_dragging, dt_masks_form_gui_t::node_edited, 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_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, dt_masks_node_polygon_t::state, TRUE, type, and dt_masks_form_t::type.
|
static |
|
static |
References _find_closest_handle(), _polygon_handle_to_ctrl(), _polygon_init_ctrl_points(), _polygon_is_clockwise(), dt_dev_pixelpipe_t::backbuf_height, dt_dev_pixelpipe_t::backbuf_width, dt_masks_form_gui_points_t::clockwise, dt_masks_form_gui_t::creation, dt_masks_form_gui_t::creation_closing_form, dt_masks_node_polygon_t::ctrl1, dt_masks_node_polygon_t::ctrl2, darktable, dt_masks_form_gui_t::delta, darktable_t::develop, dt_dev_distort_backtransform(), dt_dev_roi_delta_to_input_space(), DT_DRAW_SELECTION_RADIUS_NO_UPSCALE, DT_MASKS_CLONE, DT_MASKS_EDIT_FULL, dt_masks_gui_form_create(), dt_masks_gui_form_remove(), DT_MASKS_POINT_STATE_USER, dt_masks_form_gui_t::edit_mode, dt_masks_form_gui_t::form_dragging, g_list_next_wraparound(), g_list_shorter_than(), dt_masks_form_gui_t::handle_dragging, dt_dev_pixelpipe_t::iheight, dt_dev_pixelpipe_t::iwidth, dt_develop_t::natural_scale, dt_masks_node_polygon_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_develop_t::preview_pipe, dt_masks_form_gui_t::seg_dragging, dt_masks_form_t::source, dt_masks_form_gui_t::source_dragging, dt_masks_node_polygon_t::state, and dt_masks_form_t::type.
|
static |
References _change_hardness(), _change_size(), dt_masks_form_gui_t::creation, DT_MASKS_EDIT_FULL, dt_masks_form_change_opacity(), DT_MASKS_INCREMENT_SCALE, dt_modifier_is(), dt_masks_form_gui_t::edit_mode, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::handle_selected, dt_masks_form_gui_t::node_selected, and dt_masks_form_gui_t::seg_selected.
|
static |
References _polygon_ctrl2_to_handle(), _polygon_is_clockwise(), dt_masks_form_gui_points_t::border, dt_masks_form_gui_points_t::border_count, dt_masks_form_gui_t::border_selected, dt_masks_form_gui_points_t::clockwise, dt_masks_form_gui_t::creation, darktable, darktable_t::develop, dt_masks_functions_t::draw_shape, dt_draw_handle(), dt_draw_node(), dt_draw_shape_lines(), dt_draw_stroke_line(), dt_masks_calculate_source_pos_value(), DT_MASKS_CLONE, DT_MASKS_DASH_ROUND, DT_MASKS_DASH_STICK, dt_masks_draw_clone_source_pos(), dt_masks_draw_source(), dt_masks_functions_polygon, dt_masks_get_from_id(), dt_masks_is_corner_node(), DT_MASKS_NO_DASH, DT_MASKS_POLYGON, FALSE, dt_masks_form_gui_t::form_dragging, dt_masks_form_gui_t::form_selected, dt_develop_t::form_visible, dt_masks_form_group_t::formid, dt_masks_form_gui_t::group_selected, dt_masks_form_gui_t::handle_dragging, dt_masks_form_gui_t::handle_selected, dt_masks_form_gui_t::node_dragging, dt_masks_form_gui_t::node_edited, 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_points_t::points_count, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::seg_selected, dt_masks_form_gui_points_t::source_count, TRUE, and dt_masks_form_t::type.
| void _polygon_falloff | ( | float *const restrict | buffer, |
| int * | p0, | ||
| int * | p1, | ||
| int | posx, | ||
| int | posy, | ||
| int | bw | ||
| ) |
|
static |
we write a falloff segment respecting limits of buffer
References MAX.
Referenced by _polygon_get_mask_roi().
|
static |
fill eventual gaps between 2 points with a line using Bresenham algorithm This avoids repeated floating-point division and rounding errors.
References dt_masks_dynbuf_add_2(), and dt_masks_dynbuf_reset().
Referenced by _polygon_find_self_intersection().
|
static |
find all self intersections in a polygon
References _polygon_fill_gaps(), dt_alloc_align, dt_free_align, dt_masks_dynbuf_add_2(), dt_masks_dynbuf_buffer(), dt_masks_dynbuf_free(), dt_masks_dynbuf_get(), dt_masks_dynbuf_init(), dt_masks_dynbuf_position(), dt_masks_dynbuf_set(), and POLYGON_MAX_SELF_INTERSECTIONS.
Referenced by _polygon_get_pts_border().
|
static |
References _get_area(), FALSE, 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_point_in_form_exact(), 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 _polygon_bounding_box(), _polygon_falloff(), _polygon_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(), FALSE, 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 _polygon_bounding_box_raw(), _polygon_crop_to_roi(), _polygon_falloff_roi(), _polygon_get_pts_border(), darktable, dt_iop_module_t::dev, dt_alloc_align, dt_alloc_align_float(), DT_DEBUG_MASKS, DT_DEBUG_PERF, DT_DEV_TRANSFORM_DIR_BACK_INCL, dt_free_align, dt_get_wtime(), dt_print(), FALSE, height, dt_iop_roi_t::height, dt_iop_module_t::iop_order, m, 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 _polygon_get_XY(), g_list_next_bounded(), dt_masks_node_polygon_t::node, and dt_masks_form_t::points.
Referenced by _add_node_to_segment().
|
static |
get all points of the polygon and the border this take care of gaps and self-intersection and iop distortions
References _polygon_border_get_XY(), _polygon_find_self_intersection(), _polygon_is_clockwise(), _polygon_points_recurs(), _polygon_points_recurs_border_gaps(), dt_masks_node_polygon_t::border, dt_masks_node_polygon_t::ctrl1, dt_masks_node_polygon_t::ctrl2, darktable, dt_alloc_align_float(), 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_buffer(), 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(), g_list_next_wraparound(), dt_dev_pixelpipe_t::iheight, dt_dev_pixelpipe_t::iwidth, MAX, MIN, dt_masks_form_t::name, dt_masks_node_polygon_t::node, dt_masks_form_t::points, dt_masks_form_t::source, and darktable_t::unmuted.
Referenced by _get_area(), _polygon_get_mask(), _polygon_get_mask_roi(), and _polygon_get_points_border().
|
static |
References dt_dev_pixelpipe_t::backbuf_height, dt_dev_pixelpipe_t::backbuf_width, dt_masks_form_gui_points_t::border, darktable, darktable_t::develop, dt_masks_form_t::points, dt_masks_form_gui_points_t::points, dt_masks_form_gui_t::points, dt_masks_form_gui_points_t::points_count, and dt_develop_t::preview_pipe.
Referenced by _change_hardness(), and _change_size().
|
static |
References _get_area(), height, TRUE, and width.
|
static |
get the point of the polygon at pos t [0,1]
Referenced by _polygon_border_get_XY(), and _polygon_get_position_in_segment().
|
static |
References g_list_next_wraparound(), dt_masks_node_polygon_t::node, and dt_masks_form_t::points.
Referenced by _change_size().
|
static |
get bezier control points from handle extremity the values should be in orthonormal space
Referenced by _polygon_events_mouse_moved().
|
static |
initialise all control points to eventually match a catmull-rom like spline
References _polygon_catmull_to_bezier(), dt_masks_node_polygon_t::ctrl1, dt_masks_node_polygon_t::ctrl2, DT_MASKS_POINT_STATE_NORMAL, g_list_next_wraparound(), g_list_prev_wraparound(), dt_masks_node_polygon_t::node, dt_masks_form_t::points, and dt_masks_node_polygon_t::state.
Referenced by _add_node_to_segment(), _change_node_type(), _polygon_events_button_pressed(), and _polygon_events_mouse_moved().
|
static |
|
static |
|
static |
recursive function to get all points of the polygon AND all point of the border the function take care to avoid big gaps between points
References _polygon_border_get_XY(), _polygon_points_recurs(), and dt_masks_dynbuf_add_2().
Referenced by _polygon_get_pts_border(), and _polygon_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 node is very sharp
References dt_masks_dynbuf_reserve_n(), and M_PI.
Referenced by _polygon_get_pts_border().
|
static |
|
static |
References dt_masks_form_t::name.
|
static |
| const dt_masks_functions_t dt_masks_functions_polygon |
Referenced by _polygon_events_post_expose(), dt_masks_calculate_source_pos_value(), and dt_masks_create().