![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "develop/masks.h"#include "bauhaus/bauhaus.h"#include "common/debug.h"#include "common/mipmap_cache.h"#include "control/conf.h"#include "common/undo.h"#include "develop/blend.h"#include "develop/imageop.h"#include "develop/imageop_gui.h"#include "detail.c"
Include dependency graph for develop/masks/masks.c:Functions | |
| dt_masks_form_t * | dt_masks_dup_masks_form (const dt_masks_form_t *form) |
| static void * | _dup_masks_form_cb (const void *formdata, gpointer user_data) |
| GList * | dt_masks_dup_forms_deep (GList *forms, dt_masks_form_t *form) |
| static int | _get_opacity (dt_masks_form_gui_t *gui, const dt_masks_form_t *form) |
| static void | _set_hinter_message (dt_masks_form_gui_t *gui, const dt_masks_form_t *form) |
| void | dt_masks_init_form_gui (dt_masks_form_gui_t *gui) |
| void | dt_masks_soft_reset_form_gui (dt_masks_form_gui_t *gui) |
| void | dt_masks_gui_form_create (dt_masks_form_t *form, dt_masks_form_gui_t *gui, int index, dt_iop_module_t *module) |
| void | dt_masks_form_gui_points_free (gpointer data) |
| static void | _masks_remove_node (struct dt_iop_module_t *module, dt_masks_form_t *form, int parentid, dt_masks_form_gui_t *gui, int index) |
| static gboolean | _masks_remove_shape (struct dt_iop_module_t *module, dt_masks_form_t *form, int parentid, dt_masks_form_gui_t *gui, int index) |
| Remove a shape from the GUI and free its resources. | |
| gboolean | dt_masks_gui_delete (struct dt_iop_module_t *module, dt_masks_form_t *form, dt_masks_form_gui_t *gui, const int parentid) |
| Delete a mask shape or node form from the GUI. This function is to be used with a popupmenu "Delete" action in the future. | |
| void | dt_masks_gui_form_remove (dt_masks_form_t *form, dt_masks_form_gui_t *gui, int index) |
| void | dt_masks_gui_form_test_create (dt_masks_form_t *form, dt_masks_form_gui_t *gui, dt_iop_module_t *module) |
| static void | _check_id (dt_masks_form_t *form) |
| static void | _set_group_name_from_module (dt_iop_module_t *module, dt_masks_form_t *grp) |
| static dt_masks_form_t * | _group_create (dt_develop_t *dev, dt_iop_module_t *module, dt_masks_type_t type) |
| static dt_masks_form_t * | _group_from_module (dt_develop_t *dev, dt_iop_module_t *module) |
| void | dt_masks_append_form (dt_develop_t *dev, dt_masks_form_t *form) |
| void | dt_masks_remove_form (dt_develop_t *dev, dt_masks_form_t *form) |
| void | dt_masks_gui_form_save_creation (dt_develop_t *dev, dt_iop_module_t *module, dt_masks_form_t *form, dt_masks_form_gui_t *gui) |
| int | dt_masks_form_duplicate (dt_develop_t *dev, int formid) |
| int | dt_masks_get_points_border (dt_develop_t *dev, dt_masks_form_t *form, float **points, int *points_count, float **border, int *border_count, int source, dt_iop_module_t *module) |
| int | dt_masks_get_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) |
| int | dt_masks_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) |
| int | dt_masks_version (void) |
| static int | dt_masks_legacy_params_v1_to_v2 (dt_develop_t *dev, void *params) |
| static void | dt_masks_legacy_params_v2_to_v3_transform (const dt_image_t *img, float *points) |
| static void | dt_masks_legacy_params_v2_to_v3_transform_only_rescale (const dt_image_t *img, float *points, size_t points_count) |
| static int | dt_masks_legacy_params_v2_to_v3 (dt_develop_t *dev, void *params) |
| static int | dt_masks_legacy_params_v3_to_v4 (dt_develop_t *dev, void *params) |
| static int | dt_masks_legacy_params_v4_to_v5 (dt_develop_t *dev, void *params) |
| static int | dt_masks_legacy_params_v5_to_v6 (dt_develop_t *dev, void *params) |
| int | dt_masks_legacy_params (dt_develop_t *dev, void *params, const int old_version, const int new_version) |
| dt_masks_form_t * | dt_masks_create (dt_masks_type_t type) |
| dt_masks_form_t * | dt_masks_create_ext (dt_masks_type_t type) |
| void | dt_masks_replace_current_forms (dt_develop_t *dev, GList *forms) |
| dt_masks_form_t * | dt_masks_get_from_id_ext (GList *forms, int id) |
| dt_masks_form_t * | dt_masks_get_from_id (dt_develop_t *dev, int id) |
| void | dt_masks_read_masks_history (dt_develop_t *dev, const int32_t imgid) |
| void | dt_masks_write_masks_history_item (const int32_t imgid, const int num, dt_masks_form_t *form) |
| void | dt_masks_free_form (dt_masks_form_t *form) |
| int | dt_masks_events_mouse_leave (struct dt_iop_module_t *module) |
| int | dt_masks_events_mouse_enter (struct dt_iop_module_t *module) |
| static void | _set_cursor_shape (dt_masks_form_gui_t *gui) |
| int | dt_masks_events_mouse_moved (struct dt_iop_module_t *module, double x, double y, double pressure, int which) |
| int | dt_masks_events_button_released (struct dt_iop_module_t *module, double x, double y, int which, uint32_t state) |
| int | dt_masks_events_button_pressed (struct dt_iop_module_t *module, double x, double y, double pressure, int which, int type, uint32_t state) |
| int | dt_masks_events_mouse_scrolled (struct dt_iop_module_t *module, double x, double y, int up, uint32_t state, int scrolling_delta) |
| gboolean | dt_masks_is_corner_node (const dt_masks_form_gui_points_t *gpt, const int index, const int nb, const int coord_offset) |
| returns wether a node is a corner or not. A node is a corner if its 2 control handles are at the same position, else it's a curve. | |
| void | _dt_masks_find_best_attachment_point (float *pos_x, float *pos_y, const float offset, const float radius, const float origin_x, const float origin_y, const float cosc, const float sinc, const float *points, const int points_count) |
| Find the best attachment point for the arrow's tip or arrow's base along shape outline. | |
| void | dt_masks_draw_source (cairo_t *cr, dt_masks_form_gui_t *gui, const int index, const int nb, const float zoom_scale, const shape_draw_function_t *draw_shape_func) |
| Draw the source for a correction mask. | |
| void | dt_masks_events_post_expose (struct dt_iop_module_t *module, cairo_t *cr, int32_t width, int32_t height, int32_t pointerx, int32_t pointery) |
| void | dt_masks_clear_form_gui (dt_develop_t *dev) |
| void | dt_masks_change_form_gui (dt_masks_form_t *newform) |
| void | dt_masks_reset_form_gui (void) |
| void | dt_masks_reset_show_masks_icons (void) |
| dt_masks_edit_mode_t | dt_masks_get_edit_mode (struct dt_iop_module_t *module) |
| void | dt_masks_set_edit_mode (struct dt_iop_module_t *module, dt_masks_edit_mode_t value) |
| static void | _menu_no_masks (struct dt_iop_module_t *module) |
| static void | _menu_add_shape (struct dt_iop_module_t *module, dt_masks_type_t type) |
| static void | _menu_add_exist (dt_iop_module_t *module, int formid) |
| void | dt_masks_group_update_name (dt_iop_module_t *module) |
| void | dt_masks_iop_use_same_as (dt_iop_module_t *module, dt_iop_module_t *src) |
| void | dt_masks_iop_combo_populate (GtkWidget *w, void *m) |
| void | dt_masks_iop_value_changed_callback (GtkWidget *widget, struct dt_iop_module_t *module) |
| void | dt_masks_form_remove (struct dt_iop_module_t *module, dt_masks_form_t *grp, dt_masks_form_t *form) |
| float | dt_masks_form_get_opacity (dt_masks_form_t *form, int parentid) |
| const char * | _get_mask_plugin (dt_masks_form_t *form) |
| const char * | _get_mask_type (dt_masks_form_t *form) |
| float | dt_masks_get_set_conf_value (dt_masks_form_t *form, char *feature, float new_value, float v_min, float v_max, dt_masks_increment_t increment, int flow) |
| Change a numerical property of a mask shape, either by in/de-crementing the current value or setting it in an absolute fashion, then save it to configuration. | |
| int | dt_masks_form_set_opacity (dt_masks_form_t *form, int parentid, float opacity, dt_masks_increment_t offset, const int flow) |
| int | dt_masks_form_change_opacity (dt_masks_form_t *form, int parentid, int up, const int flow) |
| void | dt_masks_form_move (dt_masks_form_t *grp, int formid, int up) |
| static int | _find_in_group (dt_masks_form_t *grp, int formid) |
| dt_masks_form_group_t * | dt_masks_group_add_form (dt_masks_form_t *grp, dt_masks_form_t *form) |
| void | dt_masks_group_ungroup (dt_masks_form_t *dest_grp, dt_masks_form_t *grp) |
| uint64_t | dt_masks_group_get_hash (uint64_t hash, dt_masks_form_t *form) |
| static void | _cleanup_unused_recurs (GList *forms, int formid, int *used, int nb) |
| static int | _masks_cleanup_unused (GList **_forms, GList *history_list, const int history_end) |
| void | dt_masks_cleanup_unused_from_list (GList *history_list) |
| void | dt_masks_cleanup_unused (dt_develop_t *dev) |
| int | dt_masks_point_in_form_exact (float x, float y, float *points, int points_start, int points_count) |
Check whether the 2D point (x, y) lies inside the polygon (mask) described by points. | |
| int | dt_masks_point_in_form_near (float x, float y, float *points, int points_start, int points_count, float distance, int *near) |
| void | dt_masks_select_form (struct dt_iop_module_t *module, dt_masks_form_t *sel) |
| void | dt_masks_draw_clone_source_pos (cairo_t *cr, const float zoom_scale, const float x, const float y) |
| void | dt_masks_set_source_pos_initial_state (dt_masks_form_gui_t *gui, const uint32_t state, const float pzx, const float pzy) |
| void | dt_masks_set_source_pos_initial_value (dt_masks_form_gui_t *gui, dt_masks_form_t *form, const float pzx, const float pzy) |
| void | dt_masks_calculate_source_pos_value (dt_masks_form_gui_t *gui, const int mask_type, const float initial_xpos, const float initial_ypos, const float xpos, const float ypos, float *px, float *py, const int adding) |
| float | dt_masks_rotate_with_anchor (dt_develop_t *dev, const float anchor[2], const float center[2], dt_masks_form_gui_t *gui) |
| Rotate a mask shape around its center. WARNING: gui->delta will be updated with the new position after rotation. | |
| gboolean | dt_masks_is_within_radius (const float px, const float py, const float cx, const float cy, const float radius) |
| Check if a point (px,py) is inside a radius from a center point (cx,cy) | |
Variables | |
| static int | form_id = 0 |
|
static |
References darktable, darktable_t::develop, dt_masks_form_t::formid, and dt_develop_t::forms.
Referenced by _group_create(), dt_masks_form_duplicate(), and dt_masks_gui_form_save_creation().
|
static |
References _cleanup_unused_recurs(), dt_masks_get_from_id_ext(), DT_MASKS_GROUP, dt_masks_form_group_t::formid, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by _cleanup_unused_recurs(), and _masks_cleanup_unused().
| void _dt_masks_find_best_attachment_point | ( | float * | pos_x, |
| float * | pos_y, | ||
| const float | offset, | ||
| const float | radius, | ||
| const float | origin_x, | ||
| const float | origin_y, | ||
| const float | cosc, | ||
| const float | sinc, | ||
| const float * | points, | ||
| const int | points_count | ||
| ) |
Find the best attachment point for the arrow's tip or arrow's base along shape outline.
| pos_x | resulting x position |
| pos_y | resulting y position |
| offset | offset from the shape outline |
| radius | max radius of the shape |
| origin_x | x position of the shape's origin point |
| origin_y | y position of the shape's origin point |
| cosc | cosine of the angle |
| sinc | sine of the angle |
| points | array of points defining the shape outline |
| points_count | number of points in the shape outline |
References sqf().
Referenced by dt_masks_draw_source().
References dt_masks_dup_masks_form(), f(), and dt_masks_form_t::formid.
Referenced by dt_masks_dup_forms_deep().
|
static |
| const char * _get_mask_plugin | ( | dt_masks_form_t * | form | ) |
References DT_MASKS_CLONE, DT_MASKS_NON_CLONE, and dt_masks_form_t::type.
Referenced by dt_masks_get_set_conf_value().
| const char * _get_mask_type | ( | dt_masks_form_t * | form | ) |
References DT_MASKS_BRUSH, DT_MASKS_CIRCLE, DT_MASKS_ELLIPSE, DT_MASKS_GRADIENT, DT_MASKS_POLYGON, and dt_masks_form_t::type.
Referenced by dt_masks_get_set_conf_value().
|
static |
References darktable, darktable_t::develop, dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_form_group_t::formid, dt_masks_form_t::formid, dt_masks_form_gui_t::group_selected, dt_masks_form_group_t::opacity, dt_masks_form_group_t::parentid, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by _set_hinter_message().
|
static |
References _check_id(), _set_group_name_from_module(), dt_masks_append_form(), dt_masks_create(), and type.
Referenced by _menu_add_exist(), dt_masks_gui_form_save_creation(), and dt_masks_iop_use_same_as().
|
static |
References dt_iop_module_t::blend_params, dt_masks_get_from_id(), and dt_develop_blend_params_t::mask_id.
Referenced by _menu_add_exist(), _menu_no_masks(), dt_masks_form_remove(), dt_masks_group_update_name(), dt_masks_gui_form_save_creation(), dt_masks_iop_combo_populate(), and dt_masks_iop_use_same_as().
|
static |
|
static |
|
static |
Remove a shape from the GUI and free its resources.
| module | The module owning the mask |
| form | The form to remove |
| parentid | The parent ID of the form |
| gui | The GUI state |
| index | The index of the form in the group |
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_form_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 dt_masks_gui_delete().
|
static |
|
static |
|
static |
References _group_from_module(), darktable, darktable_t::develop, DT_MASKS_EDIT_OFF, dt_masks_form_remove(), dt_masks_iop_update(), and dt_masks_set_edit_mode().
Referenced by dt_masks_iop_value_changed_callback().
|
static |
References dt_masks_form_gui_t::creation, dt_masks_form_gui_t::creation_closing_form, dt_control_set_cursor(), dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::handle_selected, dt_masks_form_gui_t::node_edited, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::pivot_selected, and dt_masks_form_gui_t::seg_selected.
Referenced by dt_masks_events_button_released(), and dt_masks_events_mouse_moved().
|
static |
References dt_history_item_get_name(), and dt_masks_form_t::name.
Referenced by _group_create(), and dt_masks_group_update_name().
|
static |
References _get_opacity(), darktable_t::control, darktable, darktable_t::develop, dt_conf_get_float(), dt_control_hinter_message(), dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_form_group_t::formid, dt_masks_form_t::functions, dt_masks_form_gui_t::group_selected, dt_masks_form_t::points, dt_masks_functions_t::set_hint_message, and dt_masks_form_t::type.
Referenced by dt_masks_events_mouse_moved(), and dt_masks_events_mouse_scrolled().
| void dt_masks_append_form | ( | dt_develop_t * | dev, |
| dt_masks_form_t * | form | ||
| ) |
References dt_develop_t::forms.
Referenced by _group_create(), dt_masks_form_duplicate(), and dt_masks_gui_form_save_creation().
| void dt_masks_calculate_source_pos_value | ( | dt_masks_form_gui_t * | gui, |
| const int | mask_type, | ||
| const float | initial_xpos, | ||
| const float | initial_ypos, | ||
| const float | xpos, | ||
| const float | ypos, | ||
| float * | px, | ||
| float * | py, | ||
| const int | adding | ||
| ) |
References darktable, darktable_t::develop, DT_MASKS_BRUSH, DT_MASKS_CIRCLE, DT_MASKS_ELLIPSE, dt_masks_functions_brush, dt_masks_functions_circle, dt_masks_functions_ellipse, dt_masks_functions_polygon, DT_MASKS_POLYGON, DT_MASKS_SOURCE_POS_ABSOLUTE, DT_MASKS_SOURCE_POS_RELATIVE, DT_MASKS_SOURCE_POS_RELATIVE_TEMP, dt_dev_pixelpipe_t::iheight, dt_masks_functions_t::initial_source_pos, dt_dev_pixelpipe_t::iwidth, dt_masks_form_gui_t::pos_source, dt_develop_t::preview_pipe, and dt_masks_form_gui_t::source_pos_type.
Referenced by _brush_events_post_expose(), _circle_events_post_expose(), _ellipse_events_post_expose(), and _polygon_events_post_expose().
| void dt_masks_change_form_gui | ( | dt_masks_form_t * | newform | ) |
function used to manipulate forms for masks
References darktable, darktable_t::develop, dt_masks_clear_form_gui(), and dt_develop_t::form_visible.
Referenced by _add_shape(), _blendop_masks_add_shape(), _brush_events_button_released(), _bt_add_brush(), _bt_add_circle(), _bt_add_ellipse(), _bt_add_gradient(), _bt_add_path(), _edit_masks(), _masks_remove_shape(), _menu_add_shape(), _reset_form_creation(), _tree_add_brush(), _tree_add_circle(), _tree_add_ellipse(), _tree_add_gradient(), _tree_add_path(), _tree_delete_shape(), _tree_movedown(), _tree_moveup(), _tree_selection_change(), dt_masks_cleanup_unused(), dt_masks_reset_form_gui(), dt_masks_set_edit_mode(), enter(), gui_focus(), leave(), rt_add_shape(), rt_edit_masks_callback(), rt_reset_form_creation(), rt_select_algorithm_callback(), and rt_show_forms_for_current_scale().
| void dt_masks_cleanup_unused | ( | dt_develop_t * | dev | ) |
| void dt_masks_cleanup_unused_from_list | ( | GList * | history_list | ) |
References _masks_cleanup_unused(), dt_dev_history_item_t::forms, and dt_dev_history_item_t::op_name.
Referenced by dt_masks_cleanup_unused().
| void dt_masks_clear_form_gui | ( | dt_develop_t * | dev | ) |
References dt_masks_form_gui_t::border_selected, dt_masks_form_gui_t::border_toggling, dt_masks_form_gui_t::creation, dt_masks_form_gui_t::creation_closing_form, dt_masks_form_gui_t::creation_module, dt_masks_form_gui_t::delta, dt_masks_dynbuf_free(), DT_MASKS_EDIT_OFF, dt_masks_form_gui_points_free(), DT_MASKS_PRESSURE_OFF, dt_masks_select_form(), dt_masks_form_gui_t::edit_mode, FALSE, dt_masks_form_gui_t::form_dragging, dt_develop_t::form_gui, dt_masks_form_gui_t::form_rotating, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::formid, dt_masks_form_gui_t::gradient_toggling, 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_dragging, dt_masks_form_gui_t::handle_border_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_gui_t::pipe_hash, dt_masks_form_gui_t::pivot_selected, dt_masks_form_gui_t::points, dt_masks_form_gui_t::pressure_sensitivity, 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_gui_t::source_dragging, and dt_masks_form_gui_t::source_selected.
Referenced by _masks_remove_shape(), dt_masks_change_form_gui(), and leave().
| dt_masks_form_t * dt_masks_create | ( | dt_masks_type_t | type | ) |
we create a completely new form.
References DT_MASKS_BRUSH, DT_MASKS_CIRCLE, DT_MASKS_ELLIPSE, dt_masks_functions_brush, dt_masks_functions_circle, dt_masks_functions_ellipse, dt_masks_functions_gradient, dt_masks_functions_group, dt_masks_functions_polygon, DT_MASKS_GRADIENT, DT_MASKS_GROUP, DT_MASKS_POLYGON, dt_masks_version(), form_id, dt_masks_form_t::formid, dt_masks_form_t::functions, dt_masks_functions_t::sanitize_config, type, dt_masks_form_t::type, and dt_masks_form_t::version.
Referenced by _add_shape(), _blendop_masks_add_shape(), _group_create(), _menu_add_shape(), _tree_add_brush(), _tree_add_circle(), _tree_add_ellipse(), _tree_add_gradient(), _tree_add_path(), _tree_group(), _tree_selection_change(), dt_masks_create_ext(), dt_masks_form_duplicate(), dt_masks_read_masks_history(), legacy_params(), rt_add_shape(), and rt_select_algorithm_callback().
| dt_masks_form_t * dt_masks_create_ext | ( | dt_masks_type_t | type | ) |
we create a completely new form and add it to darktable.develop->allforms.
References dt_develop_t::allforms, darktable, darktable_t::develop, dt_masks_create(), and type.
Referenced by dt_masks_set_edit_mode(), and rt_show_forms_for_current_scale().
| void dt_masks_draw_clone_source_pos | ( | cairo_t * | cr, |
| const float | zoom_scale, | ||
| const float | x, | ||
| const float | y | ||
| ) |
utils for selecting the source of a clone mask while creating it
References dt_draw_set_color_overlay(), dt_draw_set_dash_style(), DT_DRAW_SIZE_CROSS, DT_DRAW_SIZE_LINE, DT_DRAW_SIZE_LINE_HIGHLIGHT, DT_MASKS_NO_DASH, FALSE, and TRUE.
Referenced by _brush_events_post_expose(), _circle_events_post_expose(), _ellipse_events_post_expose(), and _polygon_events_post_expose().
| void dt_masks_draw_source | ( | cairo_t * | cr, |
| dt_masks_form_gui_t * | gui, | ||
| const int | index, | ||
| const int | nb, | ||
| const float | zoom_scale, | ||
| const shape_draw_function_t * | functions | ||
| ) |
Draw the source for a correction mask.
| cr | the cairo context to draw into |
| gui | the GUI state of the mask form |
| index | the index of the mask form |
| nb | the number of coord for that shape |
| zoom_scale | the current zoom scale of the image |
| shape_function | the function to draw the shape |
References _dt_masks_find_best_attachment_point(), dt_masks_form_gui_t::creation, dt_draw_arrow(), dt_draw_set_color_overlay(), dt_draw_set_dash_style(), DT_DRAW_SIZE_LINE, DT_DRAW_SIZE_LINE_HIGHLIGHT, DT_DRAW_SIZE_LINE_HIGHLIGHT_SELECTED, DT_DRAW_SIZE_LINE_SELECTED, DT_MASKS_DASH_ROUND, DT_MASKS_NO_DASH, dt_masks_point_in_form_exact(), DT_PIXEL_APPLY_DPI, FALSE, dt_masks_form_gui_t::form_dragging, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::group_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_points_t::source, dt_masks_form_gui_points_t::source_count, dt_masks_form_gui_t::source_dragging, dt_masks_form_gui_t::source_selected, sqf(), and TRUE.
Referenced by _brush_events_post_expose(), _circle_events_post_expose(), _ellipse_events_post_expose(), and _polygon_events_post_expose().
| GList * dt_masks_dup_forms_deep | ( | GList * | forms, |
| dt_masks_form_t * | form | ||
| ) |
References _dup_masks_form_cb().
Referenced by dt_dev_add_history_item_ext(), dt_dev_pixelpipe_process(), dt_history_duplicate(), and dt_masks_replace_current_forms().
| dt_masks_form_t * dt_masks_dup_masks_form | ( | const dt_masks_form_t * | form | ) |
References dt_masks_form_t::functions, dt_masks_functions_t::point_struct_size, and dt_masks_form_t::points.
Referenced by _dup_masks_form_cb(), and dt_history_merge_module_into_history().
| int dt_masks_events_button_pressed | ( | struct dt_iop_module_t * | module, |
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | which, | ||
| int | type, | ||
| uint32_t | state | ||
| ) |
References dt_masks_functions_t::button_pressed, dt_develop_t::darkroom_skip_mouse_events, darktable, darktable_t::develop, DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_dev_retrieve_full_pos(), DT_SIGNAL_MASK_SELECTION_CHANGED, dt_develop_t::form_gui, dt_develop_t::form_visible, dt_masks_form_t::functions, darktable_t::signals, and type.
Referenced by button_pressed().
| int dt_masks_events_button_released | ( | struct dt_iop_module_t * | module, |
| double | x, | ||
| double | y, | ||
| int | which, | ||
| uint32_t | state | ||
| ) |
References _set_cursor_shape(), dt_masks_functions_t::button_released, dt_develop_t::darkroom_skip_mouse_events, darktable, darktable_t::develop, dt_dev_masks_selection_change(), dt_dev_retrieve_full_pos(), FALSE, dt_develop_t::form_gui, dt_develop_t::form_visible, dt_masks_form_t::functions, and dt_develop_t::mask_form_selected_id.
Referenced by button_released().
| int dt_masks_events_mouse_enter | ( | struct dt_iop_module_t * | module | ) |
References darktable, darktable_t::develop, FALSE, dt_develop_t::form_gui, and dt_masks_form_gui_t::mouse_leaved_center.
Referenced by mouse_enter().
| int dt_masks_events_mouse_leave | ( | struct dt_iop_module_t * | module | ) |
References darktable, darktable_t::develop, dt_develop_t::form_gui, dt_masks_form_gui_t::mouse_leaved_center, and TRUE.
Referenced by mouse_leave().
| int dt_masks_events_mouse_moved | ( | struct dt_iop_module_t * | module, |
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | which | ||
| ) |
References _set_cursor_shape(), _set_hinter_message(), dt_dev_pixelpipe_t::backbuf_height, dt_dev_pixelpipe_t::backbuf_width, dt_develop_t::darkroom_skip_mouse_events, darktable, darktable_t::develop, dt_dev_retrieve_full_pos(), FALSE, dt_develop_t::form_gui, dt_develop_t::form_visible, dt_masks_form_t::functions, dt_masks_form_gui_t::mouse_leaved_center, dt_masks_functions_t::mouse_moved, dt_develop_t::natural_scale, dt_masks_form_gui_t::pos, and dt_develop_t::preview_pipe.
Referenced by mouse_moved().
| int dt_masks_events_mouse_scrolled | ( | struct dt_iop_module_t * | module, |
| double | x, | ||
| double | y, | ||
| int | up, | ||
| uint32_t | state, | ||
| int | scrolling_delta | ||
| ) |
References _set_hinter_message(), dt_develop_t::darkroom_skip_mouse_events, darktable, darktable_t::develop, dt_dev_retrieve_full_pos(), dt_mask_scroll_increases(), DT_MASKS_INTERACTION_UNDEF, dt_develop_t::form_gui, dt_develop_t::form_visible, dt_masks_form_t::functions, and dt_masks_functions_t::mouse_scrolled.
Referenced by scrolled().
| void dt_masks_events_post_expose | ( | struct dt_iop_module_t * | module, |
| cairo_t * | cr, | ||
| int32_t | width, | ||
| int32_t | height, | ||
| int32_t | pointerx, | ||
| int32_t | pointery | ||
| ) |
References dt_masks_form_gui_t::creation, darktable, darktable_t::develop, dt_dev_get_processed_size(), dt_dev_get_zoom_level(), dt_dev_rescale_roi_to_input(), dt_group_events_post_expose(), DT_MASKS_CIRCLE, DT_MASKS_ELLIPSE, DT_MASKS_GRADIENT, DT_MASKS_GROUP, dt_masks_gui_form_test_create(), dt_develop_t::form_gui, dt_develop_t::form_visible, dt_masks_form_t::functions, height, dt_masks_form_t::points, dt_masks_functions_t::post_expose, dt_masks_form_t::type, and width.
Referenced by expose().
| int dt_masks_form_change_opacity | ( | dt_masks_form_t * | form, |
| int | parentid, | ||
| int | up, | ||
| const int | flow | ||
| ) |
| int dt_masks_form_duplicate | ( | dt_develop_t * | dev, |
| int | formid | ||
| ) |
References _check_id(), dt_masks_append_form(), dt_masks_create(), dt_masks_get_from_id(), dt_masks_functions_t::duplicate_points, dt_masks_form_t::formid, dt_masks_form_t::functions, dt_masks_form_t::name, dt_masks_form_t::source, dt_masks_form_t::type, and dt_masks_form_t::version.
Referenced by _group_duplicate_points(), and _tree_duplicate_shape().
| float dt_masks_form_get_opacity | ( | dt_masks_form_t * | form, |
| int | parentid | ||
| ) |
Getters and setters for direct GUI interaction
References darktable, darktable_t::develop, dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_form_group_t::formid, dt_masks_form_t::formid, dt_masks_form_group_t::opacity, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by _set_opacity_slider().
| void dt_masks_form_gui_points_free | ( | gpointer | data | ) |
References dt_masks_form_gui_points_t::border, dt_free_align, dt_masks_form_gui_points_t::points, and dt_masks_form_gui_points_t::source.
Referenced by dt_masks_clear_form_gui(), and dt_masks_gui_form_test_create().
| void dt_masks_form_move | ( | dt_masks_form_t * | grp, |
| int | formid, | ||
| int | up | ||
| ) |
References DT_MASKS_GROUP, dt_masks_form_group_t::formid, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by _tree_movedown(), and _tree_moveup().
| void dt_masks_form_remove | ( | struct dt_iop_module_t * | module, |
| dt_masks_form_t * | grp, | ||
| dt_masks_form_t * | form | ||
| ) |
References _group_from_module(), darktable, darktable_t::develop, DT_MASKS_CLONE, dt_masks_form_remove(), dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_iop_update(), DT_MASKS_NON_CLONE, dt_masks_remove_form(), f(), dt_masks_form_group_t::formid, dt_masks_form_t::formid, dt_develop_t::forms, dt_develop_t::iop, IOP_FLAGS_SUPPORTS_BLENDING, m, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by _gui_reset_callback(), _masks_remove_shape(), _menu_no_masks(), _tree_delete_shape(), and dt_masks_form_remove().
| int dt_masks_form_set_opacity | ( | dt_masks_form_t * | form, |
| int | parentid, | ||
| float | opacity, | ||
| dt_masks_increment_t | offset, | ||
| const int | flow | ||
| ) |
References darktable, darktable_t::develop, dt_masks_get_from_id(), DT_MASKS_GROUP, DT_MASKS_INCREMENT_OFFSET, DT_MASKS_INCREMENT_SCALE, dt_toast_log(), dt_masks_form_group_t::formid, dt_masks_form_t::formid, dt_masks_form_group_t::opacity, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by _ellipse_events_mouse_scrolled(), _opacity_changed_callback(), and dt_masks_form_change_opacity().
| void dt_masks_free_form | ( | dt_masks_form_t * | form | ) |
References dt_masks_form_t::points.
Referenced by dt_dev_add_history_item_ext(), dt_dev_cleanup(), dt_dev_free_history_item(), dt_dev_pixelpipe_cleanup(), dt_dev_pixelpipe_process(), and leave().
| int dt_masks_get_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 | ||
| ) |
get the rectangle which include the form and his border
References dt_masks_form_t::functions, dt_masks_functions_t::get_area, height, and width.
Referenced by masks_form_is_in_roi(), rt_compute_roi_in(), and rt_masks_form_is_in_roi().
| dt_masks_edit_mode_t dt_masks_get_edit_mode | ( | struct dt_iop_module_t * | module | ) |
References darktable, darktable_t::develop, DT_MASKS_EDIT_OFF, dt_masks_form_gui_t::edit_mode, and dt_develop_t::form_gui.
Referenced by _lib_history_change_callback().
| dt_masks_form_t * dt_masks_get_from_id | ( | dt_develop_t * | dev, |
| int | id | ||
| ) |
returns a form with formid == id from dev->forms
References dt_masks_get_from_id_ext(), and dt_develop_t::forms.
Referenced by _blendop_masks_show_and_edit(), _brush_events_button_released(), _circle_events_button_pressed(), _edit_masks(), _ellipse_events_button_pressed(), _find_in_group(), _get_opacity(), _group_events_button_pressed(), _group_events_button_released(), _group_events_mouse_moved(), _group_events_mouse_scrolled(), _group_events_post_expose_draw(), _group_from_module(), _group_get_mask(), _group_get_mask_roi(), _gui_reset_callback(), _is_form_used(), _lib_masks_list_recurs(), _masks_remove_shape(), _menu_add_exist(), _polygon_events_button_pressed(), _polygon_events_post_expose(), _reset_form_creation(), _resynch_params(), _set_hinter_message(), _shape_is_being_added(), _tree_add_exist(), _tree_button_pressed(), _tree_cell_edited(), _tree_delete_shape(), _tree_difference(), _tree_exclusion(), _tree_intersection(), _tree_inverse(), _tree_movedown(), _tree_moveup(), _tree_selection_change(), _tree_union(), _update_foreach(), dt_masks_form_duplicate(), dt_masks_form_get_opacity(), dt_masks_form_remove(), dt_masks_form_set_opacity(), dt_masks_group_get_hash(), dt_masks_group_ungroup(), dt_masks_gui_form_test_create(), dt_masks_iop_update(), dt_masks_iop_use_same_as(), dt_masks_set_edit_mode(), give_control_to_form(), gui_focus(), gui_update(), post_history_commit(), rt_display_selected_shapes_lbl(), rt_edit_masks_callback(), rt_get_mask_point_group(), rt_resynch_params(), rt_shape_is_being_added(), rt_show_forms_for_current_scale(), and rt_show_hide_controls().
| dt_masks_form_t * dt_masks_get_from_id_ext | ( | GList * | forms, |
| int | id | ||
| ) |
returns a form with formid == id from a list of forms
References dt_masks_form_t::formid.
Referenced by _cleanup_unused_recurs(), _fill_used_forms(), _process(), dt_develop_blend_process(), dt_history_merge_module_into_history(), dt_iop_compute_blendop_hash(), dt_masks_get_from_id(), modify_roi_in(), rt_compute_roi_in(), rt_extend_roi_in_for_clone(), rt_extend_roi_in_from_source_clones(), and rt_process_forms().
| int dt_masks_get_points_border | ( | dt_develop_t * | dev, |
| dt_masks_form_t * | form, | ||
| float ** | points, | ||
| int * | points_count, | ||
| float ** | border, | ||
| int * | border_count, | ||
| int | source, | ||
| dt_iop_module_t * | module | ||
| ) |
get points in real space with respect of distortion dx and dy are used to eventually move the center of the circle
References dt_masks_form_t::functions, and dt_masks_functions_t::get_points_border.
Referenced by dt_masks_gui_form_create().
| float dt_masks_get_set_conf_value | ( | dt_masks_form_t * | form, |
| char * | feature, | ||
| float | new_value, | ||
| float | v_min, | ||
| float | v_max, | ||
| dt_masks_increment_t | increment, | ||
| const int | flow | ||
| ) |
Change a numerical property of a mask shape, either by in/de-crementing the current value or setting it in an absolute fashion, then save it to configuration.
| form | the shape to change. We will read its type internally |
| feature | the propertie to change:Â hardness, size, curvature (for gradients) |
| new_value | if increment is set to absolute, this is directly the updated value. if increment is offset, the updated value is old_value + new_value. if increment is scale, the updated value is old value * new_value. |
| v_min | minimum acceptable value of the property for sanitization |
| v_max | maximum acceptable value of the property for sanitization |
| increment | the increment type: absolute, offset or scale. |
| flow | the value of the scroll distance that can be postive or negative. |
References _get_mask_plugin(), _get_mask_type(), dt_conf_get_float(), dt_conf_set_float(), DT_MASKS_INCREMENT_OFFSET, DT_MASKS_INCREMENT_SCALE, key, MAX, and MIN.
Referenced by _brush_events_button_pressed(), _brush_events_button_released(), _brush_events_post_expose(), _change_hardness(), _change_size(), _init_curvature(), _init_extent(), _init_hardness(), _init_hardness(), _init_hardness(), _init_hardness(), _init_opacity(), _init_opacity(), _init_opacity(), _init_opacity(), _init_rotation(), _init_rotation(), _init_size(), _init_size(), and _init_size().
| int dt_masks_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 | ||
| ) |
References DT_MASKS_CLONE, dt_masks_form_t::functions, dt_masks_functions_t::get_source_area, height, dt_masks_form_t::type, and width.
Referenced by modify_roi_in(), rt_extend_roi_in_for_clone(), and rt_extend_roi_in_from_source_clones().
| dt_masks_form_group_t * dt_masks_group_add_form | ( | dt_masks_form_t * | grp, |
| dt_masks_form_t * | form | ||
| ) |
References _find_in_group(), dt_conf_get_float(), dt_control_log(), DT_MASKS_GROUP, DT_MASKS_STATE_SHOW, DT_MASKS_STATE_UNION, DT_MASKS_STATE_USE, dt_masks_form_group_t::formid, dt_masks_form_t::formid, dt_masks_form_group_t::opacity, dt_masks_form_group_t::parentid, dt_masks_form_t::points, dt_masks_form_group_t::state, and dt_masks_form_t::type.
Referenced by _menu_add_exist(), _tree_add_exist(), and dt_masks_iop_use_same_as().
| uint64_t dt_masks_group_get_hash | ( | uint64_t | hash, |
| dt_masks_form_t * | form | ||
| ) |
References darktable, darktable_t::develop, dt_hash(), dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_group_get_hash(), f(), dt_masks_form_group_t::formid, dt_masks_form_t::formid, dt_masks_form_t::functions, dt_masks_form_group_t::opacity, dt_masks_functions_t::point_struct_size, dt_masks_form_t::points, dt_masks_form_t::source, dt_masks_form_group_t::state, dt_masks_form_t::type, and dt_masks_form_t::version.
Referenced by dt_dev_masks_update_hash(), dt_iop_compute_blendop_hash(), and dt_masks_group_get_hash().
| void dt_masks_group_ungroup | ( | dt_masks_form_t * | dest_grp, |
| dt_masks_form_t * | grp | ||
| ) |
References darktable, darktable_t::develop, dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_group_ungroup(), dt_masks_form_group_t::formid, dt_masks_form_group_t::opacity, dt_masks_form_group_t::parentid, dt_masks_form_t::points, dt_masks_form_group_t::state, and dt_masks_form_t::type.
Referenced by _tree_selection_change(), dt_masks_group_ungroup(), dt_masks_set_edit_mode(), and rt_show_forms_for_current_scale().
| void dt_masks_group_update_name | ( | dt_iop_module_t * | module | ) |
References _group_from_module(), _set_group_name_from_module(), darktable, darktable_t::develop, and dt_masks_iop_update().
Referenced by _rename_module_key_press().
| gboolean dt_masks_gui_delete | ( | struct dt_iop_module_t * | module, |
| dt_masks_form_t * | form, | ||
| dt_masks_form_gui_t * | gui, | ||
| const int | parentid | ||
| ) |
Delete a mask shape or node form from the GUI. This function is to be used with a popupmenu "Delete" action in the future.
| module | The module owning the mask |
| form | The form to delete |
| gui | The GUI state of the form |
| parentid | The parent ID of the form |
References _masks_remove_node(), _masks_remove_shape(), DT_MASKS_BRUSH, DT_MASKS_EDIT_FULL, DT_MASKS_POLYGON, dt_masks_form_gui_t::edit_mode, g_list_shorter_than(), dt_masks_form_gui_t::group_selected, dt_masks_form_gui_t::node_selected, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by _group_events_button_pressed().
| void dt_masks_gui_form_create | ( | dt_masks_form_t * | form, |
| dt_masks_form_gui_t * | gui, | ||
| int | index, | ||
| struct dt_iop_module_t * | module | ||
| ) |
functions used to manipulate gui data
References dt_dev_pixelpipe_t::backbuf_hash, dt_masks_form_gui_points_t::border, dt_masks_form_gui_points_t::border_count, darktable, darktable_t::develop, DT_MASKS_CLONE, dt_masks_get_points_border(), dt_masks_gui_form_remove(), dt_masks_form_t::formid, dt_masks_form_gui_t::formid, dt_masks_form_gui_t::pipe_hash, dt_masks_form_gui_points_t::points, dt_masks_form_gui_t::points, dt_masks_form_gui_points_t::points_count, dt_develop_t::preview_pipe, dt_masks_form_gui_points_t::source, dt_masks_form_gui_points_t::source_count, TRUE, and dt_masks_form_t::type.
Referenced by _add_node_to_segment(), _add_node_to_segment(), _brush_events_button_pressed(), _brush_events_mouse_moved(), _change_curvature(), _change_extent(), _change_hardness(), _change_hardness(), _change_hardness(), _change_hardness(), _change_node_type(), _change_node_type(), _change_rotation(), _change_rotation(), _change_size(), _change_size(), _change_size(), _change_size(), _circle_events_mouse_moved(), _ellipse_events_button_released(), _ellipse_events_mouse_moved(), _gradient_events_button_pressed(), _gradient_events_button_released(), _gradient_events_mouse_moved(), _masks_remove_node(), _polygon_events_button_pressed(), _polygon_events_mouse_moved(), and dt_masks_gui_form_test_create().
| void dt_masks_gui_form_remove | ( | dt_masks_form_t * | form, |
| dt_masks_form_gui_t * | gui, | ||
| int | index | ||
| ) |
References dt_masks_form_gui_points_t::border, dt_masks_form_gui_points_t::border_count, dt_free_align, dt_masks_form_gui_t::formid, dt_masks_form_gui_t::pipe_hash, 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 _add_node_to_segment(), _add_node_to_segment(), _brush_events_button_pressed(), _brush_events_mouse_moved(), _change_curvature(), _change_extent(), _change_hardness(), _change_hardness(), _change_hardness(), _change_hardness(), _change_node_type(), _change_node_type(), _change_rotation(), _change_rotation(), _change_size(), _change_size(), _change_size(), _change_size(), _circle_events_mouse_moved(), _ellipse_events_button_released(), _ellipse_events_mouse_moved(), _gradient_events_button_pressed(), _gradient_events_button_released(), _gradient_events_mouse_moved(), _masks_remove_node(), _polygon_events_button_pressed(), _polygon_events_mouse_moved(), and dt_masks_gui_form_create().
| void dt_masks_gui_form_save_creation | ( | dt_develop_t * | dev, |
| dt_iop_module_t * | module, | ||
| dt_masks_form_t * | form, | ||
| dt_masks_form_gui_t * | gui | ||
| ) |
References _check_id(), _group_create(), _group_from_module(), dt_masks_form_gui_t::creation, dt_conf_get_float(), dt_masks_append_form(), DT_MASKS_CLONE, DT_MASKS_GROUP, dt_masks_iop_update(), DT_MASKS_NON_CLONE, DT_MASKS_STATE_SHOW, DT_MASKS_STATE_UNION, DT_MASKS_STATE_USE, f(), FALSE, dt_develop_t::form_gui, dt_masks_form_group_t::formid, dt_masks_form_t::formid, dt_masks_form_gui_t::formid, dt_develop_t::forms, dt_masks_form_t::functions, dt_masks_form_t::name, dt_masks_form_group_t::opacity, dt_masks_form_group_t::parentid, dt_masks_form_t::points, dt_masks_functions_t::set_form_name, dt_masks_form_group_t::state, TRUE, and dt_masks_form_t::type.
Referenced by _brush_events_button_released(), _circle_events_button_pressed(), _ellipse_events_button_pressed(), _gradient_events_button_pressed(), _polygon_events_button_pressed(), and legacy_params().
| void dt_masks_gui_form_test_create | ( | dt_masks_form_t * | form, |
| dt_masks_form_gui_t * | gui, | ||
| dt_iop_module_t * | module | ||
| ) |
References dt_dev_pixelpipe_t::backbuf_hash, darktable, darktable_t::develop, dt_masks_form_gui_points_free(), dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_gui_form_create(), dt_masks_form_group_t::formid, dt_masks_form_gui_t::formid, dt_masks_form_gui_t::pipe_hash, dt_masks_form_t::points, dt_masks_form_gui_t::points, dt_develop_t::preview_pipe, and dt_masks_form_t::type.
Referenced by dt_masks_events_post_expose().
| void dt_masks_init_form_gui | ( | dt_masks_form_gui_t * | gui | ) |
init dt_masks_form_gui_t struct with default values
References DT_MASKS_SOURCE_POS_RELATIVE_TEMP, FALSE, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::mouse_leaved_center, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::pos_source, dt_masks_form_gui_t::source_pos_type, and TRUE.
Referenced by enter().
References _group_from_module(), darktable, darktable_t::develop, dt_bauhaus_combobox_add(), dt_bauhaus_combobox_length(), dt_bauhaus_combobox_remove_at(), dt_history_item_get_name(), dt_iop_request_focus(), DT_MASKS_CLONE, DT_MASKS_GROUP, DT_MASKS_NON_CLONE, dt_masks_form_group_t::formid, dt_masks_form_t::formid, IOP_FLAGS_NO_MASKS, IOP_FLAGS_SUPPORTS_BLENDING, dt_iop_gui_blend_data_t::masks_combo, dt_iop_gui_blend_data_t::masks_combo_ids, dt_masks_form_t::name, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by dt_iop_gui_init_masks().
| void dt_masks_iop_use_same_as | ( | dt_iop_module_t * | module, |
| dt_iop_module_t * | src | ||
| ) |
References _group_create(), _group_from_module(), dt_iop_module_t::blend_params, darktable, darktable_t::develop, dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_group_add_form(), dt_masks_form_group_t::formid, dt_develop_blend_params_t::mask_id, dt_masks_form_group_t::opacity, dt_masks_form_t::points, dt_masks_form_group_t::state, and dt_masks_form_t::type.
Referenced by dt_iop_gui_duplicate(), and dt_masks_iop_value_changed_callback().
| void dt_masks_iop_value_changed_callback | ( | GtkWidget * | widget, |
| struct dt_iop_module_t * | module | ||
| ) |
References _menu_add_exist(), _menu_add_shape(), _menu_no_masks(), dt_iop_module_t::blend_data, dt_iop_module_t::dev, dt_bauhaus_combobox_get(), dt_dev_add_history_item, DT_MASKS_BRUSH, DT_MASKS_CIRCLE, DT_MASKS_EDIT_FULL, DT_MASKS_ELLIPSE, DT_MASKS_GRADIENT, dt_masks_iop_update(), dt_masks_iop_use_same_as(), DT_MASKS_POLYGON, dt_masks_set_edit_mode(), dt_develop_t::iop, m, dt_iop_gui_blend_data_t::masks_combo, dt_iop_gui_blend_data_t::masks_combo_ids, and TRUE.
Referenced by dt_iop_gui_init_masks().
| gboolean dt_masks_is_corner_node | ( | const dt_masks_form_gui_points_t * | gpt, |
| const int | index, | ||
| const int | nb, | ||
| const int | coord_offset | ||
| ) |
returns wether a node is a corner or not. A node is a corner if its 2 control handles are at the same position, else it's a curve.
| gpt | the GUI points of the mask form |
| index | the index of the node to test |
| nb | the number of coord by node |
| coord_offset | the offset of the coordinates in the points array |
References dt_masks_form_gui_points_t::points.
Referenced by _brush_events_button_pressed(), _brush_events_post_expose(), _ellipse_draw_node(), _find_closest_handle(), _find_closest_handle(), _polygon_events_button_pressed(), and _polygon_events_post_expose().
| gboolean dt_masks_is_within_radius | ( | const float | px, |
| const float | py, | ||
| const float | cx, | ||
| const float | cy, | ||
| const float | radius | ||
| ) |
Check if a point (px,py) is inside a radius from a center point (cx,cy)
| px | x coord of the point to test |
| py | y coord of the point to test |
| cx | center x coord |
| cy | center y coord |
| radius | the radius from center |
Referenced by _find_closest_handle(), _find_closest_handle(), and _find_closest_handle().
| int dt_masks_legacy_params | ( | dt_develop_t * | dev, |
| void * | params, | ||
| const int | old_version, | ||
| const int | new_version | ||
| ) |
|
static |
References dt_dev_pixelpipe_iop_t::buf_in, dt_image_orientation(), DT_MASKS_BRUSH, DT_MASKS_CIRCLE, DT_MASKS_CLONE, DT_MASKS_ELLIPSE, DT_MASKS_GRADIENT, DT_MASKS_POLYGON, dt_iop_roi_t::height, dt_develop_t::image_storage, dt_develop_t::iop, m, dt_iop_module_t::op, ORIENTATION_NONE, ORIENTATION_ROTATE_180_DEG, ORIENTATION_ROTATE_CCW_90_DEG, ORIENTATION_ROTATE_CW_90_DEG, ORIENTATION_SWAP_XY, dt_masks_node_ellipse_t::radius, dt_masks_anchor_gradient_t::rotation, and dt_iop_roi_t::width.
Referenced by dt_masks_legacy_params().
|
static |
References dt_masks_node_circle_t::border, dt_masks_node_ellipse_t::border, dt_masks_node_polygon_t::border, dt_masks_node_brush_t::border, dt_masks_node_circle_t::center, dt_masks_node_ellipse_t::center, dt_masks_anchor_gradient_t::center, dt_image_t::crop_height, dt_image_t::crop_width, dt_image_t::crop_x, dt_image_t::crop_y, dt_masks_node_polygon_t::ctrl1, dt_masks_node_brush_t::ctrl1, dt_masks_node_polygon_t::ctrl2, dt_masks_node_brush_t::ctrl2, DT_MASKS_BRUSH, DT_MASKS_CIRCLE, DT_MASKS_CLONE, DT_MASKS_ELLIPSE, DT_MASKS_GRADIENT, dt_masks_legacy_params_v2_to_v3_transform(), dt_masks_legacy_params_v2_to_v3_transform_only_rescale(), DT_MASKS_POLYGON, dt_develop_t::image_storage, m, dt_masks_node_polygon_t::node, dt_masks_node_brush_t::node, dt_masks_node_circle_t::radius, dt_masks_node_ellipse_t::radius, and dt_image_t::version.
Referenced by dt_masks_legacy_params().
|
static |
References dt_image_t::crop_height, dt_image_t::crop_width, dt_image_t::crop_x, dt_image_t::crop_y, dt_image_t::height, and dt_image_t::width.
Referenced by dt_masks_legacy_params_v2_to_v3().
|
static |
References dt_image_t::crop_height, dt_image_t::crop_width, dt_image_t::crop_x, dt_image_t::crop_y, dt_image_t::height, MIN, and dt_image_t::width.
Referenced by dt_masks_legacy_params_v2_to_v3().
|
static |
References DT_MASKS_ELLIPSE, DT_MASKS_ELLIPSE_EQUIDISTANT, dt_masks_node_ellipse_t::flags, and m.
Referenced by dt_masks_legacy_params().
|
static |
References dt_masks_anchor_gradient_t::curvature, DT_MASKS_GRADIENT, and m.
Referenced by dt_masks_legacy_params().
|
static |
References DT_MASKS_GRADIENT, DT_MASKS_GRADIENT_STATE_LINEAR, m, and dt_masks_anchor_gradient_t::state.
Referenced by dt_masks_legacy_params().
| int dt_masks_point_in_form_exact | ( | float | x, |
| float | y, | ||
| float * | points, | ||
| int | points_start, | ||
| int | points_count | ||
| ) |
Check whether the 2D point (x, y) lies inside the polygon (mask) described by points.
| x | The x-coordinate of the point to test. |
| y | The y-coordinate of the point to test. |
| points | The array of polygon vertices. |
| points_start | The starting index of the polygon vertices in the array. |
| points_count | The total number of vertices in the polygon. |
Referenced by _circle_get_distance(), _ellipse_get_distance(), _polygon_get_distance(), and dt_masks_draw_source().
| int dt_masks_point_in_form_near | ( | float | x, |
| float | y, | ||
| float * | points, | ||
| int | points_start, | ||
| int | points_count, | ||
| float | distance, | ||
| int * | near | ||
| ) |
Referenced by _circle_get_distance().
| void dt_masks_read_masks_history | ( | dt_develop_t * | dev, |
| const int32_t | imgid | ||
| ) |
read the forms from the db
References darktable, darktable_t::db, dt_control_log(), dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_dev_get_history_end(), dt_masks_create(), dt_masks_legacy_params(), dt_masks_replace_current_forms(), dt_masks_version(), dt_image_t::filename, dt_masks_form_t::formid, dt_dev_history_item_t::forms, dt_masks_form_t::functions, dt_develop_t::history, dt_develop_t::image_storage, name, dt_masks_form_t::name, dt_dev_history_item_t::num, dt_masks_functions_t::point_struct_size, dt_masks_form_t::points, dt_masks_form_t::source, type, and dt_masks_form_t::version.
Referenced by dt_dev_read_history_ext().
| void dt_masks_remove_form | ( | dt_develop_t * | dev, |
| dt_masks_form_t * | form | ||
| ) |
References dt_develop_t::forms.
Referenced by dt_masks_form_remove().
| void dt_masks_replace_current_forms | ( | dt_develop_t * | dev, |
| GList * | forms | ||
| ) |
replace dev->forms with forms
References dt_develop_t::allforms, darktable, darktable_t::develop, dt_masks_dup_forms_deep(), and dt_develop_t::forms.
Referenced by dt_dev_pop_history_items_ext(), dt_masks_cleanup_unused(), and dt_masks_read_masks_history().
References darktable, darktable_t::develop, DEVELOP_MASKS_NB_SHAPES, dt_masks_change_form_gui(), DT_MASKS_EDIT_OFF, dt_develop_t::gui_module, IOP_FLAGS_NO_MASKS, IOP_FLAGS_SUPPORTS_BLENDING, m, dt_iop_gui_blend_data_t::masks_edit, dt_iop_gui_blend_data_t::masks_shapes, and dt_iop_gui_blend_data_t::masks_shown.
Referenced by dt_iop_request_focus(), and gui_reset().
References darktable, darktable_t::develop, DEVELOP_MASKS_NB_SHAPES, DT_MASKS_EDIT_OFF, FALSE, dt_develop_t::iop, IOP_FLAGS_NO_MASKS, IOP_FLAGS_SUPPORTS_BLENDING, m, dt_iop_gui_blend_data_t::masks_edit, dt_iop_gui_blend_data_t::masks_shapes, and dt_iop_gui_blend_data_t::masks_shown.
Referenced by _tree_selection_change().
| float dt_masks_rotate_with_anchor | ( | dt_develop_t * | dev, |
| const float | anchor[2], | ||
| const float | center[2], | ||
| dt_masks_form_gui_t * | gui | ||
| ) |
Rotate a mask shape around its center. WARNING: gui->delta will be updated with the new position after rotation.
| dev | the develop structure |
| anchor | the array representing the anchor position (grabbing point) in normalized coordinates. |
| center | the array representing the origin point of rotation in normalized coordinates |
| gui | the GUI form structure |
References dt_masks_form_gui_t::delta, dt_dev_distort_backtransform(), and M_PI.
Referenced by _ellipse_events_mouse_moved(), and _gradient_events_mouse_moved().
| void dt_masks_select_form | ( | struct dt_iop_module_t * | module, |
| dt_masks_form_t * | sel | ||
| ) |
allow to select a shape inside an iop
References darktable, darktable_t::develop, FALSE, dt_masks_form_t::formid, dt_develop_t::mask_form_selected_id, and TRUE.
Referenced by _brush_events_button_released(), _circle_events_button_pressed(), _ellipse_events_button_pressed(), _polygon_events_button_pressed(), and dt_masks_clear_form_gui().
| void dt_masks_set_edit_mode | ( | struct dt_iop_module_t * | module, |
| dt_masks_edit_mode_t | value | ||
| ) |
References dt_iop_module_t::blend_data, dt_iop_module_t::blend_params, darktable, dt_iop_module_t::dev, darktable_t::develop, dt_control_queue_redraw_center(), dt_dev_masks_selection_change(), dt_masks_change_form_gui(), dt_masks_create_ext(), DT_MASKS_EDIT_OFF, dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_group_ungroup(), dt_masks_form_gui_t::edit_mode, FALSE, dt_develop_t::form_gui, dt_masks_form_t::formid, dt_develop_blend_params_t::mask_id, dt_iop_gui_blend_data_t::masks_edit, dt_iop_gui_blend_data_t::masks_shown, dt_iop_gui_blend_data_t::masks_support, and TRUE.
Referenced by _blendop_masks_mode_callback(), _blendop_masks_show_and_edit(), _brush_events_button_pressed(), _brush_events_button_released(), _circle_events_button_pressed(), _edit_masks(), _ellipse_events_button_pressed(), _gradient_events_button_pressed(), _menu_add_exist(), _menu_no_masks(), _polygon_events_button_pressed(), _pop_undo(), dt_iop_gui_blending_lose_focus(), dt_iop_gui_update_blending(), dt_masks_iop_update(), dt_masks_iop_value_changed_callback(), and gui_focus().
| void dt_masks_set_source_pos_initial_state | ( | dt_masks_form_gui_t * | gui, |
| const uint32_t | state, | ||
| const float | pzx, | ||
| const float | pzy | ||
| ) |
References dt_dev_pixelpipe_t::backbuf_height, dt_dev_pixelpipe_t::backbuf_width, darktable, darktable_t::develop, DT_MASKS_SOURCE_POS_ABSOLUTE, DT_MASKS_SOURCE_POS_RELATIVE_TEMP, dt_modifier_is(), dt_develop_t::natural_scale, dt_masks_form_gui_t::pos_source, dt_develop_t::preview_pipe, and dt_masks_form_gui_t::source_pos_type.
Referenced by _brush_events_button_pressed(), _circle_events_button_pressed(), _ellipse_events_button_pressed(), and _polygon_events_button_pressed().
| void dt_masks_set_source_pos_initial_value | ( | dt_masks_form_gui_t * | gui, |
| dt_masks_form_t * | form, | ||
| const float | pzx, | ||
| const float | pzy | ||
| ) |
References dt_dev_pixelpipe_t::backbuf_height, dt_dev_pixelpipe_t::backbuf_width, darktable, darktable_t::develop, dt_dev_distort_backtransform(), dt_dev_roi_delta_to_input_space(), DT_MASKS_SOURCE_POS_ABSOLUTE, DT_MASKS_SOURCE_POS_RELATIVE, DT_MASKS_SOURCE_POS_RELATIVE_TEMP, dt_masks_form_t::functions, dt_dev_pixelpipe_t::iheight, dt_masks_functions_t::initial_source_pos, dt_dev_pixelpipe_t::iwidth, dt_develop_t::natural_scale, dt_masks_form_gui_t::pos_source, dt_develop_t::preview_pipe, dt_masks_form_t::source, and dt_masks_form_gui_t::source_pos_type.
Referenced by _brush_events_button_pressed(), _circle_events_button_pressed(), _ellipse_events_button_pressed(), and _polygon_events_button_pressed().
| void dt_masks_soft_reset_form_gui | ( | dt_masks_form_gui_t * | gui | ) |
References dt_masks_form_gui_t::border_selected, dt_masks_form_gui_t::delta, FALSE, dt_masks_form_gui_t::form_dragging, dt_masks_form_gui_t::form_rotating, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::group_selected, dt_masks_form_gui_t::handle_border_dragging, dt_masks_form_gui_t::handle_border_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_selected, dt_masks_form_gui_t::pivot_selected, dt_masks_form_gui_t::seg_dragging, dt_masks_form_gui_t::seg_selected, and dt_masks_form_gui_t::source_selected.
Referenced by _group_events_button_released().
| int dt_masks_version | ( | void | ) |
References DEVELOP_MASKS_VERSION.
Referenced by dt_masks_create(), dt_masks_read_masks_history(), and legacy_params().
| void dt_masks_write_masks_history_item | ( | const int32_t | imgid, |
| const int | num, | ||
| dt_masks_form_t * | form | ||
| ) |
write the forms into the db
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_HISTORY, DT_DEBUG_SQLITE3_BIND_BLOB, DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_print(), dt_masks_form_t::formid, dt_masks_form_t::functions, dt_masks_form_t::name, dt_masks_functions_t::point_struct_size, dt_masks_form_t::points, dt_masks_form_t::source, dt_masks_form_t::type, and dt_masks_form_t::version.
Referenced by dt_dev_write_history_item(), and legacy_params().
|
static |
Referenced by dt_masks_create().