Skip to content
Draft
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ FILE(GLOB SOURCE_FILES
"develop/masks/group.c"
"develop/masks/masks.c"
"develop/masks/path.c"
"develop/masks/raster.c"
"develop/pixelpipe.c"
"develop/tiling.c"
"dtgtk/button.c"
Expand Down
4 changes: 2 additions & 2 deletions src/develop/blend.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ typedef enum dt_develop_mask_mode_t
DEVELOP_MASK_MASK = 1 << 1, // drawn mask
DEVELOP_MASK_CONDITIONAL = 1 << 2, // parametric mask
DEVELOP_MASK_RASTER = 1 << 3, // raster mask
DEVELOP_MASK_MASK_CONDITIONAL = (DEVELOP_MASK_MASK | DEVELOP_MASK_CONDITIONAL) // drawn & parametric
DEVELOP_MASK_MASK_CONDITIONAL = (DEVELOP_MASK_MASK | DEVELOP_MASK_CONDITIONAL) // drawn & parametric
} dt_develop_mask_mode_t;

typedef enum dt_develop_mask_combine_mode_t
Expand Down Expand Up @@ -282,7 +282,7 @@ extern const dt_introspection_type_enum_tuple_t dt_develop_combine_masks_names[]
extern const dt_introspection_type_enum_tuple_t dt_develop_feathering_guide_names[];
extern const dt_introspection_type_enum_tuple_t dt_develop_invert_mask_names[];

#define DEVELOP_MASKS_NB_SHAPES 5
#define DEVELOP_MASKS_NB_SHAPES 6

/** blend gui data */
typedef struct dt_iop_gui_blend_data_t
Expand Down
8 changes: 8 additions & 0 deletions src/develop/blend_gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -2789,6 +2789,14 @@ void dt_iop_gui_init_masks(GtkWidget *blendw, dt_iop_module_t *module)
FALSE, 0, 0,
dtgtk_cairo_paint_masks_eye, abox);

bd->masks_type[5] = DT_MASKS_RASTER;
bd->masks_shapes[5] = dt_iop_togglebutton_new(module, "blend`shapes",
N_("add raster"),
N_("add multiple raster mask"),
G_CALLBACK(_blendop_masks_add_shape),
FALSE, 0, 0,
dtgtk_cairo_paint_masks_circle, abox);

bd->masks_type[0] = DT_MASKS_GRADIENT;
bd->masks_shapes[0] = dt_iop_togglebutton_new(module, "blend`shapes",
N_("add gradient"),
Expand Down
13 changes: 12 additions & 1 deletion src/develop/masks.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ typedef enum dt_masks_type_t
DT_MASKS_GRADIENT = 1 << 4,
DT_MASKS_ELLIPSE = 1 << 5,
DT_MASKS_BRUSH = 1 << 6,
DT_MASKS_NON_CLONE = 1 << 7
DT_MASKS_NON_CLONE = 1 << 7,
DT_MASKS_RASTER = 1 << 8,
} dt_masks_type_t;

/**masts states */
Expand Down Expand Up @@ -196,6 +197,15 @@ typedef struct dt_masks_point_group_t
float opacity;
} dt_masks_point_group_t;

/** structure used to store information regarding raster mask */
typedef struct dt_masks_point_raster_t
{
int32_t sourceInstanceId;
dt_mask_id_t maskId;
int state;
float opacity;
} dt_masks_point_raster_t;

/** structure used to store pointers to the functions implementing operations on a mask shape */
/** plus a few per-class descriptive data items */
typedef struct dt_masks_functions_t
Expand Down Expand Up @@ -440,6 +450,7 @@ extern const dt_masks_functions_t dt_masks_functions_brush;
extern const dt_masks_functions_t dt_masks_functions_path;
extern const dt_masks_functions_t dt_masks_functions_gradient;
extern const dt_masks_functions_t dt_masks_functions_group;
extern const dt_masks_functions_t dt_masks_functions_raster;

/** init dt_masks_form_gui_t struct with default values */
void dt_masks_init_form_gui(dt_masks_form_gui_t *gui);
Expand Down
2 changes: 2 additions & 0 deletions src/develop/masks/masks.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,8 @@ dt_masks_form_t *dt_masks_create(const dt_masks_type_t type)
form->functions = &dt_masks_functions_gradient;
else if(type & DT_MASKS_GROUP)
form->functions = &dt_masks_functions_group;
else if(type & DT_MASKS_RASTER)
form->functions = &dt_masks_functions_raster;

if(form->functions && form->functions->sanitize_config)
form->functions->sanitize_config(type);
Expand Down
Loading
Loading