Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
masks.h File Reference
#include "common/darktable.h"
#include "common/opencl.h"
#include "develop/pixelpipe.h"
#include "dtgtk/button.h"
#include "dtgtk/gradientslider.h"
#include "gui/draw.h"
#include "control/control.h"
#include <assert.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_group_t
 
struct  dt_masks_functions_t
 
struct  dt_masks_form_t
 
struct  dt_masks_form_gui_points_t
 
struct  dt_masks_dynbuf_t
 
struct  dt_masks_form_gui_t
 
struct  dt_masks_preview_buffers_t
 
struct  dt_masks_gui_center_point_t
 

Macros

#define DEVELOP_MASKS_VERSION   (6)
 
#define menu_item_set_fake_accel(menu_item, keyval, mods)
 

Typedefs

typedef enum dt_masks_type_t dt_masks_type_t
 
typedef enum dt_masks_event_t dt_masks_event_t
 
typedef enum dt_masks_state_t dt_masks_state_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_increment_t dt_masks_increment_t
 
typedef enum dt_masks_edit_mode_t dt_masks_edit_mode_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_group_t dt_masks_form_group_t
 
typedef enum dt_masks_interaction_t dt_masks_interaction_t
 
typedef struct dt_masks_functions_t dt_masks_functions_t
 
typedef struct dt_masks_form_t dt_masks_form_t
 
typedef struct dt_masks_form_gui_points_t dt_masks_form_gui_points_t
 
typedef struct dt_masks_dynbuf_t dt_masks_dynbuf_t
 
typedef struct dt_masks_form_gui_t dt_masks_form_gui_t
 
typedef struct dt_masks_preview_buffers_t dt_masks_preview_buffers_t
 
typedef struct dt_masks_gui_center_point_t dt_masks_gui_center_point_t
 
typedef gboolean(* dt_masks_border_handle_fn) (const dt_masks_form_gui_points_t *gui_points, int node_count, int node_index, float *handle_x, float *handle_y, void *user_data)
 Shape-specific callback to fetch a node's border handle in GUI space.
 
typedef void(* dt_masks_curve_handle_fn) (const dt_masks_form_gui_points_t *gui_points, int node_index, float *handle_x, float *handle_y, void *user_data)
 Shape-specific callback to fetch a node's curve handle in GUI space.
 
typedef void(* dt_masks_node_position_fn) (const dt_masks_form_gui_points_t *gui_points, int node_index, float *node_x, float *node_y, void *user_data)
 Shape-specific callback to fetch a node's position in GUI space.
 
typedef void(* dt_masks_distance_fn) (float pointer_x, float pointer_y, float cursor_radius, dt_masks_form_gui_t *mask_gui, int form_index, int node_count, int *inside, int *inside_border, int *near, int *inside_source, float *dist, void *user_data)
 Shape-specific callback for inside/border/segment hit testing.
 
typedef void(* dt_masks_post_select_fn) (dt_masks_form_gui_t *mask_gui, int inside, int inside_border, int inside_source, void *user_data)
 Optional hook to customize selection flags after inside/border/source resolution.
 

Enumerations

enum  dt_masks_type_t {
  DT_MASKS_NONE = 0 ,
  DT_MASKS_CIRCLE = 1 << 0 ,
  DT_MASKS_POLYGON = 1 << 1 ,
  DT_MASKS_GROUP = 1 << 2 ,
  DT_MASKS_CLONE = 1 << 3 ,
  DT_MASKS_GRADIENT = 1 << 4 ,
  DT_MASKS_ELLIPSE = 1 << 5 ,
  DT_MASKS_BRUSH = 1 << 6 ,
  DT_MASKS_NON_CLONE = 1 << 7 ,
  DT_MASKS_ALL ,
  DT_MASKS_IS_CLOSED_SHAPE = DT_MASKS_CIRCLE | DT_MASKS_ELLIPSE | DT_MASKS_POLYGON ,
  DT_MASKS_IS_OPEN_SHAPE = DT_MASKS_ALL & ~DT_MASKS_IS_CLOSED_SHAPE ,
  DT_MASKS_IS_RETOUCHE = DT_MASKS_CLONE | DT_MASKS_NON_CLONE ,
  DT_MASKS_IS_PATH_SHAPE = DT_MASKS_POLYGON | DT_MASKS_BRUSH ,
  DT_MASKS_IS_PRIMITIVE_SHAPE = DT_MASKS_CIRCLE | DT_MASKS_ELLIPSE | DT_MASKS_GRADIENT
}
 
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_state_t {
  DT_MASKS_STATE_NONE = 0 ,
  DT_MASKS_STATE_USE = 1 << 0 ,
  DT_MASKS_STATE_SHOW = 1 << 1 ,
  DT_MASKS_STATE_INVERSE = 1 << 2 ,
  DT_MASKS_STATE_UNION = 1 << 3 ,
  DT_MASKS_STATE_INTERSECTION = 1 << 4 ,
  DT_MASKS_STATE_DIFFERENCE = 1 << 5 ,
  DT_MASKS_STATE_EXCLUSION = 1 << 6 ,
  DT_MASKS_STATE_NOOP = 1 << 7 ,
  DT_MASKS_STATE_IS_COMBINE_OP = DT_MASKS_STATE_UNION | DT_MASKS_STATE_INTERSECTION | DT_MASKS_STATE_DIFFERENCE | DT_MASKS_STATE_EXCLUSION
}
 
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_increment_t {
  DT_MASKS_INCREMENT_ABSOLUTE = 0 ,
  DT_MASKS_INCREMENT_SCALE = 1 ,
  DT_MASKS_INCREMENT_OFFSET = 2
}
 
enum  dt_masks_edit_mode_t {
  DT_MASKS_EDIT_OFF = 0 ,
  DT_MASKS_EDIT_FULL = 1 ,
  DT_MASKS_EDIT_RESTRICTED = 2
}
 
enum  dt_masks_pressure_sensitivity_t {
  DT_MASKS_PRESSURE_OFF = 0 ,
  DT_MASKS_PRESSURE_HARDNESS_REL = 1 ,
  DT_MASKS_PRESSURE_HARDNESS_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_interaction_t {
  DT_MASKS_INTERACTION_UNDEF = 0 ,
  DT_MASKS_INTERACTION_SIZE = 1 ,
  DT_MASKS_INTERACTION_HARDNESS = 2 ,
  DT_MASKS_INTERACTION_OPACITY = 3 ,
  DT_MASKS_INTERACTION_LAST
}
 

Functions

dt_masks_form_tdt_masks_get_visible_form (const struct dt_develop_t *dev)
 
void dt_masks_set_visible_form (struct dt_develop_t *dev, dt_masks_form_t *form)
 
void dt_masks_gui_init (struct dt_develop_t *dev)
 
void dt_masks_gui_cleanup (struct dt_develop_t *dev)
 
void dt_masks_gui_set_dragging (dt_masks_form_gui_t *gui)
 
void dt_masks_gui_reset_dragging (dt_masks_form_gui_t *gui)
 
gboolean dt_masks_gui_is_dragging (const dt_masks_form_gui_t *gui)
 
static gboolean dt_masks_gui_was_anything_selected (const dt_masks_form_gui_t *gui)
 
static int dt_masks_gui_selected_node_index (const dt_masks_form_gui_t *gui)
 
static int dt_masks_gui_selected_handle_index (const dt_masks_form_gui_t *gui)
 
static int dt_masks_gui_selected_handle_border_index (const dt_masks_form_gui_t *gui)
 
static int dt_masks_gui_selected_segment_index (const dt_masks_form_gui_t *gui)
 
static gboolean dt_masks_gui_change_affects_selected_node_or_all (const dt_masks_form_gui_t *gui, const int index)
 
static float dt_masks_get_form_size_from_nodes (const GList *points)
 
static gboolean dt_masks_gui_should_hit_test (dt_masks_form_gui_t *gui)
 
static void dt_masks_gui_cursor_to_raw_norm (dt_develop_t *dev, const dt_masks_form_gui_t *gui, float point[2])
 
static void dt_masks_gui_delta_to_raw_norm (dt_develop_t *dev, const dt_masks_form_gui_t *gui, float point[2])
 
static void dt_masks_gui_delta_to_image_abs (const dt_masks_form_gui_t *gui, float point[2])
 
static void dt_masks_gui_delta_from_raw_anchor (dt_develop_t *dev, const dt_masks_form_gui_t *gui, const float anchor[2], float *delta_x, float *delta_y)
 
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])
 
