|
Blender V5.0
|
#include "MEM_guardedalloc.h"#include "BKE_context.hh"#include "BKE_mask.h"#include "BLI_listbase.h"#include "BLI_math_geom.h"#include "BLI_math_vector.h"#include "DEG_depsgraph.hh"#include "DEG_depsgraph_query.hh"#include "DNA_mask_types.h"#include "DNA_screen_types.h"#include "ED_clip.hh"#include "ED_image.hh"#include "ED_mask.hh"#include "UI_view2d.hh"#include "mask_intern.hh"Go to the source code of this file.
Functions | |
Spatial Queries | |
| bool | ED_mask_find_nearest_diff_point (const bContext *C, Mask *mask_orig, const float normal_co[2], int threshold, bool feather, float tangent[2], const bool use_deform, const bool use_project, MaskLayer **r_mask_layer, MaskSpline **r_spline, MaskSplinePoint **r_point, float *r_u, float *r_score) |
| static void | mask_point_scaled_handle (const MaskSplinePoint *point, const eMaskWhichHandle which_handle, const float scalex, const float scaley, float handle[2]) |
| MaskSplinePoint * | ED_mask_point_find_nearest (const bContext *C, Mask *mask_orig, const float normal_co[2], const float threshold, MaskLayer **r_mask_layer, MaskSpline **r_spline, eMaskWhichHandle *r_which_handle, float *r_score) |
| bool | ED_mask_feather_find_nearest (const bContext *C, Mask *mask_orig, const float normal_co[2], const float threshold, MaskLayer **r_mask_layer, MaskSpline **r_spline, MaskSplinePoint **r_point, MaskSplinePointUW **r_uw, float *r_score) |
| void | ED_mask_mouse_pos (ScrArea *area, ARegion *region, const int mval[2], float r_co[2]) |
| void | ED_mask_point_pos (ScrArea *area, ARegion *region, float x, float y, float *r_x, float *r_y) |
| void | ED_mask_point_pos__reverse (ScrArea *area, ARegion *region, float x, float y, float *r_x, float *r_y) |
| static void | handle_position_for_minmax (const MaskSplinePoint *point, eMaskWhichHandle which_handle, bool handles_as_control_point, float r_handle[2]) |
| bool | ED_mask_selected_minmax (const bContext *C, float min[2], float max[2], bool handles_as_control_point) |
| void | ED_mask_center_from_pivot_ex (const bContext *C, ScrArea *area, float r_center[2], char mode, bool *r_has_select) |
Generic 2D View Queries | |
| void | ED_mask_get_size (ScrArea *area, int *r_width, int *r_height) |
| void | ED_mask_zoom (ScrArea *area, ARegion *region, float *r_zoomx, float *r_zoomy) |
| void | ED_mask_get_aspect (ScrArea *area, ARegion *, float *r_aspx, float *r_aspy) |
| void | ED_mask_pixelspace_factor (ScrArea *area, ARegion *region, float *r_scalex, float *r_scaley) |
| void | ED_mask_cursor_location_get (ScrArea *area, float cursor[2]) |
| void ED_mask_center_from_pivot_ex | ( | const bContext * | C, |
| ScrArea * | area, | ||
| float | r_center[2], | ||
| char | mode, | ||
| bool * | r_has_select ) |
Definition at line 676 of file mask_query.cc.
References C, ED_mask_cursor_location_get(), ED_mask_selected_minmax(), max, mid_v2_v2v2(), min, and V3D_AROUND_CURSOR.
Referenced by blender::ed::transform::gizmo2d_calc_transform_pivot().
Definition at line 840 of file mask_query.cc.
References BLI_assert, copy_v2_v2(), SpaceClip::cursor, SpaceImage::cursor, ListBase::first, SPACE_CLIP, SPACE_IMAGE, SPACE_SEQ, ScrArea::spacedata, ScrArea::spacetype, and zero_v2().
Referenced by ED_mask_center_from_pivot_ex(), and primitive_add_invoke().
| bool ED_mask_feather_find_nearest | ( | const bContext * | C, |
| Mask * | mask_orig, | ||
| const float | normal_co[2], | ||
| const float | threshold, | ||
| MaskLayer ** | r_mask_layer, | ||
| MaskSpline ** | r_spline, | ||
| MaskSplinePoint ** | r_point, | ||
| MaskSplinePointUW ** | r_uw, | ||
| float * | r_score ) |
Definition at line 360 of file mask_query.cc.
References BKE_mask_spline_feather_points(), C, CTX_data_ensure_evaluated_depsgraph(), CTX_wm_area(), CTX_wm_region(), DEG_get_evaluated(), depsgraph, ED_mask_get_size(), ED_mask_pixelspace_factor(), ListBase::first, float, FLT_MAX, i, len, len_squared_v2v2(), MASK_HIDE_SELECT, MASK_HIDE_VIEW, Mask::masklayers, MEM_freeN(), MaskLayer::next, MaskSpline::next, sqrtf, MaskSplinePoint::tot_uw, and MaskSplinePoint::uw.
Referenced by select_exec(), slide_point_customdata(), and slide_spline_curvature_check().
| bool ED_mask_find_nearest_diff_point | ( | const bContext * | C, |
| Mask * | mask_orig, | ||
| const float | normal_co[2], | ||
| int | threshold, | ||
| bool | feather, | ||
| float | tangent[2], | ||
| const bool | use_deform, | ||
| const bool | use_project, | ||
| MaskLayer ** | r_mask_layer, | ||
| MaskSpline ** | r_spline, | ||
| MaskSplinePoint ** | r_point, | ||
| float * | r_u, | ||
| float * | r_score ) |
Definition at line 36 of file mask_query.cc.
References b, BKE_mask_point_segment_diff(), BKE_mask_point_segment_feather_diff(), BKE_mask_spline_project_co(), C, CTX_data_ensure_evaluated_depsgraph(), CTX_wm_area(), CTX_wm_region(), DEG_get_evaluated(), depsgraph, dist_squared_to_line_segment_v2(), ED_mask_get_size(), ED_mask_pixelspace_factor(), ListBase::first, float, FLT_MAX, i, MASK_HIDE_SELECT, MASK_HIDE_VIEW, MASK_PROJ_ANY, Mask::masklayers, MEM_freeN(), MaskLayer::next, MaskSpline::next, and sub_v2_v2v2().
Referenced by add_feather_vertex_exec(), add_vertex_subdivide(), slide_spline_curvature_customdata(), and spline_under_mouse_get().
Definition at line 766 of file mask_query.cc.
References BLI_assert, ED_space_clip_get_aspect(), ED_space_image_get_aspect(), ListBase::first, SPACE_CLIP, SPACE_IMAGE, SPACE_SEQ, ScrArea::spacedata, and ScrArea::spacetype.
Referenced by blender::ed::transform::createTransMaskingData(), and blender::ed::transform::flushTransMasking().
| void ED_mask_get_size | ( | ScrArea * | area, |
| int * | r_width, | ||
| int * | r_height ) |
Definition at line 701 of file mask_query.cc.
References BLI_assert, ED_space_clip_get_size(), ED_space_image_get_size(), ListBase::first, SPACE_CLIP, SPACE_IMAGE, SPACE_SEQ, ScrArea::spacedata, and ScrArea::spacetype.
Referenced by circle_select_exec(), clip_main_region_draw(), create_primitive_from_points(), ED_mask_feather_find_nearest(), ED_mask_find_nearest_diff_point(), ED_mask_point_find_nearest(), primitive_add_invoke(), slide_point_customdata(), and spline_under_mouse_get().
Takes event->mval.
Definition at line 487 of file mask_query.cc.
References BKE_mask_coord_from_image(), BKE_mask_coord_from_movieclip(), BLI_assert, SpaceClip::clip, ED_clip_mouse_pos(), ED_image_mouse_pos(), ListBase::first, SpaceImage::image, SpaceImage::iuser, SPACE_CLIP, SPACE_IMAGE, SPACE_SEQ, ScrArea::spacedata, ScrArea::spacetype, UI_view2d_region_to_view(), SpaceClip::user, ARegion::v2d, and zero_v2().
Referenced by add_feather_vertex_invoke(), add_vertex_invoke(), mask_select_linked_pick_invoke(), select_invoke(), slide_point_customdata(), slide_point_modal(), slide_spline_curvature_check(), slide_spline_curvature_customdata(), and slide_spline_curvature_modal().
| void ED_mask_pixelspace_factor | ( | ScrArea * | area, |
| ARegion * | region, | ||
| float * | r_scalex, | ||
| float * | r_scaley ) |
Definition at line 797 of file mask_query.cc.
References BLI_assert, ED_space_clip_get_aspect(), ED_space_image_get_aspect(), ListBase::first, SPACE_CLIP, SPACE_IMAGE, SPACE_SEQ, ScrArea::spacedata, ScrArea::spacetype, UI_view2d_scale_get(), and ARegion::v2d.
Referenced by ED_mask_feather_find_nearest(), ED_mask_find_nearest_diff_point(), ED_mask_point_find_nearest(), and mask_point_make_pixel_space().
| MaskSplinePoint * ED_mask_point_find_nearest | ( | const bContext * | C, |
| Mask * | mask_orig, | ||
| const float | normal_co[2], | ||
| const float | threshold, | ||
| MaskLayer ** | r_mask_layer, | ||
| MaskSpline ** | r_spline, | ||
| eMaskWhichHandle * | r_which_handle, | ||
| float * | r_score ) |
Definition at line 204 of file mask_query.cc.
References MaskSplinePoint::bezt, BKE_mask_point_handles_mode_get(), BKE_mask_spline_point_array(), C, CTX_data_ensure_evaluated_depsgraph(), CTX_wm_area(), CTX_wm_region(), DEG_get_evaluated(), depsgraph, ED_mask_get_size(), ED_mask_pixelspace_factor(), ListBase::first, FLT_MAX, BezTriple::h1, BezTriple::h2, HD_VECT, i, len_squared_v2v2(), MASK_HANDLE_MODE_STICK, MASK_HIDE_SELECT, MASK_HIDE_VIEW, mask_point_scaled_handle(), MASK_WHICH_HANDLE_LEFT, MASK_WHICH_HANDLE_NONE, MASK_WHICH_HANDLE_RIGHT, MASK_WHICH_HANDLE_STICK, Mask::masklayers, MaskLayer::next, MaskSpline::next, sqrtf, and BezTriple::vec.
Referenced by add_feather_vertex_exec(), mask_select_linked_pick_invoke(), select_exec(), slide_point_customdata(), and slide_spline_curvature_check().
| void ED_mask_point_pos | ( | ScrArea * | area, |
| ARegion * | region, | ||
| float | x, | ||
| float | y, | ||
| float * | r_x, | ||
| float * | r_y ) |
| x/y | input, mval space. |
| xr/yr | output, mask point space. |
Definition at line 520 of file mask_query.cc.
References BKE_mask_coord_from_image(), BKE_mask_coord_from_movieclip(), BLI_assert, SpaceClip::clip, ED_clip_point_stable_pos(), ED_image_point_pos(), ListBase::first, SpaceImage::image, SpaceImage::iuser, SPACE_CLIP, SPACE_IMAGE, SPACE_SEQ, ScrArea::spacedata, ScrArea::spacetype, SpaceClip::user, x, y, and zero_v2().
Referenced by box_select_exec(), and circle_select_exec().
| void ED_mask_point_pos__reverse | ( | ScrArea * | area, |
| ARegion * | region, | ||
| float | x, | ||
| float | y, | ||
| float * | r_x, | ||
| float * | r_y ) |
Definition at line 557 of file mask_query.cc.
References BKE_mask_coord_to_image(), BKE_mask_coord_to_movieclip(), BLI_assert, SpaceClip::clip, ED_clip_point_stable_pos__reverse(), ED_image_point_pos__reverse(), ListBase::first, SpaceImage::image, SpaceImage::iuser, SPACE_CLIP, SPACE_IMAGE, SPACE_SEQ, ScrArea::spacedata, ScrArea::spacetype, SpaceClip::user, x, y, and zero_v2().
Referenced by do_lasso_select_mask().
| bool ED_mask_selected_minmax | ( | const bContext * | C, |
| float | min[2], | ||
| float | max[2], | ||
| bool | handles_as_control_point ) |
Definition at line 611 of file mask_query.cc.
References MaskSplinePoint::bezt, BKE_mask_point_handles_mode_get(), BKE_mask_spline_point_array(), C, CTX_data_depsgraph_pointer(), CTX_data_edit_mask(), DEG_get_evaluated(), depsgraph, BezTriple::f1, BezTriple::f2, BezTriple::f3, BezTriple::h1, BezTriple::h2, handle_position_for_minmax(), HD_VECT, i, INIT_MINMAX2, LISTBASE_FOREACH, mask(), MASK_HANDLE_MODE_STICK, MASK_HIDE_SELECT, MASK_HIDE_VIEW, MASK_WHICH_HANDLE_LEFT, MASK_WHICH_HANDLE_RIGHT, MASK_WHICH_HANDLE_STICK, Mask::masklayers, MASKPOINT_ISSEL_ANY, max, min, minmax_v2v2_v2(), SELECT, and BezTriple::vec.
Referenced by ED_mask_center_from_pivot_ex(), blender::ed::transform::gizmo2d_calc_bounds(), image_view_selected_exec(), and selected_boundbox().
Definition at line 735 of file mask_query.cc.
References BLI_assert, ED_space_clip_get_zoom(), ED_space_image_get_zoom(), ListBase::first, SPACE_CLIP, SPACE_IMAGE, SPACE_SEQ, ScrArea::spacedata, and ScrArea::spacetype.
Referenced by circle_select_exec().
|
static |
Definition at line 599 of file mask_query.cc.
References MaskSplinePoint::bezt, BKE_mask_point_handle(), copy_v2_v2(), and BezTriple::vec.
Referenced by ED_mask_selected_minmax().
|
static |
Definition at line 193 of file mask_query.cc.
References BKE_mask_point_handle().
Referenced by ED_mask_point_find_nearest().