Blender  V3.3
Classes | Macros | Typedefs | Enumerations | Functions
gpencil_fill.c File Reference
#include <stdio.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
#include "BLI_math.h"
#include "BLI_stack.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "DNA_brush_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_image_types.h"
#include "DNA_material_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_windowmanager_types.h"
#include "BKE_brush.h"
#include "BKE_context.h"
#include "BKE_deform.h"
#include "BKE_gpencil.h"
#include "BKE_gpencil_geom.h"
#include "BKE_image.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_paint.h"
#include "BKE_report.h"
#include "BKE_screen.h"
#include "ED_gpencil.h"
#include "ED_keyframing.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "ED_view3d.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "GPU_framebuffer.h"
#include "GPU_immediate.h"
#include "GPU_matrix.h"
#include "GPU_state.h"
#include "UI_interface.h"
#include "WM_api.h"
#include "WM_types.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "gpencil_intern.h"

Go to the source code of this file.

Classes

struct  tGPDfill
 

Macros

#define LEAK_HORZ   0
 
#define LEAK_VERT   1
 
#define MIN_WINDOW_SIZE   128
 
#define FILL_DEBUG   0
 
#define IS_GREEN   (color[1] == 1.0f)
 
#define IS_NOT_GREEN   (color[1] != 1.0f)
 
#define IS_GREEN   (color[1] == 1.0f)
 
#define IS_NOT_GREEN   (color[1] != 1.0f)
 

Typedefs

typedef struct tGPDfill tGPDfill
 

Enumerations

enum  { GP_DRAWFILLS_NOSTATUS = (1 << 0) , GP_DRAWFILLS_ONLY3D = (1 << 1) }
 

Functions

bool skip_layer_check (short fill_layer_mode, int gpl_active_index, int gpl_index)
 
static void gpencil_draw_boundary_lines (const struct bContext *UNUSED(C), struct tGPDfill *tgpf)
 
static void gpencil_delete_temp_stroke_extension (tGPDfill *tgpf, const bool all_frames)
 
static void extrapolate_points_by_length (bGPDspoint *a, bGPDspoint *b, float length, float r_point[3])
 
static void gpencil_create_extensions (tGPDfill *tgpf)
 
static void gpencil_update_extend (tGPDfill *tgpf)
 
static bool gpencil_stroke_is_drawable (tGPDfill *tgpf, bGPDstroke *gps)
 
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)
 
static void draw_mouse_position (tGPDfill *tgpf)
 
static void gpencil_draw_datablock (tGPDfill *tgpf, const float ink[4])
 
static bool gpencil_render_offscreen (tGPDfill *tgpf)
 
static void get_pixel (const ImBuf *ibuf, const int idx, float r_col[4])
 
static void set_pixel (ImBuf *ibuf, int idx, const float col[4])
 
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 bool gpencil_boundaryfill_area (tGPDfill *tgpf)
 
static void gpencil_set_borders (tGPDfill *tgpf, const bool transparent)
 
static void gpencil_invert_image (tGPDfill *tgpf)
 
static void gpencil_erase_processed_area (tGPDfill *tgpf)
 
static bool dilate_shape (ImBuf *ibuf)
 
static bool contract_shape (ImBuf *ibuf)
 
static void gpencil_get_outline_points (tGPDfill *tgpf, const bool dilate)
 
static void gpencil_get_depth_array (tGPDfill *tgpf)
 
static int gpencil_points_from_stack (tGPDfill *tgpf)
 
static void gpencil_stroke_from_buffer (tGPDfill *tgpf)
 
static void gpencil_fill_status_indicators (bContext *C)
 
static void gpencil_draw_boundary_lines (const bContext *UNUSED(C), tGPDfill *tgpf)
 
static void gpencil_fill_draw_3d (const bContext *C, ARegion *UNUSED(region), void *arg)
 
static bool gpencil_fill_poll (bContext *C)
 
static tGPDfillgpencil_session_init_fill (bContext *C, wmOperator *op)
 
static void gpencil_fill_exit (bContext *C, wmOperator *op)
 
static void gpencil_fill_cancel (bContext *C, wmOperator *op)
 
static int gpencil_fill_init (bContext *C, wmOperator *op)
 
static int gpencil_fill_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 
static void gpencil_zoom_level_set (tGPDfill *tgpf)
 