gboolean dt_masks_node_is_cusp (const dt_masks_form_gui_points_t *gpt, const int index)
 returns wether a node is a corner or not. A node is a corner if its 2 control handles are at the same position, else it's a curve.
 
void dt_masks_gui_form_create (dt_masks_form_t *form, dt_masks_form_gui_t *gui, int index, struct dt_iop_module_t *module)
 
static gboolean dt_masks_toggle_bezier_node_type (struct dt_iop_module_t *module, struct dt_masks_form_t *mask_form, struct dt_masks_form_gui_t *mask_gui, const int form_index, const struct dt_masks_form_gui_points_t *gui_points, const int node_index, float node[2], float ctrl1[2], float ctrl2[2], dt_masks_points_states_t *state)
 
static gboolean dt_masks_reset_bezier_ctrl_points (struct dt_iop_module_t *module, struct dt_masks_form_t *mask_form, struct dt_masks_form_gui_t *mask_gui, const int form_index, const struct dt_masks_form_gui_points_t *gui_points, const int node_index, dt_masks_points_states_t *state)
 
static void dt_masks_project_on_line (const float cursor[2], const float node[2], const float handle[2], float point[2])
 
static float dt_masks_border_from_projected_handle (dt_develop_t *dev, const float node[2], const float projected_image_pos[2], const float scale_ref)
 
static void dt_masks_draw_preview_shape (cairo_t *cr, const float zoom_scale, const int num_points, float *points, const int points_count, float *border, const int border_count, void(*const *draw_shape)(cairo_t *cr, const float *points, const int points_count, const int nb, const gboolean border, const gboolean source), const cairo_line_cap_t shape_cap, const cairo_line_cap_t border_cap, const gboolean save_restore)
 
static void dt_masks_preview_buffers_cleanup (dt_masks_preview_buffers_t *buffers)
 
void dt_masks_init_form_gui (dt_masks_form_gui_t *gui)
 
int dt_masks_get_points_border (struct dt_develop_t *dev, dt_masks_form_t *form, float **points, int *points_count, float **border, int *border_count, int source, dt_iop_module_t *module)
 
int dt_masks_get_area (dt_iop_module_t *module, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, dt_masks_form_t *form, int *width, int *height, int *posx, int *posy)
 
int dt_masks_get_source_area (dt_iop_module_t *module, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, dt_masks_form_t *form, int *width, int *height, int *posx, int *posy)
 
static int 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)
 
static int dt_masks_get_mask_roi (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, const dt_iop_roi_t *roi, float *buffer)
 
int 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)
 
void dt_masks_append_form (dt_develop_t *dev, dt_masks_form_t *form)
 
void dt_masks_remove_form (dt_develop_t *dev, dt_masks_form_t *form)
 
void dt_masks_remove_node (struct dt_iop_module_t *module, dt_masks_form_t *form, int parentid, dt_masks_form_gui_t *gui, int index, int node_index)
 
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_masks_type_t type)
 
void dt_masks_replace_current_forms (dt_develop_t *dev, GList *forms)
 
GList * dt_masks_snapshot_current_forms (dt_develop_t *dev, gboolean reset_changed)
 
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.
 
void dt_masks_change_form_gui (dt_masks_form_t *newform)
 
void dt_masks_clear_form_gui (dt_develop_t *dev)
 
void dt_masks_reset_form_gui (void)
 
void dt_masks_soft_reset_form_gui (dt_masks_form_gui_t *gui)
 
void dt_masks_reset_show_masks_icons (void)
 
int dt_masks_events_mouse_moved (struct dt_iop_module_t *module, double x, double y, double pressure, int which)
 
int dt_masks_events_button_released (struct dt_iop_module_t *module, double x, double y, int which, uint32_t state)
 
int dt_masks_events_button_pressed (struct dt_iop_module_t *module, double x, double y, double pressure, int which, int type, uint32_t state)
 
int dt_masks_events_mouse_scrolled (struct dt_iop_module_t *module, double x, double y, int up, uint32_t state, int delta_y)
 
int dt_masks_events_key_pressed (struct dt_iop_module_t *module, GdkEventKey *event)
 
void dt_masks_draw_source (cairo_t *cr, dt_masks_form_gui_t *gui, const int index, const int nb, const float zoom_scale, struct dt_masks_gui_center_point_t *center_point, const shape_draw_function_t *draw_shape_func)
 Draw the source for a correction mask.
 
void dt_masks_draw_path_seg_by_seg (cairo_t *cr, dt_masks_form_gui_t *gui, const int index, const float *points, const int points_count, const int node_count, const float zoom_scale)
 
void dt_masks_events_post_expose (struct dt_iop_module_t *module, cairo_t *cr, int32_t width, int32_t height, int32_t pointerx, int32_t pointery)
 
int dt_masks_events_mouse_leave (struct dt_iop_module_t *module)
 
int dt_masks_events_mouse_enter (struct dt_iop_module_t *module)
 
gboolean dt_masks_gui_form_create_throttled (dt_masks_form_t *form, dt_masks_form_gui_t *gui, int index, struct dt_iop_module_t *module, float posx, float posy)
 
gboolean dt_masks_gui_delete (struct dt_iop_module_t *module, dt_masks_form_t *form, dt_masks_form_gui_t *gui, const int parentid)
 Delete a mask shape or node form from the GUI. This function is to be used with a popupmenu "Delete" action in the future.
 
gboolean dt_masks_form_cancel_creation (dt_iop_module_t *module, dt_masks_form_gui_t *gui)
 
void dt_masks_gui_form_remove (dt_masks_form_t *form, dt_masks_form_gui_t *gui, int index)
 
void dt_masks_gui_form_test_create (dt_masks_form_t *form, dt_masks_form_gui_t *gui, struct dt_iop_module_t *module)
 
void dt_masks_gui_form_save_creation (dt_develop_t *dev, struct dt_iop_module_t *module, dt_masks_form_t *form, dt_masks_form_gui_t *gui)
 
void dt_masks_group_ungroup (dt_masks_form_t *dest_grp, dt_masks_form_t *grp)
 
void dt_masks_group_update_name (dt_iop_module_t *module)
 
dt_masks_form_group_tdt_masks_group_add_form (dt_masks_form_t *grp, dt_masks_form_t *form)
 
void dt_masks_iop_value_changed_callback (GtkWidget *widget, struct dt_iop_module_t *module)
 
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_update (struct dt_iop_module_t *module)
 
void dt_masks_iop_combo_populate (GtkWidget *w, void *module)
 
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 (uint64_t hash, dt_masks_form_t *form)
 
void dt_masks_form_remove (struct dt_iop_module_t *module, dt_masks_form_t *grp, dt_masks_form_t *form)
 
int dt_masks_form_change_opacity (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)
 
dt_masks_form_tdt_masks_dup_masks_form (const dt_masks_form_t *form)
 Deep-copy a mask form, including its points list.
 
GList * dt_masks_dup_forms_deep (GList *forms, dt_masks_form_t *form)
 Duplicate the list of forms, replacing a single item by formid match.
 
int dt_masks_point_in_form_exact (const float *pts, int num_pts, const float *points, int points_start, int points_count)
 Check whether any 2D point in pts[] lies inside the form points[].
 
void dt_masks_select_form (struct dt_iop_module_t *module, dt_masks_form_t *sel)
 Select or clear the current mask form, notifying the owning module if needed.
 
void dt_masks_set_source_pos_initial_state (dt_masks_form_gui_t *gui, const uint32_t state)
 Decide initial source positioning mode for clone masks.
 
void dt_masks_set_source_pos_initial_value (dt_masks_form_gui_t *gui, dt_masks_form_t *form)
 Initialize the clone source position based on current GUI state.
 
void dt_masks_calculate_source_pos_value (dt_masks_form_gui_t *gui, const float initial_xpos, const float initial_ypos, const float xpos, const float ypos, float *px, float *py, const int adding)
 Compute preview-space source position for drawing the clone indicator.
 
