|
Blender
V2.93
|
#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 |
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 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 tGPDfill * | gpencil_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_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) |
| #define FILL_DEBUG 0 |
Definition at line 89 of file gpencil_fill.c.
| #define LEAK_HORZ 0 |
Definition at line 84 of file gpencil_fill.c.
| #define LEAK_VERT 1 |
Definition at line 85 of file gpencil_fill.c.
| #define MIN_WINDOW_SIZE 128 |
Definition at line 86 of file gpencil_fill.c.
| anonymous enum |
| Enumerator | |
|---|---|
| GP_DRAWFILLS_NOSTATUS | |
| GP_DRAWFILLS_ONLY3D | |
Definition at line 92 of file gpencil_fill.c.
|
static |
Naive dilate
Expand green areas into enclosing red areas. Using stack prevents creep when replacing colors directly.
----------- XXXXXXX XoooooX XXooXXX XXXX -----------
Definition at line 1134 of file gpencil_fill.c.
References BLI_stack_free(), BLI_stack_is_empty(), BLI_stack_new, BLI_stack_pop(), BLI_stack_push(), bm, get_pixel(), green, is_row_filled(), set_pixel(), v, ImBuf::x, and ImBuf::y.
Referenced by gpencil_get_outline_points().
|
static |
Definition at line 427 of file gpencil_fill.c.
References col, tGPDfill::fill_factor, tGPDfill::gps_mouse, GPU_COMP_F32, GPU_COMP_U8, GPU_FETCH_FLOAT, GPU_FETCH_INT_TO_FLOAT_UNIT, GPU_point_size(), GPU_PRIM_POINTS, GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR, GPU_vertformat_attr_add(), immAttr4ubv(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immVertex3fv(), immVertexFormat(), NULL, bGPDstroke::points, pos, bGPDspoint::x, and tGPDfill::zoom.
Referenced by gpencil_draw_datablock().
|
static |
Definition at line 226 of file gpencil_fill.c.
References Freestyle::a, add_v3_v3v3(), length(), mul_v3_fl(), normalize_v3(), sub_v3_v3v3(), and bGPDspoint::x.
Referenced by gpencil_create_extensions().
Definition at line 753 of file gpencil_fill.c.
References BLI_assert, NULL, and ImBuf::rect_float.
Referenced by dilate_shape(), gpencil_boundaryfill_area(), gpencil_erase_processed_area(), gpencil_get_outline_points(), gpencil_invert_image(), and is_leak_narrow().
|
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.
| tgpf | Temporary 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 873 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, NULL, set_pixel(), ID::tag, v, ImBuf::x, and ImBuf::y.
Referenced by gpencil_do_frame_fill().
|
static |
Definition at line 239 of file gpencil_fill.c.
References tGPDfill::active_cfra, BKE_gpencil_layer_active_get(), BKE_gpencil_layer_frame_get(), BKE_gpencil_material_settings(), BKE_gpencil_stroke_new(), BLI_addtail(), BLI_assert, BLI_findindex(), tGPDfill::brush, copy_v3_v3(), extrapolate_points_by_length(), tGPDfill::fill_extend_fac, BrushGpencilSettings::fill_layer_mode, bGPDstroke::flag, MaterialGPencilStyle::flag, GP_GETFRAME_USE_PREV, GP_LAYER_HIDE, GP_MATERIAL_HIDE, GP_STROKE_NOFILL, GP_STROKE_TAG, tGPDfill::gpd, Brush::gpencil_settings, bGPdata::layers, LISTBASE_FOREACH, NULL, tGPDfill::ob, bGPDstroke::points, bGPDspoint::pressure, skip_layer_check(), bGPDspoint::strength, bGPDframe::strokes, and bGPDspoint::x.
Referenced by gpencil_update_extend().
|
static |
Definition at line 198 of file gpencil_fill.c.
References tGPDfill::active_cfra, BKE_gpencil_free_stroke(), BKE_gpencil_layer_frame_get(), BLI_remlink(), GP_GETFRAME_USE_PREV, GP_LAYER_HIDE, GP_STROKE_NOFILL, GP_STROKE_TAG, tGPDfill::gpd, bGPdata::layers, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, bGPDframe::next, and NULL.
Referenced by gpencil_fill_exit(), gpencil_fill_modal(), and gpencil_update_extend().
|
static |
Definition at line 1984 of file gpencil_fill.c.
References BKE_id_free(), BKE_report(), BLI_stack_free(), tGPDfill::bmain, tGPDfill::C, CTX_wm_window(), tGPDfill::depth_arr, FILL_DEBUG, gpencil_boundaryfill_area(), gpencil_erase_processed_area(), gpencil_get_depth_array(), gpencil_get_outline_points(), gpencil_invert_image(), gpencil_points_from_stack(), gpencil_render_offscreen(), gpencil_set_borders(), gpencil_stroke_from_buffer(), tGPDfill::ima, MEM_SAFE_FREE, tGPDfill::reports, RPT_INFO, tGPDfill::sbuffer, tGPDfill::stack, and WM_cursor_time().
Referenced by gpencil_fill_modal().
|
static |
Definition at line 356 of file gpencil_fill.c.
References alpha, CLAMP, col, copy_v4_v4(), bGPDstroke::flag, ReportList::flag, GP_BRUSH_FILL_HIDE, GP_STROKE_NOFILL, GP_STROKE_TAG, Material::gp_style, gpencil_stroke_is_drawable(), GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_width(), GPU_PRIM_LINE_STRIP, GPU_SHADER_3D_FLAT_COLOR, GPU_vertformat_attr_add(), immAttr4fv(), immBeginAtMost(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immVertex3fv(), immVertexFormat(), tGPDfill::is_render, tGPDfill::mat, mul_v3_m4v3(), bGPDstroke::points, pos, bGPDspoint::strength, MaterialGPencilStyle::stroke_rgba, bGPDstroke::totpoints, and bGPDspoint::x.
Referenced by gpencil_draw_datablock().
Definition at line 1612 of file gpencil_fill.c.
References tGPDfill::gpd, and gpencil_draw_datablock().
|
static |
Referenced by gpencil_fill_draw_3d().
Definition at line 496 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().
|
static |
Definition at line 1055 of file gpencil_fill.c.
References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), get_pixel(), Image::id, tGPDfill::ima, init, LIB_TAG_DOIT, max_ii(), NULL, tGPDfill::sbuffer, tGPDfill::sbuffer_used, set_pixel(), ID::tag, tGPspoint::x, ImBuf::x, tGPspoint::y, and ImBuf::y.
Referenced by gpencil_do_frame_fill().
|
static |
Definition at line 1787 of file gpencil_fill.c.
References C, and gpencil_fill_exit().
Referenced by GPENCIL_OT_fill().
Definition at line 1622 of file gpencil_fill.c.
References C, CTX_wm_region(), gpencil_draw_boundary_lines(), and tGPDfill::region.
Referenced by gpencil_fill_invoke().
|
static |
Definition at line 1742 of file gpencil_fill.c.
References C, CTX_data_active_object(), CTX_wm_window(), wmOperator::customdata, Object::data, DEG_id_tag_update(), tGPDfill::depth_arr, tGPDfill::draw_handle_3d, ED_region_draw_cb_exit(), ED_workspace_status_text(), bGPdata::flag, GP_DATA_CACHE_IS_DIRTY, gpencil_delete_temp_stroke_extension(), gpencil_undo_finish(), bGPdata::id, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, MEM_freeN, MEM_SAFE_FREE, NA_EDITED, NC_GPENCIL, NULL, OB_GPENCIL, tGPDfill::region, tGPDfill::sbuffer, Object::type, ARegion::type, WM_cursor_modal_restore(), and WM_event_add_notifier().
Referenced by gpencil_fill_cancel(), gpencil_fill_init(), gpencil_fill_invoke(), and gpencil_fill_modal().
|
static |
Definition at line 1794 of file gpencil_fill.c.
References BKE_gpencil_layer_active_get(), C, CTX_data_gpencil_data(), wmOperator::customdata, bGPDlayer::flag, GP_LAYER_LOCKED, gpencil_fill_exit(), gpencil_session_init_fill(), and NULL.
Referenced by gpencil_fill_invoke().
|
static |
Definition at line 1817 of file gpencil_fill.c.
References Object::actcol, BKE_object_material_get(), BKE_paint_brush(), BKE_report(), C, CTX_data_active_object(), CTX_data_tool_settings(), CTX_wm_window(), wmOperator::customdata, DEG_id_tag_update(), tGPDfill::draw_handle_3d, ED_region_draw_cb_activate(), tGPDfill::fill_extend_fac, tGPDfill::flag, BrushGpencilSettings::flag, GP_BRUSH_FILL_SHOW_EXTENDLINES, GP_BRUSH_FILL_SHOW_HELPLINES, GP_BRUSH_MATERIAL_PINNED, ToolSettings::gp_paint, tGPDfill::gpd, gpencil_fill_draw_3d(), gpencil_fill_exit(), gpencil_fill_init(), gpencil_fill_status_indicators(), Brush::gpencil_settings, bGPdata::id, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, BrushGpencilSettings::material, MEM_freeN, NA_EDITED, NC_GPENCIL, NULL, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, GpPaint::paint, tGPDfill::region, REGION_DRAW_POST_VIEW, wmOperator::reports, RPT_ERROR, ARegion::type, WM_cursor_modal_set(), WM_CURSOR_PAINT_BRUSH, WM_event_add_modal_handler(), and WM_event_add_notifier().
Referenced by GPENCIL_OT_fill().
|
static |
Definition at line 2072 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(), tGPDfill::brect, tGPDfill::brush, BRUSH_DIR_IN, tGPDfill::bwinx, tGPDfill::bwiny, C, CLAMP_MAX, CLAMP_MIN, copy_v2fl_v2i(), wmEvent::ctrl, 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, LEFTMOUSE, 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(), tGPspoint::x, bGPDspoint::x, wmEvent::x, wmEvent::y, and tGPDfill::zoom.
Referenced by GPENCIL_OT_fill().
|
static |
Definition at line 1634 of file gpencil_fill.c.
References blender::compositor::area(), C, CTX_data_active_object(), CTX_wm_area(), CTX_wm_operator_poll_msg_set(), ED_operator_regionactive(), Object::mode, NULL, OB_GPENCIL, OB_MODE_PAINT_GPENCIL, SPACE_VIEW3D, and Object::type.
Referenced by GPENCIL_OT_fill().
|
static |
Definition at line 1605 of file gpencil_fill.c.
References C, ED_workspace_status_text(), and TIP_.
Referenced by gpencil_fill_invoke().
|
static |
Definition at line 1355 of file gpencil_fill.c.
References copy_v2_v2_int(), tGPDfill::depsgraph, tGPDfill::depth_arr, ED_view3d_autodist_depth(), ED_view3d_autodist_depth_seg(), ED_view3d_depth_override(), GP_PROJECT_DEPTH_VIEW, ToolSettings::gpencil_v3d_align, interp_sparse_array(), MEM_mallocN, NULL, tGPDfill::region, round_v2i_v2fl(), tGPDfill::sbuffer, tGPDfill::sbuffer_used, tGPDfill::scene, Scene::toolsettings, tGPDfill::v3d, V3D_DEPTH_NO_GPENCIL, view3d_region_operator_needs_opengl(), tGPDfill::win, and tGPspoint::x.
Referenced by gpencil_do_frame_fill().
|
static |
Definition at line 1247 of file gpencil_fill.c.
References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), BLI_stack_new, BLI_stack_pop(), BLI_stack_push(), copy_v2_v2_int(), dilate_shape(), get_pixel(), tGPDfill::ima, NULL, tGPDfill::stack, v, ImBuf::x, and ImBuf::y.
Referenced by gpencil_do_frame_fill().
|
static |
Definition at line 1011 of file gpencil_fill.c.
References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), center, get_pixel(), Image::id, tGPDfill::ima, LIB_TAG_DOIT, NULL, set_pixel(), ID::tag, v, ImBuf::x, and ImBuf::y.
Referenced by gpencil_do_frame_fill().
| void GPENCIL_OT_fill | ( | wmOperatorType * | ot | ) |
Definition at line 2257 of file gpencil_fill.c.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::flag, gpencil_fill_cancel(), gpencil_fill_invoke(), gpencil_fill_modal(), gpencil_fill_poll(), wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, OPTYPE_UNDO, ot, wmOperatorType::poll, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_property_flag(), and wmOperatorType::srna.
Referenced by ED_operatortypes_gpencil().
|
static |
Definition at line 1420 of file gpencil_fill.c.
References add_v2_fl(), BLI_stack_count(), BLI_stack_is_empty(), BLI_stack_pop(), copy_v2fl_v2i(), MEM_callocN, tGPspoint::pressure, tGPDfill::sbuffer, tGPDfill::sbuffer_used, tGPDfill::stack, tGPspoint::strength, tGPspoint::time, v, and tGPspoint::x.
Referenced by gpencil_do_frame_fill().
|
static |
Definition at line 622 of file gpencil_fill.c.
References abs(), BKE_image_add_from_imbuf(), BKE_image_release_ibuf(), tGPDfill::bmain, tGPDfill::brect, tGPDfill::bwinx, tGPDfill::bwiny, tGPDfill::depsgraph, ED_view3d_update_viewmat(), ED_view3d_viewplane_get(), tGPDfill::fill_factor, ReportList::flag, tGPDfill::gpd, gpencil_draw_datablock(), GPU_clear_color(), GPU_clear_depth(), GPU_DATA_FLOAT, GPU_DATA_UBYTE, GPU_depth_mask(), GPU_matrix_identity_projection_set(), GPU_matrix_identity_set(), GPU_matrix_pop(), GPU_matrix_pop_projection(), GPU_matrix_projection_set, GPU_matrix_push(), GPU_matrix_push_projection(), GPU_matrix_set, GPU_offscreen_bind(), GPU_offscreen_create(), GPU_offscreen_free(), GPU_offscreen_read_pixels(), GPU_offscreen_unbind(), height, IB_rectfloat, Image::id, tGPDfill::ima, IMB_allocImBuf(), IMB_rect_from_float(), LIB_TAG_DOIT, max_ii(), MIN_WINDOW_SIZE, NULL, orthographic_m4(), perspective_m4(), ImBuf::rect, ImBuf::rect_float, tGPDfill::region, tGPDfill::rv3d, tGPDfill::scene, tGPDfill::sizex, tGPDfill::sizey, ID::tag, tGPDfill::v3d, RegionView3D::viewmat, width, RegionView3D::winmat, ARegion::winrct, ARegion::winx, ARegion::winy, rcti::xmax, rctf::xmax, rcti::xmin, rctf::xmin, rcti::ymax, rctf::ymax, rcti::ymin, rctf::ymin, and tGPDfill::zoom.
Referenced by gpencil_do_frame_fill().
|
static |
Definition at line 1657 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(), 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, 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().
|
static |
Definition at line 977 of file gpencil_fill.c.
References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), Image::id, tGPDfill::ima, LIB_TAG_DOIT, NULL, set_pixel(), ID::tag, ImBuf::x, and ImBuf::y.
Referenced by gpencil_do_frame_fill().
|
static |
Definition at line 1448 of file gpencil_fill.c.
References Freestyle::a, Object::actcol, Object::actdef, tGPDfill::active_cfra, BrushGpencilSettings::aspect_ratio, bGPDstroke::aspect_ratio, 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(), BKE_paint_brush(), BLI_addhead(), BLI_addtail(), BLI_findlink(), tGPDfill::C, copy_v2_v2(), Object::defbase, 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, r, 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, ToolSettings::vgroup_weight, MDeformWeight::weight, and bGPDspoint::x.
Referenced by gpencil_do_frame_fill().
|
static |
Definition at line 330 of file gpencil_fill.c.
References tGPDfill::flag, bGPDstroke::flag, GP_BRUSH_FILL_SHOW_EXTENDLINES, GP_BRUSH_FILL_SHOW_HELPLINES, GP_STROKE_NOFILL, GP_STROKE_TAG, and tGPDfill::is_render.
Referenced by gpencil_draw_basic_stroke(), and gpencil_draw_datablock().
|
static |
Definition at line 320 of file gpencil_fill.c.
References tGPDfill::C, tGPDfill::fill_extend_fac, gpencil_create_extensions(), gpencil_delete_temp_stroke_extension(), NA_EDITED, NC_GPENCIL, NULL, and WM_event_add_notifier().
Referenced by gpencil_fill_modal().
|
static |
Definition at line 1878 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(), BLI_rctf_clamp(), BLI_rctf_init(), tGPDfill::brush, ceilf, tGPDfill::depsgraph, ED_gpencil_projected_2d_bound_box(), BrushGpencilSettings::fill_layer_mode, BrushGpencilSettings::flag, MaterialGPencilStyle::flag, GP_BRUSH_FILL_FIT_DISABLE, GP_GETFRAME_USE_PREV, GP_LAYER_HIDE, GP_MATERIAL_HIDE, GP_STROKE_NOFILL, tGPDfill::gpd, Brush::gpencil_settings, tGPDfill::gsc, height, INIT_MINMAX2, bGPdata::layers, LISTBASE_FOREACH, max_ff(), min_ff(), minmax_v2v2_v2(), NULL, tGPDfill::ob, tGPDfill::region, skip_layer_check(), bGPDframe::strokes, width, ARegion::winx, ARegion::winy, rctf::xmax, rctf::xmin, rctf::ymax, rctf::ymin, and tGPDfill::zoom.
Referenced by gpencil_fill_modal().
|
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.
| ibuf | Image pixel data. |
| maxpixel | Maximum index. |
| limit | Limit of pixels to analyze. |
| index | Index of current pixel. |
| type | 0-Horizontal 1-Vertical. |
Definition at line 788 of file gpencil_fill.c.
References get_pixel(), LEAK_HORZ, LEAK_VERT, type, and ImBuf::x.
Referenced by gpencil_boundaryfill_area().
|
static |
Definition at line 768 of file gpencil_fill.c.
References ImBuf::rect_float, and ImBuf::x.
Referenced by dilate_shape().
Definition at line 760 of file gpencil_fill.c.
References BLI_assert, col, copy_v4_v4(), NULL, and ImBuf::rect_float.
Referenced by dilate_shape(), gpencil_boundaryfill_area(), gpencil_erase_processed_area(), gpencil_invert_image(), and gpencil_set_borders().
| bool skip_layer_check | ( | short | fill_layer_mode, |
| int | gpl_active_index, | ||
| int | gpl_index | ||
| ) |
Definition at line 452 of file gpencil_fill.c.
References GP_FILL_GPLMODE_ABOVE, GP_FILL_GPLMODE_ACTIVE, GP_FILL_GPLMODE_ALL_ABOVE, GP_FILL_GPLMODE_ALL_BELOW, GP_FILL_GPLMODE_BELOW, and GP_FILL_GPLMODE_VISIBLE.
Referenced by gpencil_create_extensions(), gpencil_draw_datablock(), and gpencil_zoom_level_set().