![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/darktable.h"#include "gui/gdkkeys.h"#include "develop/masks.h"#include "develop/develop.h"#include "bauhaus/bauhaus.h"#include "common/debug.h"#include "common/math.h"#include "common/mipmap_cache.h"#include "control/conf.h"#include "common/undo.h"#include "develop/blend.h"#include "develop/dev_pixelpipe.h"#include "develop/imageop.h"#include "develop/imageop_gui.h"#include <stdint.h>#include "detail.c"
Include dependency graph for develop/masks/masks.c:Go to the source code of this file.
Functions | |
| gboolean | dt_masks_point_is_within_radius (const float point_x, const float point_y, const float center_x, const float center_y, const float squared_radius) |
| Check whether a point lies within a squared radius of a center. | |
| int | dt_masks_find_closest_handle_common (dt_masks_form_t *mask_form, dt_masks_form_gui_t *mask_gui, int form_index, int node_count_override, dt_masks_border_handle_fn border_handle_cb, dt_masks_curve_handle_fn curve_handle_cb, dt_masks_node_position_fn node_position_cb, dt_masks_distance_fn distance_cb, dt_masks_post_select_fn post_select_cb, void *user_data) |
| Centralized hit-testing for node/handle/segment selection across shapes. | |
| dt_masks_form_t * | dt_masks_dup_masks_form (const dt_masks_form_t *mask_form) |
| Deep-copy a mask form, including its points list. | |
| static void * | _dup_masks_form_cb (const void *formdata, gpointer user_data) |
| static dt_masks_form_group_t * | _masks_group_find_form (dt_masks_form_t *group_form, const int form_id) |
| Find a form entry inside a group by form id. | |
| int | dt_masks_group_index_from_formid (const dt_masks_form_t *group_form, int form_id) |
| dt_masks_form_t * | dt_masks_get_visible_form (const dt_develop_t *dev) |
| Return the currently visible form used by the masks GUI. | |
| void | dt_masks_set_visible_form (dt_develop_t *dev, dt_masks_form_t *form) |
| void | dt_masks_gui_init (dt_develop_t *dev) |
| void | dt_masks_gui_cleanup (dt_develop_t *dev) |
| void | dt_masks_gui_set_dragging (dt_masks_form_gui_t *gui) |
| void | dt_masks_gui_reset_dragging (dt_masks_form_gui_t *gui) |
| gboolean | dt_masks_gui_is_dragging (const dt_masks_form_gui_t *gui) |
| dt_masks_form_group_t * | dt_masks_form_group_from_parentid (int parent_id, int form_id) |
| Return the group entry for a (parent, form) pair. | |
| dt_masks_form_group_t * | dt_masks_form_get_selected_group (const dt_masks_form_t *mask_form, const dt_masks_form_gui_t *mask_gui) |
| Get the selected group entry from the GUI selection index. | |
| dt_masks_form_group_t * | dt_masks_form_get_selected_group_live (const dt_masks_form_t *mask_form, const dt_masks_form_gui_t *mask_gui) |
| Resolve a "live" selected group entry, even if GUI selection is stale. | |
| static dt_masks_form_t * | _dt_masks_events_get_dispatch_form (dt_masks_form_t *visible_form, const dt_masks_form_gui_t *mask_gui, dt_masks_form_group_t **group_entry, int *parent_id, int *form_index) |
| Resolve the concrete form that should receive an event. | |
| static gboolean | _dt_masks_events_group_update_selection (dt_masks_form_t *group_form, dt_masks_form_gui_t *mask_gui) |
| Update group selection from the current cached cursor before leaf dispatch. | |
| static gboolean | _dt_masks_events_should_update_hover_on_move (dt_masks_form_gui_t *mask_gui) |
| static int | _dt_masks_events_update_hover (dt_masks_form_t *dispatch_form, dt_masks_form_gui_t *mask_gui, const int form_index) |
| static gboolean | _dt_masks_events_cursor_over_form (const dt_masks_form_t *dispatch_form, dt_masks_form_gui_t *mask_gui, const int form_index) |
| static gboolean | _dt_masks_events_group_blocks_motion (dt_masks_form_gui_t *mask_gui) |
| Consume the initial drag motion used to disambiguate scrolling vs dragging in groups. | |
| static gboolean | _dt_masks_events_flush_rebuild_if_needed (struct dt_iop_module_t *module, dt_masks_form_t *dispatch_form, dt_masks_form_gui_t *mask_gui, const int form_index, const int button) |
| Flush a deferred throttled rebuild before drag state is reset. | |
| GList * | dt_masks_dup_forms_deep (GList *form_list, dt_masks_form_t *replacement_form) |
| Duplicate the list of forms, replacing a single item by formid match. | |
| static gboolean | _set_hinter_message (dt_masks_form_gui_t *mask_gui, const dt_masks_form_t *mask_form) |
| Build and display the on-canvas hint message for masks interactions. | |
| void | dt_masks_init_form_gui (dt_masks_form_gui_t *mask_gui) |
| void | dt_masks_soft_reset_form_gui (dt_masks_form_gui_t *mask_gui) |
| void | dt_masks_gui_form_create (dt_masks_form_t *mask_form, dt_masks_form_gui_t *mask_gui, int form_index, dt_iop_module_t *module) |
| gboolean | dt_masks_gui_form_create_throttled (dt_masks_form_t *mask_form, dt_masks_form_gui_t *mask_gui, int form_index, dt_iop_module_t *module, float posx, float posy) |
| void | dt_masks_form_gui_points_free (gpointer data) |
| void | dt_masks_remove_node (struct dt_iop_module_t *module, dt_masks_form_t *mask_form, int parent_id, dt_masks_form_gui_t *mask_gui, int form_index, int node_index) |
| static gboolean | _masks_remove_shape (struct dt_iop_module_t *module, dt_masks_form_t *mask_form, int parent_id, dt_masks_form_gui_t *mask_gui, int form_index) |
| Remove a shape from the GUI and free its resources. | |
| static int | _masks_gui_form_group_use_count (const dt_develop_t *dev, const int formid) |
| gboolean | dt_masks_remove_or_delete (struct dt_iop_module_t *module, dt_masks_form_t *sel, int parent_id, dt_masks_form_gui_t *mask_gui, int form_id) |
| If the form to remove is used once, ask to the user if he wants to delete it from the list or just remove and keep for later reuse. | |
| gboolean | dt_masks_form_exit_creation (dt_iop_module_t *module, dt_masks_form_gui_t *mask_gui) |
| gboolean | dt_masks_gui_remove (struct dt_iop_module_t *module, dt_masks_form_t *mask_form, dt_masks_form_gui_t *mask_gui, const int parent_id) |
| remove a mask shape or node form from the GUI. This function is used with a popupmenu "Delete" action. | |
| void | dt_masks_gui_form_remove (dt_masks_form_t *mask_form, dt_masks_form_gui_t *mask_gui, int form_index) |
| void | dt_masks_gui_form_test_create (dt_masks_form_t *mask_form, dt_masks_form_gui_t *mask_gui, dt_iop_module_t *module) |
| static void | _check_id (dt_masks_form_t *mask_form) |
| static void | _set_group_name_from_module (dt_iop_module_t *module, dt_masks_form_t *group_form) |
| static dt_masks_form_t * | _group_create (dt_develop_t *develop, dt_iop_module_t *module, dt_masks_type_t group_type) |
| static dt_masks_form_t * | _group_from_module (dt_develop_t *develop, dt_iop_module_t *module) |
| void | dt_masks_append_form (dt_develop_t *develop, dt_masks_form_t *mask_form) |
| void | dt_masks_remove_form (dt_develop_t *develop, dt_masks_form_t *mask_form) |
| void | dt_masks_gui_form_save_creation (dt_develop_t *develop, dt_iop_module_t *module, dt_masks_form_t *mask_form, dt_masks_form_gui_t *mask_gui) |
| Save the form creation right after a shape has been finished drawing. | |
| int | dt_masks_form_duplicate (dt_develop_t *develop, int form_id) |
| int | dt_masks_get_points_border (dt_develop_t *develop, dt_masks_form_t *mask_form, float **point_buffer, int *point_count, float **border_buffer, int *border_count, int source, dt_iop_module_t *module) |
| int | dt_masks_get_area (dt_iop_module_t *module, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, dt_masks_form_t *mask_form, int *area_width, int *area_height, int *area_pos_x, int *area_pos_y) |
| int | dt_masks_get_source_area (dt_iop_module_t *module, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, dt_masks_form_t *mask_form, int *area_width, int *area_height, int *area_pos_x, int *area_pos_y) |
| int | dt_masks_version (void) |
| static int | dt_masks_legacy_params_v1_to_v2 (dt_develop_t *develop, void *params) |
| static void | dt_masks_legacy_params_v2_to_v3_transform (const dt_image_t *image, float *coords) |
| static void | dt_masks_legacy_params_v2_to_v3_transform_only_rescale (const dt_image_t *image, float *coords, size_t coords_count) |
| static int | dt_masks_legacy_params_v2_to_v3 (dt_develop_t *develop, void *params) |
| static int | dt_masks_legacy_params_v3_to_v4 (dt_develop_t *develop, void *params) |
| static int | dt_masks_legacy_params_v4_to_v5 (dt_develop_t *develop, void *params) |
| static int | dt_masks_legacy_params_v5_to_v6 (dt_develop_t *develop, void *params) |
| int | dt_masks_legacy_params (dt_develop_t *develop, 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 *develop, GList *forms) |
| dt_masks_form_t * | dt_masks_get_from_id_ext (GList *form_list, int form_id) |
| dt_masks_form_t * | dt_masks_get_from_id (dt_develop_t *develop, int form_id) |
| dt_iop_module_t * | dt_masks_get_mask_manager (dt_develop_t *develop) |
| GList * | dt_masks_snapshot_current_forms (dt_develop_t *develop, gboolean reset_changed) |
| static void | _masks_fill_used_forms (GList *forms_list, const int form_id, int *used_form_ids, const int used_count) |
| int | dt_masks_copy_used_forms_for_module (dt_develop_t *develop_dest, dt_develop_t *develop_src, const dt_iop_module_t *source_module) |
| void | dt_masks_read_masks_history (dt_develop_t *develop, const int32_t image_id) |
| void | dt_masks_write_masks_history_item (const int32_t image_id, const int history_num, dt_masks_form_t *mask_form) |
| void | dt_masks_free_form (dt_masks_form_t *mask_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) |
| gboolean | dt_masks_is_anything_selected (const dt_masks_form_gui_t *mask_gui) |
| gboolean | dt_masks_is_anything_hovered (const dt_masks_form_gui_t *mask_gui) |
| static void | _set_cursor_shape (dt_masks_form_gui_t *mask_gui) |
| static void | _apply_gui_button_pressed_state (dt_masks_form_gui_t *mask_gui, const int button, const uint32_t state, const gboolean shape_was_selected) |
| static void | _dt_masks_events_set_current_pos (const double x, const double y, dt_masks_form_gui_t *mask_gui) |
| Convert the GTK/Cairo widget cursor once for the full mask event chain. | |
| 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 button, uint32_t state) |
| int | dt_masks_events_button_pressed (struct dt_iop_module_t *module, double x, double y, double pressure, int button, int event_type, uint32_t state) |
| int | dt_masks_events_key_pressed (struct dt_iop_module_t *module, GdkEventKey *event) |
| int | dt_masks_events_mouse_scrolled (struct dt_iop_module_t *module, double x, double y, int scroll_up, uint32_t key_state, int scrolling_delta) |
| gboolean | dt_masks_node_is_cusp (const dt_masks_form_gui_points_t *gui_points, const int node_index) |
| 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. | |
| static void | _dt_masks_find_best_attachment_point (const float ray_1[2], const float ray_2[2], const float *points, const int points_count, const float zoom_scale, const int first_pt, const gboolean is_closed_shape, const float offset_factor, float result[2]) |
| Find the best attachment point on the shape contour for a ray crossing the form. | |
| void | dt_masks_draw_source (cairo_t *cr, dt_masks_form_gui_t *mask_gui, const int form_index, const int node_count, const float zoom_scale, struct dt_masks_gui_center_point_t *center_point, const shape_draw_function_t *draw_shape_func) |
| Draw the source for a correction mask. | |
| void | dt_masks_draw_path_seg_by_seg (cairo_t *cr, dt_masks_form_gui_t *mask_gui, const int form_index, const float *points, const int points_count, const int node_count, const float zoom_scale) |
| static void | _masks_draw_creation_session_forms (dt_develop_t *develop, dt_iop_module_t *module, cairo_t *cr, const float zoom_scale, const dt_masks_form_gui_t *creation_gui) |
| Draw completed shapes from the current creation session. | |
| 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 *develop) |
| void | dt_masks_change_form_gui (dt_masks_form_t *new_form) |
| 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 form_id) |
| 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 *source_module) |
| void | dt_masks_iop_combo_populate (GtkWidget *widget, void *data) |
| void | dt_masks_iop_value_changed_callback (GtkWidget *widget, struct dt_iop_module_t *module) |
| void | dt_masks_form_delete (struct dt_iop_module_t *module, dt_masks_form_t *group_form, dt_masks_form_t *mask_form) |
| float | dt_masks_form_get_interaction_value (dt_masks_form_group_t *form_group, dt_masks_interaction_t interaction) |
| gboolean | dt_masks_form_get_gravity_center (const dt_masks_form_t *mask_form, float center[2], float *area) |
| void | dt_masks_form_update_gravity_center (dt_masks_form_t *mask_form) |
| int | dt_masks_center_view_on_form (dt_develop_t *dev, const dt_masks_form_t *mask_form) |
| Center the darkroom ROI on a mask form gravity center. | |
| static float | _change_opacity (dt_masks_form_group_t *form_group, float value, const dt_masks_increment_t increment, const int flow) |
| float | dt_masks_form_set_interaction_value (dt_masks_form_group_t *form_group, dt_masks_interaction_t interaction, float value, dt_masks_increment_t increment, int flow, dt_masks_form_gui_t *mask_gui, dt_iop_module_t *module) |
| const char * | _get_mask_plugin (dt_masks_form_t *mask_form) |
| const char * | _get_mask_type (dt_masks_form_t *mask_form) |
| float | dt_masks_apply_increment (float current, float amount, dt_masks_increment_t increment, int flow) |
| Apply a scroll increment to a scalar value. | |
| float | dt_masks_apply_increment_precomputed (float current, float amount, float scale_amount, float offset_amount, dt_masks_increment_t increment) |
| Apply a scroll increment using precomputed scale/offset factors. | |
| float | dt_masks_get_set_conf_value (dt_masks_form_t *mask_form, char *feature, float new_value, float value_min, float value_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. | |
| float | dt_masks_get_set_conf_value_with_toast (dt_masks_form_t *mask_form, const char *feature, float amount, float value_min, float value_max, dt_masks_increment_t increment, int flow, const char *toast_fmt, float toast_scale) |
| Update a mask configuration value and emit a toast message. | |
| void | dt_masks_duplicate_points (const dt_masks_form_t *base_form, dt_masks_form_t *dest_form, size_t node_size) |
| Duplicate a points list for a mask using a fixed node size. | |
| int | dt_masks_form_change_opacity (dt_masks_form_t *mask_form, int parent_id, int scroll_up, const int flow) |
| void | dt_masks_form_move (dt_masks_form_t *group_form, int form_id, int move_up) |
| static int | _find_in_group (dt_masks_form_t *group_form, int form_id) |
| dt_masks_form_group_t * | dt_masks_group_add_form (dt_masks_form_t *group_form, dt_masks_form_t *mask_form) |
| void | dt_masks_group_ungroup (dt_masks_form_t *dest_group, dt_masks_form_t *group_form) |
| uint64_t | dt_masks_group_get_hash (uint64_t hash, dt_masks_form_t *mask_form) |
| static void | _cleanup_unused_recurs (GList *form_list, int form_id, int *used_form_ids, int used_count) |
| static int | _masks_cleanup_unused (GList **forms_list, GList *history_list, const int history_end) |
| void | dt_masks_cleanup_unused_from_list (GList *history_list) |
| Remove unused mask forms from a history list, preserving undo safety. | |
| void | dt_masks_cleanup_unused (dt_develop_t *develop) |
| Cleanup unused masks and refresh the current forms snapshot. | |
| int | dt_masks_point_in_form_exact (const float *test_points, int test_point_count, const float *form_points, int form_points_start, int form_points_count) |
| Check whether any 2D point in pts[] lies inside the form points[]. | |
| void | dt_masks_select_form (struct dt_iop_module_t *module, dt_masks_form_t *selected_form) |
| Select or clear the current mask form, notifying the owning module if needed. | |
| void | dt_masks_set_source_pos_initial_state (dt_masks_form_gui_t *mask_gui, const uint32_t key_state) |
| Decide initial source positioning mode for clone masks. | |
| void | dt_masks_set_source_pos_initial_value (dt_masks_form_gui_t *mask_gui, dt_masks_form_t *mask_form) |
| Initialize the clone source position based on current GUI state. | |
| void | dt_masks_calculate_source_pos_origin (dt_masks_form_gui_t *mask_gui, const float initial_xpos, const float initial_ypos, const float xpos, const float ypos, float *pos_x, float *pos_y, const int adding) |
| Compute preview-space source position for drawing the clone indicator. | |
| float | dt_masks_rotate_with_anchor (dt_develop_t *develop, const float anchor[2], const float center[2], dt_masks_form_gui_t *mask_gui) |
| Compute rotation angle (degrees) around a center using an anchor point. | |
| void | dt_masks_creation_mode_quit (dt_masks_form_gui_t *mask_gui) |
| Exit mask creation mode, restoring cursor visibility and resetting GUI state. | |
| gboolean | dt_masks_creation_mode_enter (dt_iop_module_t *module, const dt_masks_type_t type) |
| Enter mask creation mode for a given shape type. | |
| void | apply_operation (struct dt_masks_form_group_t *group_entry, const dt_masks_state_t apply_state) |
| Apply a mask state operation on a group entry. | |
Variables | |
| static int | form_id_seed = 0 |
|
static |
Definition at line 2309 of file develop/masks/masks.c.
References dt_masks_form_gui_t::border_selected, dt_masks_form_gui_t::border_toggling, dt_masks_form_gui_t::creation, dt_masks_gui_set_dragging(), dt_modifier_is(), FALSE, dt_masks_form_gui_t::form_rotating, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::gradient_toggling, dt_masks_form_gui_t::handle_border_hovered, dt_masks_form_gui_t::handle_border_selected, dt_masks_form_gui_t::handle_hovered, dt_masks_form_gui_t::handle_selected, IS_NULL_PTR, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::node_selected_idx, dt_masks_form_gui_t::seg_hovered, dt_masks_form_gui_t::seg_selected, dt_masks_form_gui_t::source_selected, state, and TRUE.
Referenced by dt_masks_events_button_pressed().
|
static |
Definition at line 3607 of file develop/masks/masks.c.
References CLAMPF, dt_masks_apply_increment(), dt_toast_log(), IS_NULL_PTR, dt_masks_form_group_t::opacity, and value.
Referenced by dt_masks_form_set_interaction_value().
|
static |
Definition at line 1327 of file develop/masks/masks.c.
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 |
Definition at line 3912 of file develop/masks/masks.c.
References _cleanup_unused_recurs(), dt_masks_get_from_id_ext(), DT_MASKS_GROUP, dt_masks_form_group_t::formid, IS_NULL_PTR, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by _cleanup_unused_recurs(), and _masks_cleanup_unused().
|
static |
Definition at line 655 of file develop/masks/masks.c.
References dist(), DT_GUI_MOUSE_EFFECT_RADIUS, FALSE, dt_masks_form_t::functions, dt_masks_functions_t::get_distance, IS_NULL_PTR, dt_masks_form_t::points, and dt_masks_form_gui_t::pos.
Referenced by dt_masks_events_mouse_scrolled().
|
static |
Flush a deferred throttled rebuild before drag state is reset.
Definition at line 696 of file develop/masks/masks.c.
References darktable, darktable_t::develop, dt_get_wtime(), dt_masks_gui_form_create(), dt_masks_gui_is_dragging(), FALSE, IS_NULL_PTR, dt_masks_form_gui_t::last_rebuild_pos, dt_masks_form_gui_t::last_rebuild_ts, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::rebuild_pending, and TRUE.
Referenced by dt_masks_events_button_released().
|
static |
Resolve the concrete form that should receive an event.
Visible groups expose one selected child to the event path. Non-group forms dispatch to themselves.
Definition at line 507 of file develop/masks/masks.c.
References darktable, darktable_t::develop, dt_masks_form_get_selected_group_live(), dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_form_group_t::formid, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, dt_masks_form_group_t::parentid, and dt_masks_form_t::type.
Referenced by dt_masks_events_button_pressed(), dt_masks_events_button_released(), dt_masks_events_key_pressed(), dt_masks_events_mouse_moved(), and dt_masks_events_mouse_scrolled().
|
static |
Consume the initial drag motion used to disambiguate scrolling vs dragging in groups.
Definition at line 677 of file develop/masks/masks.c.
References DT_GUI_MOUSE_EFFECT_RADIUS, FALSE, IS_NULL_PTR, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::scrollx, dt_masks_form_gui_t::scrolly, and TRUE.
Referenced by dt_masks_events_mouse_moved().
|
static |
Update group selection from the current cached cursor before leaf dispatch.
If a handle on the currently selected child is already hovered, keep that child selected. Otherwise, fall back to per-shape hit testing to resolve the leaf form under the cursor.
Definition at line 539 of file develop/masks/masks.c.
References dt_masks_form_gui_t::border_selected, darktable, darktable_t::develop, dist(), DT_GUI_MOUSE_EFFECT_RADIUS, dt_masks_form_get_selected_group_live(), dt_masks_get_from_id(), dt_masks_is_anything_hovered(), DT_MASKS_IS_CLOSED_SHAPE, DT_MASKS_IS_OPEN_SHAPE, dt_masks_soft_reset_form_gui(), FALSE, dt_masks_form_group_t::formid, dt_masks_form_t::functions, dt_masks_functions_t::get_distance, dt_masks_form_t::gravity_center, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, dt_masks_form_t::points, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::raw_pos, TRUE, and dt_masks_form_t::type.
Referenced by dt_masks_events_button_pressed().
|
static |
Convert the GTK/Cairo widget cursor once for the full mask event chain.
The event entry points are the only place where widget-space x, y are consumed. Downstream handlers reuse the cached positions:
mask_gui->rel_pos: normalized output-image coordinatesmask_gui->pos: absolute output-image coordinatesmask_gui->raw_pos: absolute raw input-image coordinates Definition at line 2382 of file develop/masks/masks.c.
References darktable, darktable_t::develop, dt_dev_coordinates_image_abs_to_raw_abs(), dt_dev_coordinates_image_norm_to_image_abs(), dt_dev_coordinates_widget_to_image_norm(), IS_NULL_PTR, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::raw_pos, dt_masks_form_gui_t::rel_pos, and x.
Referenced by dt_masks_events_button_pressed(), dt_masks_events_button_released(), dt_masks_events_mouse_moved(), and dt_masks_events_mouse_scrolled().
|
static |
Definition at line 639 of file develop/masks/masks.c.
References dt_masks_form_gui_t::border_toggling, dt_masks_form_gui_t::creation, dt_masks_gui_is_dragging(), dt_masks_gui_should_hit_test(), FALSE, dt_masks_form_gui_t::form_rotating, dt_masks_form_gui_t::gradient_toggling, and IS_NULL_PTR.
Referenced by dt_masks_events_mouse_moved().
|
static |
Definition at line 647 of file develop/masks/masks.c.
References dt_masks_form_t::functions, IS_NULL_PTR, and dt_masks_functions_t::update_hover.
Referenced by dt_masks_events_button_pressed(), dt_masks_events_mouse_moved(), and dt_masks_events_mouse_scrolled().
|
static |
Find the best attachment point on the shape contour for a ray crossing the form.
The best point is the one with the smallest positive projection along the ray. The result is offset from the contour by a given distance along the ray axis, oriented toward the center of the ray segment [ray_2, ray_1].
| ray_1 | First point of the ray |
| ray_2 | Second point of the ray |
| points | Array of points defining the shape contour |
| points_count | Number of points in the contour |
| first_pt | Index of the first point to consider |
| is_closed_shape | Whether the contour is closed |
| result | Array to store the resulting attachment point |
Definition at line 2685 of file develop/masks/masks.c.
References DT_PIXEL_APPLY_DPI, f_inv_sqrtf(), and i.
Referenced by dt_masks_draw_source().
Definition at line 307 of file develop/masks/masks.c.
References dt_masks_dup_masks_form(), dt_masks_form_t::formid, and IS_NULL_PTR.
Referenced by dt_masks_dup_forms_deep().
|
static |
Definition at line 3806 of file develop/masks/masks.c.
References _find_in_group(), 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_t::points, and dt_masks_form_t::type.
Referenced by _find_in_group(), and dt_masks_group_add_form().
| const char * _get_mask_plugin | ( | dt_masks_form_t * | mask_form | ) |
Definition at line 3642 of file develop/masks/masks.c.
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 * | mask_form | ) |
Definition at line 3652 of file develop/masks/masks.c.
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 |
Definition at line 1352 of file develop/masks/masks.c.
References _check_id(), _set_group_name_from_module(), dt_masks_append_form(), and dt_masks_create().
Referenced by _menu_add_exist(), dt_masks_gui_form_save_creation(), and dt_masks_iop_use_same_as().
|
static |
Definition at line 1363 of file develop/masks/masks.c.
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_delete(), dt_masks_group_update_name(), dt_masks_gui_form_save_creation(), dt_masks_iop_combo_populate(), and dt_masks_iop_use_same_as().
|
static |
Definition at line 3939 of file develop/masks/masks.c.
References _cleanup_unused_recurs(), dt_develop_t::allforms, dt_dev_history_item_t::blend_params, dt_dev_history_item_t::blendop_params_size, darktable, darktable_t::develop, dt_free, dt_masks_form_t::formid, and dt_develop_blend_params_t::mask_id.
Referenced by dt_masks_cleanup_unused_from_list().
|
static |
Draw completed shapes from the current creation session.
During continuous creation, the GUI-visible form must remain the unfinished shape because creation previews and mouse handlers read it directly. The ids stored in creation_formids are therefore drawn explicitly here, so only the shapes created in this session stay visible until creation mode is exited.
Definition at line 2922 of file develop/masks/masks.c.
References dt_masks_form_gui_t::creation, dt_masks_form_gui_t::creation_formids, dt_masks_form_gui_points_free(), dt_masks_get_from_id(), dt_masks_gui_form_test_create(), dt_masks_init_form_gui(), DT_PIXELPIPE_CACHE_HASH_INVALID, dt_masks_form_gui_t::edit_mode, dt_masks_form_gui_t::formid, dt_masks_form_t::functions, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, dt_masks_form_gui_t::pipe_hash, dt_masks_form_t::points, dt_masks_form_gui_t::points, dt_masks_functions_t::post_expose, dt_masks_form_t::type, and dt_masks_form_gui_t::type.
Referenced by dt_masks_events_post_expose().
|
static |
Definition at line 2032 of file develop/masks/masks.c.
References _masks_fill_used_forms(), dt_masks_get_from_id_ext(), DT_MASKS_GROUP, dt_masks_form_group_t::formid, IS_NULL_PTR, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by _masks_fill_used_forms(), and dt_masks_copy_used_forms_for_module().
|
inlinestatic |
Find a form entry inside a group by form id.
Assumption: only valid for DT_MASKS_GROUP forms.
Definition at line 322 of file develop/masks/masks.c.
References DT_MASKS_GROUP, dt_masks_form_group_t::formid, IS_NULL_PTR, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by dt_masks_form_group_from_parentid().
|
static |
Definition at line 1004 of file develop/masks/masks.c.
References DT_MASKS_GROUP, dt_masks_form_group_t::formid, dt_develop_t::forms, IS_NULL_PTR, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by dt_masks_remove_or_delete().
|
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 |
Definition at line 961 of file develop/masks/masks.c.
References darktable, darktable_t::develop, dt_free, dt_masks_change_form_gui(), dt_masks_clear_form_gui(), dt_masks_form_delete(), dt_masks_get_from_id(), dt_masks_get_visible_form(), DT_MASKS_GROUP, dt_masks_form_gui_t::edit_mode, dt_masks_form_group_t::formid, dt_masks_form_t::formid, g_list_shorter_than(), IS_NULL_PTR, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by dt_masks_gui_remove(), and dt_masks_remove_or_delete().
|
static |
Definition at line 3210 of file develop/masks/masks.c.
References _group_create(), _group_from_module(), darktable, darktable_t::develop, DT_MASKS_EDIT_FULL, dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_group_add_form(), dt_masks_iop_update(), dt_masks_set_edit_mode(), and IS_NULL_PTR.
Referenced by dt_masks_iop_value_changed_callback().
|
static |
Definition at line 3205 of file develop/masks/masks.c.
References dt_masks_creation_mode_enter(), and type.
Referenced by dt_masks_iop_value_changed_callback().
|
static |
Definition at line 3193 of file develop/masks/masks.c.
References _group_from_module(), darktable, darktable_t::develop, DT_MASKS_EDIT_OFF, dt_masks_form_delete(), dt_masks_iop_update(), and dt_masks_set_edit_mode().
Referenced by dt_masks_iop_value_changed_callback().
|
static |
Definition at line 2288 of file develop/masks/masks.c.
References dt_masks_form_gui_t::creation, dt_masks_form_gui_t::creation_closing_form, dt_control_queue_cursor, dt_masks_is_anything_hovered(), dt_masks_is_anything_selected(), IS_NULL_PTR, and dt_masks_form_gui_t::pivot_selected.
Referenced by dt_masks_events_button_released(), and dt_masks_events_mouse_moved().
|
static |
Definition at line 1345 of file develop/masks/masks.c.
References dt_dev_get_masks_group_name(), dt_free, and dt_masks_form_t::name.
Referenced by _group_create(), and dt_masks_group_update_name().
|
static |
Build and display the on-canvas hint message for masks interactions.
Pitfall: set_hint_message() may rely on gui->form_selected, so we may need a temporary override when no hint is produced.
Definition at line 738 of file develop/masks/masks.c.
References darktable_t::control, darktable, darktable_t::develop, dt_conf_get_float(), dt_control_hinter_message(), DT_DEBUG_INPUT, dt_masks_form_get_interaction_value(), dt_masks_form_get_selected_group_live(), dt_masks_get_from_id(), DT_MASKS_GROUP, DT_MASKS_INTERACTION_OPACITY, dt_print(), FALSE, dt_masks_form_gui_t::form_selected, dt_masks_form_group_t::formid, dt_masks_form_t::functions, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::seg_hovered, dt_masks_functions_t::set_hint_message, and dt_masks_form_t::type.
Referenced by dt_masks_events_button_released(), dt_masks_events_mouse_moved(), and dt_masks_events_mouse_scrolled().
| void apply_operation | ( | struct dt_masks_form_group_t * | group_entry, |
| const dt_masks_state_t | apply_state | ||
| ) |
Apply a mask state operation on a group entry.
Inverse toggles its flag, combine operations replace the combine bits.
Definition at line 4380 of file develop/masks/masks.c.
References DT_MASKS_STATE_INVERSE, DT_MASKS_STATE_IS_COMBINE_OP, IS_NULL_PTR, and dt_masks_form_group_t::state.
Referenced by _blendop_masks_group_operation_callback(), _masks_operation_callback(), _tree_difference(), _tree_exclusion(), _tree_intersection(), _tree_inverse(), and _tree_union().
| void dt_masks_append_form | ( | dt_develop_t * | develop, |
| dt_masks_form_t * | mask_form | ||
| ) |
Definition at line 1368 of file develop/masks/masks.c.
References dt_pthread_rwlock_unlock, dt_pthread_rwlock_wrlock, dt_develop_t::forms, and dt_develop_t::masks_mutex.
Referenced by _blendop_masks_group_create(), _group_create(), dt_masks_form_duplicate(), and dt_masks_gui_form_save_creation().
| float dt_masks_apply_increment | ( | float | current, |
| float | amount, | ||
| dt_masks_increment_t | increment, | ||
| int | flow | ||
| ) |
Apply a scroll increment to a scalar value.
Definition at line 3671 of file develop/masks/masks.c.
References DT_MASKS_INCREMENT_ABSOLUTE, DT_MASKS_INCREMENT_OFFSET, and DT_MASKS_INCREMENT_SCALE.
Referenced by _change_curvature(), _change_extent(), _change_hardness(), _change_hardness(), _change_opacity(), _change_rotation(), _change_rotation(), _change_size(), _change_size(), and dt_masks_get_set_conf_value().
| float dt_masks_apply_increment_precomputed | ( | float | current, |
| float | amount, | ||
| float | scale_amount, | ||
| float | offset_amount, | ||
| dt_masks_increment_t | increment | ||
| ) |
Apply a scroll increment using precomputed scale/offset factors.
Definition at line 3685 of file develop/masks/masks.c.
References DT_MASKS_INCREMENT_ABSOLUTE, DT_MASKS_INCREMENT_OFFSET, and DT_MASKS_INCREMENT_SCALE.
Referenced by _change_hardness(), _change_hardness(), and _change_size().
| void dt_masks_calculate_source_pos_origin | ( | dt_masks_form_gui_t * | mask_gui, |
| const float | initial_xpos, | ||
| const float | initial_ypos, | ||
| const float | xpos, | ||
| const float | ypos, | ||
| float * | pos_x, | ||
| float * | pos_y, | ||
| const int | adding | ||
| ) |
Compute preview-space source position for drawing the clone indicator.
This uses the stored source positioning mode and can follow the cursor while adding.
Definition at line 4235 of file develop/masks/masks.c.
References darktable, darktable_t::develop, dt_masks_get_visible_form(), DT_MASKS_SOURCE_POS_ABSOLUTE, DT_MASKS_SOURCE_POS_RELATIVE, DT_MASKS_SOURCE_POS_RELATIVE_TEMP, dt_masks_form_t::functions, dt_masks_functions_t::initial_source_pos, IS_NULL_PTR, dt_masks_form_gui_t::pos_source, dt_develop_t::raw_height, dt_develop_t::raw_width, dt_develop_t::roi, and dt_masks_form_gui_t::source_pos_type.
Referenced by _circle_get_creation_preview(), _ellipse_get_creation_preview(), and dt_masks_draw_source_preview().
| int dt_masks_center_view_on_form | ( | dt_develop_t * | dev, |
| const dt_masks_form_t * | mask_form | ||
| ) |
Center the darkroom ROI on a mask form gravity center.
Mask forms store their gravity center in normalized RAW coordinates, while dev->roi.x and dev->roi.y address the processed image. Transforming through absolute RAW and processed-image coordinates keeps the center aligned with the final image after distortion modules, then the ROI clamp preserves the same bounds used by manual panning.
Definition at line 3587 of file develop/masks/masks.c.
References dt_dev_check_zoom_pos_bounds(), dt_dev_coordinates_image_abs_to_image_norm(), dt_dev_coordinates_raw_abs_to_image_abs(), dt_dev_coordinates_raw_norm_to_raw_abs(), dt_dev_pixelpipe_change_zoom_main(), dt_masks_form_get_gravity_center(), IS_NULL_PTR, dt_develop_t::roi, dt_develop_t::x, and dt_develop_t::y.
| void dt_masks_change_form_gui | ( | dt_masks_form_t * | newform | ) |
function used to manipulate forms for masks
Definition at line 3084 of file develop/masks/masks.c.
References dt_develop_t::allforms, darktable, darktable_t::develop, dt_masks_clear_form_gui(), dt_masks_free_form(), dt_masks_get_visible_form(), dt_masks_set_visible_form(), dt_pthread_rwlock_rdlock, dt_pthread_rwlock_unlock, FALSE, dt_develop_t::forms, IS_NULL_PTR, dt_develop_t::masks_mutex, and TRUE.
Referenced by _blendop_masks_all_delete_callback(), _blendop_masks_all_selection_changed(), _blendop_masks_group_delete(), _blendop_masks_group_move_callback(), _blendop_masks_group_unlink(), _brush_events_button_released(), _edit_masks(), _masks_remove_shape(), _reset_form_creation(), _tree_delete_shape(), _tree_movedown(), _tree_moveup(), _tree_selection_change(), dt_masks_cleanup_unused(), dt_masks_creation_mode_enter(), dt_masks_form_exit_creation(), dt_masks_remove_or_delete(), dt_masks_reset_form_gui(), dt_masks_set_edit_mode(), gui_focus(), rt_edit_masks_callback(), and rt_show_forms_for_current_scale().
| void dt_masks_cleanup_unused | ( | dt_develop_t * | develop | ) |
Cleanup unused masks and refresh the current forms snapshot.
Assumption: caller already decided to drop unused forms (non-reversible).
Definition at line 4031 of file develop/masks/masks.c.
References dt_dev_get_history_end_ext(), dt_masks_change_form_gui(), dt_masks_cleanup_unused_from_list(), dt_masks_replace_current_forms(), dt_dev_history_item_t::forms, and dt_develop_t::history.
Referenced by _tree_cleanup().
| void dt_masks_cleanup_unused_from_list | ( | GList * | history_list | ) |
Remove unused mask forms from a history list, preserving undo safety.
Caveat: if multiple history entries reference masks, some unused masks may remain. This is intentional so users can still jump back in history.
Definition at line 4007 of file develop/masks/masks.c.
References _masks_cleanup_unused(), dt_dev_history_item_t::forms, and IS_NULL_PTR.
Referenced by dt_masks_cleanup_unused().
| void dt_masks_clear_form_gui | ( | dt_develop_t * | develop | ) |
Definition at line 3034 of file develop/masks/masks.c.
References dt_masks_form_gui_t::border_selected, dt_masks_form_gui_t::border_toggling, dt_masks_form_gui_t::creation_closing_form, dt_masks_form_gui_t::creation_formids, dt_masks_form_gui_t::creation_last_formid, dt_masks_form_gui_t::creation_module, dt_masks_form_gui_t::creation_type, dt_masks_form_gui_t::delta, dt_masks_creation_mode_quit(), dt_masks_dynbuf_free(), DT_MASKS_EDIT_OFF, dt_masks_form_gui_points_free(), DT_MASKS_NONE, DT_MASKS_PRESSURE_OFF, dt_masks_select_form(), DT_PIXELPIPE_CACHE_HASH_INVALID, 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_hovered, dt_masks_form_gui_t::handle_border_selected, dt_masks_form_gui_t::handle_dragging, dt_masks_form_gui_t::handle_hovered, dt_masks_form_gui_t::handle_selected, IS_NULL_PTR, dt_masks_form_gui_t::last_hit_test_pos, dt_masks_form_gui_t::last_rebuild_pos, dt_masks_form_gui_t::last_rebuild_ts, dt_masks_form_gui_t::node_dragging, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::node_selected_idx, 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::rebuild_pending, 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_hovered, 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(), dt_masks_gui_cleanup(), dt_masks_gui_init(), and dt_masks_remove_or_delete().
| int dt_masks_copy_used_forms_for_module | ( | dt_develop_t * | develop_dest, |
| dt_develop_t * | develop_src, | ||
| const dt_iop_module_t * | source_module | ||
| ) |
Definition at line 2056 of file develop/masks/masks.c.
References _masks_fill_used_forms(), dt_develop_t::allforms, dt_iop_module_t::blend_params, dt_free, dt_masks_dup_masks_form(), dt_masks_get_from_id(), dt_masks_get_from_id_ext(), dt_develop_t::forms, IOP_FLAGS_SUPPORTS_BLENDING, IS_NULL_PTR, and dt_develop_blend_params_t::mask_id.
| dt_masks_form_t * dt_masks_create | ( | dt_masks_type_t | type | ) |
we create a completely new form.
Definition at line 1930 of file develop/masks/masks.c.
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(), FALSE, form_id_seed, dt_masks_form_t::formid, dt_masks_form_t::functions, IS_NULL_PTR, dt_masks_functions_t::sanitize_config, TRUE, type, dt_masks_form_t::type, dt_masks_form_t::uses_bezier_points_layout, and dt_masks_form_t::version.
Referenced by _blendop_masks_group_create(), _group_create(), _tree_group(), _tree_selection_change(), dt_masks_create_ext(), dt_masks_creation_mode_enter(), dt_masks_form_duplicate(), dt_masks_gui_form_save_creation(), dt_masks_read_masks_history(), and legacy_params().
| 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.
Definition at line 1959 of file develop/masks/masks.c.
References dt_develop_t::allforms, darktable, darktable_t::develop, dt_masks_create(), dt_pthread_rwlock_unlock, dt_pthread_rwlock_wrlock, dt_develop_t::masks_mutex, and type.
Referenced by dt_masks_set_edit_mode(), and rt_show_forms_for_current_scale().
| gboolean dt_masks_creation_mode_enter | ( | dt_iop_module_t * | module, |
| const dt_masks_type_t | type | ||
| ) |
Enter mask creation mode for a given shape type.
NOTE: this does quite the same as _menu_add_shape.
Definition at line 4354 of file develop/masks/masks.c.
References dt_masks_form_gui_t::creation, dt_masks_form_gui_t::creation_formids, dt_masks_form_gui_t::creation_last_formid, dt_masks_form_gui_t::creation_module, dt_masks_form_gui_t::creation_type, darktable, darktable_t::develop, dt_iop_request_focus(), DT_MASKS_ALL, dt_masks_change_form_gui(), dt_masks_create(), dt_ui_center(), FALSE, dt_develop_t::form_gui, darktable_t::gui, IS_NULL_PTR, TRUE, type, and dt_gui_gtk_t::ui.
Referenced by _add_shape(), _masks_shape_button_pressed(), _menu_add_shape(), _tree_add_brush(), _tree_add_circle(), _tree_add_ellipse(), _tree_add_gradient(), _tree_add_polygon(), and rt_select_algorithm_callback().
| void dt_masks_creation_mode_quit | ( | dt_masks_form_gui_t * | mask_gui | ) |
Exit mask creation mode, restoring cursor visibility and resetting GUI state.
| mask_gui | The GUI state of the mask form |
Definition at line 4342 of file develop/masks/masks.c.
References dt_masks_form_gui_t::creation, FALSE, and IS_NULL_PTR.
Referenced by dt_masks_clear_form_gui(), and dt_masks_form_exit_creation().
| void dt_masks_draw_path_seg_by_seg | ( | cairo_t * | cr, |
| dt_masks_form_gui_t * | mask_gui, | ||
| const int | form_index, | ||
| const float * | points, | ||
| const int | points_count, | ||
| const int | node_count, | ||
| const float | zoom_scale | ||
| ) |
Definition at line 2861 of file develop/masks/masks.c.
References dt_masks_form_gui_t::creation, dt_draw_stroke_line(), DT_MASKS_DASH_ROUND, dt_masks_gui_selected_segment_index(), dt_masks_is_anything_selected(), DT_MASKS_NO_DASH, FALSE, dt_masks_form_gui_t::form_dragging, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::group_selected, and IS_NULL_PTR.
Referenced by _brush_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, | ||
| struct dt_masks_gui_center_point_t * | center_point, | ||
| const shape_draw_function_t * | draw_shape_func | ||
| ) |
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 |
Definition at line 2746 of file develop/masks/masks.c.
References _dt_masks_find_best_attachment_point(), dt_masks_form_gui_t::creation, darktable, DT_DEBUG_MASKS, dt_draw_arrow(), dt_draw_source_shape(), DT_MASKS_BRUSH, DT_MASKS_DASH_ROUND, DT_MASKS_ELLIPSE, DT_MASKS_IS_CLOSED_SHAPE, DT_MASKS_IS_OPEN_SHAPE, DT_MASKS_IS_PATH_SHAPE, dt_masks_point_in_form_exact(), DT_PIXEL_APPLY_DPI, dt_masks_form_gui_t::form_dragging, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, M_PI, main(), dt_masks_gui_center_point_t::main, 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_gui_center_point_t::source, dt_masks_form_gui_points_t::source_count, dt_masks_form_gui_t::source_dragging, dt_masks_form_gui_t::source_selected, TRUE, dt_masks_form_gui_t::type, darktable_t::unmuted, dt_masks_gui_center_point_t::x, and dt_masks_gui_center_point_t::y.
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 * | form_list, |
| dt_masks_form_t * | replacement_form | ||
| ) |
Duplicate the list of forms, replacing a single item by formid match.
Definition at line 727 of file develop/masks/masks.c.
References _dup_masks_form_cb().
Referenced by dt_dev_pixelpipe_process(), dt_history_duplicate(), dt_masks_replace_current_forms(), and dt_masks_snapshot_current_forms().
| dt_masks_form_t * dt_masks_dup_masks_form | ( | const dt_masks_form_t * | mask_form | ) |
Deep-copy a mask form, including its points list.
Caveats:
Definition at line 276 of file develop/masks/masks.c.
References dt_masks_form_t::functions, IS_NULL_PTR, dt_masks_functions_t::point_struct_size, and dt_masks_form_t::points.
Referenced by _dup_masks_form_cb(), and dt_masks_copy_used_forms_for_module().
| void dt_masks_duplicate_points | ( | const dt_masks_form_t * | base, |
| dt_masks_form_t * | dest, | ||
| size_t | node_size | ||
| ) |
Duplicate a points list for a mask using a fixed node size.
The destination list is appended to, mirroring the previous per-mask implementations.
Definition at line 3742 of file develop/masks/masks.c.
References IS_NULL_PTR, and dt_masks_form_t::points.
Referenced by _brush_duplicate_points(), _circle_duplicate_points(), _ellipse_duplicate_points(), _gradient_duplicate_points(), and _polygon_duplicate_points().
| int dt_masks_events_button_pressed | ( | struct dt_iop_module_t * | module, |
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | button, | ||
| int | event_type, | ||
| uint32_t | state | ||
| ) |
Definition at line 2491 of file develop/masks/masks.c.
References _apply_gui_button_pressed_state(), _dt_masks_events_get_dispatch_form(), _dt_masks_events_group_update_selection(), _dt_masks_events_set_current_pos(), _dt_masks_events_update_hover(), dt_masks_functions_t::button_pressed, dt_masks_form_gui_t::creation, dt_develop_t::darkroom_skip_mouse_events, darktable, darktable_t::develop, dt_masks_create_menu(), dt_masks_get_visible_form(), DT_MASKS_GROUP, dt_masks_is_anything_hovered(), dt_masks_is_anything_selected(), dt_masks_select_form(), FALSE, dt_develop_t::form_gui, dt_masks_form_t::functions, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, dt_masks_form_gui_t::rel_pos, state, TRUE, dt_masks_form_t::type, and x.
Referenced by button_pressed().
| int dt_masks_events_button_released | ( | struct dt_iop_module_t * | module, |
| double | x, | ||
| double | y, | ||
| int | button, | ||
| uint32_t | state | ||
| ) |
Definition at line 2444 of file develop/masks/masks.c.
References _dt_masks_events_flush_rebuild_if_needed(), _dt_masks_events_get_dispatch_form(), _dt_masks_events_set_current_pos(), _set_cursor_shape(), _set_hinter_message(), dt_masks_functions_t::button_released, dt_masks_form_gui_t::creation, dt_develop_t::darkroom_skip_mouse_events, darktable, darktable_t::develop, dt_dev_masks_selection_change(), dt_masks_form_get_selected_group_live(), dt_masks_get_visible_form(), DT_MASKS_GROUP, dt_masks_gui_reset_dragging(), FALSE, dt_develop_t::form_gui, dt_masks_form_group_t::formid, dt_masks_form_t::functions, IS_NULL_PTR, state, dt_masks_form_t::type, and x.
Referenced by button_released().
| int dt_masks_events_key_pressed | ( | struct dt_iop_module_t * | module, |
| GdkEventKey * | event | ||
| ) |
Definition at line 2552 of file develop/masks/masks.c.
References _dt_masks_events_get_dispatch_form(), darktable, darktable_t::develop, dt_keys_mainpad_alternatives(), dt_masks_form_exit_creation(), dt_masks_form_get_selected_group(), dt_masks_get_from_id(), dt_masks_get_visible_form(), DT_MASKS_GROUP, dt_masks_gui_remove(), FALSE, dt_develop_t::form_gui, dt_masks_form_group_t::formid, dt_masks_form_t::functions, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, key, dt_masks_functions_t::key_pressed, dt_masks_form_group_t::parentid, and dt_masks_form_t::type.
Referenced by key_pressed().
| int dt_masks_events_mouse_enter | ( | struct dt_iop_module_t * | module | ) |
Definition at line 2265 of file develop/masks/masks.c.
Referenced by mouse_enter().
| int dt_masks_events_mouse_leave | ( | struct dt_iop_module_t * | module | ) |
Definition at line 2260 of file develop/masks/masks.c.
Referenced by mouse_leave().
| int dt_masks_events_mouse_moved | ( | struct dt_iop_module_t * | module, |
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | which | ||
| ) |
Definition at line 2400 of file develop/masks/masks.c.
References _dt_masks_events_get_dispatch_form(), _dt_masks_events_group_blocks_motion(), _dt_masks_events_set_current_pos(), _dt_masks_events_should_update_hover_on_move(), _dt_masks_events_update_hover(), _set_cursor_shape(), _set_hinter_message(), dt_develop_t::darkroom_skip_mouse_events, darktable, darktable_t::develop, dt_masks_get_visible_form(), DT_MASKS_GROUP, dt_develop_t::form_gui, dt_masks_form_t::functions, IS_NULL_PTR, dt_masks_functions_t::mouse_moved, dt_masks_form_t::type, and x.
Referenced by mouse_moved().
| int dt_masks_events_mouse_scrolled | ( | struct dt_iop_module_t * | module, |
| double | x, | ||
| double | y, | ||
| int | scroll_up, | ||
| uint32_t | key_state, | ||
| int | scrolling_delta | ||
| ) |
Definition at line 2608 of file develop/masks/masks.c.
References _dt_masks_events_cursor_over_form(), _dt_masks_events_get_dispatch_form(), _dt_masks_events_set_current_pos(), _dt_masks_events_update_hover(), _set_hinter_message(), dt_masks_form_gui_t::creation, dt_develop_t::darkroom_skip_mouse_events, darktable, darktable_t::develop, DT_DEBUG_INPUT, dt_mask_scroll_increases(), dt_masks_get_visible_form(), DT_MASKS_INTERACTION_UNDEF, dt_masks_is_anything_selected(), dt_print(), dt_develop_t::form_gui, dt_masks_form_t::functions, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, dt_masks_functions_t::mouse_scrolled, dt_masks_form_t::type, and x.
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 | ||
| ) |
Definition at line 2960 of file develop/masks/masks.c.
References _masks_draw_creation_session_forms(), 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_get_visible_form(), DT_MASKS_GROUP, dt_masks_gui_form_test_create(), DT_MASKS_IS_PRIMITIVE_SHAPE, dt_develop_t::form_gui, dt_masks_form_t::functions, height, IS_NULL_PTR, dt_masks_form_t::points, dt_masks_functions_t::post_expose, dt_masks_form_t::type, dt_masks_form_gui_t::type, and width.
Referenced by expose().
| int dt_masks_find_closest_handle_common | ( | dt_masks_form_t * | mask_form, |
| dt_masks_form_gui_t * | mask_gui, | ||
| int | form_index, | ||
| int | node_count_override, | ||
| dt_masks_border_handle_fn | border_handle_cb, | ||
| dt_masks_curve_handle_fn | curve_handle_cb, | ||
| dt_masks_node_position_fn | node_position_cb, | ||
| dt_masks_distance_fn | distance_cb, | ||
| dt_masks_post_select_fn | post_select_cb, | ||
| void * | user_data | ||
| ) |
Centralized hit-testing for node/handle/segment selection across shapes.
Shared selection logic for node/handle/segment hit testing.
This function:
node_count_override can be used for shapes that don't expose nodes via GList (e.g. gradient/ellipse control points). Pass -1 to use g_list_length().
Callers provide shape-specific callbacks for handles and distance tests.
The cached cursor in mask_gui->pos is authoritative for hit testing.
Definition at line 92 of file develop/masks/masks.c.
References dt_masks_form_gui_t::border_selected, dt_masks_form_gui_t::creation, DT_GUI_MOUSE_EFFECT_RADIUS, dt_masks_gui_selected_node_index(), dt_masks_gui_was_anything_selected(), dt_masks_node_is_cusp(), dt_masks_point_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_dragging, dt_masks_form_gui_t::handle_border_hovered, dt_masks_form_gui_t::handle_dragging, dt_masks_form_gui_t::handle_hovered, IS_NULL_PTR, dt_masks_form_gui_t::node_dragging, dt_masks_form_gui_t::node_hovered, 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_hovered, dt_masks_form_gui_t::source_selected, TRUE, and dt_masks_form_t::uses_bezier_points_layout.
Referenced by _find_closest_handle(), _find_closest_handle(), _find_closest_handle(), _find_closest_handle(), and _find_closest_handle().
| int dt_masks_form_change_opacity | ( | dt_masks_form_t * | mask_form, |
| int | parent_id, | ||
| int | scroll_up, | ||
| const int | flow | ||
| ) |
Definition at line 3758 of file develop/masks/masks.c.
References dt_masks_form_group_from_parentid(), dt_masks_form_set_interaction_value(), DT_MASKS_INCREMENT_OFFSET, DT_MASKS_INTERACTION_OPACITY, dt_masks_form_t::formid, and IS_NULL_PTR.
Referenced by _brush_events_mouse_scrolled(), _circle_events_mouse_scrolled(), _ellipse_events_mouse_scrolled(), _gradient_events_mouse_scrolled(), and _polygon_events_mouse_scrolled().
| void dt_masks_form_delete | ( | struct dt_iop_module_t * | module, |
| dt_masks_form_t * | group_form, | ||
| dt_masks_form_t * | mask_form | ||
| ) |
Definition at line 3431 of file develop/masks/masks.c.
References _group_from_module(), dt_iop_module_t::blend_params, darktable, darktable_t::develop, dt_free, DT_MASKS_CLONE, dt_masks_form_delete(), dt_masks_form_update_gravity_center(), dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_iop_update(), DT_MASKS_NON_CLONE, dt_masks_remove_form(), dt_masks_form_group_t::formid, dt_masks_form_t::formid, dt_develop_t::forms, dt_develop_t::iop, IOP_FLAGS_SUPPORTS_BLENDING, IS_NULL_PTR, dt_develop_blend_params_t::mask_id, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by _blendop_masks_all_delete_callback(), _blendop_masks_all_toggled(), _blendop_masks_group_delete(), _blendop_masks_group_unlink(), _gui_reset_callback(), _masks_remove_shape(), _menu_no_masks(), _tree_delete_shape(), dt_masks_form_delete(), and dt_masks_remove_or_delete().
| int dt_masks_form_duplicate | ( | dt_develop_t * | develop, |
| int | form_id | ||
| ) |
Definition at line 1503 of file develop/masks/masks.c.
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, IS_NULL_PTR, dt_masks_form_t::name, dt_masks_form_t::source, dt_masks_form_t::type, and dt_masks_form_t::version.
Referenced by _blendop_masks_all_duplicate_callback(), _group_duplicate_points(), and _tree_duplicate_shape().
| gboolean dt_masks_form_exit_creation | ( | dt_iop_module_t * | module, |
| dt_masks_form_gui_t * | mask_gui | ||
| ) |
Definition at line 1135 of file develop/masks/masks.c.
References dt_iop_module_t::blend_data, dt_masks_form_gui_t::border_selected, dt_masks_form_gui_t::creation, dt_masks_form_gui_t::creation_formids, dt_masks_form_gui_t::creation_last_formid, dt_masks_form_gui_t::creation_module, dt_masks_form_gui_t::creation_type, darktable, darktable_t::develop, dt_dev_masks_selection_change(), dt_masks_change_form_gui(), dt_masks_creation_mode_quit(), dt_masks_dynbuf_free(), DT_MASKS_EDIT_FULL, dt_masks_free_form(), dt_masks_get_from_id(), dt_masks_get_visible_form(), dt_masks_group_index_from_formid(), dt_masks_iop_update(), DT_MASKS_NONE, dt_masks_set_edit_mode(), dt_masks_set_visible_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_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_masks_form_gui_t::handle_border_selected, dt_masks_form_gui_t::handle_selected, IS_NULL_PTR, dt_iop_gui_blend_data_t::masks_edit, dt_iop_gui_blend_data_t::masks_shown, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::node_selected_idx, dt_masks_form_gui_t::pivot_selected, dt_masks_form_gui_t::seg_selected, dt_masks_form_gui_t::source_dragging, dt_masks_form_gui_t::source_selected, and TRUE.
Referenced by _group_events_key_pressed(), _masks_gui_delete_node_callback(), _masks_gui_exit_creation_callback(), _masks_shape_button_pressed(), _polygon_events_key_pressed(), dt_masks_events_key_pressed(), dt_masks_gui_cleanup(), dt_masks_gui_form_save_creation(), and dt_masks_gui_remove().
| gboolean dt_masks_form_get_gravity_center | ( | const dt_masks_form_t * | mask_form, |
| float | center[2], | ||
| float * | area | ||
| ) |
Definition at line 3549 of file develop/masks/masks.c.
References FALSE, dt_masks_form_t::functions, dt_masks_functions_t::get_gravity_center, and IS_NULL_PTR.
Referenced by dt_masks_center_view_on_form(), and dt_masks_form_update_gravity_center().
| float dt_masks_form_get_interaction_value | ( | dt_masks_form_group_t * | form_group, |
| dt_masks_interaction_t | interaction | ||
| ) |
Definition at line 3533 of file develop/masks/masks.c.
References darktable, darktable_t::develop, dt_masks_get_from_id(), DT_MASKS_INTERACTION_OPACITY, dt_masks_form_group_t::formid, dt_masks_form_t::functions, dt_masks_functions_t::get_interaction_value, IS_NULL_PTR, and dt_masks_form_group_t::opacity.
Referenced by _set_hinter_message(), and dt_masks_create_menu().
| dt_masks_form_group_t * dt_masks_form_get_selected_group | ( | const dt_masks_form_t * | mask_form, |
| const dt_masks_form_gui_t * | mask_gui | ||
| ) |
Get the selected group entry from the GUI selection index.
Selection sequence overview:
Use dt_masks_form_get_selected_group() in tight GUI paths where the list is known stable; use dt_masks_form_get_selected_group_live() when correctness matters across potential list mutations.
Definition at line 462 of file develop/masks/masks.c.
References dt_masks_form_gui_t::group_selected, IS_NULL_PTR, and dt_masks_form_t::points.
Referenced by dt_masks_events_key_pressed(), and dt_masks_form_get_selected_group_live().
| dt_masks_form_group_t * dt_masks_form_get_selected_group_live | ( | const dt_masks_form_t * | mask_form, |
| const dt_masks_form_gui_t * | mask_gui | ||
| ) |
Resolve a "live" selected group entry, even if GUI selection is stale.
Selection source:
If the GUI works on a temporary group copy, we re-resolve through parentid to get the live entry from dev->forms.
Definition at line 479 of file develop/masks/masks.c.
References dt_masks_form_get_selected_group(), dt_masks_form_group_from_parentid(), dt_masks_form_group_t::formid, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, and dt_masks_form_group_t::parentid.
Referenced by _dt_masks_events_get_dispatch_form(), _dt_masks_events_group_update_selection(), _set_hinter_message(), and dt_masks_events_button_released().
| dt_masks_form_group_t * dt_masks_form_group_from_parentid | ( | int | parent_id, |
| int | form_id | ||
| ) |
Return the group entry for a (parent, form) pair.
Caveat: returns NULL if parent isn't a group or the entry is missing.
Definition at line 436 of file develop/masks/masks.c.
References _masks_group_find_form(), darktable, darktable_t::develop, dt_masks_get_from_id(), DT_MASKS_GROUP, IS_NULL_PTR, and dt_masks_form_t::type.
Referenced by _blendop_masks_group_operation_callback(), dt_masks_create_menu(), dt_masks_form_change_opacity(), and dt_masks_form_get_selected_group_live().
| void dt_masks_form_gui_points_free | ( | gpointer | data | ) |
Definition at line 920 of file develop/masks/masks.c.
References dt_masks_form_gui_points_t::border, dt_free, dt_pixelpipe_cache_free_align, IS_NULL_PTR, dt_masks_form_gui_points_t::points, and dt_masks_form_gui_points_t::source.
Referenced by _masks_draw_creation_session_forms(), dt_masks_clear_form_gui(), dt_masks_gui_form_save_creation(), and dt_masks_gui_form_test_create().
| void dt_masks_form_move | ( | dt_masks_form_t * | group_form, |
| int | form_id, | ||
| int | move_up | ||
| ) |
Definition at line 3771 of file develop/masks/masks.c.
References DT_MASKS_GROUP, dt_masks_form_group_t::formid, IS_NULL_PTR, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by _masks_move_up_down_callback(), _tree_movedown(), and _tree_moveup().
| float dt_masks_form_set_interaction_value | ( | dt_masks_form_group_t * | form_group, |
| dt_masks_interaction_t | interaction, | ||
| float | value, | ||
| dt_masks_increment_t | increment, | ||
| int | flow, | ||
| dt_masks_form_gui_t * | mask_gui, | ||
| dt_iop_module_t * | module | ||
| ) |
Definition at line 3617 of file develop/masks/masks.c.
References _change_opacity(), darktable, darktable_t::develop, dt_masks_form_update_gravity_center(), dt_masks_get_from_id(), DT_MASKS_INTERACTION_OPACITY, dt_masks_form_group_t::formid, dt_masks_form_t::functions, IS_NULL_PTR, dt_masks_functions_t::set_interaction_value, and value.
Referenced by _masks_gui_interaction_apply_value(), and dt_masks_form_change_opacity().
| void dt_masks_form_update_gravity_center | ( | dt_masks_form_t * | mask_form | ) |
Definition at line 3559 of file develop/masks/masks.c.
References dt_masks_form_t::area, DT_DEBUG_MASKS, dt_masks_form_get_gravity_center(), dt_print(), dt_masks_form_t::formid, dt_masks_form_t::gravity_center, IS_NULL_PTR, and dt_masks_form_t::type.
Referenced by dt_masks_form_delete(), dt_masks_form_set_interaction_value(), dt_masks_group_add_form(), dt_masks_group_ungroup(), dt_masks_gui_form_create(), dt_masks_gui_form_save_creation(), dt_masks_read_masks_history(), and dt_masks_replace_current_forms().
| void dt_masks_free_form | ( | dt_masks_form_t * | mask_form | ) |
Definition at line 2252 of file develop/masks/masks.c.
References dt_free, dt_free_gpointer(), IS_NULL_PTR, and dt_masks_form_t::points.
Referenced by dt_dev_cleanup(), dt_dev_free_history_item(), dt_dev_history_item_update_from_params(), dt_dev_pixelpipe_cleanup(), dt_dev_pixelpipe_process(), dt_masks_change_form_gui(), dt_masks_form_exit_creation(), and leave().
| int dt_masks_get_area | ( | dt_iop_module_t * | module, |
| dt_dev_pixelpipe_t * | pipe, | ||
| 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
Definition at line 1538 of file develop/masks/masks.c.
References dt_masks_form_t::functions, and dt_masks_functions_t::get_area.
Referenced by __attribute__(), 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 | ) |
Definition at line 3155 of file develop/masks/masks.c.
References darktable, darktable_t::develop, DT_MASKS_EDIT_OFF, dt_masks_form_gui_t::edit_mode, and dt_develop_t::form_gui.
Referenced by dt_dev_history_undo_end_record_locked().
| dt_masks_form_t * dt_masks_get_from_id | ( | dt_develop_t * | dev, |
| int | id | ||
| ) |
returns a form with formid == id from dev->forms
Definition at line 2004 of file develop/masks/masks.c.
References dt_masks_get_from_id_ext(), dt_pthread_rwlock_rdlock, dt_pthread_rwlock_unlock, dt_develop_t::forms, and dt_develop_t::masks_mutex.
Referenced by _blendop_masks_all_delete_callback(), _blendop_masks_all_name_edited(), _blendop_masks_all_selection_changed(), _blendop_masks_all_toggled(), _blendop_masks_group_button_pressed(), _blendop_masks_group_delete(), _blendop_masks_group_from_module(), _blendop_masks_group_move_callback(), _blendop_masks_group_selection_changed(), _blendop_masks_group_tree_append(), _blendop_masks_group_unlink(), _blendop_masks_group_update_row(), _blendop_masks_is_group_with_shapes(), _blendop_masks_is_single_group_wrapper(), _blendop_masks_show_and_edit(), _brush_add_node_callback(), _brush_events_button_released(), _brush_reset_round_node_callback(), _brush_switch_node_callback(), _develop_blend_init_drawn_mask(), _dt_masks_events_get_dispatch_form(), _dt_masks_events_group_update_selection(), _edit_masks(), _find_in_group(), _group_from_module(), _group_get_child_at(), _group_get_gravity_center(), _group_get_mask(), _group_get_mask_roi(), _gui_reset_callback(), _is_form_used(), _lib_masks_handler_callback(), _lib_masks_list_recurs(), _lib_masks_update_item(), _masks_draw_creation_session_forms(), _masks_gui_delete_form_callback(), _masks_gui_delete_node_callback(), _masks_move_up_down_callback(), _masks_remove_shape(), _menu_add_exist(), _polygon_add_node_callback(), _polygon_events_post_expose(), _polygon_reset_round_node_callback(), _polygon_switch_node_callback(), _process(), _reset_form_creation(), _resynch_params(), _set_hinter_message(), _shape_is_being_added(), _tree_add_exist(), _tree_cell_edited(), _tree_context_menu(), _tree_delete_shape(), _tree_difference(), _tree_exclusion(), _tree_format_form_usage_label(), _tree_intersection(), _tree_inverse(), _tree_movedown(), _tree_moveup(), _tree_selection_change(), _tree_union(), _update_foreach(), dt_develop_blend_get_mask_usage(), dt_masks_copy_used_forms_for_module(), dt_masks_create_menu(), dt_masks_events_key_pressed(), dt_masks_form_delete(), dt_masks_form_duplicate(), dt_masks_form_exit_creation(), dt_masks_form_get_interaction_value(), dt_masks_form_group_from_parentid(), dt_masks_form_set_interaction_value(), 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_remove_or_delete(), dt_masks_set_edit_mode(), gui_focus(), gui_update(), modify_roi_in(), post_history_commit(), rt_compute_roi_in(), rt_display_selected_shapes_lbl(), rt_edit_masks_callback(), rt_extend_roi_in_for_clone(), rt_extend_roi_in_from_source_clones(), rt_get_mask_point_group(), rt_menu_select_algorithm_callback(), rt_process_forms(), rt_process_forms_cl(), 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
Definition at line 1994 of file develop/masks/masks.c.
References dt_masks_form_t::formid.
Referenced by _cleanup_unused_recurs(), _hm_history_masks_match(), _masks_fill_used_forms(), dt_iop_compute_blendop_hash(), dt_masks_copy_used_forms_for_module(), dt_masks_get_from_id(), and rt_resynch_params().
| dt_iop_module_t * dt_masks_get_mask_manager | ( | struct dt_develop_t * | dev | ) |
return the mask manager module instance if present
Definition at line 2012 of file develop/masks/masks.c.
References dt_develop_t::iop.
| int dt_masks_get_points_border | ( | struct 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
Definition at line 1527 of file develop/masks/masks.c.
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. |
Definition at line 3700 of file develop/masks/masks.c.
References _get_mask_plugin(), _get_mask_type(), dt_conf_get_float(), dt_conf_set_float(), dt_free, dt_masks_apply_increment(), MAX, and MIN.
Referenced by _brush_events_button_pressed(), _brush_events_button_released(), _brush_events_post_expose(), _change_hardness(), _change_size(), _init_hardness(), _init_size(), and dt_masks_get_set_conf_value_with_toast().
| float dt_masks_get_set_conf_value_with_toast | ( | dt_masks_form_t * | form, |
| const char * | feature, | ||
| float | amount, | ||
| float | v_min, | ||
| float | v_max, | ||
| dt_masks_increment_t | increment, | ||
| int | flow, | ||
| const char * | toast_fmt, | ||
| float | toast_scale | ||
| ) |
Update a mask configuration value and emit a toast message.
This is a convenience wrapper around dt_masks_get_set_conf_value() that keeps UI feedback consistent across mask types.
Definition at line 3730 of file develop/masks/masks.c.
References dt_masks_get_set_conf_value(), dt_toast_log(), IS_NULL_PTR, and value.
Referenced by _init_curvature(), _init_extent(), _init_hardness(), _init_hardness(), _init_hardness(), _init_opacity(), _init_opacity(), _init_opacity(), _init_opacity(), _init_rotation(), _init_rotation(), _init_size(), and _init_size().
| int dt_masks_get_source_area | ( | dt_iop_module_t * | module, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece, | ||
| dt_masks_form_t * | mask_form, | ||
| int * | area_width, | ||
| int * | area_height, | ||
| int * | area_pos_x, | ||
| int * | area_pos_y | ||
| ) |
Definition at line 1548 of file develop/masks/masks.c.
References DT_MASKS_CLONE, dt_masks_form_t::functions, dt_masks_functions_t::get_source_area, and dt_masks_form_t::type.
Referenced by modify_roi_in(), rt_extend_roi_in_for_clone(), and rt_extend_roi_in_from_source_clones().
| dt_masks_form_t * dt_masks_get_visible_form | ( | const dt_develop_t * | dev | ) |
Return the currently visible form used by the masks GUI.
This can be a temporary group copy used for editing, not necessarily a form stored in dev->forms.
Definition at line 355 of file develop/masks/masks.c.
References dt_develop_t::form_gui, dt_masks_form_gui_t::form_visible, and IS_NULL_PTR.
Referenced by _masks_remove_shape(), dt_masks_calculate_source_pos_origin(), dt_masks_change_form_gui(), dt_masks_events_button_pressed(), dt_masks_events_button_released(), dt_masks_events_key_pressed(), dt_masks_events_mouse_moved(), dt_masks_events_mouse_scrolled(), dt_masks_events_post_expose(), dt_masks_form_exit_creation(), and dt_masks_remove_or_delete().
| dt_masks_form_group_t * dt_masks_group_add_form | ( | dt_masks_form_t * | group_form, |
| dt_masks_form_t * | mask_form | ||
| ) |
Definition at line 3823 of file develop/masks/masks.c.
References _find_in_group(), dt_conf_get_float(), dt_control_log(), dt_masks_form_update_gravity_center(), 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 _blendop_masks_all_toggled(), _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 * | mask_form | ||
| ) |
Definition at line 3876 of file develop/masks/masks.c.
References darktable, darktable_t::develop, dt_hash(), dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_group_get_hash(), dt_masks_form_group_t::formid, dt_masks_form_t::formid, dt_masks_form_t::functions, IS_NULL_PTR, 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 _hm_history_masks_match(), dt_dev_masks_update_hash(), dt_iop_compute_blendop_hash(), and dt_masks_group_get_hash().
| int dt_masks_group_index_from_formid | ( | const dt_masks_form_t * | group_form, |
| int | form_id | ||
| ) |
Definition at line 335 of file develop/masks/masks.c.
References DT_MASKS_GROUP, dt_masks_form_group_t::formid, IS_NULL_PTR, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by _blendop_masks_group_selection_changed(), and dt_masks_form_exit_creation().
| void dt_masks_group_ungroup | ( | dt_masks_form_t * | dest_group, |
| dt_masks_form_t * | group_form | ||
| ) |
Definition at line 3846 of file develop/masks/masks.c.
References darktable, darktable_t::develop, dt_masks_form_update_gravity_center(), dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_group_ungroup(), dt_masks_form_group_t::formid, IS_NULL_PTR, 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 | ) |
Definition at line 3231 of file develop/masks/masks.c.
References _group_from_module(), _set_group_name_from_module(), darktable, darktable_t::develop, dt_masks_iop_update(), and IS_NULL_PTR.
Referenced by _rename_module_key_press().
| void dt_masks_gui_cleanup | ( | dt_develop_t * | dev | ) |
Definition at line 383 of file develop/masks/masks.c.
References dt_free, dt_masks_clear_form_gui(), dt_masks_form_exit_creation(), dt_masks_set_visible_form(), dt_develop_t::form_gui, and IS_NULL_PTR.
Referenced by leave().
| 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
Definition at line 844 of file develop/masks/masks.c.
References dt_dev_pixelpipe_t::backbuf, dt_masks_form_gui_points_t::border, dt_masks_form_gui_points_t::border_count, darktable, darktable_t::develop, dt_dev_backbuf_get_hash(), DT_MASKS_CLONE, dt_masks_form_update_gravity_center(), 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, dt_masks_form_t::type, and dt_masks_form_gui_t::type.
Referenced by _add_node_to_segment(), _add_node_to_segment(), _brush_events_mouse_moved(), _change_curvature(), _change_extent(), _change_hardness(), _change_hardness(), _change_hardness(), _change_hardness(), _change_rotation(), _change_rotation(), _change_size(), _change_size(), _change_size(), _change_size(), _circle_events_mouse_moved(), _dt_masks_events_flush_rebuild_if_needed(), _ellipse_events_button_released(), _ellipse_events_mouse_moved(), _gradient_events_button_pressed(), _gradient_events_button_released(), _gradient_events_mouse_moved(), _polygon_events_button_pressed(), _polygon_events_mouse_moved(), dt_masks_gui_form_create_throttled(), dt_masks_gui_form_test_create(), dt_masks_remove_node(), dt_masks_reset_bezier_ctrl_points(), and dt_masks_toggle_bezier_node_type().
| gboolean dt_masks_gui_form_create_throttled | ( | dt_masks_form_t * | mask_form, |
| dt_masks_form_gui_t * | mask_gui, | ||
| int | form_index, | ||
| dt_iop_module_t * | module, | ||
| float | posx, | ||
| float | posy | ||
| ) |
Definition at line 880 of file develop/masks/masks.c.
References dt_dev_pixelpipe_t::backbuf, darktable, darktable_t::develop, dt_dev_backbuf_get_hash(), dt_get_wtime(), dt_masks_gui_form_create(), FALSE, IS_NULL_PTR, dt_masks_form_gui_t::last_rebuild_pos, dt_masks_form_gui_t::last_rebuild_ts, dt_masks_form_gui_t::pipe_hash, dt_develop_t::preview_pipe, dt_masks_form_gui_t::rebuild_pending, and TRUE.
Referenced by _brush_events_mouse_moved(), and _polygon_events_mouse_moved().
| void dt_masks_gui_form_remove | ( | dt_masks_form_t * | mask_form, |
| dt_masks_form_gui_t * | mask_gui, | ||
| int | form_index | ||
| ) |
Definition at line 1271 of file develop/masks/masks.c.
References dt_masks_form_gui_points_t::border, dt_masks_form_gui_points_t::border_count, dt_pixelpipe_cache_free_align, DT_PIXELPIPE_CACHE_HASH_INVALID, dt_masks_form_gui_t::formid, IS_NULL_PTR, 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 dt_masks_gui_form_create().
| void dt_masks_gui_form_save_creation | ( | dt_develop_t * | dev, |
| struct dt_iop_module_t * | module, | ||
| dt_masks_form_t * | form, | ||
| dt_masks_form_gui_t * | gui | ||
| ) |
Save the form creation right after a shape has been finished drawing.
| dev | the develop structure |
| module | the module owning the mask |
| form | the form to save |
| gui | the GUI state of the form |
Definition at line 1382 of file develop/masks/masks.c.
References _check_id(), _group_create(), _group_from_module(), dt_masks_form_gui_t::creation_closing_form, dt_masks_form_gui_t::creation_formids, dt_masks_form_gui_t::creation_last_formid, dt_masks_form_gui_t::creation_type, darktable, dt_conf_get_float(), DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_masks_append_form(), DT_MASKS_CLONE, dt_masks_create(), dt_masks_dynbuf_free(), DT_MASKS_EVENT_ADD, dt_masks_form_exit_creation(), dt_masks_form_gui_points_free(), dt_masks_form_update_gravity_center(), DT_MASKS_GROUP, dt_masks_iop_update(), DT_MASKS_NON_CLONE, dt_masks_set_visible_form(), dt_masks_soft_reset_form_gui(), DT_MASKS_STATE_SHOW, DT_MASKS_STATE_UNION, DT_MASKS_STATE_USE, DT_PIXELPIPE_CACHE_HASH_INVALID, dt_pthread_rwlock_rdlock, dt_pthread_rwlock_unlock, DT_SIGNAL_MASK_CHANGED, FALSE, 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_gui_t::guipoints, dt_masks_form_gui_t::guipoints_count, dt_masks_form_gui_t::guipoints_payload, IS_NULL_PTR, dt_develop_t::masks_mutex, dt_masks_form_t::name, dt_masks_form_group_t::opacity, dt_masks_form_group_t::parentid, dt_masks_form_gui_t::pipe_hash, dt_masks_form_t::points, dt_masks_form_gui_t::points, dt_masks_functions_t::set_form_name, darktable_t::signals, 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_creation_closing_form(), and legacy_params().
| void dt_masks_gui_form_test_create | ( | dt_masks_form_t * | mask_form, |
| dt_masks_form_gui_t * | mask_gui, | ||
| dt_iop_module_t * | module | ||
| ) |
Definition at line 1290 of file develop/masks/masks.c.
References dt_dev_pixelpipe_t::backbuf, darktable, darktable_t::develop, dt_dev_backbuf_get_hash(), dt_masks_form_gui_points_free(), dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_gui_form_create(), DT_PIXELPIPE_CACHE_HASH_INVALID, dt_masks_form_group_t::formid, dt_masks_form_gui_t::formid, IS_NULL_PTR, 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 _masks_draw_creation_session_forms(), and dt_masks_events_post_expose().
| void dt_masks_gui_init | ( | dt_develop_t * | dev | ) |
Definition at line 367 of file develop/masks/masks.c.
References dt_masks_clear_form_gui(), dt_masks_init_form_gui(), dt_masks_set_visible_form(), DT_PIXELPIPE_CACHE_HASH_INVALID, dt_develop_t::form_gui, dt_masks_form_gui_t::formid, IS_NULL_PTR, and dt_masks_form_gui_t::pipe_hash.
Referenced by enter().
| gboolean dt_masks_gui_is_dragging | ( | const dt_masks_form_gui_t * | gui | ) |
Definition at line 422 of file develop/masks/masks.c.
References darktable, FALSE, dt_masks_form_gui_t::form_dragging, darktable_t::gui, dt_masks_form_gui_t::handle_border_dragging, dt_masks_form_gui_t::handle_dragging, dt_gui_gtk_t::is_dragging, IS_NULL_PTR, dt_gui_gtk_t::mouse, dt_masks_form_gui_t::node_dragging, dt_masks_form_gui_t::seg_dragging, and dt_masks_form_gui_t::source_dragging.
Referenced by _brush_events_button_released(), _dt_masks_events_flush_rebuild_if_needed(), _dt_masks_events_should_update_hover_on_move(), and _polygon_events_button_released().
| gboolean dt_masks_gui_remove | ( | struct dt_iop_module_t * | module, |
| dt_masks_form_t * | form, | ||
| dt_masks_form_gui_t * | gui, | ||
| const int | parentid | ||
| ) |
remove a mask shape or node form from the GUI. This function is used with a popupmenu "Delete" action.
| module | The module owning the mask |
| form | The form to remove |
| gui | The GUI state of the form |
| parentid | The parent ID of the form |
Definition at line 1241 of file develop/masks/masks.c.
References _masks_remove_shape(), DT_MASKS_EDIT_FULL, dt_masks_form_exit_creation(), DT_MASKS_IS_PATH_SHAPE, dt_masks_remove_node(), dt_masks_remove_or_delete(), dt_masks_form_gui_t::edit_mode, FALSE, dt_masks_form_t::formid, g_list_shorter_than(), dt_masks_form_gui_t::group_selected, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_t::points, TRUE, and dt_masks_form_t::type.
Referenced by _group_events_key_pressed(), and dt_masks_events_key_pressed().
| void dt_masks_gui_reset_dragging | ( | dt_masks_form_gui_t * | gui | ) |
Definition at line 410 of file develop/masks/masks.c.
References FALSE, dt_masks_form_gui_t::form_dragging, dt_masks_form_gui_t::handle_border_dragging, dt_masks_form_gui_t::handle_dragging, IS_NULL_PTR, dt_masks_form_gui_t::node_dragging, dt_masks_form_gui_t::seg_dragging, and dt_masks_form_gui_t::source_dragging.
Referenced by dt_masks_events_button_released().
| void dt_masks_gui_set_dragging | ( | dt_masks_form_gui_t * | gui | ) |
Definition at line 396 of file develop/masks/masks.c.
References dt_masks_form_gui_t::form_dragging, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::handle_border_dragging, dt_masks_form_gui_t::handle_border_hovered, dt_masks_form_gui_t::handle_border_selected, dt_masks_form_gui_t::handle_dragging, dt_masks_form_gui_t::handle_hovered, dt_masks_form_gui_t::handle_selected, IS_NULL_PTR, dt_masks_form_gui_t::node_dragging, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::seg_dragging, dt_masks_form_gui_t::seg_hovered, dt_masks_form_gui_t::seg_selected, dt_masks_form_gui_t::source_dragging, dt_masks_form_gui_t::source_selected, and TRUE.
Referenced by _apply_gui_button_pressed_state().
| void dt_masks_init_form_gui | ( | dt_masks_form_gui_t * | gui | ) |
init dt_masks_form_gui_t struct with default values
Definition at line 792 of file develop/masks/masks.c.
References dt_masks_form_gui_t::border_selected, DT_MASKS_SOURCE_POS_RELATIVE_TEMP, FALSE, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::handle_border_hovered, dt_masks_form_gui_t::handle_border_selected, dt_masks_form_gui_t::handle_hovered, dt_masks_form_gui_t::handle_selected, dt_masks_form_gui_t::last_hit_test_pos, dt_masks_form_gui_t::last_rebuild_pos, dt_masks_form_gui_t::last_rebuild_ts, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::node_selected_idx, dt_masks_form_gui_t::pivot_selected, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::pos_source, dt_masks_form_gui_t::raw_pos, dt_masks_form_gui_t::rebuild_pending, dt_masks_form_gui_t::rel_pos, dt_masks_form_gui_t::seg_hovered, dt_masks_form_gui_t::seg_selected, dt_masks_form_gui_t::source_pos_type, and dt_masks_form_gui_t::source_selected.
Referenced by _masks_draw_creation_session_forms(), and dt_masks_gui_init().
Definition at line 3277 of file develop/masks/masks.c.
References _group_from_module(), darktable, darktable_t::develop, dt_bauhaus_combobox_add(), dt_bauhaus_combobox_length(), dt_bauhaus_combobox_remove_at(), dt_free, dt_history_item_get_name(), dt_iop_request_focus(), DT_MASKS_CLONE, DT_MASKS_GROUP, DT_MASKS_NON_CLONE, dt_pthread_rwlock_rdlock, dt_pthread_rwlock_unlock, 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.
| void dt_masks_iop_use_same_as | ( | dt_iop_module_t * | module, |
| dt_iop_module_t * | source_module | ||
| ) |
Definition at line 3242 of file develop/masks/masks.c.
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, IS_NULL_PTR, 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 | ||
| ) |
Definition at line 3361 of file develop/masks/masks.c.
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, dt_iop_gui_blend_data_t::masks_combo, dt_iop_gui_blend_data_t::masks_combo_ids, and TRUE.
| gboolean dt_masks_is_anything_hovered | ( | const dt_masks_form_gui_t * | mask_gui | ) |
Returns TRUE if anything in the mask is hovered at all, regardless of what it is.
Definition at line 2280 of file develop/masks/masks.c.
References dt_masks_form_gui_t::handle_border_hovered, dt_masks_form_gui_t::handle_hovered, dt_masks_form_gui_t::node_hovered, and dt_masks_form_gui_t::seg_hovered.
Referenced by _dt_masks_events_group_update_selection(), _set_cursor_shape(), and dt_masks_events_button_pressed().
| gboolean dt_masks_is_anything_selected | ( | const dt_masks_form_gui_t * | mask_gui | ) |
Returns TRUE if anything in the mask is selected at all, regardless of what it is.
Definition at line 2270 of file develop/masks/masks.c.
References dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::handle_border_selected, dt_masks_form_gui_t::handle_selected, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::seg_selected, and dt_masks_form_gui_t::source_selected.
Referenced by _brush_events_mouse_scrolled(), _polygon_events_mouse_scrolled(), _set_cursor_shape(), dt_masks_draw_path_seg_by_seg(), dt_masks_events_button_pressed(), and dt_masks_events_mouse_scrolled().
| int dt_masks_legacy_params | ( | dt_develop_t * | develop, |
| void * | params, | ||
| const int | old_version, | ||
| const int | new_version | ||
| ) |
Definition at line 1884 of file develop/masks/masks.c.
References dt_masks_legacy_params_v1_to_v2(), dt_masks_legacy_params_v2_to_v3(), dt_masks_legacy_params_v3_to_v4(), dt_masks_legacy_params_v4_to_v5(), and dt_masks_legacy_params_v5_to_v6().
Referenced by dt_masks_read_masks_history(), and legacy_params().
|
static |
Definition at line 1570 of file develop/masks/masks.c.
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, IS_NULL_PTR, 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_form_t::points, dt_masks_node_ellipse_t::radius, dt_masks_anchor_gradient_t::rotation, dt_masks_form_t::type, dt_masks_form_t::version, and dt_iop_roi_t::width.
Referenced by dt_masks_legacy_params().
|
static |
Definition at line 1726 of file develop/masks/masks.c.
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, IS_NULL_PTR, dt_masks_node_polygon_t::node, dt_masks_node_brush_t::node, dt_masks_form_t::points, dt_masks_node_circle_t::radius, dt_masks_node_ellipse_t::radius, dt_masks_form_t::source, dt_masks_form_t::type, and dt_masks_form_t::version.
Referenced by dt_masks_legacy_params().
|
static |
Definition at line 1685 of file develop/masks/masks.c.
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 |
Definition at line 1706 of file develop/masks/masks.c.
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 |
Definition at line 1806 of file develop/masks/masks.c.
References DT_MASKS_ELLIPSE, DT_MASKS_ELLIPSE_EQUIDISTANT, dt_masks_node_ellipse_t::flags, IS_NULL_PTR, dt_masks_form_t::points, dt_masks_form_t::type, and dt_masks_form_t::version.
Referenced by dt_masks_legacy_params().
|
static |
Definition at line 1833 of file develop/masks/masks.c.
References dt_masks_anchor_gradient_t::curvature, DT_MASKS_GRADIENT, IS_NULL_PTR, dt_masks_form_t::points, dt_masks_form_t::type, and dt_masks_form_t::version.
Referenced by dt_masks_legacy_params().
|
static |
Definition at line 1858 of file develop/masks/masks.c.
References DT_MASKS_GRADIENT, DT_MASKS_GRADIENT_STATE_LINEAR, IS_NULL_PTR, dt_masks_form_t::points, dt_masks_anchor_gradient_t::state, dt_masks_form_t::type, and dt_masks_form_t::version.
Referenced by dt_masks_legacy_params().
| gboolean dt_masks_node_is_cusp | ( | const dt_masks_form_gui_points_t * | gpt, |
| const int | index | ||
| ) |
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 |
Definition at line 2660 of file develop/masks/masks.c.
References FALSE, IS_NULL_PTR, dt_masks_form_gui_points_t::points, and dt_masks_form_gui_points_t::points_count.
Referenced by _brush_events_button_pressed(), _brush_events_post_expose(), _brush_populate_context_menu(), _polygon_events_button_pressed(), _polygon_events_post_expose(), _polygon_populate_context_menu(), dt_masks_find_closest_handle_common(), dt_masks_reset_bezier_ctrl_points(), and dt_masks_toggle_bezier_node_type().
| int dt_masks_point_in_form_exact | ( | const float * | test_points, |
| int | test_point_count, | ||
| const float * | form_points, | ||
| int | form_points_start, | ||
| int | form_points_count | ||
| ) |
Check whether any 2D point in pts[] lies inside the form points[].
We use the ray casting algorithm for each tested point.
| pts | Flat array of tested points [x0, y0, x1, y1, ...]. |
| num_pts | Number of tested points in pts. |
| points | The array of form vertices. |
| points_start | The starting index of the form vertices in the array. |
| points_count | The total number of vertices in the form. |
Definition at line 4066 of file develop/masks/masks.c.
References i, and IS_NULL_PTR.
Referenced by _circle_get_distance(), _ellipse_get_distance(), _polygon_get_distance(), and dt_masks_draw_source().
| gboolean dt_masks_point_is_within_radius | ( | const float | point_x, |
| const float | point_y, | ||
| const float | center_x, | ||
| const float | center_y, | ||
| const float | squared_radius | ||
| ) |
Check whether a point lies within a squared radius of a center.
Check if a point (px,py) is inside a radius from a center point (cx,cy)
Assumptions/caveats:
Definition at line 66 of file develop/masks/masks.c.
Referenced by dt_masks_find_closest_handle_common().
| void dt_masks_read_masks_history | ( | dt_develop_t * | dev, |
| const int32_t | imgid | ||
| ) |
read the forms from the db
Definition at line 2103 of file develop/masks/masks.c.
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_ext(), dt_masks_create(), dt_masks_form_update_gravity_center(), 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, 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, and dt_masks_form_t::version.
Referenced by dt_dev_read_history_ext().
| void dt_masks_remove_form | ( | dt_develop_t * | develop, |
| dt_masks_form_t * | mask_form | ||
| ) |
Definition at line 1375 of file develop/masks/masks.c.
References dt_pthread_rwlock_unlock, dt_pthread_rwlock_wrlock, dt_develop_t::forms, and dt_develop_t::masks_mutex.
Referenced by dt_masks_form_delete().
| void dt_masks_remove_node | ( | struct dt_iop_module_t * | module, |
| dt_masks_form_t * | mask_form, | ||
| int | parent_id, | ||
| dt_masks_form_gui_t * | mask_gui, | ||
| int | form_index, | ||
| int | node_index | ||
| ) |
Definition at line 932 of file develop/masks/masks.c.
References dt_free, dt_masks_gui_form_create(), FALSE, dt_masks_form_t::functions, dt_masks_functions_t::init_ctrl_points, IS_NULL_PTR, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::node_selected_idx, and dt_masks_form_t::points.
Referenced by _masks_gui_delete_node_callback(), _polygon_events_key_pressed(), and dt_masks_gui_remove().
| gboolean dt_masks_remove_or_delete | ( | struct dt_iop_module_t * | module, |
| dt_masks_form_t * | sel, | ||
| int | parent_id, | ||
| dt_masks_form_gui_t * | mask_gui, | ||
| int | form_id | ||
| ) |
If the form to remove is used once, ask to the user if he wants to delete it from the list or just remove and keep for later reuse.
| module | The module owning the mask |
| sel | The form to remove |
| parent_id | The parent ID of the form |
| mask_gui | The GUI state of the form |
| form_id | The form ID of the form to remove |
Definition at line 1030 of file develop/masks/masks.c.
References _masks_gui_form_group_use_count(), _masks_remove_shape(), darktable, darktable_t::develop, DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_dev_add_history_item, dt_dev_masks_selection_change(), dt_free, dt_masks_change_form_gui(), dt_masks_clear_form_gui(), DT_MASKS_EVENT_DELETE, DT_MASKS_EVENT_REMOVE, dt_masks_form_delete(), dt_masks_get_from_id(), dt_masks_get_visible_form(), DT_MASKS_GROUP, dt_masks_gui_confirm_delete_form_dialog(), dt_masks_select_form(), DT_SIGNAL_MASK_CHANGED, dt_masks_form_gui_t::edit_mode, FALSE, dt_masks_form_gui_t::form_selected, dt_masks_form_group_t::formid, dt_masks_form_t::formid, g_list_shorter_than(), dt_masks_form_gui_t::group_selected, IS_NULL_PTR, dt_masks_form_t::name, dt_masks_form_t::points, darktable_t::signals, TRUE, and dt_masks_form_t::type.
Referenced by _masks_gui_delete_form_callback(), and dt_masks_gui_remove().
| void dt_masks_replace_current_forms | ( | dt_develop_t * | dev, |
| GList * | forms | ||
| ) |
replace dev->forms with forms
Definition at line 1973 of file develop/masks/masks.c.
References dt_develop_t::allforms, darktable, darktable_t::develop, dt_masks_dup_forms_deep(), dt_masks_form_update_gravity_center(), dt_pthread_rwlock_unlock, dt_pthread_rwlock_wrlock, dt_develop_t::forms, and dt_develop_t::masks_mutex.
Referenced by dt_dev_pop_history_items_ext(), dt_masks_cleanup_unused(), and dt_masks_read_masks_history().
Definition at line 3120 of file develop/masks/masks.c.
References dt_masks_change_form_gui(), DT_MASKS_EDIT_OFF, dt_masks_shape_buttons_deactivate_all(), IOP_FLAGS_NO_MASKS, IOP_FLAGS_SUPPORTS_BLENDING, IS_NULL_PTR, dt_iop_gui_blend_data_t::masks_edit, and dt_iop_gui_blend_data_t::masks_shown.
Referenced by dt_iop_request_focus(), and gui_reset().
Definition at line 3135 of file develop/masks/masks.c.
References darktable, darktable_t::develop, DT_MASKS_EDIT_OFF, dt_masks_shape_buttons_deactivate_all(), FALSE, dt_develop_t::iop, IOP_FLAGS_SUPPORTS_BLENDING, and IS_NULL_PTR.
Referenced by _tree_selection_change().
| float dt_masks_rotate_with_anchor | ( | dt_develop_t * | develop, |
| const float | anchor[2], | ||
| const float | center[2], | ||
| dt_masks_form_gui_t * | mask_gui | ||
| ) |
Compute rotation angle (degrees) around a center using an anchor point.
Rotate a mask shape around its center. WARNING: gui->delta will be updated with the new position after rotation.
anchor, center, and mask_gui->delta are absolute output-image coordinates. The angle accounts for possible axis inversion due to distortion transforms. Updates mask_gui->delta to store the last anchor position.
Definition at line 4298 of file develop/masks/masks.c.
References dt_masks_form_gui_t::delta, dt_dev_coordinates_image_abs_to_raw_abs(), 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 * | selected_form | ||
| ) |
Select or clear the current mask form, notifying the owning module if needed.
Passing NULL clears the selection.
Definition at line 4122 of file develop/masks/masks.c.
References dt_masks_form_t::formid, and IS_NULL_PTR.
Referenced by _brush_events_button_released(), dt_masks_clear_form_gui(), dt_masks_events_button_pressed(), and dt_masks_remove_or_delete().
| void dt_masks_set_edit_mode | ( | struct dt_iop_module_t * | module, |
| dt_masks_edit_mode_t | value | ||
| ) |
Definition at line 3162 of file develop/masks/masks.c.
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, IS_NULL_PTR, 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, TRUE, and value.
Referenced by _blendop_masks_all_toggled(), _blendop_masks_group_selection_changed(), _blendop_masks_show_and_edit(), _brush_events_button_released(), _edit_masks(), _menu_add_exist(), _menu_no_masks(), _pop_undo(), dt_iop_gui_blending_lose_focus(), dt_iop_gui_update_blending(), dt_masks_form_exit_creation(), 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 * | mask_gui, |
| const uint32_t | key_state | ||
| ) |
Decide initial source positioning mode for clone masks.
Uses key modifiers to choose absolute vs. relative positioning, and stores the reference position in preview coordinates. The current implementation caches that reference in absolute output-image coordinates.
Definition at line 4140 of file develop/masks/masks.c.
References DT_MASKS_SOURCE_POS_ABSOLUTE, DT_MASKS_SOURCE_POS_RELATIVE_TEMP, dt_modifier_is(), dt_masks_form_gui_t::pos, dt_masks_form_gui_t::pos_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_set_source_pos_initial_value | ( | dt_masks_form_gui_t * | mask_gui, |
| dt_masks_form_t * | mask_form | ||
| ) |
Initialize the clone source position based on current GUI state.
Handles first-time relative positioning, existing relative offsets, and absolute coordinates. Updates mask_form->source accordingly. mask_gui->rel_pos is the normalized output-image cursor, while mask_gui->pos_source stores either an absolute output-image position or an absolute output-image delta depending on the current source mode.
Definition at line 4165 of file develop/masks/masks.c.
References darktable, darktable_t::develop, dt_dev_coordinates_image_abs_to_raw_abs(), dt_dev_coordinates_image_abs_to_raw_norm(), dt_dev_coordinates_raw_abs_to_raw_norm(), DT_MASKS_SOURCE_POS_ABSOLUTE, DT_MASKS_SOURCE_POS_RELATIVE, DT_MASKS_SOURCE_POS_RELATIVE_TEMP, dt_masks_form_t::functions, dt_masks_functions_t::initial_source_pos, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::pos_source, dt_develop_t::raw_height, dt_develop_t::raw_width, dt_develop_t::roi, dt_masks_form_t::source, and dt_masks_form_gui_t::source_pos_type.
Referenced by _brush_events_button_pressed(), _circle_init_new(), _ellipse_init_new(), and _polygon_events_button_pressed().
| void dt_masks_set_visible_form | ( | dt_develop_t * | dev, |
| dt_masks_form_t * | form | ||
| ) |
Definition at line 361 of file develop/masks/masks.c.
References dt_develop_t::form_gui, dt_masks_form_gui_t::form_visible, and IS_NULL_PTR.
Referenced by _lib_masks_handler_callback(), dt_masks_change_form_gui(), dt_masks_form_exit_creation(), dt_masks_gui_cleanup(), dt_masks_gui_form_save_creation(), and dt_masks_gui_init().
| GList * dt_masks_snapshot_current_forms | ( | dt_develop_t * | dev, |
| gboolean | reset_changed | ||
| ) |
snapshot current dev->forms (deep copy) and optionally reset dev->forms_changed
Definition at line 2023 of file develop/masks/masks.c.
References dt_masks_dup_forms_deep(), dt_pthread_rwlock_rdlock, dt_pthread_rwlock_unlock, FALSE, dt_develop_t::forms, dt_develop_t::forms_changed, and dt_develop_t::masks_mutex.
Referenced by dt_dev_add_history_item_ext(), and dt_dev_history_item_from_source_history_item().
| void dt_masks_soft_reset_form_gui | ( | dt_masks_form_gui_t * | mask_gui | ) |
Definition at line 820 of file develop/masks/masks.c.
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_hovered, dt_masks_form_gui_t::handle_border_selected, dt_masks_form_gui_t::handle_dragging, dt_masks_form_gui_t::handle_hovered, dt_masks_form_gui_t::handle_selected, dt_masks_form_gui_t::last_hit_test_pos, dt_masks_form_gui_t::last_rebuild_pos, dt_masks_form_gui_t::last_rebuild_ts, dt_masks_form_gui_t::node_dragging, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::node_selected_idx, dt_masks_form_gui_t::pivot_selected, dt_masks_form_gui_t::rebuild_pending, dt_masks_form_gui_t::seg_dragging, dt_masks_form_gui_t::seg_hovered, dt_masks_form_gui_t::seg_selected, and dt_masks_form_gui_t::source_selected.
Referenced by _dt_masks_events_group_update_selection(), and dt_masks_gui_form_save_creation().
| int dt_masks_version | ( | void | ) |
Definition at line 1565 of file develop/masks/masks.c.
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
Definition at line 2209 of file develop/masks/masks.c.
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_free, 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 |
Definition at line 1928 of file develop/masks/masks.c.
Referenced by dt_masks_create().