static void dt_masks_draw_source_preview (cairo_t *cr, const float zoom_scale, dt_masks_form_gui_t *gui, const float initial_xpos, const float initial_ypos, const float xpos, const float ypos, const int adding)
 
float dt_masks_rotate_with_anchor (dt_develop_t *dev, const float anchor[2], const float center[2], dt_masks_form_gui_t *gui)
 Rotate a mask shape around its center. WARNING: gui->delta will be updated with the new position after rotation.
 
dt_masks_form_group_tdt_masks_form_group_from_parentid (int parentid, int formid)
 Return the group entry for a (parent, form) pair.
 
int dt_masks_group_index_from_formid (const dt_masks_form_t *group_form, int formid)
 
dt_masks_form_group_tdt_masks_form_get_selected_group (const struct dt_masks_form_t *form, const struct dt_masks_form_gui_t *gui)
 
gboolean dt_masks_is_anything_selected (const dt_masks_form_gui_t *mask_gui)
 
gboolean dt_masks_is_anything_hovered (const dt_masks_form_gui_t *mask_gui)
 
dt_masks_form_group_tdt_masks_form_get_selected_group_live (const struct dt_masks_form_t *form, const struct dt_masks_form_gui_t *gui)
 Return the currently selected group entry, resolving to the live form group when the GUI is operating on a temporary copy (for example the visible group created for editing).
 
float dt_masks_form_get_interaction_value (dt_masks_form_group_t *form_group, dt_masks_interaction_t interaction)
 
gboolean dt_masks_form_get_gravity_center (const struct dt_masks_form_t *form, float center[2], float *area)
 
void dt_masks_form_update_gravity_center (struct dt_masks_form_t *form)
 
float dt_masks_form_set_interaction_value (dt_masks_form_group_t *form_group, dt_masks_interaction_t interaction, float value, dt_masks_increment_t increment, int flow, struct dt_masks_form_gui_t *gui, struct dt_iop_module_t *module)
 
float dt_masks_get_set_conf_value (dt_masks_form_t *form, char *feature, float new_value, float v_min, float v_max, dt_masks_increment_t increment, const int flow)
 Change a numerical property of a mask shape, either by in/de-crementing the current value or setting it in an absolute fashion, then save it to configuration.
 
float dt_masks_get_set_conf_value_with_toast (dt_masks_form_t *form, const char *feature, float amount, float v_min, float v_max, dt_masks_increment_t increment, int flow, const char *toast_fmt, float toast_scale)
 Update a mask configuration value and emit a toast message.
 
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.
 
float dt_masks_apply_increment (float current, float amount, dt_masks_increment_t increment, int flow)
 Apply a scroll increment to a scalar value.
 
float dt_masks_apply_increment_precomputed (float current, float amount, float scale_amount, float offset_amount, dt_masks_increment_t increment)
 Apply a scroll increment using precomputed scale/offset factors.
 
void dt_masks_extend_border (float *const mask, const int width, const int height, const int border)
 
void dt_masks_blur_9x9_coeff (float *coeffs, const float sigma)
 
void dt_masks_blur_9x9 (float *const src, float *const out, const int width, const int height, const float sigma)
 
void dt_masks_calc_rawdetail_mask (float *const src, float *const out, float *const tmp, const int width, const int height, const dt_aligned_pixel_t wb)
 
void dt_masks_calc_detail_mask (float *const src, float *const out, float *const tmp, const int width, const int height, const float threshold, const gboolean detail)
 
void dt_group_events_post_expose (cairo_t *cr, float zoom_scale, dt_masks_form_t *form, dt_masks_form_gui_t *gui)
 
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)
 
gboolean dt_masks_point_is_within_radius (const float px, const float py, const float cx, const float cy, const float radius)
 Check if a point (px,py) is inside a radius from a center point (cx,cy)
 
int dt_masks_find_closest_handle_common (dt_masks_form_t *mask_form, dt_masks_form_gui_t *mask_gui, int form_index, int node_count_override, dt_masks_border_handle_fn border_handle_cb, dt_masks_curve_handle_fn curve_handle_cb, dt_masks_node_position_fn node_position_cb, dt_masks_distance_fn distance_cb, dt_masks_post_select_fn post_select_cb, void *user_data)
 Shared selection logic for node/handle/segment hit testing.
 
gboolean dt_masks_creation_mode (dt_iop_module_t *module, const dt_masks_type_t type)
 Enter mask creation mode for a given shape type.
 
void apply_operation (struct dt_masks_form_group_t *pt, const dt_masks_state_t apply_state)
 Apply a mask state operation on a group entry.
 
void _masks_gui_delete_node_callback (GtkWidget *menu, gpointer user_data)
 
GdkModifierType dt_masks_get_accel_mods (dt_masks_interaction_t interaction)
 
GtkWidgetdt_masks_create_menu (dt_masks_form_gui_t *gui, dt_masks_form_t *form, const dt_masks_form_group_t *fpt, const float pzx, const float pzy)
 

Variables

const dt_masks_functions_t dt_masks_functions_circle
 
const dt_masks_functions_t dt_masks_functions_ellipse
 
const dt_masks_functions_t dt_masks_functions_brush
 
const dt_masks_functions_t dt_masks_functions_polygon
 
const dt_masks_functions_t dt_masks_functions_gradient
 
const dt_masks_functions_t dt_masks_functions_group
 

Macro Definition Documentation

◆ DEVELOP_MASKS_VERSION

#define DEVELOP_MASKS_VERSION   (6)

◆ menu_item_set_fake_accel

#define menu_item_set_fake_accel (   menu_item,
  keyval,
  mods 
)
Value:
\
{ \
GtkWidget *child = gtk_bin_get_child(GTK_BIN(menu_item)); \
if(GTK_IS_ACCEL_LABEL(child)) \
gtk_accel_label_set_accel(GTK_ACCEL_LABEL(child), keyval, mods); \
}
struct _GtkWidget GtkWidget
Definition splash.h:29

Contextual menu

Typedef Documentation

◆ dt_masks_anchor_gradient_t

structure used to store anchor for a gradient

◆ dt_masks_border_handle_fn

typedef gboolean(* dt_masks_border_handle_fn) (const dt_masks_form_gui_points_t *gui_points, int node_count, int node_index, float *handle_x, float *handle_y, void *user_data)

Shape-specific callback to fetch a node's border handle in GUI space.

Returns
TRUE if the handle is valid and written to (handle_x, handle_y).

◆ dt_masks_curve_handle_fn

typedef void(* dt_masks_curve_handle_fn) (const dt_masks_form_gui_points_t *gui_points, int node_index, float *handle_x, float *handle_y, void *user_data)

Shape-specific callback to fetch a node's curve handle in GUI space.

The handle is only queried for non-cusp nodes; implementations may assume that.

◆ dt_masks_distance_fn

typedef void(* dt_masks_distance_fn) (float pointer_x, float pointer_y, float cursor_radius, dt_masks_form_gui_t *mask_gui, int form_index, int node_count, int *inside, int *inside_border, int *near, int *inside_source, float *dist, void *user_data)

Shape-specific callback for inside/border/segment hit testing.

This mirrors the per-shape *_get_distance() APIs and returns the same outputs. The dist output is a squared distance in absolute output-image coordinates.

◆ dt_masks_dynbuf_t

structure for dynamic buffers

◆ dt_masks_edit_mode_t

◆ dt_masks_ellipse_flags_t

◆ dt_masks_event_t

masts states

◆ dt_masks_form_group_t

structure used to store all forms's id for a group

◆ dt_masks_form_gui_points_t

structure used to define all the gui points to draw in viewport

◆ dt_masks_form_gui_t

structure used to display a form

◆ dt_masks_form_t

structure used to define a form

◆ dt_masks_functions_t

structure used to store pointers to the functions implementing operations on a mask shape plus a few per-class descriptive data items

◆ dt_masks_gradient_states_t

◆ dt_masks_gui_center_point_t

◆ dt_masks_increment_t

◆ dt_masks_interaction_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_node_position_fn