static bool gpencil_find_and_mark_empty_areas (tGPDfill *tgpf)
 
static bool gpencil_do_frame_fill (tGPDfill *tgpf, const bool is_inverted)
 
static int gpencil_fill_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
void GPENCIL_OT_fill (wmOperatorType *ot)
 

Macro Definition Documentation

◆ FILL_DEBUG

#define FILL_DEBUG   0

Definition at line 73 of file gpencil_fill.c.

◆ IS_GREEN [1/2]

#define IS_GREEN   (color[1] == 1.0f)

◆ IS_GREEN [2/2]

#define IS_GREEN   (color[1] == 1.0f)

◆ IS_NOT_GREEN [1/2]

#define IS_NOT_GREEN   (color[1] != 1.0f)

◆ IS_NOT_GREEN [2/2]

#define IS_NOT_GREEN   (color[1] != 1.0f)

◆ LEAK_HORZ

#define LEAK_HORZ   0

Definition at line 68 of file gpencil_fill.c.

◆ LEAK_VERT

#define LEAK_VERT   1

Definition at line 69 of file gpencil_fill.c.

◆ MIN_WINDOW_SIZE

#define MIN_WINDOW_SIZE   128

Definition at line 70 of file gpencil_fill.c.

Typedef Documentation

◆ tGPDfill

typedef struct tGPDfill tGPDfill

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
GP_DRAWFILLS_NOSTATUS 
GP_DRAWFILLS_ONLY3D 

Definition at line 76 of file gpencil_fill.c.

Function Documentation

◆ contract_shape()

static bool contract_shape ( ImBuf ibuf)
static

Contract

Contract green areas to scale down the size. Using stack prevents creep when replacing colors directly.

Definition at line 1231 of file gpencil_fill.c.

References BLI_stack_free(), BLI_stack_is_empty(), BLI_stack_new, BLI_stack_pop(), BLI_stack_push(), clear(), color, get_pixel(), IS_GREEN, IS_NOT_GREEN, is_row_filled(), set_pixel(), v, ImBuf::x, and ImBuf::y.

Referenced by gpencil_get_outline_points().

◆ dilate_shape()

static bool dilate_shape ( ImBuf ibuf)
static

Naive dilate

Expand green areas into enclosing red or transparent areas. Using stack prevents creep when replacing colors directly.

-----------
 XXXXXXX
 XoooooX
 XXooXXX
  XXXX
-----------

Definition at line 1111 of file gpencil_fill.c.

References BLI_stack_free(), BLI_stack_is_empty(), BLI_stack_new, BLI_stack_pop(), BLI_stack_push(), bm, color, get_pixel(), green, IS_GREEN, IS_NOT_GREEN, is_row_filled(), set_pixel(), v, ImBuf::x, and ImBuf::y.

Referenced by gpencil_get_outline_points().

◆ draw_mouse_position()

static void draw_mouse_position ( tGPDfill tgpf)
static

◆ extrapolate_points_by_length()

static void extrapolate_points_by_length ( bGPDspoint a,
bGPDspoint b,
float  length,
float  r_point[3] 
)
static

◆ get_pixel()

static void get_pixel ( const ImBuf ibuf,
const int  idx,
float  r_col[4] 
)
static

◆ gpencil_boundaryfill_area()

static bool gpencil_boundaryfill_area ( tGPDfill tgpf)
static

Boundary fill inside strokes Fills the space created by a set of strokes using the stroke color as the boundary of the shape to fill.

Parameters
tgpfTemporary fill data.

The fill use a stack to save the pixel list instead of the common recursive 4-contact point method. The problem with recursive calls is that for big fill areas, we can get max limit of recursive calls and STACK_OVERFLOW error.

The 4-contact point analyze the pixels to the left, right, bottom and top

-----------
|    X    |
|   XoX   |
|    X    |
-----------

Definition at line 860 of file gpencil_fill.c.

References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), BLI_stack_free(), BLI_stack_is_empty(), BLI_stack_new, BLI_stack_pop(), BLI_stack_push(), FILL_DEBUG, tGPDfill::fill_leak, get_pixel(), Image::id, tGPDfill::ima, is_leak_narrow(), LEAK_HORZ, LEAK_VERT, LIB_TAG_DOIT, lock, NULL, usdtokens::rgba(), set_pixel(), ID::tag, v, ImBuf::x, and ImBuf::y.

