![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/hash.h"#include "system/macros.h"#include "system/openmp.h"#include "system/mem_alloc.h"#include "common/logging.h"#include "common/times.h"#include "caches/pixelpipe_cache_alloc.h"#include "widgets/gdkkeys.h"#include "develop/imageop.h"#include "develop/masks.h"#include "develop/masks_gui.h"#include "develop/masks/masks_functions.h"#include "develop/masks/masks_touched.h"
Include dependency graph for group.c:Go to the source code of this file.
Functions | |
| static dt_masks_form_t * | _group_get_child_at (dt_develop_t *dev, dt_masks_form_t *form, const int group_index, dt_masks_form_group_t **group_entry) |
| static dt_masks_form_t * | _group_get_selected_child (dt_masks_form_t *form, dt_masks_form_gui_t *gui, dt_masks_form_group_t **group_entry) |
| static int | _group_events_mouse_scrolled (struct dt_iop_module_t *module, double x, double y, int up, const int flow, uint32_t state, dt_masks_form_t *form, int unused1, dt_masks_form_gui_t *gui, int unused, dt_masks_interaction_t interaction) |
| static gboolean | _group_events_button_pressed (struct dt_iop_module_t *module, double x, double y, double pressure, int which, int type, uint32_t state, dt_masks_form_t *form, int unused1, dt_masks_form_gui_t *gui, int unused2) |
| static int | _group_events_button_released (struct dt_iop_module_t *module, double x, double y, int which, uint32_t state, dt_masks_form_t *form, int unused1, dt_masks_form_gui_t *gui, int unused2) |
| static int | _group_events_key_pressed (struct dt_iop_module_t *module, GdkEventKey *event, dt_masks_form_t *form, int parentid, dt_masks_form_gui_t *gui, int index) |
| static int | _group_events_mouse_moved (struct dt_iop_module_t *module, double x, double y, double pressure, int which, dt_masks_form_t *form, int unused1, dt_masks_form_gui_t *gui, int unused2) |
| static void | _group_events_post_expose_draw (cairo_t *cr, float zoom_scale, dt_masks_form_t *form, dt_masks_form_gui_t *gui, int pos) |
| void | dt_group_events_post_expose_except (cairo_t *cr, float zoom_scale, dt_masks_form_t *form, dt_masks_form_gui_t *gui, const int except_pos) |
| void | dt_group_events_post_expose_only (cairo_t *cr, float zoom_scale, dt_masks_form_t *form, dt_masks_form_gui_t *gui, const int pos) |
| void | dt_group_events_post_expose (cairo_t *cr, float zoom_scale, dt_masks_form_t *form, dt_masks_form_gui_t *gui) |
| static int | _inverse_mask (const dt_iop_module_t *const module, const dt_dev_pixelpipe_iop_t *const piece, dt_masks_form_t *const form, float **buffer, int *width, int *height, int *posx, int *posy) |
| static dt_masks_raster_result_t | _group_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) |
| static void | _combine_masks_union (float *const restrict dest, float *const restrict newmask, const size_t npixels, const float opacity, const int inverted) |
| static void | _combine_masks_union_box (float *const restrict dest, const float *const restrict newmask, const int width, const dt_iop_roi_t *const box, const float opacity) |
| static void | _combine_masks_intersect (float *const restrict dest, float *const restrict newmask, const size_t npixels, const float opacity, const int inverted) |
| static int | both_positive (const float val1, const float val2) |
| static void | _combine_masks_difference (float *const restrict dest, float *const restrict newmask, const size_t npixels, const float opacity, const int inverted) |
| static void | _combine_masks_exclusion (float *const restrict dest, float *const restrict newmask, const size_t npixels, const float opacity, const int inverted) |
| static uint64_t | _group_prefix_hash (const dt_masks_form_t *const form, GList *masks, const dt_dev_pixelpipe_iop_t *const piece, const dt_iop_roi_t *const roi, const int count) |
Identity of the group mask after folding the first count shapes, at this ROI. | |
| static dt_masks_raster_result_t | _group_get_mask_roi (const dt_iop_module_t *const restrict module, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *const restrict piece, dt_masks_form_t *const form, const dt_iop_roi_t *const roi, float *const restrict buffer, dt_iop_roi_t *touched) |
| 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) |
| static void | _group_duplicate_points (dt_develop_t *const dev, dt_masks_form_t *const base, dt_masks_form_t *const dest) |
| static gboolean | _group_get_gravity_center (dt_develop_t *dev, const dt_masks_form_t *form, float center[2], float *area) |
Variables | |
| const dt_masks_functions_t | dt_masks_functions_group |
|
static |
Definition at line 593 of file group.c.
References __OMP_FOR_SIMD__, and both_positive().
Referenced by _group_get_mask_roi().
|
static |
Definition at line 617 of file group.c.
References __OMP_FOR_SIMD__, both_positive(), and MAX.
Referenced by _group_get_mask_roi().
|
static |
Definition at line 563 of file group.c.
References __OMP_FOR_SIMD__, MAX, and MIN.
Referenced by _group_get_mask_roi().
|
static |
Definition at line 524 of file group.c.
References __OMP_FOR_SIMD__, and MAX.
Referenced by _group_get_mask_roi().
|
static |
Union bounded to ‘box’ (buffer-relative): outside it the child is zero and max(dest, 0) is dest.
Definition at line 548 of file group.c.
References dt_iop_roi_t::height, MAX, width, dt_iop_roi_t::width, x, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by _group_get_mask_roi().
|
static |
Definition at line 952 of file group.c.
References dt_masks_form_duplicate(), dt_masks_form_t::formid, dt_masks_form_group_t::formid, dt_masks_form_group_t::opacity, dt_masks_form_group_t::parentid, dt_masks_form_t::points, and dt_masks_form_group_t::state.
|
static |
|
static |
|
static |
Definition at line 90 of file group.c.
References _group_get_selected_child(), dt_keys_mainpad_alternatives(), dt_masks_form_exit_creation(), dt_masks_gui_remove(), FALSE, dt_masks_form_gui_t::group_selected, IS_NULL_PTR, key, and dt_masks_form_group_t::parentid.
|
static |
|
static |
|
static |
Definition at line 132 of file group.c.
References _group_get_child_at(), dt_masks_form_gui_points_t::border_count, dt_masks_form_gui_t::dev, DT_DEBUG_MASKS, dt_get_debug_flags(), dt_get_times(), dt_show_times_f(), dt_masks_form_t::functions, IS_NULL_PTR, dt_masks_form_t::name, dt_masks_form_t::points, dt_masks_form_gui_t::points, dt_masks_form_gui_points_t::points_count, dt_masks_functions_t::post_expose, dt_masks_form_t::type, and dt_masks_form_gui_t::type.
Referenced by dt_group_events_post_expose(), dt_group_events_post_expose_except(), and dt_group_events_post_expose_only().
|
static |
Definition at line 53 of file group.c.
References dt_masks_get_from_id(), dt_masks_form_group_t::formid, IS_NULL_PTR, and dt_masks_form_t::points.
Referenced by _group_events_post_expose_draw(), and _group_get_selected_child().
|
static |
Definition at line 968 of file group.c.
References dt_masks_form_get_gravity_center(), dt_masks_get_from_id(), FALSE, dt_masks_form_group_t::formid, IS_NULL_PTR, dt_masks_form_t::points, and TRUE.
|
static |
Definition at line 250 of file group.c.
References __OMP_PARALLEL_FOR__, _inverse_mask(), cleanup(), dt_iop_module_t::dev, dt_alloc_align(), dt_alloc_align_float(), dt_calloc_align(), DT_DEBUG_MASKS, DT_DEBUG_PERF, dt_free_align, dt_get_debug_flags(), dt_get_wtime(), dt_masks_get_from_id(), dt_masks_get_mask(), DT_MASKS_RASTER_EMPTY, DT_MASKS_RASTER_ERROR, DT_MASKS_RASTER_OK, DT_MASKS_STATE_DIFFERENCE, DT_MASKS_STATE_EXCLUSION, DT_MASKS_STATE_INTERSECTION, DT_MASKS_STATE_INVERSE, DT_MASKS_STATE_UNION, dt_pixelpipe_cache_alloc_align_float_cache, dt_pixelpipe_cache_free_align, dt_print(), dt_masks_form_group_t::formid, height, i, IS_NULL_PTR, MAX, MIN, dt_masks_form_t::name, dt_masks_form_group_t::opacity, dt_masks_form_t::points, r, dt_masks_form_group_t::state, t, v, width, and x.
|
static |
Definition at line 693 of file group.c.
References __OMP_PARALLEL_FOR_SIMD__, _combine_masks_difference(), _combine_masks_exclusion(), _combine_masks_intersect(), _combine_masks_union(), _combine_masks_union_box(), _group_prefix_hash(), DT_DEBUG_MASKS, DT_DEBUG_PERF, dt_dev_pixelpipe_cache_get(), dt_dev_pixelpipe_cache_peek(), dt_dev_pixelpipe_cache_rdlock_entry(), dt_dev_pixelpipe_cache_ref_count_entry(), dt_dev_pixelpipe_cache_wrlock_entry(), dt_get_debug_flags(), dt_get_wtime(), dt_masks_get_from_id_ext(), dt_masks_get_mask_roi(), DT_MASKS_RASTER_EMPTY, DT_MASKS_RASTER_ERROR, DT_MASKS_RASTER_OK, DT_MASKS_STATE_DIFFERENCE, DT_MASKS_STATE_EXCLUSION, DT_MASKS_STATE_INTERSECTION, DT_MASKS_STATE_INVERSE, DT_MASKS_STATE_IS_COMBINE_OP, DT_MASKS_STATE_UNION, dt_masks_touched_clear(), dt_masks_touched_full(), dt_masks_touched_is_empty(), dt_masks_touched_none(), dt_masks_touched_union(), dt_pixelpipe_cache_alloc_align_float_cache, dt_pixelpipe_cache_free_align, dt_print(), FALSE, dt_masks_form_group_t::formid, dt_dev_pixelpipe_t::forms, height, dt_iop_roi_t::height, i, IS_NULL_PTR, dt_masks_form_group_t::opacity, dt_masks_form_t::points, dt_masks_form_group_t::state, state, TRUE, dt_dev_pixelpipe_t::type, width, dt_iop_roi_t::width, x, dt_iop_roi_t::x, and dt_iop_roi_t::y.
|
static |
Definition at line 62 of file group.c.
References _group_get_child_at(), dt_masks_form_gui_t::dev, and dt_masks_form_gui_t::group_selected.
Referenced by _group_events_key_pressed().
|
static |
Identity of the group mask after folding the first count shapes, at this ROI.
The fold below is a left fold: the result after k shapes is a pure function of the result after k-1 and of shape k. So every PREFIX of it is a cacheable value, and the one that matters is the longest one: drawing a new stroke appends a shape and leaves every earlier prefix untouched.
What has to be in the key is everything the fold reads:
Definition at line 667 of file group.c.
References dt_dev_pixelpipe_iop_t::buf_in, dt_dev_pixelpipe_iop_t::buf_out, dt_hash(), dt_masks_form_get_own_hash(), dt_masks_get_from_id_ext(), dt_masks_form_group_t::formid, i, IS_NULL_PTR, dt_masks_form_group_t::opacity, dt_masks_form_t::points, and dt_masks_form_group_t::state.
Referenced by _group_get_mask_roi().
|
static |
Definition at line 198 of file group.c.
References __OMP_PARALLEL_FOR__, dt_pixelpipe_cache_alloc_align_float_cache, dt_pixelpipe_cache_free_align, height, dt_dev_pixelpipe_iop_t::iheight, IS_NULL_PTR, dt_dev_pixelpipe_iop_t::iwidth, MAX, MIN, row, and width.
Referenced by _group_get_mask().
|
inlinestatic |
Definition at line 587 of file group.c.
Referenced by _combine_masks_difference(), and _combine_masks_exclusion().
| void dt_group_events_post_expose | ( | cairo_t * | cr, |
| float | zoom_scale, | ||
| dt_masks_form_t * | form, | ||
| dt_masks_form_gui_t * | gui | ||
| ) |
Definition at line 179 of file group.c.
References _group_events_post_expose_draw(), dt_masks_form_gui_t::group_selected, and dt_masks_form_t::points.
Referenced by _overlay_draw_form().
| void dt_group_events_post_expose_except | ( | cairo_t * | cr, |
| float | zoom_scale, | ||
| dt_masks_form_t * | form, | ||
| dt_masks_form_gui_t * | gui, | ||
| int | except_pos | ||
| ) |
Draw every member of form but the one at except_pos, in the group's order.
Definition at line 164 of file group.c.
References _group_events_post_expose_draw(), and dt_masks_form_t::points.
Referenced by _static_layer_ensure().
| void dt_group_events_post_expose_only | ( | cairo_t * | cr, |
| float | zoom_scale, | ||
| dt_masks_form_t * | form, | ||
| dt_masks_form_gui_t * | gui, | ||
| int | pos | ||
| ) |
Draw the member of form at pos alone; nothing for a position the group has not.
Definition at line 172 of file group.c.
References _group_events_post_expose_draw(), and dt_masks_form_t::points.
Referenced by _overlay_draw_form().
| 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().
| const dt_masks_functions_t dt_masks_functions_group |
Definition at line 1020 of file group.c.
Referenced by _write_fixture_init(), and dt_masks_create().