Blender  V3.3
ED_mask.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2012 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 #include "DNA_mask_types.h"
15 
16 struct Depsgraph;
17 struct KeyframeEditData;
18 struct MaskLayer;
19 struct MaskLayerShape;
20 struct bContext;
21 struct wmKeyConfig;
22 
23 /* mask_edit.c */
24 
25 /* Returns true when the following conditions are met:
26  * - Current space supports mask editing.
27  * - The space is configured to interact with mask.
28  *
29  * It is not required to have mask opened for editing. */
30 bool ED_maskedit_poll(struct bContext *C);
31 
32 /* Returns true when the following conditions are met:
33  * - Current space supports mask editing.
34  * - The space is configured to interact with mask.
35  * - Mask has visible and editable splines.
36  *
37  * It is not required to have mask opened for editing. */
39 
40 /* Returns true when the following conditions are met:
41  * - Current space supports mask editing.
42  * - The space is configured to interact with mask.
43  * - The space has mask open for editing. */
44 bool ED_maskedit_mask_poll(struct bContext *C);
45 
46 /* Returns true when the following conditions are met:
47  * - Current space supports mask editing.
48  * - The space is configured to interact with mask.
49  * - The space has mask opened.
50  * - Mask has visible and editable splines. */
52 
53 void ED_mask_deselect_all(const struct bContext *C);
54 
55 void ED_operatortypes_mask(void);
56 void ED_keymap_mask(struct wmKeyConfig *keyconf);
57 void ED_operatormacros_mask(void);
58 
59 /* mask_query.c */
60 
61 void ED_mask_get_size(struct ScrArea *area, int *width, int *height);
62 void ED_mask_zoom(struct ScrArea *area, struct ARegion *region, float *zoomx, float *zoomy);
63 void ED_mask_get_aspect(struct ScrArea *area, struct ARegion *region, float *aspx, float *aspy);
64 
66  struct ARegion *region,
67  float *scalex,
68  float *scaley);
72 void ED_mask_mouse_pos(struct ScrArea *area,
73  struct ARegion *region,
74  const int mval[2],
75  float co[2]);
76 
82  struct ScrArea *area, struct ARegion *region, float x, float y, float *xr, float *yr);
84  struct ScrArea *area, struct ARegion *region, float x, float y, float *xr, float *yr);
85 
86 void ED_mask_cursor_location_get(struct ScrArea *area, float cursor[2]);
87 bool ED_mask_selected_minmax(const struct bContext *C,
88  float min[2],
89  float max[2],
90  bool handles_as_control_point);
91 
92 /* mask_draw.c */
93 
99  struct Mask *mask,
100  struct ARegion *region,
101  char draw_flag,
102  char draw_type,
103  eMaskOverlayMode overlay_mode,
104  float blend_factor,
105  int width_i,
106  int height_i,
107  float aspx,
108  float aspy,
109  bool do_scale_applied,
110  bool do_draw_cb,
111  float stabmat[4][4],
112  const struct bContext *C);
113 
114 void ED_mask_draw_frames(struct Mask *mask, struct ARegion *region, int cfra, int sfra, int efra);
115 
116 /* mask_shapekey.c */
117 
118 void ED_mask_layer_shape_auto_key(struct MaskLayer *mask_layer, int frame);
119 bool ED_mask_layer_shape_auto_key_all(struct Mask *mask, int frame);
120 bool ED_mask_layer_shape_auto_key_select(struct Mask *mask, int frame);
121 
122 /* ----------- Mask AnimEdit API ------------------ */
123 
127 bool ED_masklayer_frames_looper(struct MaskLayer *mask_layer,
128  struct Scene *scene,
129  bool (*mask_layer_shape_cb)(struct MaskLayerShape *,
130  struct Scene *));
134 void ED_masklayer_make_cfra_list(struct MaskLayer *mask_layer, ListBase *elems, bool onlysel);
135 
139 bool ED_masklayer_frame_select_check(const struct MaskLayer *mask_layer);
143 void ED_masklayer_frame_select_set(struct MaskLayer *mask_layer, short mode);
147 void ED_masklayer_frames_select_box(struct MaskLayer *mask_layer,
148  float min,
149  float max,
150  short select_mode);
155  struct MaskLayer *mask_layer,
156  short tool,
157  short select_mode);
161 void ED_mask_select_frames(struct MaskLayer *mask_layer, short select_mode);
165 void ED_mask_select_frame(struct MaskLayer *mask_layer, int selx, short select_mode);
166 
170 bool ED_masklayer_frames_delete(struct MaskLayer *mask_layer);
174 void ED_masklayer_frames_duplicate(struct MaskLayer *mask_layer);
175 
179 void ED_masklayer_snap_frames(struct MaskLayer *mask_layer, struct Scene *scene, short mode);
180 
181 #if 0
182 void free_gpcopybuf(void);
183 void copy_gpdata(void);
184 void paste_gpdata(void);
185 
186 void mirror_masklayer_frames(struct MaskLayer *mask_layer, short mode);
187 #endif
188 
189 #ifdef __cplusplus
190 }
191 #endif
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
eMaskOverlayMode
bool ED_masklayer_frame_select_check(const struct MaskLayer *mask_layer)
void ED_mask_deselect_all(const struct bContext *C)
void ED_mask_draw_frames(struct Mask *mask, struct ARegion *region, int cfra, int sfra, int efra)
Definition: mask_draw.c:773
void ED_masklayer_frame_select_set(struct MaskLayer *mask_layer, short mode)
void ED_mask_get_aspect(struct ScrArea *area, struct ARegion *region, float *aspx, float *aspy)
bool ED_maskedit_mask_visible_splines_poll(struct bContext *C)
Definition: mask_edit.c:77
bool ED_maskedit_poll(struct bContext *C)
Definition: mask_edit.c:29
void ED_masklayer_frames_duplicate(struct MaskLayer *mask_layer)
void ED_operatormacros_mask(void)
Definition: mask_edit.c:169
bool ED_maskedit_mask_poll(struct bContext *C)
Definition: mask_edit.c:61
void ED_mask_zoom(struct ScrArea *area, struct ARegion *region, float *zoomx, float *zoomy)
Definition: mask_query.c:708
void ED_mask_select_frames(struct MaskLayer *mask_layer, short select_mode)
bool ED_masklayer_frames_delete(struct MaskLayer *mask_layer)
void ED_masklayer_frames_select_region(struct KeyframeEditData *ked, struct MaskLayer *mask_layer, short tool, short select_mode)
bool ED_mask_layer_shape_auto_key_select(struct Mask *mask, int frame)
void ED_mask_point_pos__reverse(struct ScrArea *area, struct ARegion *region, float x, float y, float *xr, float *yr)
Definition: mask_query.c:548
bool ED_mask_layer_shape_auto_key_all(struct Mask *mask, int frame)
void ED_mask_mouse_pos(struct ScrArea *area, struct ARegion *region, const int mval[2], float co[2])
Definition: mask_query.c:478
void ED_masklayer_snap_frames(struct MaskLayer *mask_layer, struct Scene *scene, short mode)
bool ED_masklayer_frames_looper(struct MaskLayer *mask_layer, struct Scene *scene, bool(*mask_layer_shape_cb)(struct MaskLayerShape *, struct Scene *))
void ED_masklayer_frames_select_box(struct MaskLayer *mask_layer, float min, float max, short select_mode)
void ED_mask_pixelspace_factor(struct ScrArea *area, struct ARegion *region, float *scalex, float *scaley)
Definition: mask_query.c:770
bool ED_mask_selected_minmax(const struct bContext *C, float min[2], float max[2], bool handles_as_control_point)
void ED_masklayer_make_cfra_list(struct MaskLayer *mask_layer, ListBase *elems, bool onlysel)
bool ED_maskedit_visible_splines_poll(struct bContext *C)
Definition: mask_edit.c:45
void ED_mask_cursor_location_get(struct ScrArea *area, float cursor[2])
Definition: mask_query.c:813
void ED_keymap_mask(struct wmKeyConfig *keyconf)
Definition: mask_edit.c:163
void ED_mask_select_frame(struct MaskLayer *mask_layer, int selx, short select_mode)
void ED_mask_point_pos(struct ScrArea *area, struct ARegion *region, float x, float y, float *xr, float *yr)
Definition: mask_query.c:511
void ED_mask_draw_region(struct Depsgraph *depsgraph, struct Mask *mask, struct ARegion *region, char draw_flag, char draw_type, eMaskOverlayMode overlay_mode, float blend_factor, int width_i, int height_i, float aspx, float aspy, bool do_scale_applied, bool do_draw_cb, float stabmat[4][4], const struct bContext *C)
void ED_mask_layer_shape_auto_key(struct MaskLayer *mask_layer, int frame)
void ED_operatortypes_mask(void)
Definition: mask_edit.c:99
void ED_mask_get_size(struct ScrArea *area, int *width, int *height)
Definition: mask_query.c:674
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
#define C
Definition: RandGen.cpp:25
Scene scene
const Depsgraph * depsgraph
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
Definition: math_float4.h:513
static void area(int d1, int d2, int e1, int e2, float weights[2])
#define min(a, b)
Definition: sort.c:35
float max