Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
masks.h File Reference
#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
 

Enumerations

enum  dt_masks_event_t {
  DT_MASKS_EVENT_NONE = 0 ,
  DT_MASKS_EVENT_ADD = 1 ,
  DT_MASKS_EVENT_REMOVE = 2 ,
  DT_MASKS_EVENT_UPDATE = 3 ,
  DT_MASKS_EVENT_DELETE = 4 ,
  DT_MASKS_EVENT_CHANGE = 5 ,
  DT_MASKS_EVENT_RESET = 6
}
 
enum  dt_masks_points_states_t {
  DT_MASKS_POINT_STATE_NORMAL = 1 ,
  DT_MASKS_POINT_STATE_USER = 2
}
 
enum  dt_masks_gradient_states_t {
  DT_MASKS_GRADIENT_STATE_LINEAR = 1 ,
  DT_MASKS_GRADIENT_STATE_SIGMOIDAL = 2
}
 
enum  dt_masks_pressure_sensitivity_t {
  DT_MASKS_PRESSURE_OFF = 0 ,
  DT_MASKS_PRESSURE_FADING_REL = 1 ,
  DT_MASKS_PRESSURE_FADING_ABS = 2 ,
  DT_MASKS_PRESSURE_OPACITY_REL = 3 ,
  DT_MASKS_PRESSURE_OPACITY_ABS = 4 ,
  DT_MASKS_PRESSURE_BRUSHSIZE_REL = 5
}
 
enum  dt_masks_ellipse_flags_t {
  DT_MASKS_ELLIPSE_EQUIDISTANT = 0 ,
  DT_MASKS_ELLIPSE_PROPORTIONAL = 1
}
 
enum  dt_masks_source_pos_type_t {
  DT_MASKS_SOURCE_POS_RELATIVE = 0 ,
  DT_MASKS_SOURCE_POS_RELATIVE_TEMP = 1 ,
  DT_MASKS_SOURCE_POS_ABSOLUTE = 2
}
 
enum  dt_masks_raster_result_t {
  DT_MASKS_RASTER_OK = 0 ,
  DT_MASKS_RASTER_EMPTY ,
  DT_MASKS_RASTER_ERROR
}
 What a rasterisation attempt produced. More...
 

Functions

static dt_masks_raster_result_t dt_masks_raster_from_status (const int status)
 
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)
 
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)
 
static gboolean dt_masks_form_uses_spot_defaults (const dt_masks_form_t *form)
 
static gboolean dt_masks_form_is_clone (const dt_masks_form_t *form)
 
static void dt_masks_reset_source (dt_masks_form_t *form)
 
static void dt_masks_translate_source (dt_masks_form_t *form, const float delta_x, const float delta_y)
 
static void dt_masks_translate_ctrl_node (float node[2], float ctrl1[2], float ctrl2[2], const float delta_x, const float delta_y)
 
static void dt_masks_set_ctrl_points (float ctrl1[2], float ctrl2[2], const float control_points[4])
 
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)
 
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)
 
int dt_masks_version (void)
 
int dt_masks_legacy_params (dt_develop_t *dev, void *params, const int old_version, const int new_version)
 
dt_masks_form_tdt_masks_create (dt_masks_type_t type)
 
dt_masks_form_tdt_masks_create_ext (dt_develop_t *dev, dt_masks_type_t type)
 
dt_masks_form_tdt_masks_get_from_id_ext (GList *forms, int id)
 
dt_masks_form_tdt_masks_get_from_id (dt_develop_t *dev, int id)
 
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)
 
struct dt_iop_module_tdt_masks_get_mask_manager (struct dt_develop_t *dev)
 
void dt_masks_read_masks_history (dt_develop_t *dev, const int32_t imgid)
 
void dt_masks_write_masks_history_item (const int32_t imgid, const int num, dt_masks_form_t *form)
 
void dt_masks_free_form (dt_masks_form_t *form)
 
void dt_masks_cleanup_unused (dt_develop_t *dev)
 Cleanup unused masks and refresh the current forms snapshot.
 
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)
 
void dt_masks_iop_use_same_as (struct dt_iop_module_t *module, struct dt_iop_module_t *src)
 
uint64_t dt_masks_group_get_hash_ext (uint64_t hash, GList *masks, dt_masks_form_t *form)
 
uint64_t dt_masks_form_get_own_hash (uint64_t hash, GList *masks, const dt_masks_form_t *form)
 
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)
 
int dt_masks_form_change_opacity (dt_develop_t *dev, dt_masks_form_t *form, int parentid, int up, const int flow)
 
void dt_masks_form_move (dt_masks_form_t *grp, int formid, int up)
 
int dt_masks_form_duplicate (dt_develop_t *dev, int formid)
 
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.
 
dt_masks_form_tdt_masks_dup_masks_form (const dt_masks_form_t *form)
 Deep-copy a mask form, including its points list.
 
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.
 
static gboolean _dt_masks_dynbuf_growto (dt_masks_dynbuf_t *a, size_t size)
 
static dt_masks_dynbuf_tdt_masks_dynbuf_init (size_t size, const char *tag)
 