typedef void(* dt_masks_node_position_fn) (const dt_masks_form_gui_points_t *gui_points, int node_index, float *node_x, float *node_y, void *user_data)

Shape-specific callback to fetch a node's position in GUI space.

When NULL, the common helper assumes Bezier-like layout at points[k*6+2].

◆ dt_masks_points_states_t

◆ dt_masks_post_select_fn

typedef void(* dt_masks_post_select_fn) (dt_masks_form_gui_t *mask_gui, int inside, int inside_border, int inside_source, void *user_data)

Optional hook to customize selection flags after inside/border/source resolution.

◆ dt_masks_pressure_sensitivity_t

◆ dt_masks_preview_buffers_t

◆ dt_masks_source_pos_type_t

◆ dt_masks_state_t

◆ dt_masks_type_t

forms types

Enumeration Type Documentation

◆ dt_masks_edit_mode_t

Enumerator
DT_MASKS_EDIT_OFF 
DT_MASKS_EDIT_FULL 
DT_MASKS_EDIT_RESTRICTED 

◆ dt_masks_ellipse_flags_t

Enumerator
DT_MASKS_ELLIPSE_EQUIDISTANT 
DT_MASKS_ELLIPSE_PROPORTIONAL 

◆ 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 

◆ dt_masks_gradient_states_t

Enumerator
DT_MASKS_GRADIENT_STATE_LINEAR 
DT_MASKS_GRADIENT_STATE_SIGMOIDAL 

◆ dt_masks_increment_t

Enumerator
DT_MASKS_INCREMENT_ABSOLUTE 
DT_MASKS_INCREMENT_SCALE 
DT_MASKS_INCREMENT_OFFSET 

◆ dt_masks_interaction_t

Enumerator
DT_MASKS_INTERACTION_UNDEF 
DT_MASKS_INTERACTION_SIZE 
DT_MASKS_INTERACTION_HARDNESS 
DT_MASKS_INTERACTION_OPACITY 
DT_MASKS_INTERACTION_LAST 

◆ dt_masks_points_states_t

Enumerator
DT_MASKS_POINT_STATE_NORMAL 
DT_MASKS_POINT_STATE_USER 

◆ dt_masks_pressure_sensitivity_t

Enumerator
DT_MASKS_PRESSURE_OFF 
DT_MASKS_PRESSURE_HARDNESS_REL 
DT_MASKS_PRESSURE_HARDNESS_ABS 
DT_MASKS_PRESSURE_OPACITY_REL 
DT_MASKS_PRESSURE_OPACITY_ABS 
DT_MASKS_PRESSURE_BRUSHSIZE_REL 

◆ dt_masks_source_pos_type_t

Enumerator
DT_MASKS_SOURCE_POS_RELATIVE 
DT_MASKS_SOURCE_POS_RELATIVE_TEMP 
DT_MASKS_SOURCE_POS_ABSOLUTE 

◆ dt_masks_state_t

Enumerator
DT_MASKS_STATE_NONE 
DT_MASKS_STATE_USE 
DT_MASKS_STATE_SHOW 
DT_MASKS_STATE_INVERSE 
DT_MASKS_STATE_UNION 
DT_MASKS_STATE_INTERSECTION 
DT_MASKS_STATE_DIFFERENCE 
DT_MASKS_STATE_EXCLUSION 
DT_MASKS_STATE_NOOP 
DT_MASKS_STATE_IS_COMBINE_OP 

◆ dt_masks_type_t

forms types

Enumerator
DT_MASKS_NONE 
DT_MASKS_CIRCLE 
DT_MASKS_POLYGON 
DT_MASKS_GROUP 
DT_MASKS_CLONE 
DT_MASKS_GRADIENT 
DT_MASKS_ELLIPSE 
DT_MASKS_BRUSH 
DT_MASKS_NON_CLONE 
DT_MASKS_ALL 
DT_MASKS_IS_CLOSED_SHAPE 
DT_MASKS_IS_OPEN_SHAPE 
DT_MASKS_IS_RETOUCHE 
DT_MASKS_IS_PATH_SHAPE 
DT_MASKS_IS_PRIMITIVE_SHAPE 

Function Documentation

◆ _dt_masks_dynbuf_growto()

static gboolean _dt_masks_dynbuf_growto ( dt_masks_dynbuf_t a,
size_t  size 
)
inlinestatic

◆ _masks_gui_delete_node_callback()

◆ apply_operation()

void apply_operation ( struct dt_masks_form_group_t group_entry,
const dt_masks_state_t  apply_state 
)

Apply a mask state operation on a group entry.

Inverse toggles its flag, combine operations replace the combine bits.

References DT_MASKS_STATE_INVERSE, DT_MASKS_STATE_IS_COMBINE_OP, and dt_masks_form_group_t::state.

Referenced by _blendop_masks_group_operation_callback(), _masks_operation_callback(), _tree_difference(), _tree_exclusion(), _tree_intersection(), _tree_inverse(), and _tree_union().

◆ dt_group_events_post_expose()

void dt_group_events_post_expose ( cairo_t *  cr,
float  zoom_scale,
dt_masks_form_t form,
dt_masks_form_gui_t gui 
)

◆ dt_masks_append_form()

◆ dt_masks_apply_increment()

float dt_masks_apply_increment ( float  current,
float  amount,
dt_masks_increment_t  increment,
int  flow 
)

◆ dt_masks_apply_increment_precomputed()

float dt_masks_apply_increment_precomputed ( float  current,
float  amount,
float  scale_amount,
float  offset_amount,
dt_masks_increment_t  increment 
)

Apply a scroll increment using precomputed scale/offset factors.

References DT_MASKS_INCREMENT_ABSOLUTE, DT_MASKS_INCREMENT_OFFSET, and DT_MASKS_INCREMENT_SCALE.

Referenced by _change_hardness(), _change_hardness(), and _change_size().

◆ dt_masks_blur_9x9()

void dt_masks_blur_9x9 ( float *const  src,
float *const  out,
const int  width,
const int  height,
const float  sigma 
)

◆ dt_masks_blur_9x9_coeff()

void dt_masks_blur_9x9_coeff ( float *  coeffs,
const float  sigma 
)

References c, i, kernel(), and sqf().

Referenced by dt_masks_blur_9x9().

◆ dt_masks_border_from_projected_handle()

static float dt_masks_border_from_projected_handle ( dt_develop_t dev,
const float  node[2],
const float  projected_image_pos[2],
const float  scale_ref 
)
inlinestatic

◆ dt_masks_calc_detail_mask()

void dt_masks_calc_detail_mask ( float *const  src,
float *const  out,
float *const  tmp,
const int  width,
const int  height,
const float  threshold,
const gboolean  detail 
)

◆ dt_masks_calc_rawdetail_mask()

void dt_masks_calc_rawdetail_mask ( float *const  src,
float *const  out,
float *const  tmp,
const int  width,
const int  height,
const dt_aligned_pixel_t  wb 
)

◆ dt_masks_calculate_source_pos_value()

void dt_masks_calculate_source_pos_value ( dt_masks_form_gui_t mask_gui,
const float  initial_xpos,
const float  initial_ypos,
const float  xpos,
const float  ypos,
float *  pos_x,
float *  pos_y,
const int  adding 
)

◆ 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_change_form_gui()

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

References dt_dev_get_history_end_ext(), dt_masks_change_form_gui(), dt_masks_cleanup_unused_from_list(), dt_masks_replace_current_forms(), dt_dev_history_item_t::forms, and dt_develop_t::history.

Referenced by _tree_cleanup().

◆ dt_masks_clear_form_gui()

void dt_masks_clear_form_gui ( dt_develop_t dev)

