Blender  V2.93
mask_intern.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2011 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #include "ED_clip.h"
27 
28 struct Mask;
29 struct bContext;
30 struct wmOperatorType;
31 
32 /* internal exports only */
33 
34 /* mask_add.c */
39 
40 /* mask_ops.c */
41 struct Mask *ED_mask_new(struct bContext *C, const char *name);
42 struct MaskLayer *ED_mask_layer_ensure(struct bContext *C, bool *r_added_mask);
43 
44 void MASK_OT_new(struct wmOperatorType *ot);
45 void MASK_OT_layer_new(struct wmOperatorType *ot);
48 
51 
52 void MASK_OT_delete(struct wmOperatorType *ot);
53 
59 
61 
63 
64 void MASK_OT_duplicate(struct wmOperatorType *ot);
67 
68 /* mask_relationships.c */
71 
72 /* mask_select.c */
73 void MASK_OT_select(struct wmOperatorType *ot);
75 
83 
84 bool ED_mask_spline_select_check(const struct MaskSpline *spline);
85 bool ED_mask_layer_select_check(const struct MaskLayer *mask_layer);
86 bool ED_mask_select_check(const struct Mask *mask);
87 
88 void ED_mask_spline_select_set(struct MaskSpline *spline, const bool do_select);
89 void ED_mask_layer_select_set(struct MaskLayer *mask_layer, const bool do_select);
90 void ED_mask_select_toggle_all(struct Mask *mask, int action);
91 void ED_mask_select_flush_all(struct Mask *mask);
92 
93 /* mask_editor.c */
94 bool ED_maskedit_poll(struct bContext *C);
95 bool ED_maskedit_mask_poll(struct bContext *C);
96 
97 /* Generalized solution for preserving editor viewport when making changes while lock-to-selection
98  * is enabled.
99  * Any mask operator can use this API, without worrying that some editors do not have an idea of
100  * lock-to-selection. */
101 
102 typedef struct MaskViewLockState {
105 
108  const MaskViewLockState *state);
109 
110 /* mask_query.c */
112  struct Mask *mask,
113  const float normal_co[2],
114  int threshold,
115  bool feather,
116  float tangent[2],
117  const bool use_deform,
118  const bool use_project,
119  struct MaskLayer **r_mask_layer,
120  struct MaskSpline **r_spline,
121  struct MaskSplinePoint **r_point,
122  float *r_u,
123  float *r_score);
125  struct Mask *mask,
126  const float normal_co[2],
127  const float threshold,
128  struct MaskLayer **r_mask_layer,
129  struct MaskSpline **r_spline,
130  struct MaskSplinePoint **r_point,
131  struct MaskSplinePointUW **r_uw,
132  float *r_score);
134  struct Mask *mask,
135  const float normal_co[2],
136  const float threshold,
137  struct MaskLayer **r_mask_layer,
138  struct MaskSpline **r_spline,
139  eMaskWhichHandle *r_which_handle,
140  float *r_score);
141 
142 /* mask_shapekey.c */
eMaskWhichHandle
Definition: BKE_mask.h:46
#define C
Definition: RandGen.cpp:39
void ED_mask_select_flush_all(struct Mask *mask)
Definition: mask_select.c:165
void MASK_OT_select(struct wmOperatorType *ot)
Definition: mask_select.c:410
void MASK_OT_primitive_circle_add(struct wmOperatorType *ot)
Definition: mask_add.c:841
void MASK_OT_new(struct wmOperatorType *ot)
Definition: mask_ops.c:121
void MASK_OT_shape_key_clear(struct wmOperatorType *ot)
void MASK_OT_select_circle(struct wmOperatorType *ot)
Definition: mask_select.c:755
void MASK_OT_slide_point(struct wmOperatorType *ot)
Definition: mask_ops.c:915
void MASK_OT_hide_view_clear(struct wmOperatorType *ot)
Definition: mask_ops.c:1748
bool ED_maskedit_poll(struct bContext *C)
Definition: mask_edit.c:45
void MASK_OT_hide_view_set(struct wmOperatorType *ot)
Definition: mask_ops.c:1809
bool ED_maskedit_mask_poll(struct bContext *C)
Definition: mask_edit.c:61
void MASK_OT_duplicate(struct wmOperatorType *ot)
Definition: mask_ops.c:2055
void ED_mask_spline_select_set(struct MaskSpline *spline, const bool do_select)
Definition: mask_select.c:99
void ED_mask_view_lock_state_restore_no_jump(const struct bContext *C, const MaskViewLockState *state)
void MASK_OT_select_less(struct wmOperatorType *ot)
Definition: mask_select.c:994
void MASK_OT_slide_spline_curvature(struct wmOperatorType *ot)
Definition: mask_ops.c:1307
void MASK_OT_delete(struct wmOperatorType *ot)
Definition: mask_ops.c:1503
void MASK_OT_layer_new(struct wmOperatorType *ot)
Definition: mask_ops.c:157
void MASK_OT_select_linked_pick(struct wmOperatorType *ot)
Definition: mask_select.c:820
void MASK_OT_add_feather_vertex(struct wmOperatorType *ot)
Definition: mask_add.c:666
void MASK_OT_switch_direction(struct wmOperatorType *ot)
Definition: mask_ops.c:1562
struct MaskViewLockState MaskViewLockState
void MASK_OT_shape_key_rekey(struct wmOperatorType *ot)
void MASK_OT_handle_type_set(struct wmOperatorType *ot)
Definition: mask_ops.c:1695
void MASK_OT_normals_make_consistent(struct wmOperatorType *ot)
Definition: mask_ops.c:1625
void MASK_OT_shape_key_insert(struct wmOperatorType *ot)
Definition: mask_shapekey.c:77
struct MaskSplinePoint * ED_mask_point_find_nearest(const struct bContext *C, struct Mask *mask, const float normal_co[2], const float threshold, struct MaskLayer **r_mask_layer, struct MaskSpline **r_spline, eMaskWhichHandle *r_which_handle, float *r_score)
struct Mask * ED_mask_new(struct bContext *C, const char *name)
Definition: mask_ops.c:57
void MASK_OT_select_more(struct wmOperatorType *ot)
Definition: mask_select.c:974
void MASK_OT_copy_splines(struct wmOperatorType *ot)
Definition: mask_ops.c:2086
void MASK_OT_primitive_square_add(struct wmOperatorType *ot)
Definition: mask_add.c:872
void MASK_OT_shape_key_feather_reset(struct wmOperatorType *ot)
bool ED_mask_find_nearest_diff_point(const struct bContext *C, struct Mask *mask, const float normal_co[2], int threshold, bool feather, float tangent[2], const bool use_deform, const bool use_project, struct MaskLayer **r_mask_layer, struct MaskSpline **r_spline, struct MaskSplinePoint **r_point, float *r_u, float *r_score)
void ED_mask_layer_select_set(struct MaskLayer *mask_layer, const bool do_select)
Definition: mask_select.c:115
void MASK_OT_layer_remove(struct wmOperatorType *ot)
Definition: mask_ops.c:192
void MASK_OT_select_all(struct wmOperatorType *ot)
Definition: mask_select.c:234
void MASK_OT_feather_weight_clear(struct wmOperatorType *ot)
Definition: mask_ops.c:1861
void MASK_OT_parent_clear(struct wmOperatorType *ot)
void ED_mask_select_toggle_all(struct Mask *mask, int action)
Definition: mask_select.c:128
void MASK_OT_layer_move(struct wmOperatorType *ot)
Definition: mask_ops.c:1929
bool ED_mask_layer_select_check(const struct MaskLayer *mask_layer)
void MASK_OT_select_lasso(struct wmOperatorType *ot)
Definition: mask_select.c:637
struct MaskLayer * ED_mask_layer_ensure(struct bContext *C, bool *r_added_mask)
Definition: mask_ops.c:88
bool ED_mask_feather_find_nearest(const struct bContext *C, struct Mask *mask, const float normal_co[2], const float threshold, struct MaskLayer **r_mask_layer, struct MaskSpline **r_spline, struct MaskSplinePoint **r_point, struct MaskSplinePointUW **r_uw, float *r_score)
void MASK_OT_select_box(struct wmOperatorType *ot)
Definition: mask_select.c:514
void MASK_OT_cyclic_toggle(struct wmOperatorType *ot)
Definition: mask_ops.c:1347
bool ED_mask_spline_select_check(const struct MaskSpline *spline)
void ED_mask_view_lock_state_store(const struct bContext *C, MaskViewLockState *state)
bool ED_mask_select_check(const struct Mask *mask)
void MASK_OT_paste_splines(struct wmOperatorType *ot)
Definition: mask_ops.c:2130
void MASK_OT_select_linked(struct wmOperatorType *ot)
Definition: mask_select.c:875
void MASK_OT_add_vertex(struct wmOperatorType *ot)
Definition: mask_add.c:574
void MASK_OT_parent_set(struct wmOperatorType *ot)
static ulong state[N]
ClipViewLockState space_clip_state
Definition: mask_intern.h:103
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
wmOperatorType * ot
Definition: wm_files.c:3156