![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "develop/masks_types.h"#include "system/atomic.h"#include "common/logging.h"#include "system/macros.h"#include "system/simd.h"#include "common/times.h"#include "caches/pixelpipe_cache_alloc.h"#include "develop/develop.h"#include "develop/pixelpipe.h"#include <assert.h>#include "develop/masks/masks_history.h"
Include dependency graph for masks.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | dt_masks_node_circle_t |
| struct | dt_masks_node_ellipse_t |
| struct | dt_masks_node_polygon_t |
| struct | dt_masks_node_brush_t |
| struct | dt_masks_anchor_gradient_t |
| struct | dt_masks_form_t |
| struct | dt_masks_dynbuf_t |
Macros | |
| #define | DEVELOP_MASKS_VERSION (6) |
Typedefs | |
| typedef struct dt_masks_functions_t | dt_masks_functions_t |
| typedef enum dt_masks_event_t | dt_masks_event_t |
| typedef enum dt_masks_points_states_t | dt_masks_points_states_t |
| typedef enum dt_masks_gradient_states_t | dt_masks_gradient_states_t |
| typedef enum dt_masks_pressure_sensitivity_t | dt_masks_pressure_sensitivity_t |
| typedef enum dt_masks_ellipse_flags_t | dt_masks_ellipse_flags_t |
| typedef enum dt_masks_source_pos_type_t | dt_masks_source_pos_type_t |
| typedef struct dt_masks_node_circle_t | dt_masks_node_circle_t |
| typedef struct dt_masks_node_ellipse_t | dt_masks_node_ellipse_t |
| typedef struct dt_masks_node_polygon_t | dt_masks_node_polygon_t |
| typedef struct dt_masks_node_brush_t | dt_masks_node_brush_t |
| typedef struct dt_masks_anchor_gradient_t | dt_masks_anchor_gradient_t |
| typedef struct dt_masks_form_t | dt_masks_form_t |
| typedef enum dt_masks_raster_result_t | dt_masks_raster_result_t |
| What a rasterisation attempt produced. | |
| typedef struct dt_masks_dynbuf_t | dt_masks_dynbuf_t |
| typedef struct dt_masks_anchor_gradient_t dt_masks_anchor_gradient_t |
structure used to store anchor for a gradient
| typedef struct dt_masks_dynbuf_t dt_masks_dynbuf_t |
structure for dynamic buffers
| typedef enum dt_masks_ellipse_flags_t dt_masks_ellipse_flags_t |
| typedef enum dt_masks_event_t dt_masks_event_t |
masts states
| typedef struct dt_masks_form_t dt_masks_form_t |
structure used to define a form
| typedef struct dt_masks_functions_t dt_masks_functions_t |
| typedef enum dt_masks_gradient_states_t dt_masks_gradient_states_t |
| typedef struct dt_masks_node_brush_t dt_masks_node_brush_t |
structure used to store 1 node for a brush form
| typedef struct dt_masks_node_circle_t dt_masks_node_circle_t |
structure used to store 1 node for a circle
| typedef struct dt_masks_node_ellipse_t dt_masks_node_ellipse_t |
structure used to store 1 node for an ellipse
| typedef struct dt_masks_node_polygon_t dt_masks_node_polygon_t |
structure used to store 1 node for a path form
| typedef enum dt_masks_points_states_t dt_masks_points_states_t |
| typedef enum dt_masks_raster_result_t dt_masks_raster_result_t |
What a rasterisation attempt produced.
get points in real space with respect of distortion dx and dy are used to eventually move the center of the circle
The rasterisation family used to return a bare int on a "0 means success" convention that could not say the third thing that actually happens: a shape with nothing to draw. Callers therefore had to guess, and the shapes disagreed – a NULL points list made a circle report failure (which aborted the whole group fold) and an ellipse report success (which rendered it as zeros). Same data, opposite outcomes, decided by which shape carried it.
OK – the buffer was written; touched, where the callee takes one, describes what. EMPTY – nothing to draw: degenerate geometry, or the shape lies entirely outside this ROI. A legitimate outcome, NOT an error. The buffer is left as the caller supplied it. ERROR – the shape could not be computed (allocation failure, a distortion transform that did not converge). The buffer's contents are undefined and must not be published.
OK is 0 so that a caller written against the old convention still reads a success as success; every other value is a non-success, which is the safe direction for anything not yet migrated.
| typedef enum dt_masks_source_pos_type_t dt_masks_source_pos_type_t |
| enum dt_masks_event_t |
What a rasterisation attempt produced.
get points in real space with respect of distortion dx and dy are used to eventually move the center of the circle
The rasterisation family used to return a bare int on a "0 means success" convention that could not say the third thing that actually happens: a shape with nothing to draw. Callers therefore had to guess, and the shapes disagreed – a NULL points list made a circle report failure (which aborted the whole group fold) and an ellipse report success (which rendered it as zeros). Same data, opposite outcomes, decided by which shape carried it.
OK – the buffer was written; touched, where the callee takes one, describes what. EMPTY – nothing to draw: degenerate geometry, or the shape lies entirely outside this ROI. A legitimate outcome, NOT an error. The buffer is left as the caller supplied it. ERROR – the shape could not be computed (allocation failure, a distortion transform that did not converge). The buffer's contents are undefined and must not be published.
OK is 0 so that a caller written against the old convention still reads a success as success; every other value is a non-success, which is the safe direction for anything not yet migrated.
| Enumerator | |
|---|---|
| DT_MASKS_RASTER_OK | |
| DT_MASKS_RASTER_EMPTY | |
| DT_MASKS_RASTER_ERROR | |
|
inlinestatic |
code for dynamic handling of intermediate buffers
Definition at line 540 of file masks.h.
References DT_DEBUG_MASKS, dt_pixelpipe_cache_alloc_align_float_cache, dt_pixelpipe_cache_free_align, dt_print(), dt_round_size_sse(), FALSE, IS_NULL_PTR, size, and TRUE.
Referenced by dt_masks_dynbuf_add_2(), dt_masks_dynbuf_add_zeros(), dt_masks_dynbuf_init(), and dt_masks_dynbuf_reserve_n().
|
inlinestatic |
Definition at line 661 of file masks.h.
References DT_DEBUG_MASKS, DT_DEBUG_PERF, dt_get_debug_flags(), dt_get_wtime(), dt_print(), FALSE, i, inv, IS_NULL_PTR, and TRUE.
Referenced by _brush_get_gravity_center(), and _polygon_get_gravity_center().
| 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 1587 of file masks.c.
References _masks_cleanup_unused_from_list(), dt_dev_get_history_end_ext(), dt_masks_change_form_gui(), dt_masks_replace_current_forms(), dt_pthread_rwlock_unlock(), dt_pthread_rwlock_wrlock(), dt_dev_history_item_t::forms, dt_develop_t::history, and dt_develop_t::history_mutex.
Referenced by _tree_delete_unused().
| int dt_masks_copy_used_forms_for_module | ( | dt_develop_t * | dev_dest, |
| dt_develop_t * | dev_src, | ||
| const struct dt_iop_module_t * | mod_src | ||
| ) |
copy forms used by a module from dev_src to dev_dest
Referenced by dt_dev_copy_module_contents(), and dt_dev_history_item_from_source_history_item().
| dt_masks_form_t * dt_masks_create | ( | dt_masks_type_t | type | ) |
we create a completely new form.
Definition at line 851 of file masks.c.
References dt_atomic_set_int(), 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(), dt_supervisor_active(), dt_supervisor_form(), DT_SV_CREATE, FALSE, form_id_seed, dt_masks_form_t::formid, dt_masks_form_t::functions, IS_NULL_PTR, dt_masks_form_t::refcount, dt_masks_functions_t::sanitize_config, TRUE, dt_masks_form_t::type, type, dt_masks_form_t::uses_bezier_points_layout, and dt_masks_form_t::version.
Referenced by _blendop_masks_group_create(), _group_create(), _group_member(), _read_mask_row(), _time_overlay_group(), _tree_selection_change(), dt_masks_create_ext(), dt_masks_creation_mode_enter(), dt_masks_form_duplicate(), dt_masks_gui_form_save_creation(), and legacy_params().
| dt_masks_form_t * dt_masks_create_ext | ( | dt_develop_t * | dev, |
| dt_masks_type_t | type | ||
| ) |
we create a completely new form and add it to dev->allforms.
Definition at line 885 of file masks.c.
References dt_develop_t::allforms, dt_masks_create(), dt_pthread_rwlock_unlock(), dt_pthread_rwlock_wrlock(), dt_develop_t::masks_mutex, and type.
Referenced by _module_create_own_mask(), _tree_group(), dt_masks_set_edit_mode(), and rt_show_forms_for_current_scale().
| 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 77 of file masks.c.
References dt_atomic_set_int(), dt_masks_form_t::functions, IS_NULL_PTR, dt_masks_functions_t::point_struct_size, dt_masks_form_t::points, and dt_masks_form_t::refcount.
Referenced by dt_masks_copy_used_forms_for_module(), and dt_masks_cow_touch().
| 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 1332 of file 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().
|
inlinestatic |
Definition at line 582 of file masks.h.
References _dt_masks_dynbuf_growto(), and IS_NULL_PTR.
Referenced by _brush_events_button_pressed(), _brush_events_button_released(), _brush_events_mouse_moved(), _brush_payload_sync(), _brush_points_recurs(), _brush_walk_segment(), _brush_walk_single_dab(), _polygon_points_recurs(), and _polygon_walk_segment().
|
inlinestatic |
Definition at line 617 of file masks.h.
References _dt_masks_dynbuf_growto(), IS_NULL_PTR, and n.
Referenced by _brush_get_pts_border(), and _polygon_get_pts_border().
|
inlinestatic |
Definition at line 655 of file masks.h.
References IS_NULL_PTR.
Referenced by _brush_events_button_released(), _brush_events_post_expose(), and _polygon_walk_write_header().
|
inlinestatic |
Definition at line 754 of file masks.h.
References DT_DEBUG_MASKS, dt_free, dt_pixelpipe_cache_free_align, dt_print(), and IS_NULL_PTR.
Referenced by _brush_bufs_alloc(), _brush_events_button_released(), _brush_get_pts_border(), _polygon_get_pts_border(), dt_masks_clear_form_gui(), dt_masks_form_exit_creation(), and dt_masks_gui_form_save_creation().
|
inlinestatic |
Definition at line 637 of file masks.h.
References IS_NULL_PTR.
Referenced by _brush_events_button_released(), and _brush_events_mouse_moved().
|
inlinestatic |
Definition at line 744 of file masks.h.
References IS_NULL_PTR, and r.
Referenced by _brush_get_pts_border(), and _polygon_get_pts_border().
|
inlinestatic |
Definition at line 562 of file masks.h.
References _dt_masks_dynbuf_growto(), DT_DEBUG_MASKS, dt_free, dt_print(), IS_NULL_PTR, and size.
Referenced by _brush_bufs_alloc(), _brush_events_button_pressed(), and _polygon_get_pts_border().
|
inlinestatic |
Definition at line 732 of file masks.h.
References IS_NULL_PTR.
Referenced by _brush_get_pts_border(), _brush_payload_sync(), and _polygon_get_pts_border().
|
inlinestatic |
Definition at line 597 of file masks.h.
References _dt_masks_dynbuf_growto(), IS_NULL_PTR, and n.
Referenced by _brush_get_pts_border(), _brush_points_recurs_border_gaps(), _brush_points_recurs_border_small_gaps(), _brush_points_stamp(), _polygon_get_pts_border(), and _polygon_points_recurs_border_gaps().
|
inlinestatic |
Definition at line 738 of file masks.h.
References IS_NULL_PTR.
|
inlinestatic |
Definition at line 646 of file masks.h.
References IS_NULL_PTR, and value.
Referenced by _init_fading(), and _init_size().
| int dt_masks_form_change_opacity | ( | dt_develop_t * | dev, |
| dt_masks_form_t * | form, | ||
| int | parentid, | ||
| int | up, | ||
| const int | flow | ||
| ) |
Definition at line 5840 of file masks_gui.c.
References dt_masks_apply_increment(), dt_masks_group_get_member(), dt_masks_group_set_member_opacity(), DT_MASKS_INCREMENT_OFFSET, DT_MASKS_OK, DT_MASKS_UNCHANGED, dt_toast_log(), dt_masks_form_t::formid, IS_NULL_PTR, and dt_masks_member_t::opacity.
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 | ( | dt_develop_t * | dev, |
| struct dt_iop_module_t * | module, | ||
| dt_masks_form_t * | grp, | ||
| dt_masks_form_t * | form | ||
| ) |
Definition at line 1196 of file masks.c.
References _group_from_module(), dt_iop_module_t::blend_params, dt_free, dt_iop_gui_blend_masks_update(), DT_MASKS_CLONE, dt_masks_cow_touch(), dt_masks_form_delete(), dt_masks_form_update_gravity_center(), dt_masks_get_from_id(), DT_MASKS_GROUP, DT_MASKS_NON_CLONE, dt_masks_remove_form(), dt_masks_form_t::formid, dt_masks_form_group_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(), _blendop_masks_all_toggled(), _blendop_masks_group_delete(), _blendop_masks_group_unlink(), _gui_reset_callback(), _masks_remove_or_delete_finish(), _masks_remove_shape(), _menu_no_masks(), _tree_delete_shape(), _tree_row_action(), _tree_row_assign_to_modules(), and dt_masks_form_delete().
| int dt_masks_form_duplicate | ( | dt_develop_t * | dev, |
| int | formid | ||
| ) |
Definition at line 186 of file 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 dt_masks_form_duplicate_in_group().
| int dt_masks_form_duplicate_in_group | ( | dt_develop_t * | dev, |
| int | group_id, | ||
| int | form_id | ||
| ) |
Duplicate a shape (dt_masks_form_duplicate) and, if group_id names a valid group, attach the duplicate as a new member of that group right away, inheriting the source form's group-entry state (operation) and opacity. If group_id is not a group (e.g. <= 0), the duplicate is left unattached in dev->forms, same as dt_masks_form_duplicate alone. Shared by every "Duplicate shape" UI entry point so the attach-and-inherit behavior does not get re-implemented per caller.
Definition at line 210 of file masks.c.
References dt_masks_cow_touch(), dt_masks_form_duplicate(), dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_group_add_form(), dt_masks_form_group_t::formid, IS_NULL_PTR, 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 _blendop_masks_group_duplicate_callback(), and _tree_duplicate_shape().
| uint64_t dt_masks_form_get_own_hash | ( | uint64_t | hash, |
| GList * | masks, | ||
| const dt_masks_form_t * | form | ||
| ) |
Same as dt_masks_group_get_hash_ext(), but hashes only the form's own content: for a group, member references (id/state/opacity) instead of recursing into each member's content. Meant for walking a flat list where every member already gets its own top-level call.
Definition at line 1439 of file masks.c.
References dt_hash(), dt_masks_get_from_id_ext(), DT_MASKS_GROUP, dt_masks_form_t::formid, dt_masks_form_group_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 _group_prefix_hash(), and dt_dev_masks_update_hash().
|
inlinestatic |
Definition at line 356 of file masks.h.
References DT_MASKS_CLONE, and dt_masks_form_t::type.
Referenced by _brush_set_hint_message(), _circle_events_post_expose(), _circle_get_creation_preview(), _circle_init_new(), _circle_set_hint_message(), _ellipse_events_post_expose(), _ellipse_get_creation_preview(), _ellipse_init_new(), and _ellipse_set_hint_message().
| void dt_masks_form_move | ( | dt_masks_form_t * | grp, |
| int | formid, | ||
| int | up | ||
| ) |
Definition at line 1349 of file 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().
|
inlinestatic |
Definition at line 351 of file masks.h.
References DT_MASKS_CLONE, DT_MASKS_NON_CLONE, and dt_masks_form_t::type.
Referenced by _circle_get_creation_values(), and _ellipse_get_creation_values().
| void dt_masks_free_form | ( | dt_masks_form_t * | form | ) |
Definition at line 1140 of file masks.c.
References dt_free, dt_free_gpointer(), IS_NULL_PTR, and dt_masks_form_t::points.
Referenced by dt_masks_form_exit_creation(), and dt_masks_form_unref().
| dt_masks_raster_result_t 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 450 of file masks.c.
References DT_MASKS_RASTER_ERROR, dt_masks_form_t::functions, and dt_masks_functions_t::get_area.
Referenced by __attribute__(), _area_and_mask_always_write_their_out_parameters(), 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 1148 of file masks.c.
References dt_iop_module_t::dev, DT_MASKS_EDIT_OFF, and IS_NULL_PTR.
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 909 of file 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(), _blendop_masks_all_name_edited(), _blendop_masks_all_selection_changed(), _blendop_masks_all_toggled(), _blendop_masks_group_button_pressed(), _blendop_masks_group_create(), _blendop_masks_group_ctx_menu(), _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_holder(), _find_in_group(), _first_use_recurs(), _form_can_join_group(), _group_contains_recurs(), _group_covers_recurs(), _group_from_module(), _group_get_child_at(), _group_get_gravity_center(), _group_get_mask(), _groups_naming_form(), _gui_reset_callback(), _masks_draw_creation_session_forms(), _masks_gui_delete_node_callback(), _masks_gui_resolve_selected_shape(), _masks_move_up_down_callback(), _masks_remove_or_delete_finish(), _masks_remove_shape(), _menu_add_exist(), _modchooser_run(), _module_create_own_mask(), _outline_nodes(), _polygon_add_node_callback(), _polygon_events_post_expose(), _polygon_reset_round_node_callback(), _polygon_switch_node_callback(), _process(), _reset_form_creation(), _resolve_member(), _resynch_params(), _set_hinter_message(), _shape_is_being_added(), _shape_manager_handler_callback(), _shape_manager_list_recurs(), _shape_manager_update_item(), _time_hit_test(), _tooltip_add_text(), _tooltip_assign_text(), _tree_add_exist(), _tree_add_to_group(), _tree_apply_operation(), _tree_cell_edited(), _tree_context_menu(), _tree_delete_shape(), _tree_format_form_usage_label(), _tree_group(), _tree_movedown(), _tree_moveup(), _tree_row_action(), _tree_row_add_to_group(), _tree_row_assign_to_modules(), _tree_selection_change(), _tree_store_add_forms(), _update_foreach(), dt_dev_add_history_item_ext(), dt_develop_blend_get_mask_usage(), dt_iop_gui_blend_masks_update(), dt_iop_gui_blend_set_drawn_mask_group(), 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_duplicate_in_group(), 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_set_name_from_module(), dt_masks_group_ungroup(), dt_masks_gui_form_test_create(), dt_masks_iop_use_same_as(), 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_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 899 of file masks.c.
References dt_masks_form_t::formid.
Referenced by _cleanup_unused_recurs(), _develop_blend_init_drawn_mask(), _group_get_mask_roi(), _group_prefix_hash(), _hm_history_masks_match(), _masks_fill_used_forms(), dt_iop_compute_blendop_hash(), dt_masks_copy_used_forms_for_module(), dt_masks_form_get_own_hash(), dt_masks_get_from_id(), dt_masks_group_get_hash_ext(), dt_masks_replace_current_forms(), rt_process_forms(), rt_process_forms_cl(), and rt_resynch_params().
| dt_masks_raster_result_t dt_masks_get_mask | ( | const dt_iop_module_t *const | module, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t *const | piece, | ||
| dt_masks_form_t *const | form, | ||
| float ** | buffer, | ||
| int * | width, | ||
| int * | height, | ||
| int * | posx, | ||
| int * | posy | ||
| ) |
get the transparency mask of the form and his border
Definition at line 1626 of file masks.c.
References DT_MASKS_RASTER_ERROR, dt_masks_form_t::functions, dt_masks_functions_t::get_mask, height, and width.
Referenced by _area_and_mask_always_write_their_out_parameters(), _group_get_mask(), _process(), rt_process_forms(), and rt_process_forms_cl().
| struct 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 917 of file masks.c.
References dt_develop_t::iop.
| dt_masks_raster_result_t 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 * | form, | ||
| int * | width, | ||
| int * | height, | ||
| int * | posx, | ||
| int * | posy | ||
| ) |
Definition at line 464 of file masks.c.
References DT_MASKS_CLONE, DT_MASKS_RASTER_EMPTY, 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().
| uint64_t dt_masks_group_get_hash_ext | ( | uint64_t | hash, |
| GList * | masks, | ||
| dt_masks_form_t * | form | ||
| ) |
Hash a group's full content (recursing into members). Children are resolved from the given forms list — pass the same list the group came from (live dev->forms or a snapshot), so the hash describes one coherent state instead of mixing the group with foreign children.
Definition at line 1401 of file masks.c.
References dt_hash(), dt_masks_get_from_id_ext(), DT_MASKS_GROUP, dt_masks_group_get_hash_ext(), dt_masks_form_t::formid, dt_masks_form_group_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_iop_compute_blendop_hash(), and dt_masks_group_get_hash_ext().
| dt_masks_raster_result_t dt_masks_group_render_roi | ( | dt_iop_module_t * | module, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| dt_masks_form_t * | form, | ||
| const dt_iop_roi_t * | roi, | ||
| float * | buffer | ||
| ) |
Rasterise form into the pre-zeroed ROI-sized buffer. touched (may be NULL) receives the buffer-relative rectangle enclosing every pixel written; empty when nothing was.
Definition at line 938 of file group.c.
References DT_DEBUG_MASKS, DT_DEBUG_PERF, dt_get_debug_flags(), dt_get_wtime(), dt_masks_get_mask_roi(), DT_MASKS_RASTER_EMPTY, dt_print(), and IS_NULL_PTR.
Referenced by _develop_blend_init_drawn_mask().
| void dt_masks_iop_use_same_as | ( | struct dt_iop_module_t * | module, |
| struct dt_iop_module_t * | src | ||
| ) |
Definition at line 1157 of file masks.c.
References _group_create(), _group_from_module(), dt_iop_module_t::blend_params, dt_iop_module_t::dev, dt_masks_cow_touch(), 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().
| int dt_masks_legacy_params | ( | dt_develop_t * | dev, |
| void * | params, | ||
| const int | old_version, | ||
| const int | new_version | ||
| ) |
Definition at line 805 of file 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 _read_mask_row(), and legacy_params().
|
inlinestatic |
Adapt an internal helper still on the plain "0 means success" convention. Such a helper has no way to report EMPTY, so everything non-zero becomes ERROR – which is the conservative reading, and the one those helpers' callers already applied.
Definition at line 322 of file masks.h.
References DT_MASKS_RASTER_ERROR, DT_MASKS_RASTER_OK, and status.
Referenced by _brush_get_area(), _brush_get_points_border(), _brush_get_source_area(), _circle_get_points_border(), _ellipse_get_points_border(), _from_status_maps_zero_to_ok_and_everything_else_to_error(), _gradient_get_points_border(), _polygon_get_area(), _polygon_get_points_border(), and _polygon_get_source_area().
| void dt_masks_read_masks_history | ( | dt_develop_t * | dev, |
| const int32_t | imgid | ||
| ) |
read the forms from the db
Definition at line 1097 of file masks.c.
References _read_mask_row(), _masks_read_ctx_t::develop, dt_history_repository_foreach_mask_item(), dt_masks_replace_current_forms(), dt_dev_history_item_t::forms, and _masks_read_ctx_t::last_history_item.
Referenced by dt_dev_read_history_ext().
|
inlinestatic |
Definition at line 361 of file masks.h.
References dt_masks_form_t::source.
Referenced by _circle_init_new(), and _ellipse_init_new().
|
inlinestatic |
Definition at line 763 of file masks.h.
Referenced by _circle_get_mask_roi().
|
inlinestatic |
Definition at line 384 of file masks.h.
Referenced by _brush_events_mouse_moved(), and _polygon_events_mouse_moved().
| void dt_masks_set_edit_mode | ( | struct dt_iop_module_t * | module, |
| dt_masks_edit_mode_t | value | ||
| ) |
Definition at line 5809 of file masks_gui.c.
References dt_iop_module_t::blend_params, dt_iop_module_t::dev, 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(), FALSE, 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_blend_masks_update(), dt_iop_gui_blending_lose_focus(), dt_iop_gui_update_blending(), dt_masks_form_exit_creation(), dt_masks_iop_value_changed_callback(), and gui_focus().
|
inlinestatic |
Definition at line 373 of file masks.h.
Referenced by _brush_translate_node(), and _polygon_translate_node().
|
inlinestatic |
Definition at line 367 of file masks.h.
References dt_masks_form_t::source.
Referenced by _brush_events_mouse_moved(), and _polygon_events_mouse_moved().
| int dt_masks_version | ( | void | ) |
Definition at line 486 of file masks.c.
References DEVELOP_MASKS_VERSION.
Referenced by _read_mask_row(), dt_masks_create(), 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 1110 of file masks.c.
References dt_alloc_align(), DT_DEBUG_HISTORY, dt_free_align, dt_history_repository_write_mask_item(), 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().