Blender
V3.3
|
#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) } |
#define FILL_DEBUG 0 |
Definition at line 73 of file gpencil_fill.c.
#define LEAK_HORZ 0 |
Definition at line 68 of file gpencil_fill.c.
#define LEAK_VERT 1 |
Definition at line 69 of file gpencil_fill.c.
#define MIN_WINDOW_SIZE 128 |
Definition at line 70 of file gpencil_fill.c.
anonymous enum |
Enumerator | |
---|---|
GP_DRAWFILLS_NOSTATUS | |
GP_DRAWFILLS_ONLY3D |
Definition at line 76 of file gpencil_fill.c.
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().
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().
Definition at line 413 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 212 of file gpencil_fill.c.
References Freestyle::a, add_v3_v3v3(), usdtokens::b(), blender::math::length(), mul_v3_fl(), normalize_v3(), and sub_v3_v3v3().
Referenced by gpencil_create_extensions().
Definition at line 740 of file gpencil_fill.c.
References BLI_assert, NULL, and ImBuf::rect_float.
Referenced by contract_shape(), dilate_shape(), gpencil_boundaryfill_area(), gpencil_erase_processed_area(), gpencil_find_and_mark_empty_areas(), gpencil_get_outline_points(), gpencil_invert_image(), and is_leak_narrow().
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 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().
Definition at line 225 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().
Definition at line 184 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().
Definition at line 2083 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_find_and_mark_empty_areas(), 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 342 of file gpencil_fill.c.
References CLAMP, col, color, copy_v4_v4(), bGPDstroke::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 1685 of file gpencil_fill.c.
References tGPDfill::gpd, and gpencil_draw_datablock().
|
static |
Referenced by gpencil_fill_draw_3d().
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().
Definition at line 1032 of file gpencil_fill.c.
References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), get_pixel(), Image::id, tGPDfill::ima, init, LIB_TAG_DOIT, lock, tGPspoint::m_xy, max_ii(), NULL, usdtokens::rgba(), tGPDfill::sbuffer, tGPDfill::sbuffer_used, set_pixel(), ID::tag, ImBuf::x, and ImBuf::y.
Referenced by gpencil_do_frame_fill().
|
static |
Definition at line 1865 of file gpencil_fill.c.
References C, and gpencil_fill_exit().
Referenced by GPENCIL_OT_fill().
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().
|
static |
Definition at line 1815 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::depths, tGPDfill::draw_handle_3d, ED_region_draw_cb_exit(), ED_view3d_depths_free(), 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 1872 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 1895 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 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().
Definition at line 1707 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().
Definition at line 1678 of file gpencil_fill.c.
References C, ED_workspace_status_text(), and TIP_.
Referenced by gpencil_fill_invoke().
Definition at line 2062 of file gpencil_fill.c.
References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), get_pixel(), tGPDfill::ima, lock, NULL, usdtokens::rgba(), set_pixel(), ImBuf::x, and ImBuf::y.
Referenced by gpencil_do_frame_fill().
Definition at line 1434 of file gpencil_fill.c.
References copy_v2_v2_int(), tGPDfill::depsgraph, tGPDfill::depth_arr, DEPTH_INVALID, tGPDfill::depths, ViewDepths::depths, ED_view3d_depth_override(), ED_view3d_depth_read_cached(), ED_view3d_depth_read_cached_seg(), GP_PROJECT_DEPTH_VIEW, ToolSettings::gpencil_v3d_align, interp_sparse_array(), tGPspoint::m_xy, 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(), and tGPDfill::win.
Referenced by gpencil_do_frame_fill().
Definition at line 1309 of file gpencil_fill.c.
References blender::math::abs(), BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), BLI_stack_new, BLI_stack_pop(), BLI_stack_push(), tGPDfill::brush, contract_shape(), copy_v2_v2_int(), BrushGpencilSettings::dilate_pixels, dilate_shape(), get_pixel(), Brush::gpencil_settings, tGPDfill::ima, lock, NULL, offset, usdtokens::rgba(), tGPDfill::stack, v, ImBuf::x, and ImBuf::y.
Referenced by gpencil_do_frame_fill().
Definition at line 998 of file gpencil_fill.c.
References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), color, get_pixel(), Image::id, tGPDfill::ima, LIB_TAG_DOIT, lock, 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 2359 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 1498 of file gpencil_fill.c.
References add_v2_fl(), BLI_stack_count(), BLI_stack_is_empty(), BLI_stack_pop(), copy_v2fl_v2i(), tGPspoint::m_xy, MEM_callocN, tGPspoint::pressure, tGPDfill::sbuffer, tGPDfill::sbuffer_used, tGPDfill::stack, tGPspoint::strength, tGPspoint::time, and v.
Referenced by gpencil_do_frame_fill().
Definition at line 608 of file gpencil_fill.c.
References blender::math::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, 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(), GPU_RGBA8, 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 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().
Definition at line 964 of file gpencil_fill.c.
References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), Image::id, tGPDfill::ima, LIB_TAG_DOIT, lock, NULL, set_pixel(), ID::tag, ImBuf::x, and ImBuf::y.
Referenced by gpencil_do_frame_fill().
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().
|
static |
Definition at line 316 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().
Definition at line 306 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().
Definition at line 1956 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 775 of file gpencil_fill.c.
References get_pixel(), LEAK_HORZ, LEAK_VERT, usdtokens::rgba(), type, and ImBuf::x.
Referenced by gpencil_boundaryfill_area().
Definition at line 755 of file gpencil_fill.c.
References ImBuf::rect_float, and ImBuf::x.
Referenced by contract_shape(), and dilate_shape().
Definition at line 747 of file gpencil_fill.c.
References BLI_assert, col, copy_v4_v4(), NULL, and ImBuf::rect_float.
Referenced by contract_shape(), dilate_shape(), gpencil_boundaryfill_area(), gpencil_erase_processed_area(), gpencil_find_and_mark_empty_areas(), 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 438 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().