References dt_masks_form_gui_t::border_selected, dt_masks_form_gui_t::border_toggling, dt_masks_form_gui_t::creation, dt_masks_form_gui_t::creation_closing_form, dt_masks_form_gui_t::creation_module, dt_masks_form_gui_t::delta, dt_masks_dynbuf_free(), DT_MASKS_EDIT_OFF, dt_masks_form_gui_points_free(), DT_MASKS_PRESSURE_OFF, dt_masks_select_form(), DT_PIXELPIPE_CACHE_HASH_INVALID, dt_masks_form_gui_t::edit_mode, FALSE, dt_masks_form_gui_t::form_dragging, dt_develop_t::form_gui, dt_masks_form_gui_t::form_rotating, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::formid, dt_masks_form_gui_t::gradient_toggling, dt_masks_form_gui_t::group_selected, dt_masks_form_gui_t::guipoints, dt_masks_form_gui_t::guipoints_count, dt_masks_form_gui_t::guipoints_payload, dt_masks_form_gui_t::handle_border_dragging, dt_masks_form_gui_t::handle_border_hovered, dt_masks_form_gui_t::handle_border_selected, dt_masks_form_gui_t::handle_dragging, dt_masks_form_gui_t::handle_hovered, dt_masks_form_gui_t::handle_selected, dt_masks_form_gui_t::last_hit_test_pos, dt_masks_form_gui_t::last_rebuild_pos, dt_masks_form_gui_t::last_rebuild_ts, dt_masks_form_gui_t::node_dragging, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_gui_t::node_selected_idx, dt_masks_form_gui_t::pipe_hash, dt_masks_form_gui_t::pivot_selected, dt_masks_form_gui_t::points, dt_masks_form_gui_t::pressure_sensitivity, dt_masks_form_gui_t::rebuild_pending, dt_masks_form_gui_t::scrollx, dt_masks_form_gui_t::scrolly, dt_masks_form_gui_t::seg_dragging, dt_masks_form_gui_t::seg_hovered, dt_masks_form_gui_t::seg_selected, dt_masks_form_gui_t::source_dragging, and dt_masks_form_gui_t::source_selected.

Referenced by _masks_remove_shape(), dt_masks_change_form_gui(), dt_masks_gui_cleanup(), and dt_masks_gui_init().

◆ 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_masks_type_t  type)

◆ dt_masks_create_menu()

GtkWidget * dt_masks_create_menu ( dt_masks_form_gui_t gui,
dt_masks_form_t form,
const dt_masks_form_group_t fpt,
const float  pzx,
const float  pzy 
)

References _masks_gui_add_interaction_slider(), _masks_gui_cancel_creation_callback(), _masks_gui_delete_node_callback(), _masks_gui_remove_form_callback(), _masks_movedown_callback(), _masks_moveup_callback(), dt_masks_form_gui_t::creation, ctx_gtk_menu_item_new_with_markup(), ctx_gtk_menu_item_new_with_markup_and_pixbuf(), darktable, darktable_t::develop, dt_draw_get_pixbuf_from_cairo(), dt_free, DT_MASKS_BRUSH, DT_MASKS_CIRCLE, DT_MASKS_ELLIPSE, dt_masks_form_get_interaction_value(), dt_masks_form_group_from_parentid(), dt_masks_get_from_id(), DT_MASKS_GRADIENT, DT_MASKS_GROUP, DT_MASKS_INCREMENT_ABSOLUTE, DT_MASKS_INCREMENT_SCALE, DT_MASKS_INTERACTION_HARDNESS, DT_MASKS_INTERACTION_OPACITY, DT_MASKS_INTERACTION_SIZE, DT_MASKS_IS_RETOUCHE, DT_MASKS_POLYGON, 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_PIXEL_APPLY_DPI, dtgtk_cairo_paint_masks_difference(), dtgtk_cairo_paint_masks_exclusion(), dtgtk_cairo_paint_masks_intersection(), dtgtk_cairo_paint_masks_inverse(), dtgtk_cairo_paint_masks_union(), FALSE, dt_masks_form_gui_t::form_selected, dt_masks_form_group_t::formid, dt_masks_form_t::formid, dt_masks_form_t::functions, dt_develop_t::gui_module, masks_gtk_menu_item_new_bold, MAX, menu_item_set_fake_accel, dt_masks_form_t::name, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_group_t::parentid, dt_masks_form_t::points, dt_masks_functions_t::populate_context_menu, dt_masks_form_gui_t::seg_hovered, dt_masks_form_group_t::state, TRUE, dt_masks_form_t::type, and width.

Referenced by dt_masks_events_button_pressed().

◆ dt_masks_creation_mode()

◆ dt_masks_draw_path_seg_by_seg()

void dt_masks_draw_path_seg_by_seg ( cairo_t *  cr,
dt_masks_form_gui_t gui,
const int  index,
const float *  points,
const int  points_count,
const int  node_count,
const float  zoom_scale 
)

◆ dt_masks_draw_preview_shape()

static void dt_masks_draw_preview_shape ( cairo_t *  cr,
const float  zoom_scale,
const int  num_points,
float *  points,
const int  points_count,
float *  border,
const int  border_count,
void(**)(cairo_t *cr, const float *points, const int points_count, const int nb, const gboolean border, const gboolean source)  draw_shape,
const cairo_line_cap_t  shape_cap,
const cairo_line_cap_t  border_cap,
const gboolean  save_restore 
)
inlinestatic

◆ dt_masks_draw_source()

void dt_masks_draw_source ( cairo_t *  cr,
dt_masks_form_gui_t gui,
const int  index,
const int  nb,
const float  zoom_scale,
struct dt_masks_gui_center_point_t center_point,
const shape_draw_function_t draw_shape_func 
)

◆ dt_masks_draw_source_preview()

static void dt_masks_draw_source_preview ( cairo_t *  cr,
const float  zoom_scale,
dt_masks_form_gui_t gui,
const float  initial_xpos,
const float  initial_ypos,
const float  xpos,
const float  ypos,
const int  adding 
)
inlinestatic

◆ dt_masks_dup_forms_deep()

GList * dt_masks_dup_forms_deep ( GList *  forms,
dt_masks_form_t form 
)

Duplicate the list of forms, replacing a single item by formid match.

References _dup_masks_form_cb().

Referenced by dt_dev_pixelpipe_process(), dt_history_duplicate(), dt_masks_replace_current_forms(), and dt_masks_snapshot_current_forms().

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

References dt_masks_form_t::functions, dt_masks_functions_t::point_struct_size, and dt_masks_form_t::points.

Referenced by _dup_masks_form_cb(), and dt_masks_copy_used_forms_for_module().

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

References 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

◆ 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

◆ dt_masks_dynbuf_harvest()

static float * dt_masks_dynbuf_harvest ( dt_masks_dynbuf_t a)
inlinestatic

References a, 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

◆ dt_masks_dynbuf_reserve_n()

◆ dt_masks_dynbuf_reset()

static void dt_masks_dynbuf_reset ( dt_masks_dynbuf_t a)
inlinestatic

References a.

Referenced by _polygon_fill_gaps().

◆ dt_masks_dynbuf_set()

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

◆ dt_masks_events_button_pressed()

◆ dt_masks_events_button_released()

◆ dt_masks_events_key_pressed()

◆ dt_masks_events_mouse_enter()

int dt_masks_events_mouse_enter ( struct dt_iop_module_t module)

Referenced by mouse_enter().

◆ dt_masks_events_mouse_leave()

int dt_masks_events_mouse_leave ( struct dt_iop_module_t module)

Referenced by mouse_leave().

◆ dt_masks_events_mouse_moved()

◆ dt_masks_events_mouse_scrolled()

◆ dt_masks_events_post_expose()

◆ dt_masks_extend_border()

void dt_masks_extend_border ( float *const  mask,
const int  width,
const int  height,
const int  border 
)

detail mask support

◆ dt_masks_find_closest_handle_common()

int dt_masks_find_closest_handle_common ( dt_masks_form_t mask_form,
dt_masks_form_gui_t mask_gui,
int  form_index,
int  node_count_override,
dt_masks_border_handle_fn  border_handle_cb,
dt_masks_curve_handle_fn  curve_handle_cb,
dt_masks_node_position_fn  node_position_cb,
dt_masks_distance_fn  distance_cb,
dt_masks_post_select_fn  post_select_cb,
void user_data 
)

Shared selection logic for node/handle/segment hit testing.

The shape-specific callbacks supply handles and distance tests while this function performs common selection bookkeeping on dt_masks_form_gui_t.

The cached cursor in mask_gui->pos is authoritative for hit testing.

Shared selection logic for node/handle/segment hit testing.