static void dt_masks_dynbuf_add_2 (dt_masks_dynbuf_t *a, float value1, float value2)
 
static float * dt_masks_dynbuf_reserve_n (dt_masks_dynbuf_t *a, const int n)
 
static void dt_masks_dynbuf_add_zeros (dt_masks_dynbuf_t *a, const int n)
 
static float dt_masks_dynbuf_get (dt_masks_dynbuf_t *a, int offset)
 
static void dt_masks_dynbuf_set (dt_masks_dynbuf_t *a, int offset, float value)
 
static float * dt_masks_dynbuf_buffer (dt_masks_dynbuf_t *a)
 
static gboolean dt_masks_center_of_gravity_from_points (const float *points, const int points_count, float center[2], float *area)
 
static size_t dt_masks_dynbuf_position (dt_masks_dynbuf_t *a)
 
static void dt_masks_dynbuf_reset (dt_masks_dynbuf_t *a)
 
static float * dt_masks_dynbuf_harvest (dt_masks_dynbuf_t *a)
 
static void dt_masks_dynbuf_free (dt_masks_dynbuf_t *a)
 
static int dt_masks_roundup (int num, int mult)
 

Macro Definition Documentation

◆ DEVELOP_MASKS_VERSION

#define DEVELOP_MASKS_VERSION   (6)

Definition at line 136 of file masks.h.

Typedef Documentation

◆ dt_masks_anchor_gradient_t

structure used to store anchor for a gradient

◆ dt_masks_dynbuf_t

structure for dynamic buffers

◆ dt_masks_ellipse_flags_t

◆ dt_masks_event_t

masts states

◆ dt_masks_form_t

structure used to define a form

◆ dt_masks_functions_t

Definition at line 128 of file masks.h.

◆ dt_masks_gradient_states_t

◆ dt_masks_node_brush_t

structure used to store 1 node for a brush form

◆ dt_masks_node_circle_t

structure used to store 1 node for a circle

◆ dt_masks_node_ellipse_t

structure used to store 1 node for an ellipse

◆ dt_masks_node_polygon_t

structure used to store 1 node for a path form

◆ dt_masks_points_states_t

◆ dt_masks_pressure_sensitivity_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.

◆ dt_masks_source_pos_type_t

Enumeration Type Documentation

◆ dt_masks_ellipse_flags_t

Enumerator
DT_MASKS_ELLIPSE_EQUIDISTANT 
DT_MASKS_ELLIPSE_PROPORTIONAL 

Definition at line 180 of file masks.h.

◆ dt_masks_event_t

masts states

Enumerator
DT_MASKS_EVENT_NONE 
DT_MASKS_EVENT_ADD 
DT_MASKS_EVENT_REMOVE 
DT_MASKS_EVENT_UPDATE 
DT_MASKS_EVENT_DELETE 
DT_MASKS_EVENT_CHANGE 
DT_MASKS_EVENT_RESET 

Definition at line 142 of file masks.h.

◆ dt_masks_gradient_states_t

Enumerator
DT_MASKS_GRADIENT_STATE_LINEAR 
DT_MASKS_GRADIENT_STATE_SIGMOIDAL 

Definition at line 160 of file masks.h.

◆ dt_masks_points_states_t

Enumerator
DT_MASKS_POINT_STATE_NORMAL 
DT_MASKS_POINT_STATE_USER 

Definition at line 154 of file masks.h.

◆ dt_masks_pressure_sensitivity_t

Enumerator
DT_MASKS_PRESSURE_OFF 
DT_MASKS_PRESSURE_FADING_REL 
DT_MASKS_PRESSURE_FADING_ABS 
DT_MASKS_PRESSURE_OPACITY_REL 
DT_MASKS_PRESSURE_OPACITY_ABS 
DT_MASKS_PRESSURE_BRUSHSIZE_REL 

Definition at line 170 of file masks.h.

◆ 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.

Enumerator
DT_MASKS_RASTER_OK 
DT_MASKS_RASTER_EMPTY 
DT_MASKS_RASTER_ERROR 

Definition at line 312 of file masks.h.

◆ dt_masks_source_pos_type_t

Enumerator
DT_MASKS_SOURCE_POS_RELATIVE 
DT_MASKS_SOURCE_POS_RELATIVE_TEMP 
DT_MASKS_SOURCE_POS_ABSOLUTE 

Definition at line 186 of file masks.h.

Function Documentation

◆ _dt_masks_dynbuf_growto()

static gboolean _dt_masks_dynbuf_growto ( dt_masks_dynbuf_t a,
size_t  size 
)
inlinestatic

◆ dt_masks_center_of_gravity_from_points()

static gboolean dt_masks_center_of_gravity_from_points ( const float *  points,
const int  points_count,
float  center[2],
float *  area 
)
inlinestatic

◆ dt_masks_cleanup_unused()

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().

◆ dt_masks_copy_used_forms_for_module()

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_create()

◆ dt_masks_create_ext()

dt_masks_form_t * dt_masks_create_ext ( dt_develop_t dev,
dt_masks_type_t  type 
)