Referenced by gpencil_do_frame_fill().

◆ gpencil_create_extensions()

static void gpencil_create_extensions ( tGPDfill tgpf)
static

◆ gpencil_delete_temp_stroke_extension()

static void gpencil_delete_temp_stroke_extension ( tGPDfill tgpf,
const bool  all_frames 
)
static

◆ gpencil_do_frame_fill()

static bool gpencil_do_frame_fill ( tGPDfill tgpf,
const bool  is_inverted 
)
static

◆ gpencil_draw_basic_stroke()

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

◆ gpencil_draw_boundary_lines() [1/2]

static void gpencil_draw_boundary_lines ( const bContext UNUSEDC,
tGPDfill tgpf 
)
static

Definition at line 1685 of file gpencil_fill.c.

References tGPDfill::gpd, and gpencil_draw_datablock().

◆ gpencil_draw_boundary_lines() [2/2]

static void gpencil_draw_boundary_lines ( const struct bContext UNUSEDC,
struct tGPDfill tgpf 
)
static

Referenced by gpencil_fill_draw_3d().

◆ gpencil_draw_datablock()

static void gpencil_draw_datablock ( tGPDfill tgpf,
const float  ink[4] 
)
static

Definition at line 482 of file gpencil_fill.c.

References tGPDfill::active_cfra, BKE_gpencil_layer_active_get(), BKE_gpencil_layer_frame_get(), BKE_gpencil_layer_transform_matrix_get(), BKE_gpencil_material_settings(), BLI_assert, BLI_findindex(), tGPDfill::brush, copy_v4_v4(), tGPDdraw::custonion, tGPDfill::depsgraph, tGPDdraw::depsgraph, tGPDdraw::dflag, tGPDdraw::diff_mat, tGPDdraw::disable_fill, draw_mouse_position(), ED_gpencil_draw_fill(), ELEM, tGPDfill::fill_draw_mode, BrushGpencilSettings::fill_layer_mode, tGPDfill::fill_threshold, tGPDfill::flag, MaterialGPencilStyle::flag, GP_DRAWFILLS_NOSTATUS, GP_DRAWFILLS_ONLY3D, GP_FILL_DMODE_BOTH, GP_FILL_DMODE_CONTROL, GP_FILL_DMODE_STROKE, GP_GETFRAME_ADD_COPY, GP_GETFRAME_ADD_NEW, GP_GETFRAME_USE_PREV, GP_LAYER_HIDE, GP_MATERIAL_HIDE, GP_STROKE_CYCLIC, GP_STROKE_NOFILL, GP_STROKE_TAG, GP_TOOL_FLAG_RETAIN_LAST, tGPDfill::gpd, tGPDdraw::gpd, gpencil_draw_basic_stroke(), ToolSettings::gpencil_flags, Brush::gpencil_settings, gpencil_stroke_is_drawable(), tGPDdraw::gpf, tGPDfill::gpl, tGPDdraw::gpl, tGPDdraw::gps, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, IS_AUTOKEY_ON, tGPDdraw::is_fill_stroke, bGPdata::layers, LISTBASE_FOREACH, tGPDdraw::lthick, NULL, tGPDfill::ob, tGPDdraw::ob, tGPDdraw::offsx, tGPDdraw::offsy, tGPDdraw::onion, tGPDdraw::opacity, tGPDfill::rv3d, tGPDdraw::rv3d, tGPDfill::scene, tGPDfill::sizex, tGPDfill::sizey, skip_layer_check(), bGPDframe::strokes, tGPDdraw::t_gpf, tGPDdraw::tintcolor, Scene::toolsettings, tGPDdraw::winx, and tGPDdraw::winy.

Referenced by gpencil_draw_boundary_lines(), and gpencil_render_offscreen().

◆ gpencil_erase_processed_area()

static void gpencil_erase_processed_area ( tGPDfill tgpf)
static

◆ gpencil_fill_cancel()

static void gpencil_fill_cancel ( bContext C,
wmOperator op 
)
static

Definition at line 1865 of file gpencil_fill.c.

References C, and gpencil_fill_exit().

Referenced by GPENCIL_OT_fill().

◆ gpencil_fill_draw_3d()

