Blender
V3.3
|
#include <stddef.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "DNA_mask_types.h"
#include "DNA_object_types.h"
#include "BKE_curve.h"
#include "BKE_mask.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
Go to the source code of this file.
Classes | |
struct | FeatherEdgesBucket |
Macros | |
#define | BUCKET_INDEX(co) feather_bucket_index_from_coord(co, min, bucket_scale, buckets_per_side) |
Typedefs | |
typedef struct FeatherEdgesBucket | FeatherEdgesBucket |
Functions | |
unsigned int | BKE_mask_spline_resolution (MaskSpline *spline, int width, int height) |
unsigned int | BKE_mask_spline_feather_resolution (MaskSpline *spline, int width, int height) |
int | BKE_mask_spline_differentiate_calc_total (const MaskSpline *spline, const unsigned int resol) |
float(* | BKE_mask_spline_differentiate_with_resolution (MaskSpline *spline, const unsigned int resol, unsigned int *r_tot_diff_point))[2] |
float(* | BKE_mask_spline_differentiate (MaskSpline *spline, int width, int height, unsigned int *r_tot_diff_point))[2] |
static void | feather_bucket_add_edge (FeatherEdgesBucket *bucket, int start, int end) |
static void | feather_bucket_check_intersect (float(*feather_points)[2], int tot_feather_point, FeatherEdgesBucket *bucket, int cur_a, int cur_b) |
static int | feather_bucket_index_from_coord (const float co[2], const float min[2], const float bucket_scale[2], const int buckets_per_side) |
static void | feather_bucket_get_diagonal (FeatherEdgesBucket *buckets, int start_bucket_index, int end_bucket_index, int buckets_per_side, FeatherEdgesBucket **r_diagonal_bucket_a, FeatherEdgesBucket **r_diagonal_bucket_b) |
void | BKE_mask_spline_feather_collapse_inner_loops (MaskSpline *spline, float(*feather_points)[2], const unsigned int tot_feather_point) |
static float(* | mask_spline_feather_differentiated_points_with_resolution__even (MaskSpline *spline, const unsigned int resol, const bool do_feather_isect, unsigned int *r_tot_feather_point))[2] |
static float(* | mask_spline_feather_differentiated_points_with_resolution__double (MaskSpline *spline, const unsigned int resol, const bool do_feather_isect, unsigned int *r_tot_feather_point))[2] |
float(* | BKE_mask_spline_feather_differentiated_points_with_resolution (MaskSpline *spline, const unsigned int resol, const bool do_feather_isect, unsigned int *r_tot_feather_point))[2] |
float(* | BKE_mask_spline_feather_points (MaskSpline *spline, int *r_tot_feather_point))[2] |
float * | BKE_mask_point_segment_feather_diff (MaskSpline *spline, MaskSplinePoint *point, int width, int height, unsigned int *r_tot_feather_point) |
float * | BKE_mask_point_segment_diff (MaskSpline *spline, MaskSplinePoint *point, int width, int height, unsigned int *r_tot_diff_point) |
static void | mask_evaluate_apply_point_parent (MaskSplinePoint *point, float ctime) |
void | BKE_mask_layer_evaluate_animation (MaskLayer *masklay, const float ctime) |
void | BKE_mask_layer_evaluate_deform (MaskLayer *masklay, const float ctime) |
void | BKE_mask_eval_animation (struct Depsgraph *depsgraph, Mask *mask) |
void | BKE_mask_eval_update (struct Depsgraph *depsgraph, Mask *mask) |
Functions for evaluating the mask beziers into points for the outline and feather.
Definition in file mask_evaluate.c.
#define BUCKET_INDEX | ( | co | ) | feather_bucket_index_from_coord(co, min, bucket_scale, buckets_per_side) |
typedef struct FeatherEdgesBucket FeatherEdgesBucket |
Definition at line 916 of file mask_evaluate.c.
References BKE_mask_layer_evaluate_animation(), DEG_debug_print_eval(), DEG_get_ctime(), depsgraph, mask(), and NULL.
Referenced by blender::deg::DepsgraphNodeBuilder::build_mask().
Definition at line 926 of file mask_evaluate.c.
References MaskSplinePoint::bezt, BKE_mask_layer_evaluate_deform(), DEG_debug_print_eval(), DEG_get_ctime(), DEG_get_original_id(), DEG_is_active(), depsgraph, ListBase::first, mask(), Mask::masklayers, and NULL.
Referenced by blender::deg::DepsgraphNodeBuilder::build_mask().
Definition at line 846 of file mask_evaluate.c.
References BKE_mask_layer_shape_find_frame_range(), BKE_mask_layer_shape_to_mask(), BKE_mask_layer_shape_to_mask_interp(), BLI_assert, BLI_listbase_count(), MaskLayerShape::frame, MaskLayer::splines_shapes, and w().
Referenced by BKE_mask_eval_animation(), and BKE_mask_layer_evaluate().
Definition at line 884 of file mask_evaluate.c.
References MaskSplinePoint::bezt, BKE_mask_calc_handle_point(), BKE_mask_layer_calc_handles(), BKE_mask_point_free(), BKE_mask_spline_ensure_deform(), ELEM, ListBase::first, BezTriple::h1, HD_AUTO, HD_VECT, mask_evaluate_apply_point_parent(), MEM_dupallocN, MaskSpline::next, NULL, point, MaskSpline::points, MaskSpline::points_deform, MaskLayer::splines, MaskSpline::tot_point, and MaskSplinePoint::uw.
Referenced by BKE_mask_eval_update(), and BKE_mask_layer_evaluate().
float* BKE_mask_point_segment_diff | ( | MaskSpline * | spline, |
MaskSplinePoint * | point, | ||
int | width, | ||
int | height, | ||
unsigned int * | r_tot_diff_point | ||
) |
Definition at line 799 of file mask_evaluate.c.
References BKE_curve_forward_diff_bezier(), BKE_mask_spline_point_array_from_point(), BKE_mask_spline_point_next_bezt(), BKE_mask_spline_resolution(), copy_v2_v2(), height, MEM_callocN, NULL, point, BezTriple::vec, and width.
Referenced by ED_mask_find_nearest_diff_point().
float* BKE_mask_point_segment_feather_diff | ( | MaskSpline * | spline, |
MaskSplinePoint * | point, | ||
int | width, | ||
int | height, | ||
unsigned int * | r_tot_feather_point | ||
) |
Definition at line 771 of file mask_evaluate.c.
References BKE_mask_point_normal(), BKE_mask_point_segment_co(), BKE_mask_point_weight(), BKE_mask_spline_feather_resolution(), float(), height, MEM_callocN, point, and width.
Referenced by ED_mask_find_nearest_diff_point().
float(* BKE_mask_spline_differentiate | ( | MaskSpline * | spline, |
int | width, | ||
int | height, | ||
unsigned int * | r_tot_diff_point | ||
) | )[2] |
Definition at line 178 of file mask_evaluate.c.
References BKE_mask_spline_differentiate_with_resolution(), BKE_mask_spline_resolution(), height, and width.
int BKE_mask_spline_differentiate_calc_total | ( | const MaskSpline * | spline, |
const unsigned int | resol | ||
) |
Definition at line 105 of file mask_evaluate.c.
References MaskSpline::flag, MASK_SPLINE_CYCLIC, and MaskSpline::tot_point.
Referenced by BKE_mask_spline_differentiate_with_resolution(), mask_spline_feather_differentiated_points_with_resolution__double(), and mask_spline_feather_differentiated_points_with_resolution__even().
float(* BKE_mask_spline_differentiate_with_resolution | ( | MaskSpline * | spline, |
const unsigned int | resol, | ||
unsigned int * | r_tot_diff_point | ||
) | )[2] |
Definition at line 114 of file mask_evaluate.c.
References Freestyle::a, MaskSplinePoint::bezt, BKE_curve_forward_diff_bezier(), BKE_mask_spline_differentiate_calc_total(), BKE_mask_spline_point_array(), copy_v2_v2(), float(), MASK_SPLINE_CYCLIC, MEM_mallocN, NULL, and BezTriple::vec.
Referenced by BKE_mask_spline_differentiate(), BKE_maskrasterize_handle_init(), and draw_spline_curve().
void BKE_mask_spline_feather_collapse_inner_loops | ( | MaskSpline * | spline, |
float(*) | feather_points[2], | ||
const unsigned int | tot_feather_point | ||
) |
Definition at line 317 of file mask_evaluate.c.
References BUCKET_INDEX, fabsf, feather_bucket_add_edge(), feather_bucket_check_intersect(), feather_bucket_get_diagonal(), MaskSpline::flag, INIT_MINMAX2, MASK_SPLINE_CYCLIC, max, MAX2, MEM_callocN, MEM_freeN, min, min_ii(), minmax_v2v2_v2(), and next.
Referenced by BKE_maskrasterize_handle_init(), mask_spline_feather_differentiated_points_with_resolution__double(), and mask_spline_feather_differentiated_points_with_resolution__even().
float(* BKE_mask_spline_feather_differentiated_points_with_resolution | ( | struct MaskSpline * | spline, |
unsigned int | resol, | ||
bool | do_feather_isect, | ||
unsigned int * | r_tot_feather_point | ||
) | )[2] |
values align with BKE_mask_spline_differentiate_with_resolution when resol arguments match.
Definition at line 707 of file mask_evaluate.c.
References mask_spline_feather_differentiated_points_with_resolution__double(), mask_spline_feather_differentiated_points_with_resolution__even(), MASK_SPLINE_OFFSET_EVEN, MASK_SPLINE_OFFSET_SMOOTH, and MaskSpline::offset_mode.
Referenced by BKE_maskrasterize_handle_init(), and draw_spline_curve().
float(* BKE_mask_spline_feather_points | ( | MaskSpline * | spline, |
int * | r_tot_feather_point | ||
) | )[2] |
Definition at line 724 of file mask_evaluate.c.
References BKE_mask_point_normal(), BKE_mask_point_segment_co(), BKE_mask_point_weight(), BKE_mask_spline_point_array(), float(), madd_v2_v2v2fl(), MEM_mallocN, point, MaskSpline::tot_point, and BezTriple::vec.
Referenced by draw_spline_points(), and ED_mask_feather_find_nearest().
unsigned int BKE_mask_spline_feather_resolution | ( | MaskSpline * | spline, |
int | width, | ||
int | height | ||
) |
Definition at line 66 of file mask_evaluate.c.
References BKE_mask_spline_resolution(), CLAMPIS, fabsf, height, jump(), MASK_RESOL_MAX, max_ff(), point, MaskSpline::points, MaskSpline::tot_point, and width.
Referenced by BKE_mask_point_segment_feather_diff(), BKE_maskrasterize_handle_init(), and draw_spline_curve().
unsigned int BKE_mask_spline_resolution | ( | MaskSpline * | spline, |
int | width, | ||
int | height | ||
) |
Definition at line 27 of file mask_evaluate.c.
References Freestyle::a, usdtokens::b(), BKE_mask_spline_point_next_bezt(), Freestyle::c, CLAMPIS, float(), height, len, len_v3v3(), MASK_RESOL_MAX, MAX2, max_ii(), NULL, point, MaskSpline::points, MaskSpline::tot_point, BezTriple::vec, and width.
Referenced by BKE_mask_point_segment_diff(), BKE_mask_spline_differentiate(), BKE_mask_spline_feather_resolution(), BKE_maskrasterize_handle_init(), and draw_spline_curve().
|
static |
Definition at line 194 of file mask_evaluate.c.
References FeatherEdgesBucket::alloc_segment, MEM_callocN, MEM_reallocN, FeatherEdgesBucket::segments, and FeatherEdgesBucket::tot_segment.
Referenced by BKE_mask_spline_feather_collapse_inner_loops().
|
static |
Definition at line 217 of file mask_evaluate.c.
References copy_v2_v2(), INIT_MINMAX2, isect_seg_seg_v2_point(), isect_seg_seg_v2_simple(), minmax_v2v2_v2(), FeatherEdgesBucket::segments, FeatherEdgesBucket::tot_segment, v1, and v2.
Referenced by BKE_mask_spline_feather_collapse_inner_loops().
|
static |
Definition at line 297 of file mask_evaluate.c.
Referenced by BKE_mask_spline_feather_collapse_inner_loops().
|
static |
Definition at line 278 of file mask_evaluate.c.
|
static |
Definition at line 837 of file mask_evaluate.c.
References BKE_mask_point_parent_matrix_get(), mul_m3_v2(), and point.
Referenced by BKE_mask_layer_evaluate_deform().
|
static |
only called from BKE_mask_spline_feather_differentiated_points_with_resolution() !
Definition at line 566 of file mask_evaluate.c.
References Freestyle::a, add_v2_v2(), MaskSplinePoint::bezt, BKE_curve_forward_diff_bezier(), BKE_mask_point_segment_co(), BKE_mask_point_weight(), BKE_mask_point_weight_scalar(), BKE_mask_spline_differentiate_calc_total(), BKE_mask_spline_feather_collapse_inner_loops(), BKE_mask_spline_point_array(), copy_v2_v2(), dist_ensure_v2_v2fl(), MaskSpline::flag, float(), len_v2v2(), MASK_SPLINE_CYCLIC, MASK_SPLINE_NOINTERSECT, MEM_mallocN, mul_v2_fl(), normalize_v2(), NULL, sub_v2_v2v2(), MaskSpline::tot_point, MaskSplinePoint::tot_uw, BezTriple::vec, and BezTriple::weight.
Referenced by BKE_mask_spline_feather_differentiated_points_with_resolution().
|
static |
only called from BKE_mask_spline_feather_differentiated_points_with_resolution() !
Definition at line 492 of file mask_evaluate.c.
References Freestyle::a, BKE_mask_point_normal(), BKE_mask_point_segment_co(), BKE_mask_point_weight(), BKE_mask_spline_differentiate_calc_total(), BKE_mask_spline_feather_collapse_inner_loops(), BKE_mask_spline_point_array(), MaskSpline::flag, float(), madd_v2_v2v2fl(), MASK_SPLINE_CYCLIC, MASK_SPLINE_NOINTERSECT, MEM_mallocN, and MaskSpline::tot_point.
Referenced by BKE_mask_spline_feather_differentiated_points_with_resolution().