◆ dt_masks_dup_masks_form()

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:

  • The caller owns the returned form and must free it.
  • Point payloads are copied byte-for-byte using the type's point struct size.

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().

◆ dt_masks_duplicate_points()

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().

◆ dt_masks_dynbuf_add_2()

◆ dt_masks_dynbuf_add_zeros()

static void dt_masks_dynbuf_add_zeros ( dt_masks_dynbuf_t a,
const int  n 
)
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().

◆ dt_masks_dynbuf_buffer()

static float * dt_masks_dynbuf_buffer ( dt_masks_dynbuf_t a)
inlinestatic

◆ dt_masks_dynbuf_free()

◆ dt_masks_dynbuf_get()

static float dt_masks_dynbuf_get ( dt_masks_dynbuf_t a,
int  offset 
)
inlinestatic

Definition at line 637 of file masks.h.

References IS_NULL_PTR.

Referenced by _brush_events_button_released(), and _brush_events_mouse_moved().

◆ dt_masks_dynbuf_harvest()

static float * dt_masks_dynbuf_harvest ( dt_masks_dynbuf_t a)
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().

◆ dt_masks_dynbuf_init()

static dt_masks_dynbuf_t * dt_masks_dynbuf_init ( size_t  size,
const char *  tag 
)
inlinestatic

◆ dt_masks_dynbuf_position()

static size_t dt_masks_dynbuf_position ( dt_masks_dynbuf_t a)
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().

◆ dt_masks_dynbuf_reserve_n()

static float * dt_masks_dynbuf_reserve_n ( dt_masks_dynbuf_t a,
const int  n 
)
inlinestatic

◆ dt_masks_dynbuf_reset()

static void dt_masks_dynbuf_reset ( dt_masks_dynbuf_t a)
inlinestatic

Definition at line 738 of file masks.h.

References IS_NULL_PTR.

◆ dt_masks_dynbuf_set()

static void dt_masks_dynbuf_set ( dt_masks_dynbuf_t a,
int  offset,
float  value 
)
inlinestatic

Definition at line 646 of file masks.h.

References IS_NULL_PTR, and value.

Referenced by _init_fading(), and _init_size().

◆ dt_masks_form_change_opacity()

◆ dt_masks_form_delete()

◆ dt_masks_form_duplicate()

◆ 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.

Returns
the new form's id, or <= 0 on failure.

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().

◆ dt_masks_form_get_own_hash()

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().

◆ dt_masks_form_is_clone()

◆ dt_masks_form_move()

void dt_masks_form_move ( dt_masks_form_t grp,
int  formid,
int  up 
)

◆ dt_masks_form_uses_spot_defaults()

static gboolean dt_masks_form_uses_spot_defaults ( const dt_masks_form_t form)
inlinestatic

◆ dt_masks_free_form()

void dt_masks_free_form ( dt_masks_form_t form)

◆ dt_masks_get_area()

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_get_edit_mode()

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_get_from_id()

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_get_from_id_ext()

◆ dt_masks_get_mask()

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 
)

◆ dt_masks_get_mask_manager()

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_get_source_area()

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 
)

◆ dt_masks_group_get_hash_ext()

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_group_render_roi()

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().

◆ dt_masks_iop_use_same_as()

◆ dt_masks_legacy_params()

int dt_masks_legacy_params ( dt_develop_t dev,
void params,
const int  old_version,
const int  new_version 
)

◆ dt_masks_raster_from_status()

static dt_masks_raster_result_t dt_masks_raster_from_status ( const int  status)
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().

◆ dt_masks_read_masks_history()

void dt_masks_read_masks_history ( dt_develop_t dev,
const int32_t  imgid 
)

◆ dt_masks_reset_source()

static void dt_masks_reset_source ( dt_masks_form_t form)
inlinestatic

Definition at line 361 of file masks.h.

References dt_masks_form_t::source.

Referenced by _circle_init_new(), and _ellipse_init_new().

◆ dt_masks_roundup()

static int dt_masks_roundup ( int  num,
int  mult 
)
inlinestatic

Definition at line 763 of file masks.h.

Referenced by _circle_get_mask_roi().

◆ dt_masks_set_ctrl_points()

static void dt_masks_set_ctrl_points ( float  ctrl1[2],
float  ctrl2[2],
const float  control_points[4] 
)
inlinestatic

Definition at line 384 of file masks.h.

Referenced by _brush_events_mouse_moved(), and _polygon_events_mouse_moved().

◆ dt_masks_set_edit_mode()

◆ dt_masks_translate_ctrl_node()

static void dt_masks_translate_ctrl_node ( float  node[2],
float  ctrl1[2],
float  ctrl2[2],
const float  delta_x,
const float  delta_y 
)
inlinestatic

Definition at line 373 of file masks.h.

Referenced by _brush_translate_node(), and _polygon_translate_node().

◆ dt_masks_translate_source()

static void dt_masks_translate_source ( dt_masks_form_t form,
const float  delta_x,
const float  delta_y 
)
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().

◆ dt_masks_version()

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().

◆ dt_masks_write_masks_history_item()