[Pixman] [PATCH v14 08/22] pixman-filter: rename "scale" to "size" when it is 1/scale

spitzak at gmail.com spitzak at gmail.com
Mon Mar 7 01:06:43 UTC 2016


From: Bill Spitzak <spitzak at gmail.com>

This is to remove some confusion when reading the code. "scale" gets larger
as the picture gets larger, while "size" (ie the size of the filter) gets
smaller.

v14: Removed changes to integral function

Signed-off-by: Bill Spitzak <spitzak at gmail.com>
Reviewed-by: Oded Gabbay <oded.gabbay at gmail.com>
---
 pixman/pixman-filter.c | 18 +++++++++---------
 pixman/pixman.h        |  6 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c
index a29116a..c03a7f6 100644
--- a/pixman/pixman-filter.c
+++ b/pixman/pixman-filter.c
@@ -221,7 +221,7 @@ static void
 create_1d_filter (int              width,
 		  pixman_kernel_t  reconstruct,
 		  pixman_kernel_t  sample,
-		  double           scale,
+		  double           size,
 		  int              n_phases,
 		  pixman_fixed_t *p)
 {
@@ -251,8 +251,8 @@ create_1d_filter (int              width,
 	    double pos = x + 0.5 - frac;
 	    double rlow = - filters[reconstruct].width / 2.0;
 	    double rhigh = rlow + filters[reconstruct].width;
-	    double slow = pos - scale * filters[sample].width / 2.0;
-	    double shigh = slow + scale * filters[sample].width;
+	    double slow = pos - size * filters[sample].width / 2.0;
+	    double shigh = slow + size * filters[sample].width;
 	    double c = 0.0;
 	    double ilow, ihigh;
 
@@ -262,7 +262,7 @@ create_1d_filter (int              width,
 		ihigh = MIN (shigh, rhigh);
 
 		c = integral (reconstruct, ilow,
-			      sample, 1.0 / scale, ilow - pos,
+			      sample, 1.0 / size, ilow - pos,
 			      ihigh - ilow);
 	    }
 
@@ -335,12 +335,12 @@ filter_width (pixman_kernel_t reconstruct, pixman_kernel_t sample, double size)
 }
 
 /* Create the parameter list for a SEPARABLE_CONVOLUTION filter
- * with the given kernels and scale parameters
+ * with the given kernels and size parameters
  */
 PIXMAN_EXPORT pixman_fixed_t *
 pixman_filter_create_separable_convolution (int             *n_values,
-					    pixman_fixed_t   scale_x,
-					    pixman_fixed_t   scale_y,
+					    pixman_fixed_t   size_x,
+					    pixman_fixed_t   size_y,
 					    pixman_kernel_t  reconstruct_x,
 					    pixman_kernel_t  reconstruct_y,
 					    pixman_kernel_t  sample_x,
@@ -348,8 +348,8 @@ pixman_filter_create_separable_convolution (int             *n_values,
 					    int              subsample_bits_x,
 					    int	             subsample_bits_y)
 {
-    double sx = fabs (pixman_fixed_to_double (scale_x));
-    double sy = fabs (pixman_fixed_to_double (scale_y));
+    double sx = fabs (pixman_fixed_to_double (size_x));
+    double sy = fabs (pixman_fixed_to_double (size_y));
     pixman_fixed_t *params;
     int subsample_x, subsample_y;
     int width, height;
diff --git a/pixman/pixman.h b/pixman/pixman.h
index 509ba5e..b012a33 100644
--- a/pixman/pixman.h
+++ b/pixman/pixman.h
@@ -845,12 +845,12 @@ typedef enum
 } pixman_kernel_t;
 
 /* Create the parameter list for a SEPARABLE_CONVOLUTION filter
- * with the given kernels and scale parameters.
+ * with the given kernels and size parameters.
  */
 pixman_fixed_t *
 pixman_filter_create_separable_convolution (int             *n_values,
-					    pixman_fixed_t   scale_x,
-					    pixman_fixed_t   scale_y,
+					    pixman_fixed_t   size_x,
+					    pixman_fixed_t   size_y,
 					    pixman_kernel_t  reconstruct_x,
 					    pixman_kernel_t  reconstruct_y,
 					    pixman_kernel_t  sample_x,
-- 
1.9.1



More information about the Pixman mailing list