86 #define MIN_WINDOW_SIZE 128
194 bool skip_layer_check(
short fill_layer_mode,
int gpl_active_index,
int gpl_index);
205 bGPDframe *init_gpf = (all_frames) ? gpl->frames.first :
208 if (init_gpf ==
NULL) {
271 if ((gps->points ==
NULL) || (gps->totpoints < 2)) {
301 pt0 = &gps->points[gps->totpoints - 2];
302 pt1 = &gps->points[gps->totpoints - 1];
340 if ((!show_help) && (show_extend)) {
346 if ((show_help) && (!show_extend)) {
358 const float diff_mat[4][4],
362 const float thershold,
363 const float thickness)
373 const float extend_col[4] = {0.0f, 1.0f, 1.0f, 1.0f};
387 int cyclic_add = (cyclic) ? 1 : 0;
400 for (
int i = 0; i < totpoints; i++, pt++) {
405 col[3] =
alpha <= thershold ? 0.0f : 1.0f;
416 if (cyclic && totpoints > 2) {
432 uchar mouse_color[4] = {0, 0, 255, 255};
456 switch (fill_layer_mode) {
458 if (gpl_index != gpl_active_index) {
464 if (gpl_index != gpl_active_index + 1) {
470 if (gpl_index != gpl_active_index - 1) {
476 if (gpl_index <= gpl_active_index) {
482 if (gpl_index >= gpl_active_index) {
543 if (gpl == tgpf->
gpl) {
544 if ((gpl->actframe ==
NULL) || (gpl->actframe->framenum != tgpf->
active_cfra)) {
545 short add_frame_mode;
570 if ((gps->points ==
NULL) || (gps->totpoints < 2)) {
591 tgpw.
lthick = gpl->line_change;
624 bool is_ortho =
false;
648 char err_out[256] =
"unknown";
650 if (offscreen ==
NULL) {
651 printf(
"GPencil - Fill - Unable to create fill buffer\n");
660 float clip_start, clip_end;
678 float scale_x = (width_new -
width) / 2.0f;
679 float scale_y = (height_new -
height) / 2.0f;
681 viewplane.
xmin -= scale_x;
682 viewplane.
xmax += scale_x;
683 viewplane.
ymin -= scale_y;
684 viewplane.
ymax += scale_y;
721 const float ink[4] = {1.0f, 0.0f, 0.0f, 1.0f};
733 else if (ibuf->
rect) {
756 memcpy(r_col, &ibuf->
rect_float[idx * 4],
sizeof(
float[4]));
770 float *row = &ibuf->
rect_float[ibuf->
x * 4 * row_index];
771 return (row[0] == 0.0f && memcmp(row, row + 1, ((ibuf->
x * 4) - 1) *
sizeof(
float)) != 0);
794 const int extreme = limit - 1;
805 pt = index + (ibuf->
x * extreme);
806 if (pt <= maxpixel) {
808 if (rgba[0] == 1.0f) {
817 pt = index - (ibuf->
x * extreme);
820 if (rgba[0] == 1.0f) {
836 int row = index / ibuf->
x;
837 int lowpix = row * ibuf->
x;
838 int higpix = lowpix + ibuf->
x - 1;
841 pt = index - extreme;
844 if (rgba[0] == 1.0f) {
852 pt = index + extreme;
855 if (rgba[0] == 1.0f) {
863 return (
bool)(t_a && t_b);
878 const float fill_col[4] = {0.0f, 1.0f, 0.0f, 1.0f};
880 const int maxpixel = (ibuf->
x * ibuf->
y) - 1;
881 bool border_contact =
false;
888 for (
int i = 0; i < maxpixel; i++) {
890 if (rgba[2] == 1.0f) {
896 if ((index >= 0) && (index <= maxpixel)) {
925 if (rgba[3] == 0.5f) {
926 border_contact =
true;
930 if ((rgba[0] != 1.0f) && (rgba[1] != 1.0f)) {
943 if (
v + 1 <= maxpixel) {
950 if (
v + ibuf->
x <= maxpixel) {
957 if (
v - ibuf->
x >= 0) {
973 return border_contact;
981 const float fill_col[2][4] = {{1.0f, 0.0f, 0.0f, 0.5f}, {0.0f, 0.0f, 0.0f, 0.0f}};
985 const int coloridx = transparent ? 0 : 1;
988 for (idx = 0; idx < ibuf->
x; idx++) {
990 set_pixel(ibuf, idx, fill_col[coloridx]);
992 pixel = idx + (ibuf->
x * (ibuf->
y - 1));
993 set_pixel(ibuf, pixel, fill_col[coloridx]);
996 for (idx = 0; idx < ibuf->
y; idx++) {
998 set_pixel(ibuf, ibuf->
x * idx, fill_col[coloridx]);
1000 pixel = ibuf->
x * idx + (ibuf->
x - 1);
1001 set_pixel(ibuf, pixel, fill_col[coloridx]);
1015 const float fill_col[3][4] = {
1016 {1.0f, 0.0f, 0.0f, 1.0f}, {0.0f, 1.0f, 0.0f, 1.0f}, {0.0f, 0.0f, 0.0f, 0.0f}};
1019 const int maxpixel = (ibuf->
x * ibuf->
y) - 1;
1020 const int center = ibuf->
x / 2;
1022 for (
int v = maxpixel;
v != 0;
v--) {
1026 if (color[1] == 1.0f) {
1030 else if (color[0] == 1.0f) {
1034 int row =
v / ibuf->
x;
1035 int lowpix = row * ibuf->
x;
1036 int highpix = lowpix + ibuf->
x - 1;
1037 if ((
v > lowpix) && (
v < highpix)) {
1038 int offset = (
v % ibuf->
x <
center) ? 1 : -1;
1059 const float blue_col[4] = {0.0f, 0.0f, 1.0f, 1.0f};
1060 const float clear_col[4] = {1.0f, 0.0f, 0.0f, 1.0f};
1071 for (
int i = 0; i < tgpf->
sbuffer_used && point2D; i++, point2D++) {
1072 int image_idx = ibuf->
x * (int)point2D->
y + (
int)point2D->
x;
1079 for (
int idy = 0; idy < ibuf->
y; idy++) {
1082 for (
int idx = 0; idx < ibuf->
x; idx++) {
1083 int image_idx = ibuf->
x * idy + idx;
1086 if (rgba[2] == 1.0f) {
1095 else if (rgba[0] == 1.0f) {
1139 const float green[4] = {0.0f, 1.0f, 0.0f, 1.0f};
1142 for (
int row = 0; row < ibuf->
y; row++) {
1146 int maxpixel = (ibuf->
x * (row + 1)) - 1;
1147 int minpixel = ibuf->
x * row;
1149 for (
int v = maxpixel;
v != minpixel;
v--) {
1153 if (color[1] == 1.0f) {
1163 if (color[0] == 1.0f) {
1169 if (
v + 1 <= maxpixel) {
1172 if (color[0] == 1.0f) {
1178 if (
v + (ibuf->
x * 1) <= maxpixel) {
1179 index =
v + (ibuf->
x * 1);
1181 if (color[0] == 1.0f) {
1187 if (
v - (ibuf->
x * 1) >= 0) {
1188 index =
v - (ibuf->
x * 1);
1190 if (color[0] == 1.0f) {
1199 if (color[0] == 1.0f) {
1207 if (color[0] == 1.0f) {
1215 if (color[0] == 1.0f) {
1223 if (color[0] == 1.0f) {
1255 int first_co[2] = {-1, -1};
1256 int backtracked_co[2];
1257 int current_check_co[2];
1258 int prev_check_co[2];
1259 int backtracked_offset[1][2] = {{0, 0}};
1260 bool first_pixel =
false;
1261 bool start_found =
false;
1262 const int NEIGHBOR_COUNT = 8;
1264 const int offset[8][2] = {
1278 int imagesize = ibuf->
x * ibuf->
y;
1285 for (
int idx = imagesize - 1; idx != 0; idx--) {
1287 if (rgba[1] == 1.0f) {
1288 boundary_co[0] = idx % ibuf->
x;
1289 boundary_co[1] = idx / ibuf->
x;
1291 backtracked_co[0] = (idx - 1) % ibuf->
x;
1292 backtracked_co[1] = (idx - 1) / ibuf->
x;
1293 backtracked_offset[0][0] = backtracked_co[0] - boundary_co[0];
1294 backtracked_offset[0][1] = backtracked_co[1] - boundary_co[1];
1303 while (start_found) {
1304 int cur_back_offset = -1;
1305 for (
int i = 0; i < NEIGHBOR_COUNT; i++) {
1306 if (backtracked_offset[0][0] == offset[i][0] && backtracked_offset[0][1] == offset[i][1]) {
1308 cur_back_offset = i;
1314 while (loop < (NEIGHBOR_COUNT - 1) && cur_back_offset != -1) {
1315 int offset_idx = (cur_back_offset + 1) % NEIGHBOR_COUNT;
1316 current_check_co[0] = boundary_co[0] + offset[offset_idx][0];
1317 current_check_co[1] = boundary_co[1] + offset[offset_idx][1];
1319 int image_idx = ibuf->
x * current_check_co[1] + current_check_co[0];
1323 if (rgba[1] == 1.0f) {
1326 backtracked_offset[0][0] = backtracked_co[0] - boundary_co[0];
1327 backtracked_offset[0][1] = backtracked_co[1] - boundary_co[1];
1338 if ((boundary_co[0] == start_co[0] && boundary_co[1] == start_co[1]) ||
1339 (boundary_co[0] == first_co[0] && boundary_co[1] == first_co[1])) {
1362 if (totpoints == 0) {
1377 int depth_margin = 0;
1380 int mval_prev[2] = {0};
1381 int interp_depth = 0;
1382 int found_depth = 0;
1386 for (i = 0, ptc = tgpf->
sbuffer; i < totpoints; i++, ptc++) {
1395 tgpf->
region, mval_i, mval_prev, depth_margin + 1, tgpf->
depth_arr + i) == 0))) {
1396 interp_depth =
true;
1405 if (found_depth ==
false) {
1407 for (i = totpoints - 1; i >= 0; i--) {
1424 if (totpoints == 0) {
1440 point2D->
time = 0.0f;
1454 const bool is_camera = is_lock_axis_view && (tgpf->
rv3d->
persp ==
RV3D_CAMOB) && (!is_depth);
1457 if (brush ==
NULL) {
1522 const int def_nr = tgpf->
ob->
actdef - 1;
1530 for (
int i = 0; i < tgpf->
sbuffer_used && point2D; i++, point2D++, pt++) {
1555 if (dvert !=
NULL) {
1564 float reduce = 0.0f;
1565 float smoothfac = 1.0f;
1566 for (
int r = 0;
r < 1;
r++) {
1567 for (
int i = 0; i < gps->
totpoints; i++) {
1589 if ((!is_depth) && (((align_flag &
GP_PROJECT_VIEWSPACE) && is_lock_axis_view) || (is_camera))) {
1607 const char *status_str =
TIP_(
"Fill: ESC/RMB cancel, LMB Fill, Shift Draw on Back");
1617 const float ink[4] = {1.0f, 0.0f, 0.0f, 1.0f};
1627 if (region != tgpf->
region) {
1702 tgpf->
brush = brush;
1716 bmain, tgpf->
ob, brush);
1897 const float winx_half = tgpf->
region->
winx / 2.0f;
1898 const float winy_half = tgpf->
region->
winy / 2.0f;
1905 float objectbox_min[2], objectbox_max[2];
1912 float diff_mat[4][4];
1930 if ((gps->points ==
NULL) || (gps->totpoints < 2)) {
1944 float boundbox_min[2];
1945 float boundbox_max[2];
1953 &rect_bound, objectbox_min[0], objectbox_max[0], objectbox_min[1], objectbox_max[1]);
1959 if (rect_bound.
xmin < 0.0f) {
1967 if (rect_bound.
ymin < 0.0f) {
1979 if ((zoomx != 1.0f) || (zoomy != 1.0f)) {
2000 if ((!border_contact) || (is_inverted)) {
2009 int totpoints_prv = 0;
2011 while (totpoints > 0) {
2017 if (totpoints > 0) {
2043 if (totpoints < 3) {
2047 if (totpoints_prv == totpoints) {
2049 if (loop_limit > 3) {
2053 totpoints_prv = totpoints;
2080 const bool is_inverted = (is_brush_inv && !
event->ctrl) || (!is_brush_inv && event->
ctrl);
2087 switch (event->
type) {
2100 if ((tgpf->
oldkey != -1) || (!help_lines)) {
2104 bool in_bounds =
false;
2109 tgpf->
mouse[0] =
event->mval[0];
2110 tgpf->
mouse[1] =
event->mval[1];
2128 if (!is_multiedit) {
2151 int step = ((
float)i / (
float)total) * 100.0f;
2161 while ((!tgpf->
done) && (loop_limit < 2)) {
2172 if (tgpf->
zoom == 1.0f) {
2214 else if (do_extend) {
2217 tgpf->
oldkey =
event->type;
2262 ot->
name =
"Grease Pencil Fill";
2264 ot->
description =
"Fill with color the shape formed by strokes";
typedef float(TangentPoint)[2]
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
struct bGPdata * CTX_data_gpencil_data(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
void CTX_wm_operator_poll_msg_set(struct bContext *C, const char *msg)
struct Main * CTX_data_main(const bContext *C)
struct ToolSettings * CTX_data_tool_settings(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
struct bGPDlayer * BKE_gpencil_layer_active_get(struct bGPdata *gpd)
void BKE_gpencil_dvert_ensure(struct bGPDstroke *gps)
struct Material * BKE_gpencil_object_material_ensure_from_active_input_brush(struct Main *bmain, struct Object *ob, struct Brush *brush)
struct bGPDstroke * BKE_gpencil_stroke_new(int mat_idx, int totpoints, short thickness)
void BKE_gpencil_free_stroke(struct bGPDstroke *gps)
struct bGPDframe * BKE_gpencil_layer_frame_get(struct bGPDlayer *gpl, int cframe, eGP_GetFrame_Mode addnew)
int BKE_gpencil_object_material_get_index_from_brush(struct Object *ob, struct Brush *brush)
void BKE_gpencil_layer_transform_matrix_get(const struct Depsgraph *depsgraph, struct Object *obact, struct bGPDlayer *gpl, float diff_mat[4][4])
struct bGPDlayer * BKE_gpencil_layer_addnew(struct bGPdata *gpd, const char *name, bool setactive)
void BKE_gpencil_frame_selected_hash(struct bGPdata *gpd, struct GHash *r_list)
void BKE_gpencil_stroke_geometry_update(struct bGPdata *gpd, struct bGPDstroke *gps)
bool BKE_gpencil_stroke_smooth(struct bGPDstroke *gps, int i, float inf)
void BKE_gpencil_stroke_simplify_fixed(struct bGPdata *gpd, struct bGPDstroke *gps)
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
struct Image * BKE_image_add_from_imbuf(struct Main *bmain, struct ImBuf *ibuf, const char *name)
void BKE_id_free(struct Main *bmain, void *idv)
General operations, lookup, etc. for materials.
struct MaterialGPencilStyle * BKE_gpencil_material_settings(struct Object *ob, short act)
struct Material * BKE_object_material_get(struct Object *ob, short act)
struct Brush * BKE_paint_brush(struct Paint *paint)
void BKE_report(ReportList *reports, ReportType type, const char *message)
struct ARegion * BKE_area_find_region_xy(struct ScrArea *area, const int regiontype, int x, int y)
BLI_INLINE void * BLI_ghashIterator_getKey(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
#define GHASH_ITER(gh_iter_, ghash_)
unsigned int BLI_ghash_len(GHash *gh) ATTR_WARN_UNUSED_RESULT
GHash * BLI_ghash_int_new_ex(const char *info, const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
void perspective_m4(float mat[4][4], const float left, const float right, const float bottom, const float top, const float nearClip, const float farClip)
int interp_sparse_array(float *array, const int list_size, const float skipval)
void orthographic_m4(float mat[4][4], const float left, const float right, const float bottom, const float top, const float nearClip, const float farClip)
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
MINLINE void round_v2i_v2fl(int r[2], const float a[2])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void copy_v2fl_v2i(float r[2], const int a[2])
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
void minmax_v2v2_v2(float min[2], float max[2], const float vec[2])
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void add_v2_fl(float r[2], float f)
bool BLI_rctf_clamp(struct rctf *rect, const struct rctf *rect_bounds, float r_xy[2])
bool BLI_rcti_isect_pt(const struct rcti *rect, const int x, const int y)
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
void BLI_stack_pop(BLI_Stack *stack, void *dst) ATTR_NONNULL()
size_t BLI_stack_count(const BLI_Stack *stack) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLI_stack_push(BLI_Stack *stack, const void *src) ATTR_NONNULL()
bool BLI_stack_is_empty(const BLI_Stack *stack) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLI_stack_free(BLI_Stack *stack) ATTR_NONNULL()
#define BLI_stack_new(esize, descr)
#define INIT_MINMAX2(min, max)
#define POINTER_FROM_INT(i)
#define POINTER_AS_INT(i)
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
@ GP_BRUSH_FILL_SHOW_HELPLINES
@ GP_BRUSH_MATERIAL_PINNED
@ GP_BRUSH_FILL_SHOW_EXTENDLINES
@ GP_BRUSH_FILL_FIT_DISABLE
@ GP_FILL_GPLMODE_ALL_ABOVE
@ GP_FILL_GPLMODE_VISIBLE
@ GP_FILL_GPLMODE_ALL_BELOW
#define GPENCIL_MIN_FILL_FAC
#define GPENCIL_MULTIEDIT_SESSIONS_ON(gpd)
#define GPENCIL_MAX_FILL_FAC
Object is a sort of wrapper for general info.
@ GP_PROJECT_DEPTH_STROKE
@ GP_TOOL_FLAG_RETAIN_LAST
@ GP_TOOL_FLAG_PAINT_ONBACK
@ GP_TOOL_FLAG_CREATE_WEIGHTS
#define IS_AUTOKEY_ON(scene)
bool ED_operator_regionactive(struct bContext *C)
void ED_workspace_status_text(struct bContext *C, const char *str)
#define REGION_DRAW_POST_VIEW
void * ED_region_draw_cb_activate(struct ARegionType *art, void(*draw)(const struct bContext *, struct ARegion *, void *), void *customdata, int type)
void ED_region_draw_cb_exit(struct ARegionType *, void *)
bool ED_view3d_viewplane_get(struct Depsgraph *depsgraph, const struct View3D *v3d, const struct RegionView3D *rv3d, int winxi, int winyi, struct rctf *r_viewplane, float *r_clipsta, float *r_clipend, float *r_pixsize)
void ED_view3d_update_viewmat(struct Depsgraph *depsgraph, const struct Scene *scene, struct View3D *v3d, struct ARegion *region, const float viewmat[4][4], const float winmat[4][4], const struct rcti *rect, bool offscreen)
void ED_view3d_depth_override(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, struct Object *obact, eV3DDepthOverrideMode mode, bool update_cache)
void view3d_region_operator_needs_opengl(struct wmWindow *win, struct ARegion *region)
bool ED_view3d_autodist_depth_seg(struct ARegion *region, const int mval_sta[2], const int mval_end[2], int margin, float *depth)
bool ED_view3d_autodist_depth(struct ARegion *region, const int mval[2], int margin, float *depth)
NSNotificationCenter * center
_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 GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_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
_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 type
_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 green
void GPU_matrix_pop(void)
void GPU_matrix_identity_projection_set(void)
void GPU_matrix_pop_projection(void)
#define GPU_matrix_set(x)
void GPU_matrix_push(void)
#define GPU_matrix_projection_set(x)
void GPU_matrix_identity_set(void)
void GPU_matrix_push_projection(void)
@ GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR
@ GPU_SHADER_3D_FLAT_COLOR
void GPU_blend(eGPUBlend blend)
void GPU_line_width(float width)
void GPU_depth_mask(bool depth)
void GPU_point_size(float size)
struct ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, unsigned char planes, unsigned int flags)
void IMB_rect_from_float(struct ImBuf *ibuf)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
Group RGB to Bright Vector Camera CLAMP
#define ND_SPACE_PROPERTIES
ATTR_WARN_UNUSED_RESULT BMesh * bm
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
static CCL_NAMESPACE_BEGIN const double alpha
void ED_gpencil_draw_fill(tGPDdraw *tgpw)
static int gpencil_fill_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static void gpencil_zoom_level_set(tGPDfill *tgpf)
static bool is_row_filled(const ImBuf *ibuf, const int row_index)
static bool is_leak_narrow(ImBuf *ibuf, const int maxpixel, int limit, int index, int type)
static void gpencil_fill_status_indicators(bContext *C)
void GPENCIL_OT_fill(wmOperatorType *ot)
static bool gpencil_do_frame_fill(tGPDfill *tgpf, const bool is_inverted)
static bool gpencil_stroke_is_drawable(tGPDfill *tgpf, bGPDstroke *gps)
static void gpencil_draw_datablock(tGPDfill *tgpf, const float ink[4])
static int gpencil_fill_init(bContext *C, wmOperator *op)
static void gpencil_draw_boundary_lines(const struct bContext *UNUSED(C), struct tGPDfill *tgpf)
static bool gpencil_boundaryfill_area(tGPDfill *tgpf)
static void gpencil_draw_basic_stroke(tGPDfill *tgpf, bGPDstroke *gps, const float diff_mat[4][4], const bool cyclic, const float ink[4], const int flag, const float thershold, const float thickness)
bool skip_layer_check(short fill_layer_mode, int gpl_active_index, int gpl_index)
static void get_pixel(const ImBuf *ibuf, const int idx, float r_col[4])
static void gpencil_fill_exit(bContext *C, wmOperator *op)
static void gpencil_invert_image(tGPDfill *tgpf)
static void set_pixel(ImBuf *ibuf, int idx, const float col[4])
static void gpencil_update_extend(tGPDfill *tgpf)
static int gpencil_fill_modal(bContext *C, wmOperator *op, const wmEvent *event)
static bool gpencil_fill_poll(bContext *C)
static void gpencil_fill_draw_3d(const bContext *C, ARegion *UNUSED(region), void *arg)
static void gpencil_fill_cancel(bContext *C, wmOperator *op)
static void gpencil_erase_processed_area(tGPDfill *tgpf)
static void gpencil_get_outline_points(tGPDfill *tgpf, const bool dilate)
static tGPDfill * gpencil_session_init_fill(bContext *C, wmOperator *op)
static void draw_mouse_position(tGPDfill *tgpf)
static int gpencil_points_from_stack(tGPDfill *tgpf)
static void gpencil_stroke_from_buffer(tGPDfill *tgpf)
static bool dilate_shape(ImBuf *ibuf)
static bool gpencil_render_offscreen(tGPDfill *tgpf)
static void gpencil_get_depth_array(tGPDfill *tgpf)
static void gpencil_create_extensions(tGPDfill *tgpf)
static void gpencil_delete_temp_stroke_extension(tGPDfill *tgpf, const bool all_frames)
static void gpencil_set_borders(tGPDfill *tgpf, const bool transparent)
static void extrapolate_points_by_length(bGPDspoint *a, bGPDspoint *b, float length, float r_point[3])
void gpencil_undo_init(struct bGPdata *gpd)
void gpencil_point_conversion_init(struct bContext *C, GP_SpaceConversion *r_gsc)
void gpencil_apply_parent_point(struct Depsgraph *depsgraph, struct Object *obact, bGPDlayer *gpl, bGPDspoint *pt)
void gpencil_undo_push(struct bGPdata *gpd)
void gpencil_undo_finish(void)
void gpencil_stroke_convertcoords_tpoint(struct Scene *scene, struct ARegion *region, struct Object *ob, const struct tGPspoint *point2D, float *depth, float out[3])
void ED_gpencil_projected_2d_bound_box(GP_SpaceConversion *gsc, bGPDstroke *gps, const float diff_mat[4][4], float r_min[2], float r_max[2])
void ED_gpencil_project_stroke_to_plane(const Scene *scene, const Object *ob, const RegionView3D *rv3d, bGPDlayer *gpl, bGPDstroke *gps, const float origin[3], const int axis)
void ED_gpencil_project_stroke_to_view(bContext *C, bGPDlayer *gpl, bGPDstroke *gps)
void ED_gpencil_fill_vertex_color_set(ToolSettings *ts, Brush *brush, bGPDstroke *gps)
void ED_gpencil_point_vertex_color_set(ToolSettings *ts, Brush *brush, bGPDspoint *pt, tGPspoint *tpt)
void ED_gpencil_drawing_reference_get(const Scene *scene, const Object *ob, char align_flag, float r_vec[3])
void GPU_offscreen_free(GPUOffScreen *ofs)
void GPU_offscreen_unbind(GPUOffScreen *UNUSED(ofs), bool restore)
void GPU_offscreen_read_pixels(GPUOffScreen *ofs, eGPUDataFormat format, void *pixels)
void GPU_clear_color(float red, float green, float blue, float alpha)
GPUOffScreen * GPU_offscreen_create(int width, int height, bool depth, bool high_bitdepth, char err_out[256])
void GPU_clear_depth(float depth)
void GPU_offscreen_bind(GPUOffScreen *ofs, bool save)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
struct ARegionType * type
struct Material * material
struct BrushGpencilSettings * gpencil_settings
struct MaterialGPencilStyle * gp_style
struct ToolSettings * toolsettings
struct MDeformVert * dvert
struct Depsgraph * depsgraph
struct RegionView3D * rv3d
struct ReportList * reports
struct Depsgraph * depsgraph
struct RegionView3D * rv3d
struct bGPDstroke * gps_mouse
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
void(* cancel)(struct bContext *, struct wmOperator *)
struct ReportList * reports
__forceinline const avxi abs(const avxi &a)
ccl_device_inline float3 ceil(const float3 &a)
void WM_cursor_modal_set(wmWindow *win, int val)
void WM_cursor_modal_restore(wmWindow *win)
void WM_cursor_time(wmWindow *win, int nr)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)