diff options
author | Bill Spitzak <spitzak@gmail.com> | 2016-03-06 17:06:43 -0800 |
---|---|---|
committer | Søren Sandmann Pedersen <soren.sandmann@gmail.com> | 2016-03-11 00:00:45 -0500 |
commit | 5cd193992007e6099224c2da55f0080161a002c7 (patch) | |
tree | 84132353fb0f32d5cf7edb46c555d142bb2b56c7 | |
parent | 446ca248673b19cdcaebbcd8e4758d6657b271e2 (diff) |
pixman-filter: rename "scale" to "size" when it is 1/scale
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@gmail.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
-rw-r--r-- | pixman/pixman-filter.c | 18 | ||||
-rw-r--r-- | pixman/pixman.h | 6 |
2 files changed, 12 insertions, 12 deletions
diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c index a29116ad..c03a7f6d 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 509ba5e5..b012a33e 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, |