This function:

  • Translates pointer coordinates into GUI space,
  • Resets selection flags,
  • Tests border/curve handles and nodes,
  • Delegates inside/border/segment tests to the shape callback.

node_count_override can be used for shapes that don't expose nodes via GList (e.g. gradient/ellipse control points). Pass -1 to use g_list_length().

Callers provide shape-specific callbacks for handles and distance tests.

The cached cursor in mask_gui->pos is authoritative for hit testing.

References dt_masks_form_gui_t::border_selected, dt_masks_form_gui_t::creation, DT_GUI_MOUSE_EFFECT_RADIUS_SCALED, dt_masks_gui_selected_node_index(), dt_masks_gui_was_anything_selected(), dt_masks_node_is_cusp(), dt_masks_point_is_within_radius(), FALSE, dt_masks_form_gui_t::form_selected, dt_masks_form_gui_t::group_selected, dt_masks_form_gui_t::handle_border_dragging, dt_masks_form_gui_t::handle_border_hovered, dt_masks_form_gui_t::handle_dragging, dt_masks_form_gui_t::handle_hovered, dt_masks_form_gui_t::node_dragging, dt_masks_form_gui_t::node_hovered, dt_masks_form_t::points, dt_masks_form_gui_points_t::points, dt_masks_form_gui_t::points, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::seg_dragging, dt_masks_form_gui_t::seg_hovered, dt_masks_form_gui_t::source_selected, TRUE, and dt_masks_form_t::uses_bezier_points_layout.

Referenced by _find_closest_handle(), _find_closest_handle(), _find_closest_handle(), _find_closest_handle(), and _find_closest_handle().

◆ dt_masks_form_cancel_creation()

◆ dt_masks_form_change_opacity()

◆ dt_masks_form_duplicate()

◆ dt_masks_form_get_gravity_center()

gboolean dt_masks_form_get_gravity_center ( const struct dt_masks_form_t form,
float  center[2],
float *  area 
)

◆ dt_masks_form_get_interaction_value()

◆ dt_masks_form_get_selected_group()

◆ dt_masks_form_get_selected_group_live()

dt_masks_form_group_t * dt_masks_form_get_selected_group_live ( const struct dt_masks_form_t form,
const struct dt_masks_form_gui_t gui 
)

Return the currently selected group entry, resolving to the live form group when the GUI is operating on a temporary copy (for example the visible group created for editing).

The selection is taken from gui->group_selected. If the selected entry belongs to a temporary group (non-zero parentid), the function resolves and returns the corresponding entry from the real group in dev->forms.

Referenced by rt_get_selected_shape_id().

◆ dt_masks_form_group_from_parentid()

dt_masks_form_group_t * dt_masks_form_group_from_parentid ( int  parent_id,
int  form_id 
)

Return the group entry for a (parent, form) pair.

Getters and setters for direct GUI interaction

Caveat: returns NULL if parent isn't a group or the entry is missing.

References _masks_group_find_form(), darktable, darktable_t::develop, dt_masks_get_from_id(), DT_MASKS_GROUP, and dt_masks_form_t::type.

Referenced by _blendop_masks_group_operation_callback(), _opacity_changed_callback(), dt_masks_create_menu(), dt_masks_form_change_opacity(), and dt_masks_form_get_selected_group_live().

◆ dt_masks_form_is_clone()

static gboolean dt_masks_form_is_clone ( const dt_masks_form_t form)
inlinestatic

◆ dt_masks_form_move()

◆ dt_masks_form_remove()

◆ dt_masks_form_set_interaction_value()

◆ dt_masks_form_update_gravity_center()

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

◆ dt_masks_get_accel_mods()

GdkModifierType dt_masks_get_accel_mods ( dt_masks_interaction_t  interaction)

◆ dt_masks_get_area()

int dt_masks_get_area ( dt_iop_module_t module,
dt_dev_pixelpipe_t pipe,
dt_dev_pixelpipe_iop_t piece,
dt_masks_form_t form,
int *  width,
int *  height,
int *  posx,
int *  posy 
)

get the rectangle which include the form and his border

References dt_masks_form_t::functions, and dt_masks_functions_t::get_area.

Referenced by masks_form_is_in_roi(), rt_compute_roi_in(), and rt_masks_form_is_in_roi().

◆ dt_masks_get_edit_mode()

◆ dt_masks_get_form_size_from_nodes()

static float dt_masks_get_form_size_from_nodes ( const GList *  points)
inlinestatic

◆ 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

References dt_masks_get_from_id_ext(), dt_pthread_rwlock_rdlock, dt_pthread_rwlock_unlock, dt_develop_t::forms, and dt_develop_t::masks_mutex.

Referenced by _blendop_masks_all_delete_callback(), _blendop_masks_all_name_edited(), _blendop_masks_all_toggled(), _blendop_masks_group_button_pressed(), _blendop_masks_group_from_module(), _blendop_masks_group_move_callback(), _blendop_masks_group_tree_append(), _blendop_masks_is_group_with_shapes(), _blendop_masks_is_single_group_wrapper(), _blendop_masks_show_and_edit(), _brush_add_node_callback(), _brush_events_button_released(), _brush_reset_round_node_callback(), _brush_switch_node_callback(), _develop_blend_init_drawn_mask(), _dt_masks_events_get_dispatch_form(), _dt_masks_events_group_update_selection(), _edit_masks(), _find_in_group(), _group_from_module(), _group_get_child_at(), _group_get_gravity_center(), _group_get_mask(), _group_get_mask_roi(), _gui_reset_callback(), _is_form_used(), _lib_masks_handler_callback(), _lib_masks_list_recurs(), _lib_masks_update_item(), _masks_gui_delete_node_callback(), _masks_gui_remove_form_callback(), _masks_move_up_down_callback(), _masks_remove_shape(), _menu_add_exist(), _polygon_add_node_callback(), _polygon_events_post_expose(), _polygon_reset_round_node_callback(), _polygon_switch_node_callback(), _process(), _reset_form_creation(), _resynch_params(), _set_hinter_message(), _shape_is_being_added(), _tree_add_exist(), _tree_cell_edited(), _tree_context_menu(), _tree_delete_shape(), _tree_difference(), _tree_exclusion(), _tree_format_form_usage_label(), _tree_intersection(), _tree_inverse(), _tree_movedown(), _tree_moveup(), _tree_selection_change(), _tree_union(), _update_foreach(), dt_masks_copy_used_forms_for_module(), dt_masks_create_menu(), dt_masks_events_key_pressed(), dt_masks_form_duplicate(), dt_masks_form_get_interaction_value(), dt_masks_form_group_from_parentid(), dt_masks_form_remove(), dt_masks_form_set_interaction_value(), dt_masks_group_get_hash(), dt_masks_group_ungroup(), dt_masks_gui_form_test_create(), dt_masks_iop_update(), dt_masks_iop_use_same_as(), dt_masks_set_edit_mode(), give_control_to_form(), gui_focus(), gui_update(), modify_roi_in(), post_history_commit(), rt_compute_roi_in(), rt_display_selected_shapes_lbl(), rt_edit_masks_callback(), rt_extend_roi_in_for_clone(), rt_extend_roi_in_from_source_clones(), rt_get_mask_point_group(), rt_menu_select_algorithm_callback(), rt_process_forms(), rt_resynch_params(), rt_shape_is_being_added(), rt_show_forms_for_current_scale(), and rt_show_hide_controls().

◆ dt_masks_get_from_id_ext()

dt_masks_form_t * dt_masks_get_from_id_ext ( GList *  forms,
int  id 
)

◆ dt_masks_get_mask()

static int 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 
)
inlinestatic

get the transparency mask of the form and his border

References dt_masks_form_t::functions, dt_masks_functions_t::get_mask, height, and width.

Referenced by _group_get_mask(), _process(), and rt_process_forms().

◆ 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

References dt_develop_t::iop.

◆ dt_masks_get_mask_roi()

static int dt_masks_get_mask_roi ( 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,
const dt_iop_roi_t roi,
float *  buffer 
)
inlinestatic

◆ dt_masks_get_points_border()

int dt_masks_get_points_border ( struct dt_develop_t dev,
dt_masks_form_t form,
float **  points,
int *  points_count,
float **  border,
int *  border_count,
int  source,
dt_iop_module_t module 
)

