Don't use with_resol suffix for functions which doesn't get resolution
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 20 Dec 2013 10:00:05 +0000 (16:00 +0600)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 20 Dec 2013 10:00:05 +0000 (16:00 +0600)
source/blender/blenkernel/BKE_mask.h
source/blender/blenkernel/intern/mask_evaluate.c
source/blender/blenkernel/intern/mask_rasterize.c
source/blender/editors/mask/mask_add.c
source/blender/editors/mask/mask_draw.c

index 8d2233fefd16f4646d28dae881711df90721ca32..125a4354c37965f68bdb5483ef070dd3eec6f314 100644 (file)
@@ -189,23 +189,23 @@ unsigned int BKE_mask_spline_resolution(struct MaskSpline *spline, int width, in
 unsigned int BKE_mask_spline_feather_resolution(struct MaskSpline *spline, int width, int height);
 int          BKE_mask_spline_differentiate_calc_total(const struct MaskSpline *spline, const unsigned int resol);
 
-float (*BKE_mask_spline_differentiate_with_resolution_ex(struct MaskSpline *spline, unsigned int *tot_diff_point,
-                                                         const unsigned int resol))[2];
+float (*BKE_mask_spline_differentiate_with_resolution(struct MaskSpline *spline, unsigned int *tot_diff_point,
+                                                      const unsigned int resol))[2];
 void    BKE_mask_spline_feather_collapse_inner_loops(struct MaskSpline *spline, float (*feather_points)[2], const unsigned int tot_feather_point);
-float (*BKE_mask_spline_differentiate_with_resolution(struct MaskSpline *spline, int width, int height, unsigned int *tot_diff_point))[2];
-float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(struct MaskSpline *spline, unsigned int *tot_feather_point,
-                                                                         const unsigned int resol, const int do_feather_isect))[2];
+float (*BKE_mask_spline_differentiate(struct MaskSpline *spline, int width, int height, unsigned int *tot_diff_point))[2];
+float (*BKE_mask_spline_feather_differentiated_points_with_resolution(struct MaskSpline *spline, unsigned int *tot_feather_point,
+                                                                      const unsigned int resol, const int do_feather_isect))[2];
 
 /* *** mask point functions which involve evaluation *** */
 float (*BKE_mask_spline_feather_points(struct MaskSpline *spline, int *tot_feather_point))[2];
 
-float *BKE_mask_point_segment_diff_with_resolution(struct MaskSpline *spline, struct MaskSplinePoint *point,
-                                                   int width, int height,
-                                                   unsigned int *tot_diff_point);
+float *BKE_mask_point_segment_diff(struct MaskSpline *spline, struct MaskSplinePoint *point,
+                                   int width, int height,
+                                   unsigned int *tot_diff_point);
 
-float *BKE_mask_point_segment_feather_diff_with_resolution(struct MaskSpline *spline, struct MaskSplinePoint *point,
-                                                           int width, int height,
-                                                           unsigned int *tot_feather_point);
+float *BKE_mask_point_segment_feather_diff(struct MaskSpline *spline, struct MaskSplinePoint *point,
+                                           int width, int height,
+                                           unsigned int *tot_feather_point);
 
 /* mask_rasterize.c */
 struct MaskRasterHandle;
index 2a4ba5aa3afb4eab2f2ff07e9e2f86c8ca71cf9b..f63d027d9f4851f014914382617581ab101f3d9d 100644 (file)
@@ -154,10 +154,10 @@ int BKE_mask_spline_differentiate_calc_total(const MaskSpline *spline, const uns
        }
 }
 