static void gpencil_fill_draw_3d ( const bContext C,
ARegion UNUSEDregion,
void arg 
)
static

Definition at line 1695 of file gpencil_fill.c.

References C, CTX_wm_region(), gpencil_draw_boundary_lines(), and tGPDfill::region.

Referenced by gpencil_fill_invoke().

◆ gpencil_fill_exit()

static void gpencil_fill_exit ( bContext C,
wmOperator op 
)
static

◆ gpencil_fill_init()

static int gpencil_fill_init ( bContext C,
wmOperator op 
)
static

◆ gpencil_fill_invoke()

static int gpencil_fill_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSEDevent 
)
static

◆ gpencil_fill_modal()

static int gpencil_fill_modal ( bContext C,
wmOperator op,
const wmEvent event 
)
static

Definition at line 2174 of file gpencil_fill.c.

References bGPDlayer::actframe, tGPDfill::active_cfra, BKE_area_find_region_xy(), BKE_gpencil_frame_selected_hash(), BKE_gpencil_free_stroke(), BKE_gpencil_layer_frame_get(), BKE_gpencil_stroke_new(), BKE_report(), BLI_ghash_free(), BLI_ghash_insert(), BLI_ghash_int_new_ex(), BLI_ghash_len(), BLI_ghashIterator_getKey(), BLI_rcti_isect_pt_v(), bool, tGPDfill::brect, tGPDfill::brush, BRUSH_DIR_IN, tGPDfill::bwinx, tGPDfill::bwiny, C, CLAMP_MAX, CLAMP_MIN, copy_v2fl_v2i(), CTX_wm_area(), CTX_wm_window(), wmOperator::customdata, tGPDfill::done, EVT_ESCKEY, EVT_PAGEDOWNKEY, EVT_PAGEUPKEY, BrushGpencilSettings::fill_direction, tGPDfill::fill_extend_fac, BrushGpencilSettings::fill_extend_fac, tGPDfill::fill_factor, BrushGpencilSettings::fill_factor, tGPDfill::flag, bGPDframe::flag, float(), GHASH_ITER, GP_BRUSH_FILL_SHOW_EXTENDLINES, GP_BRUSH_FILL_SHOW_HELPLINES, GP_FRAME_SELECT, GP_GETFRAME_ADD_NEW, GP_GETFRAME_USE_PREV, tGPDfill::gpd, gpencil_delete_temp_stroke_extension(), gpencil_do_frame_fill(), gpencil_fill_exit(), GPENCIL_MAX_FILL_FAC, GPENCIL_MIN_FILL_FAC, GPENCIL_MULTIEDIT_SESSIONS_ON, Brush::gpencil_settings, gpencil_stroke_convertcoords_tpoint(), gpencil_undo_push(), gpencil_update_extend(), gpencil_zoom_level_set(), tGPDfill::gpf, tGPDfill::gpl, tGPDfill::gps_mouse, IS_AUTOKEY_ON, tGPDfill::is_render, KM_CTRL, KM_SHIFT, LEFTMOUSE, tGPspoint::m_xy, max_ff(), min_ff(), tGPDfill::mouse, NA_EDITED, NC_GPENCIL, NULL, tGPDfill::ob, tGPDfill::oldkey, tGPDfill::on_back, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, POINTER_AS_INT, POINTER_FROM_INT, bGPDstroke::points, wmOperator::ptr, tGPDfill::region, ARegion::regiontype, wmOperator::reports, RGN_TYPE_ANY, RGN_TYPE_WINDOW, RIGHTMOUSE, RNA_boolean_get(), RPT_INFO, tGPDfill::scene, wmEvent::type, WHEELDOWNMOUSE, WHEELUPMOUSE, ARegion::winrct, ARegion::winx, ARegion::winy, WM_cursor_modal_restore(), WM_cursor_time(), WM_event_add_notifier(), bGPDspoint::x, wmEvent::xy, and tGPDfill::zoom.

Referenced by GPENCIL_OT_fill().

◆ gpencil_fill_poll()

static bool gpencil_fill_poll ( bContext C)
static

◆ gpencil_fill_status_indicators()

static void gpencil_fill_status_indicators ( bContext C)
static

Definition at line 1678 of file gpencil_fill.c.

References C, ED_workspace_status_text(), and TIP_.

Referenced by gpencil_fill_invoke().