get points in real space with respect of distortion dx and dy are used to eventually move the center of the circle

References dt_masks_form_t::functions, and dt_masks_functions_t::get_points_border.

Referenced by dt_masks_gui_form_create().

◆ dt_masks_get_set_conf_value()

float dt_masks_get_set_conf_value ( dt_masks_form_t form,
char *  feature,
float  new_value,
float  v_min,
float  v_max,
dt_masks_increment_t  increment,
const int  flow 
)

Change a numerical property of a mask shape, either by in/de-crementing the current value or setting it in an absolute fashion, then save it to configuration.

Parameters
formthe shape to change. We will read its type internally
featurethe propertie to change: hardness, size, curvature (for gradients)
new_valueif increment is set to absolute, this is directly the updated value. if increment is offset, the updated value is old_value + new_value. if increment is scale, the updated value is old value * new_value.
v_minminimum acceptable value of the property for sanitization
v_maxmaximum acceptable value of the property for sanitization
incrementthe increment type: absolute, offset or scale.
flowthe value of the scroll distance that can be postive or negative.

References _get_mask_plugin(), _get_mask_type(), dt_conf_get_float(), dt_conf_set_float(), dt_free, dt_masks_apply_increment(), MAX, and MIN.

Referenced by _brush_events_button_pressed(), _brush_events_button_released(), _brush_events_post_expose(), _change_hardness(), _change_size(), _init_hardness(), _init_size(), and dt_masks_get_set_conf_value_with_toast().

◆ dt_masks_get_set_conf_value_with_toast()

float dt_masks_get_set_conf_value_with_toast ( dt_masks_form_t form,
const char *  feature,
float  amount,
float  v_min,
float  v_max,
dt_masks_increment_t  increment,
int  flow,
const char *  toast_fmt,
float  toast_scale 
)

Update a mask configuration value and emit a toast message.

This is a convenience wrapper around dt_masks_get_set_conf_value() that keeps UI feedback consistent across mask types.

References dt_masks_get_set_conf_value(), dt_toast_log(), and value.

Referenced by _init_curvature(), _init_extent(), _init_hardness(), _init_hardness(), _init_hardness(), _init_opacity(), _init_opacity(), _init_opacity(), _init_opacity(), _init_rotation(), _init_rotation(), _init_size(), and _init_size().

◆ dt_masks_get_source_area()

int dt_masks_get_source_area ( dt_iop_module_t module,
dt_dev_pixelpipe_t pipe,
dt_dev_pixelpipe_iop_t piece,
dt_masks_form_t form,
int *  width,
int *  height,
int *  posx,
int *  posy 
)

◆ dt_masks_get_visible_form()

◆ dt_masks_group_add_form()

◆ dt_masks_group_get_hash()

◆ dt_masks_group_index_from_formid()

int dt_masks_group_index_from_formid ( const dt_masks_form_t group_form,
int  formid 
)

◆ dt_masks_group_render_roi()

int 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 
)

◆ dt_masks_group_ungroup()

◆ dt_masks_group_update_name()

◆ dt_masks_gui_change_affects_selected_node_or_all()

static gboolean dt_masks_gui_change_affects_selected_node_or_all ( const dt_masks_form_gui_t gui,
const int  index 
)
inlinestatic

◆ dt_masks_gui_cleanup()

void dt_masks_gui_cleanup ( struct dt_develop_t dev)

◆ dt_masks_gui_cursor_to_raw_norm()

◆ dt_masks_gui_delete()

gboolean dt_masks_gui_delete ( struct dt_iop_module_t module,
dt_masks_form_t form,
dt_masks_form_gui_t gui,
const int  parentid 
)

Delete a mask shape or node form from the GUI. This function is to be used with a popupmenu "Delete" action in the future.

Parameters
moduleThe module owning the mask
formThe form to delete
guiThe GUI state of the form
parentidThe parent ID of the form
Returns
gboolean TRUE if the form was deleted, FALSE otherwise

References _masks_remove_shape(), DT_MASKS_EDIT_FULL, dt_masks_form_cancel_creation(), DT_MASKS_IS_PATH_SHAPE, dt_masks_remove_node(), dt_masks_form_gui_t::edit_mode, FALSE, g_list_shorter_than(), dt_masks_form_gui_t::group_selected, dt_masks_form_gui_t::node_hovered, dt_masks_form_gui_t::node_selected, dt_masks_form_t::points, TRUE, and dt_masks_form_t::type.

Referenced by _group_events_key_pressed(), _masks_gui_remove_form_callback(), and dt_masks_events_key_pressed().

◆ dt_masks_gui_delta_from_raw_anchor()

static void dt_masks_gui_delta_from_raw_anchor ( dt_develop_t dev,
const dt_masks_form_gui_t gui,
const float  anchor[2],
float *  delta_x,
float *  delta_y 
)
inlinestatic

◆ dt_masks_gui_delta_to_image_abs()

static void dt_masks_gui_delta_to_image_abs ( const dt_masks_form_gui_t gui,
float  point[2] 
)
inlinestatic

◆ dt_masks_gui_delta_to_raw_norm()

◆ dt_masks_gui_form_create()

void dt_masks_gui_form_create ( dt_masks_form_t form,
dt_masks_form_gui_t gui,
int  index,
struct dt_iop_module_t module 
)

◆ dt_masks_gui_form_create_throttled()

◆ dt_masks_gui_form_remove()

◆ dt_masks_gui_form_save_creation()

◆ dt_masks_gui_form_test_create()

◆ dt_masks_gui_init()

◆ dt_masks_gui_is_dragging()

◆ dt_masks_gui_reset_dragging()

◆ dt_masks_gui_selected_handle_border_index()

static int dt_masks_gui_selected_handle_border_index ( const dt_masks_form_gui_t gui)
inlinestatic

◆ dt_masks_gui_selected_handle_index()

◆ dt_masks_gui_selected_node_index()

◆ dt_masks_gui_selected_segment_index()

static int dt_masks_gui_selected_segment_index ( const dt_masks_form_gui_t gui)
inlinestatic

◆ dt_masks_gui_set_dragging()

◆ dt_masks_gui_should_hit_test()

◆ dt_masks_gui_was_anything_selected()

◆ dt_masks_init_form_gui()

◆ dt_masks_iop_combo_populate()

◆ dt_masks_iop_update()

◆ dt_masks_iop_use_same_as()

◆ dt_masks_iop_value_changed_callback()

◆ dt_masks_is_anything_hovered()

gboolean dt_masks_is_anything_hovered ( const dt_masks_form_gui_t mask_gui)

◆ dt_masks_is_anything_selected()

◆ 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_node_is_cusp()

gboolean dt_masks_node_is_cusp ( const dt_masks_form_gui_points_t gpt,
const int  index 
)

returns wether a node is a corner or not. A node is a corner if its 2 control handles are at the same position, else it's a curve.

Parameters
gptthe GUI points of the mask form
indexthe index of the node to test
nbthe number of coord by node
coord_offsetthe offset of the coordinates in the points array
Returns
TRUE if the node is a corner, FALSE it's a curve.

References FALSE, dt_masks_form_gui_points_t::points, and dt_masks_form_gui_points_t::points_count.

Referenced by _brush_events_button_pressed(), _brush_events_post_expose(), _brush_populate_context_menu(), _polygon_events_button_pressed(), _polygon_events_post_expose(), _polygon_populate_context_menu(), dt_masks_find_closest_handle_common(), dt_masks_reset_bezier_ctrl_points(), and dt_masks_toggle_bezier_node_type().

◆ dt_masks_point_in_form_exact()

int dt_masks_point_in_form_exact ( const float *  test_points,
int  test_point_count,
const float *  form_points,
int  form_points_start,
int  form_points_count 
)

Check whether any 2D point in pts[] lies inside the form points[].

utils functions

We use the ray casting algorithm for each tested point.

Parameters
ptsFlat array of tested points [x0, y0, x1, y1, ...].
num_ptsNumber of tested points in pts.
pointsThe array of form vertices.
points_startThe starting index of the form vertices in the array.
points_countThe total number of vertices in the form.
Returns
int Index of the first tested point found inside the form, -1 otherwise.

