![]() |
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_area_t |
| struct | dt_masks_dynbuf_t |
Macros | |
| #define | DEVELOP_MASKS_VERSION (6) |
structure used to store anchor for a gradient
A form's rectangle in full-resolution pipe coordinates, as the area and mask queries report it.
structure for dynamic buffers
masts states
structure used to define a form
structure used to store 1 node for a brush form
structure used to store 1 node for a circle
structure used to store 1 node for an ellipse
structure used to store 1 node for a path form
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.
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 564 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, L, 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().
| gboolean dt_masks_area_intersects | ( | const dt_masks_area_t * | area, |
| const dt_iop_roi_t * | roi | ||
| ) |
Whether a scaled area overlaps the ROI.
Definition at line 458 of file masks.c.
References dt_masks_area_t::height, dt_iop_roi_t::height, dt_masks_area_t::width, dt_iop_roi_t::width, dt_masks_area_t::x, dt_iop_roi_t::x, dt_masks_area_t::y, and dt_iop_roi_t::y.
Referenced by dt_masks_form_is_in_roi(), and rt_compute_roi_in().
| void dt_masks_area_scale | ( | dt_masks_area_t * | area, |
| const double | scale | ||
| ) |
Scale an area into the coordinates of a ROI at scale, truncating each field.
Definition at line 450 of file masks.c.
References dt_masks_area_t::height, dt_masks_area_t::width, dt_masks_area_t::x, and dt_masks_area_t::y.
Referenced by dt_masks_form_is_in_roi(), modify_roi_in(), rt_compute_roi_in(), rt_extend_roi_in_for_clone(), and rt_extend_roi_in_from_source_clones().
|
inlinestatic |
Definition at line 685 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, L, 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 1608 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, dt_develop_t::history_mutex, and L.
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 867 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, IS_NULL_PTR, L, dt_masks_functions_t::sanitize_config, TRUE, and type.
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 901 of file masks.c.
References dt_develop_t::allforms, dt_masks_create(), dt_pthread_rwlock_unlock(), dt_pthread_rwlock_wrlock(), L, 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(), IS_NULL_PTR, and L.
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 1353 of file masks.c.
References IS_NULL_PTR, and L.
Referenced by _brush_duplicate_points(), _circle_duplicate_points(), _ellipse_duplicate_points(), _gradient_duplicate_points(), and _polygon_duplicate_points().
|
inlinestatic |
Definition at line 606 of file masks.h.
References _dt_masks_dynbuf_growto(), IS_NULL_PTR, and L.
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 641 of file masks.h.
References _dt_masks_dynbuf_growto(), IS_NULL_PTR, L, and n.
Referenced by _brush_get_pts_border(), and _polygon_get_pts_border().
|
inlinestatic |
Definition at line 679 of file masks.h.
References IS_NULL_PTR, and L.
Referenced by _brush_events_button_released(), _brush_events_post_expose(), and _polygon_walk_write_header().
|
inlinestatic |
Definition at line 778 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 661 of file masks.h.
References IS_NULL_PTR, and L.
Referenced by _brush_events_button_released(), and _brush_events_mouse_moved().
|
inlinestatic |
Definition at line 768 of file masks.h.
References IS_NULL_PTR, L, and r.
Referenced by _brush_get_pts_border(), and _polygon_get_pts_border().
|
inlinestatic |
Definition at line 586 of file masks.h.
References _dt_masks_dynbuf_growto(), DT_DEBUG_MASKS, dt_free, dt_print(), IS_NULL_PTR, L, and size.
Referenced by _brush_bufs_alloc(), _brush_events_button_pressed(), and _polygon_get_pts_border().
|
inlinestatic |
Definition at line 756 of file masks.h.
References IS_NULL_PTR, and L.
Referenced by _brush_get_pts_border(), _brush_payload_sync(), and _polygon_get_pts_border().
|
inlinestatic |
Definition at line 621 of file masks.h.
References _dt_masks_dynbuf_growto(), IS_NULL_PTR, L, 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 762 of file masks.h.
References IS_NULL_PTR, and L.
|
inlinestatic |
Definition at line 670 of file masks.h.
References IS_NULL_PTR, L, 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(), IS_NULL_PTR, and L.
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 1217 of file masks.c.
References _group_from_module(), 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_develop_t::forms, dt_develop_t::iop, IOP_FLAGS_SUPPORTS_BLENDING, IS_NULL_PTR, and L.
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(), IS_NULL_PTR, and L.
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(), IS_NULL_PTR, and L.
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 1460 of file masks.c.
References dt_hash(), dt_masks_get_from_id_ext(), DT_MASKS_GROUP, hash, IS_NULL_PTR, and L.
Referenced by _group_prefix_hash(), dt_dev_masks_update_hash(), and rt_shape_geometry_hash().
|
inlinestatic |
Definition at line 376 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().
| gboolean dt_masks_form_is_in_roi | ( | const dt_iop_module_t * | iop_module, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| dt_masks_form_t * | form, | ||
| const dt_iop_roi_t * | roi_in, | ||
| const dt_iop_roi_t * | roi_out | ||
| ) |
Whether the form's area, scaled by roi_in->scale, intersects roi_out. FALSE when the area cannot be computed.
Definition at line 475 of file masks.c.
References dt_masks_area_intersects(), dt_masks_area_scale(), dt_masks_get_area(), DT_MASKS_RASTER_OK, FALSE, L, piece, pipe, and dt_iop_roi_t::scale.
Referenced by _process(), and modify_roi_in().
| void dt_masks_form_move | ( | dt_masks_form_t * | grp, |
| int | formid, | ||
| int | up | ||
| ) |
Definition at line 1370 of file masks.c.
References DT_MASKS_GROUP, dt_masks_form_group_t::formid, IS_NULL_PTR, and L.
Referenced by _masks_move_up_down_callback(), _tree_movedown(), and _tree_moveup().
|
inlinestatic |
Definition at line 371 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 1161 of file masks.c.
References dt_free, dt_free_gpointer(), IS_NULL_PTR, and L.
Referenced by dt_masks_form_exit_creation(), and dt_masks_form_unref().
| dt_masks_raster_result_t dt_masks_get_area | ( | const dt_iop_module_t * | iop_module, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| dt_masks_form_t * | form, | ||
| dt_masks_area_t * | area | ||
| ) |
get the rectangle which include the form and his border
Definition at line 464 of file masks.c.
References DT_MASKS_RASTER_ERROR, dt_masks_area_t::height, L, piece, pipe, dt_masks_area_t::width, dt_masks_area_t::x, and dt_masks_area_t::y.
Referenced by _area_and_mask_always_write_their_out_parameters(), dt_masks_form_is_in_roi(), rt_compute_shape_box(), and rt_compute_shape_geometry().
| dt_masks_edit_mode_t dt_masks_get_edit_mode | ( | struct dt_iop_module_t * | module | ) |
Definition at line 1169 of file masks.c.
References DT_MASKS_EDIT_OFF, IS_NULL_PTR, and L.
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 925 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(), _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(), post_history_commit(), rt_display_selected_shapes_lbl(), rt_edit_masks_callback(), 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 915 of file masks.c.
References L.
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_get_from_id_in_pipe(), dt_masks_group_get_hash_ext(), dt_masks_replace_current_forms(), and rt_resynch_params().
| dt_masks_form_t * dt_masks_get_from_id_in_pipe | ( | const dt_dev_pixelpipe_t * | pipe, |
| int | id | ||
| ) |
returns a form with formid == id from pipe->forms, the refcounted snapshot the pipe renders from. This is the resolver of the pipeline thread (modify_roi_in(), process()): dt_masks_get_from_id() reads the GUI-owned dev->forms, which the GUI thread replaces and frees mid-edit.
Definition at line 933 of file masks.c.
References dt_masks_get_from_id_ext(), dt_dev_pixelpipe_t::forms, and pipe.
Referenced by _process(), modify_roi_in(), rt_pipe_group_members(), and rt_pipe_member_form().
| dt_masks_raster_result_t dt_masks_get_mask | ( | const dt_iop_module_t *const | module, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t *const | piece, | ||
| dt_masks_form_t *const | form, | ||
| float ** | buffer, | ||
| dt_masks_area_t * | area | ||
| ) |
get the transparency mask of the form and his border
Definition at line 1647 of file masks.c.
References DT_MASKS_RASTER_ERROR, dt_masks_form_t::functions, dt_masks_functions_t::get_mask, dt_masks_area_t::height, L, piece, pipe, dt_masks_area_t::width, dt_masks_area_t::x, and dt_masks_area_t::y.
Referenced by _area_and_mask_always_write_their_out_parameters(), _group_get_mask(), _spots_clone_mask(), and rt_rasterize_scaled_mask().
| 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 938 of file masks.c.
References dt_develop_t::iop, and L.
| dt_masks_raster_result_t dt_masks_get_source_area | ( | const dt_iop_module_t * | iop_module, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| dt_masks_form_t * | form, | ||
| dt_masks_area_t * | area | ||
| ) |
Definition at line 486 of file masks.c.
References DT_MASKS_CLONE, DT_MASKS_RASTER_EMPTY, dt_masks_area_t::height, L, piece, pipe, dt_masks_area_t::width, dt_masks_area_t::x, and dt_masks_area_t::y.
Referenced by modify_roi_in(), rt_compute_shape_box(), and rt_compute_shape_geometry().
| 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 1422 of file masks.c.
References dt_hash(), dt_masks_get_from_id_ext(), DT_MASKS_GROUP, dt_masks_group_get_hash_ext(), hash, IS_NULL_PTR, and L.
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, |
| const 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 963 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(), IS_NULL_PTR, L, piece, and pipe.
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 1178 of file masks.c.
References _group_create(), _group_from_module(), dt_masks_cow_touch(), dt_masks_get_from_id(), DT_MASKS_GROUP, dt_masks_group_add_form(), IS_NULL_PTR, and L.
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 821 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(), dt_masks_legacy_params_v5_to_v6(), L, and params.
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 1118 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_develop_t::forms, and L.
Referenced by dt_dev_read_history_ext().
|
inlinestatic |
Definition at line 381 of file masks.h.
References dt_masks_form_t::source.
Referenced by _circle_init_new(), and _ellipse_init_new().
|
inlinestatic |
|
inlinestatic |
Definition at line 404 of file masks.h.
References L.
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_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, IS_NULL_PTR, L, 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 393 of file masks.h.
References L.
Referenced by _brush_translate_node(), and _polygon_translate_node().
|
inlinestatic |
Definition at line 387 of file masks.h.
References L, and dt_masks_form_t::source.
Referenced by _brush_events_mouse_moved(), and _polygon_events_mouse_moved().
| int dt_masks_version | ( | void | ) |
Definition at line 502 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 1131 of file masks.c.
References dt_alloc_align(), DT_DEBUG_HISTORY, dt_free_align, dt_history_repository_write_mask_item(), dt_print(), and L.
Referenced by dt_dev_write_history_item(), and legacy_params().