diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-26 22:09:01 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-26 22:09:01 +0400 |
commit | 52310bd4a799e90dda3e589b7e863c217df0fd4e (patch) | |
tree | 5fc6ac361da68a5a75c687af225a8b967467ef96 /source/blender/blenkernel/intern/mask.c | |
parent | 7b84a75a2232c2fd810b584539110046b6a4f518 (diff) |
code cleanup: remove dead assignments, gave mask vars clearer names & moved some mask evaluation funcs into mask_evaluate.c
Diffstat (limited to 'source/blender/blenkernel/intern/mask.c')
-rw-r--r-- | source/blender/blenkernel/intern/mask.c | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c index d7f6b6f6b25..5182c52605a 100644 --- a/source/blender/blenkernel/intern/mask.c +++ b/source/blender/blenkernel/intern/mask.c @@ -483,73 +483,6 @@ void BKE_mask_point_set_handle(MaskSplinePoint *point, float loc[2], int keep_di } } -float *BKE_mask_point_segment_feather_diff_with_resolution(MaskSpline *spline, MaskSplinePoint *point, - int width, int height, - unsigned int *tot_feather_point) -{ - float *feather, *fp; - unsigned int resol = BKE_mask_spline_feather_resolution(spline, width, height); - unsigned int i; - - feather = fp = MEM_callocN(2 * resol * sizeof(float), "mask point spline feather diff points"); - - for (i = 0; i < resol; i++, fp += 2) { - float u = (float)(i % resol) / resol, weight; - float co[2], n[2]; - - BKE_mask_point_segment_co(spline, point, u, co); - BKE_mask_point_normal(spline, point, u, n); - weight = BKE_mask_point_weight(spline, point, u); - - fp[0] = co[0] + n[0] * weight; - fp[1] = co[1] + n[1] * weight; - } - - *tot_feather_point = resol; - - return feather; -} - -float *BKE_mask_point_segment_feather_diff(MaskSpline *spline, MaskSplinePoint *point, unsigned int *tot_feather_point) -{ - return BKE_mask_point_segment_feather_diff_with_resolution(spline, point, 0, 0, tot_feather_point); -} - -float *BKE_mask_point_segment_diff_with_resolution(MaskSpline *spline, MaskSplinePoint *point, - int width, int height, unsigned int *tot_diff_point) -{ - MaskSplinePoint *points_array = BKE_mask_spline_point_array_from_point(spline, point); - - BezTriple *bezt, *bezt_next; - float *diff_points, *fp; - int j, resol = BKE_mask_spline_resolution(spline, width, height); - - bezt = &point->bezt; - bezt_next = BKE_mask_spline_point_next_bezt(spline, points_array, point); - - if (!bezt_next) - return NULL; - - /* resol+1 because of 'forward_diff_bezier' function */ - *tot_diff_point = resol + 1; - diff_points = fp = MEM_callocN((resol + 1) * 2 * sizeof(float), "mask segment vets"); - - for (j = 0; j < 2; j++) { - BKE_curve_forward_diff_bezier(bezt->vec[1][j], bezt->vec[2][j], - bezt_next->vec[0][j], bezt_next->vec[1][j], - fp + j, resol, 2 * sizeof(float)); - } - - copy_v2_v2(fp + 2 * resol, bezt_next->vec[1]); - - return diff_points; -} - -float *BKE_mask_point_segment_diff(MaskSpline *spline, MaskSplinePoint *point, unsigned int *tot_diff_point) -{ - return BKE_mask_point_segment_diff_with_resolution(spline, point, 0, 0, tot_diff_point); -} - void BKE_mask_point_segment_co(MaskSpline *spline, MaskSplinePoint *point, float u, float co[2]) { MaskSplinePoint *points_array = BKE_mask_spline_point_array_from_point(spline, point); |