◆ gpencil_find_and_mark_empty_areas()

static bool gpencil_find_and_mark_empty_areas ( tGPDfill tgpf)
static

◆ gpencil_get_depth_array()

static void gpencil_get_depth_array ( tGPDfill tgpf)
static

◆ gpencil_get_outline_points()

static void gpencil_get_outline_points ( tGPDfill tgpf,
const bool  dilate 
)
static

◆ gpencil_invert_image()

static void gpencil_invert_image ( tGPDfill tgpf)
static

◆ GPENCIL_OT_fill()

void GPENCIL_OT_fill ( wmOperatorType ot)

◆ gpencil_points_from_stack()

static int gpencil_points_from_stack ( tGPDfill tgpf)
static

◆ gpencil_render_offscreen()

static bool gpencil_render_offscreen ( tGPDfill tgpf)
static

◆ gpencil_session_init_fill()

static tGPDfill* gpencil_session_init_fill ( bContext C,
wmOperator op 
)
static

Definition at line 1730 of file gpencil_fill.c.

References tGPDfill::active_cfra, tGPDfill::area, BKE_gpencil_layer_active_get(), BKE_gpencil_layer_addnew(), BKE_gpencil_object_material_ensure_from_active_input_brush(), BKE_paint_brush(), tGPDfill::bmain, tGPDfill::brush, tGPDfill::C, C, ceil(), RenderData::cfra, CTX_data_active_object(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_gpencil_data(), CTX_data_main(), CTX_data_scene(), CTX_data_tool_settings(), CTX_wm_area(), CTX_wm_region(), CTX_wm_window(), DATA_, tGPDfill::depsgraph, tGPDfill::depth_arr, tGPDfill::fill_draw_mode, BrushGpencilSettings::fill_draw_mode, tGPDfill::fill_extend_fac, BrushGpencilSettings::fill_extend_fac, tGPDfill::fill_factor, BrushGpencilSettings::fill_factor, tGPDfill::fill_leak, BrushGpencilSettings::fill_leak, tGPDfill::fill_simplylvl, BrushGpencilSettings::fill_simplylvl, tGPDfill::fill_threshold, BrushGpencilSettings::fill_threshold, ListBase::first, tGPDfill::flag, BrushGpencilSettings::flag, ToolSettings::gp_paint, ToolSettings::gp_sculpt, GP_STROKE_TAG, tGPDfill::gpd, GPENCIL_MAX_FILL_FAC, GPENCIL_MIN_FILL_FAC, gpencil_point_conversion_init(), Brush::gpencil_settings, gpencil_undo_init(), tGPDfill::gpl, tGPDfill::gsc, tGPDfill::is_render, bGPdata::layers, LISTBASE_FOREACH, tGPDfill::lock_axis, GP_Sculpt_Settings::lock_axis, tGPDfill::mat, max_ff(), MEM_callocN, min_ff(), NC_SPACE, ND_SPACE_PROPERTIES, NULL, tGPDfill::ob, tGPDfill::oldkey, GpPaint::paint, Scene::r, tGPDfill::region, ARegion::regiondata, tGPDfill::reports, wmOperator::reports, tGPDfill::rv3d, tGPDfill::sbuffer, tGPDfill::sbuffer_used, scene, tGPDfill::scene, ScrArea::spacedata, Object::totcol, tGPDfill::v3d, tGPDfill::win, WM_event_add_notifier(), and tGPDfill::zoom.

Referenced by gpencil_fill_init().

◆ gpencil_set_borders()

static void gpencil_set_borders ( tGPDfill tgpf,
const bool  transparent 
)
static

◆ gpencil_stroke_from_buffer()

static void gpencil_stroke_from_buffer ( tGPDfill tgpf)
static

Definition at line 1526 of file gpencil_fill.c.

References Freestyle::a, Object::actcol, tGPDfill::active_cfra, BrushGpencilSettings::aspect_ratio, bGPDstroke::aspect_ratio, usdtokens::b(), BKE_defvert_ensure_index(), BKE_gpencil_dvert_ensure(), BKE_gpencil_layer_frame_get(), BKE_gpencil_object_material_get_index_from_brush(), BKE_gpencil_stroke_geometry_update(), BKE_gpencil_stroke_simplify_fixed(), BKE_gpencil_stroke_smooth_point(), BKE_paint_brush(), BLI_addhead(), BLI_addtail(), BLI_findlink(), bool, tGPDfill::C, copy_v2_v2(), tGPDfill::depsgraph, tGPDfill::depth_arr, tGPDfill::done, bGPDstroke::dvert, MDeformVert::dw, ED_gpencil_drawing_reference_get(), ED_gpencil_fill_vertex_color_set(), ED_gpencil_point_vertex_color_set(), ED_gpencil_project_stroke_to_plane(), ED_gpencil_project_stroke_to_view(), bGPDstroke::fill_opacity_fac, tGPDfill::fill_simplylvl, bGPDstroke::flag, bGPDframe::flag, GP_FRAME_SELECT, GP_GETFRAME_ADD_NEW, GP_GETFRAME_USE_PREV, GP_LOCKAXIS_VIEW, ToolSettings::gp_paint, GP_PROJECT_DEPTH_STROKE, GP_PROJECT_DEPTH_VIEW, GP_PROJECT_VIEWSPACE, ToolSettings::gp_sculpt, GP_STROKE_3DSPACE, GP_STROKE_CYCLIC, GP_TOOL_FLAG_CREATE_WEIGHTS, GP_TOOL_FLAG_PAINT_ONBACK, tGPDfill::gpd, gpencil_apply_parent_point(), ToolSettings::gpencil_flags, Brush::gpencil_settings, gpencil_stroke_convertcoords_tpoint(), ToolSettings::gpencil_v3d_align, tGPDfill::gpf, tGPDfill::gpl, BrushGpencilSettings::hardeness, bGPDstroke::hardeness, bGPDstroke::inittime, IS_AUTOKEY_ON, tGPDfill::lock_axis, GP_Sculpt_Settings::lock_axis, bGPDstroke::mat_nr, MEM_callocN, NULL, tGPDfill::ob, tGPDfill::on_back, GpPaint::paint, RegionView3D::persp, bGPDstroke::points, bGPDspoint::pressure, tGPDfill::region, tGPDfill::rv3d, RV3D_CAMOB, tGPDfill::sbuffer, tGPDfill::sbuffer_used, tGPDfill::scene, Brush::size, bGPDspoint::strength, bGPDframe::strokes, bGPDstroke::thickness, bGPDspoint::time, Scene::toolsettings, bGPDstroke::totpoints, MDeformVert::totweight, bGPdata::vertex_group_active_index, bGPdata::vertex_group_names, ToolSettings::vgroup_weight, MDeformWeight::weight, and bGPDspoint::x.

Referenced by gpencil_do_frame_fill().

◆ gpencil_stroke_is_drawable()

static bool gpencil_stroke_is_drawable ( tGPDfill tgpf,
bGPDstroke gps 
)
static

◆ gpencil_update_extend()

static void gpencil_update_extend ( tGPDfill tgpf)
static

◆ gpencil_zoom_level_set()

static void gpencil_zoom_level_set ( tGPDfill tgpf)
static

◆ is_leak_narrow()

static bool is_leak_narrow ( ImBuf ibuf,
const int  maxpixel,
int  limit,
int  index,
int  type 
)
static

Check if the size of the leak is narrow to determine if the stroke is closed this is used for strokes with small gaps between them to get a full fill and do not get a full screen fill.

This function assumes that if the furthest pixel is occupied, the other pixels are occupied.

Parameters
ibufImage pixel data.
maxpixelMaximum index.
limitLimit of pixels to analyze.
indexIndex of current pixel.
type0-Horizontal 1-Vertical.

Definition at line 775 of file gpencil_fill.c.

References get_pixel(), LEAK_HORZ, LEAK_VERT, usdtokens::rgba(), type, and ImBuf::x.

Referenced by gpencil_boundaryfill_area().

◆ is_row_filled()

static bool is_row_filled ( const ImBuf ibuf,
const int  row_index 
)
static

Definition at line 755 of file gpencil_fill.c.

References ImBuf::rect_float, and ImBuf::x.

Referenced by contract_shape(), and dilate_shape().

◆ set_pixel()

static void set_pixel ( ImBuf ibuf,
int  idx,
const float  col[4] 
)
static

◆ skip_layer_check()

bool skip_layer_check ( short  fill_layer_mode,
int  gpl_active_index,
int  gpl_index 
)