References i.

Referenced by _circle_get_distance(), _ellipse_get_distance(), _polygon_get_distance(), and dt_masks_draw_source().

◆ dt_masks_point_is_within_radius()

gboolean dt_masks_point_is_within_radius ( const float  point_x,
const float  point_y,
const float  center_x,
const float  center_y,
const float  squared_radius 
)

Check if a point (px,py) is inside a radius from a center point (cx,cy)

Parameters
pxx coord of the point to test
pyy coord of the point to test
cxcenter x coord
cycenter y coord
radiusthe radius from center
Returns
gboolean TRUE if the point is inside the radius from center, FALSE otherwise

Check if a point (px,py) is inside a radius from a center point (cx,cy)

Assumptions/caveats:

  • Uses squared distance to avoid sqrt.
  • Callers must pass a squared radius (not the radius).

Referenced by dt_masks_find_closest_handle_common().

◆ dt_masks_preview_buffers_cleanup()

◆ dt_masks_project_on_line()

static void dt_masks_project_on_line ( const float  cursor[2],
const float  node[2],
const float  handle[2],
float  point[2] 
)
inlinestatic

References a, b, and denom.

Referenced by _brush_events_mouse_moved(), and _polygon_events_mouse_moved().

◆ dt_masks_read_masks_history()

◆ dt_masks_remove_form()

◆ dt_masks_remove_node()

◆ dt_masks_replace_current_forms()

◆ dt_masks_reset_bezier_ctrl_points()

static gboolean dt_masks_reset_bezier_ctrl_points ( struct dt_iop_module_t module,
struct dt_masks_form_t mask_form,
struct dt_masks_form_gui_t mask_gui,
const int  form_index,
const struct dt_masks_form_gui_points_t gui_points,
const int  node_index,
dt_masks_points_states_t state 
)
inlinestatic

◆ dt_masks_reset_form_gui()

◆ dt_masks_reset_show_masks_icons()

void dt_masks_reset_show_masks_icons ( void  )
Todo:
: this doesn't look right. Why do we break the while look as soon as one module has no blend_data?

References darktable, darktable_t::develop, DEVELOP_MASKS_NB_SHAPES, DT_MASKS_EDIT_OFF, FALSE, dt_develop_t::iop, IOP_FLAGS_SUPPORTS_BLENDING, and n.

Referenced by _tree_selection_change().

◆ dt_masks_reset_source()

static void dt_masks_reset_source ( dt_masks_form_t form)
inlinestatic

◆ dt_masks_rotate_with_anchor()

float dt_masks_rotate_with_anchor ( dt_develop_t develop,
const float  anchor[2],
const float  center[2],
dt_masks_form_gui_t mask_gui 
)

Rotate a mask shape around its center. WARNING: gui->delta will be updated with the new position after rotation.

Parameters
devthe develop structure
anchorthe current cursor position in absolute output-image coordinates.
centerthe origin point of rotation in absolute output-image coordinates.
guithe GUI form structure
Returns
* float : The signed angle to increment.

Rotate a mask shape around its center. WARNING: gui->delta will be updated with the new position after rotation.

anchor, center, and mask_gui->delta are absolute output-image coordinates. The angle accounts for possible axis inversion due to distortion transforms. Updates mask_gui->delta to store the last anchor position.

References dt_masks_form_gui_t::delta, dt_dev_coordinates_image_abs_to_raw_abs(), and M_PI.

Referenced by _ellipse_events_mouse_moved(), and _gradient_events_mouse_moved().

◆ dt_masks_roundup()

static int dt_masks_roundup ( int  num,
int  mult 
)
inlinestatic

Referenced by _circle_get_mask_roi().

◆ dt_masks_select_form()

void dt_masks_select_form ( struct dt_iop_module_t module,
dt_masks_form_t selected_form 
)

Select or clear the current mask form, notifying the owning module if needed.

allow to select a shape inside an iop

Passing NULL clears the selection.

References dt_masks_form_t::formid.

Referenced by _brush_events_button_released(), and dt_masks_clear_form_gui().

◆ dt_masks_set_ctrl_points()

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

◆ dt_masks_set_edit_mode()

◆ dt_masks_set_source_pos_initial_state()

void dt_masks_set_source_pos_initial_state ( dt_masks_form_gui_t mask_gui,
const uint32_t  key_state 
)

Decide initial source positioning mode for clone masks.

utils for selecting the source of a clone mask while creating it

Uses key modifiers to choose absolute vs. relative positioning, and stores the reference position in preview coordinates. The current implementation caches that reference in absolute output-image coordinates.

References DT_MASKS_SOURCE_POS_ABSOLUTE, DT_MASKS_SOURCE_POS_RELATIVE_TEMP, dt_modifier_is(), dt_masks_form_gui_t::pos, dt_masks_form_gui_t::pos_source, and dt_masks_form_gui_t::source_pos_type.

Referenced by _brush_events_button_pressed(), _circle_events_button_pressed(), _ellipse_events_button_pressed(), and _polygon_events_button_pressed().

◆ dt_masks_set_source_pos_initial_value()

void dt_masks_set_source_pos_initial_value ( dt_masks_form_gui_t mask_gui,
dt_masks_form_t mask_form 
)

Initialize the clone source position based on current GUI state.

Handles first-time relative positioning, existing relative offsets, and absolute coordinates. Updates mask_form->source accordingly. mask_gui->rel_pos is the normalized output-image cursor, while mask_gui->pos_source stores either an absolute output-image position or an absolute output-image delta depending on the current source mode.

References darktable, darktable_t::develop, dt_dev_coordinates_image_abs_to_raw_abs(), dt_dev_coordinates_image_abs_to_raw_norm(), dt_dev_coordinates_raw_abs_to_raw_norm(), DT_MASKS_SOURCE_POS_ABSOLUTE, DT_MASKS_SOURCE_POS_RELATIVE, DT_MASKS_SOURCE_POS_RELATIVE_TEMP, dt_masks_form_t::functions, dt_masks_functions_t::initial_source_pos, dt_masks_form_gui_t::pos, dt_masks_form_gui_t::pos_source, dt_develop_t::raw_height, dt_develop_t::raw_width, dt_develop_t::roi, dt_masks_form_t::source, and dt_masks_form_gui_t::source_pos_type.

Referenced by _brush_events_button_pressed(), _circle_init_new(), _ellipse_init_new(), and _polygon_events_button_pressed().

◆ dt_masks_set_visible_form()

◆ dt_masks_snapshot_current_forms()

GList * dt_masks_snapshot_current_forms ( dt_develop_t dev,
gboolean  reset_changed 
)

◆ dt_masks_soft_reset_form_gui()

◆ dt_masks_toggle_bezier_node_type()

static gboolean dt_masks_toggle_bezier_node_type ( struct dt_iop_module_t module,
struct dt_masks_form_t mask_form,
struct dt_masks_form_gui_t mask_gui,
const int  form_index,
const struct dt_masks_form_gui_points_t gui_points,
const int  node_index,
float  node[2],
float  ctrl1[2],
float  ctrl2[2],
dt_masks_points_states_t state 
)
inlinestatic

◆ 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

◆ dt_masks_translate_source()

static void dt_masks_translate_source ( dt_masks_form_t form,
const float  delta_x,
const float  delta_y 
)
inlinestatic

◆ dt_masks_version()

int dt_masks_version ( void  )

◆ dt_masks_write_masks_history_item()

Variable Documentation

◆ dt_masks_functions_brush

const dt_masks_functions_t dt_masks_functions_brush
extern

◆ dt_masks_functions_circle

const dt_masks_functions_t dt_masks_functions_circle
extern

the shape-specific function tables

Referenced by _circle_events_post_expose(), and dt_masks_create().

◆ dt_masks_functions_ellipse

const dt_masks_functions_t dt_masks_functions_ellipse
extern

◆ dt_masks_functions_gradient

const dt_masks_functions_t dt_masks_functions_gradient
extern

◆ dt_masks_functions_group

const dt_masks_functions_t dt_masks_functions_group
extern

Referenced by dt_masks_create().

◆ dt_masks_functions_polygon

const dt_masks_functions_t dt_masks_functions_polygon
extern