-float (*BKE_mask_spline_differentiate_with_resolution_ex(MaskSpline *spline,
-                                                         unsigned int *tot_diff_point,
-                                                         const unsigned int resol
-                                                         ))[2]
+float (*BKE_mask_spline_differentiate_with_resolution(MaskSpline *spline,
+                                                      unsigned int *tot_diff_point,
+                                                      const unsigned int resol
+                                                      ))[2]
 {
        MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
 
@@ -213,13 +213,13 @@ float (*BKE_mask_spline_differentiate_with_resolution_ex(MaskSpline *spline,
        return diff_points;
 }
 
-float (*BKE_mask_spline_differentiate_with_resolution(MaskSpline *spline, int width, int height,
-                                                      unsigned int *tot_diff_point
-                                                      ))[2]
+float (*BKE_mask_spline_differentiate(MaskSpline *spline, int width, int height,
+                                      unsigned int *tot_diff_point
+                                      ))[2]
 {
        int unsigned resol = BKE_mask_spline_resolution(spline, width, height);
 
-       return BKE_mask_spline_differentiate_with_resolution_ex(spline, tot_diff_point, resol);
+       return BKE_mask_spline_differentiate_with_resolution(spline, tot_diff_point, resol);
 }
 
 /* ** feather points self-intersection collapse routine ** */
@@ -501,12 +501,12 @@ void BKE_mask_spline_feather_collapse_inner_loops(MaskSpline *spline, float (*fe
 #undef BUCKET_INDEX
 }
 
-/** only called from #BKE_mask_spline_feather_differentiated_points_with_resolution_ex() ! */
-static float (*mask_spline_feather_differentiated_points_with_resolution_ex__even(MaskSpline *spline,
-                                                                                  unsigned int *tot_feather_point,
-                                                                                  const unsigned int resol,
-                                                                                  const int do_feather_isect
-                                                                                  ))[2]
+/** only called from #BKE_mask_spline_feather_differentiated_points_with_resolution() ! */
+static float (*mask_spline_feather_differentiated_points_with_resolution__even(MaskSpline *spline,
+                                                                               unsigned int *tot_feather_point,
+                                                                               const unsigned int resol,
+                                                                               const int do_feather_isect
+                                                                               ))[2]
 {
        MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
        MaskSplinePoint *point_curr, *point_prev;
@@ -574,12 +574,12 @@ static float (*mask_spline_feather_differentiated_points_with_resolution_ex__eve
        return feather;
 }
 
-/** only called from #BKE_mask_spline_feather_differentiated_points_with_resolution_ex() ! */
-static float (*mask_spline_feather_differentiated_points_with_resolution_ex__double(MaskSpline *spline,
-                                                                                    unsigned int *tot_feather_point,
-                                                                                    const unsigned int resol,
-                                                                                    const int do_feather_isect
-                                                                                    ))[2]
+/** only called from #BKE_mask_spline_feather_differentiated_points_with_resolution() ! */
+static float (*mask_spline_feather_differentiated_points_with_resolution__double(MaskSpline *spline,
+                                                                                 unsigned int *tot_feather_point,
+                                                                                 const unsigned int resol,
+                                                                                 const int do_feather_isect
+                                                                                 ))[2]
 {
        MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
 
@@ -709,22 +709,22 @@ static float (*mask_spline_feather_differentiated_points_with_resolution_ex__dou
 }
 
 /**
- * values align with #BKE_mask_spline_differentiate_with_resolution_ex
+ * values align with #BKE_mask_spline_differentiate_with_resolution
  * when \a resol arguments match.
  */
-float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(MaskSpline *spline,
-                                                                         unsigned int *tot_feather_point,
-                                                                         const unsigned int resol,
-                                                                         const int do_feather_isect
-                                                                         ))[2]
+float (*BKE_mask_spline_feather_differentiated_points_with_resolution(MaskSpline *spline,
+                                                                      unsigned int *tot_feather_point,
+                                                                      const unsigned int resol,
+                                                                      const int do_feather_isect
+                                                                      ))[2]
 {
        switch (spline->offset_mode) {
                case MASK_SPLINE_OFFSET_EVEN:
-                       return mask_spline_feather_differentiated_points_with_resolution_ex__even(spline, tot_feather_point, resol, do_feather_isect);
+                       return mask_spline_feather_differentiated_points_with_resolution__even(spline, tot_feather_point, resol, do_feather_isect);
                        break;
                case MASK_SPLINE_OFFSET_SMOOTH:
                default:
-                       return mask_spline_feather_differentiated_points_with_resolution_ex__double(spline, tot_feather_point, resol, do_feather_isect);
+                       return mask_spline_feather_differentiated_points_with_resolution__double(spline, tot_feather_point, resol, do_feather_isect);
                        break;
        }
 }
@@ -777,9 +777,9 @@ float (*BKE_mask_spline_feather_points(MaskSpline *spline, int *tot_feather_poin
 }
 
 /* *** mask point functions which involve evaluation *** */
-float *BKE_mask_point_segment_feather_diff_with_resolution(MaskSpline *spline, MaskSplinePoint *point,
-                                                           int width, int height,
-                                                           unsigned int *tot_feather_point)
+float *BKE_mask_point_segment_feather_diff(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);
@@ -804,8 +804,8 @@ float *BKE_mask_point_segment_feather_diff_with_resolution(MaskSpline *spline, M
        return feather;
 }
 
-float *BKE_mask_point_segment_diff_with_resolution(MaskSpline *spline, MaskSplinePoint *point,
-                                                   int width, int height, unsigned int *tot_diff_point)
+float *BKE_mask_point_segment_diff(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);
 
index a43bf41058ceb40cf283803b6d60631cbca4fd05..38301d51cbd6605b7a2c6a20d786daa2923df6fb 100644 (file)
@@ -626,11 +626,11 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, struct Mask *mas
                        const unsigned int resol_b = BKE_mask_spline_feather_resolution(spline, width, height) / 4;
                        const unsigned int resol = CLAMPIS(MAX2(resol_a, resol_b), 4, 512);
 
-                       diff_points = BKE_mask_spline_differentiate_with_resolution_ex(
+                       diff_points = BKE_mask_spline_differentiate_with_resolution(
                                          spline, &tot_diff_point, resol);
 
                        if (do_feather) {
-                               diff_feather_points = BKE_mask_spline_feather_differentiated_points_with_resolution_ex(
+                               diff_feather_points = BKE_mask_spline_feather_differentiated_points_with_resolution(
                                                          spline, &tot_diff_feather_points, resol, FALSE);
                                BLI_assert(diff_feather_points);
                        }
index 7a78d60e11ece544f10dffabafa81a621b760755..d2704923de15f2728dfa246a4b892b5812e37952 100644 (file)
@@ -94,8 +94,8 @@ static int find_nearest_diff_point(const bContext *C, Mask *mask, const float no
                                float *diff_points;
                                unsigned int tot_diff_point;
 
-                               diff_points = BKE_mask_point_segment_diff_with_resolution(spline, cur_point, width, height,
-                                                                                         &tot_diff_point);
+                               diff_points = BKE_mask_point_segment_diff(spline, cur_point, width, height,
+                                                                         &tot_diff_point);
 
                                if (diff_points) {
                                        int j, tot_point;
@@ -103,9 +103,9 @@ static int find_nearest_diff_point(const bContext *C, Mask *mask, const float no
                                        float *feather_points = NULL, *points;
 
                                        if (feather) {
-                                               feather_points = BKE_mask_point_segment_feather_diff_with_resolution(spline, cur_point,
-                                                                                                                    width, height,
-                                                                                                                    &tot_feather_point);
+                                               feather_points = BKE_mask_point_segment_feather_diff(spline, cur_point,
+                                                                                                    width, height,
+                                                                                                    &tot_feather_point);
 
                                                points = feather_points;
                                                tot_point = tot_feather_point;
index 50d8e653737df65b7c135c85c09c3b4969bf5964..6b60e5ed390be84929bd323220e9d7f3f1b6229a 100644 (file)
@@ -425,7 +425,7 @@ static void draw_spline_curve(const bContext *C, MaskLayer *masklay, MaskSpline
        unsigned int tot_feather_point;
        float (*feather_points)[2];
 
-       diff_points = BKE_mask_spline_differentiate_with_resolution_ex(spline, &tot_diff_point, resol);
+       diff_points = BKE_mask_spline_differentiate_with_resolution(spline, &tot_diff_point, resol);
 
        if (!diff_points)
                return;
@@ -436,7 +436,7 @@ static void draw_spline_curve(const bContext *C, MaskLayer *masklay, MaskSpline
                glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        }
 
-       feather_points = BKE_mask_spline_feather_differentiated_points_with_resolution_ex(spline, &tot_feather_point, resol, (is_fill != FALSE));
+       feather_points = BKE_mask_spline_feather_differentiated_points_with_resolution(spline, &tot_feather_point, resol, (is_fill != FALSE));
 
        /* draw feather */
        mask_spline_feather_color_get(masklay, spline, is_spline_sel, rgb_tmp);