<div dir="ltr"><div>I suppose it's a little illogical that scale_x and scale_y really are the reciprocal values of how much the source image should be scaled. I don't remember exactly what I was thinking, but it might have something like "this allows you to just pass t[0][0] and t[1][1] if you have a pure scaling, which avoids a division". There is also kind of precedence in the Pixman API since the transformation given as in the dst->source direction.<br><br>I don't really like "size" either though. It's not really the size of the filter that we are specifying; it just happens to be proportional to it.<br></div><br>If it comes down to "size" and "scale", I prefer "scale".<br><div><br><br></div><div>Søren<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 6, 2016 at 8:06 PM, <span dir="ltr"><<a href="mailto:spitzak@gmail.com" target="_blank">spitzak@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Bill Spitzak <<a href="mailto:spitzak@gmail.com">spitzak@gmail.com</a>><br>
<br>
This is to remove some confusion when reading the code. "scale" gets larger<br>
as the picture gets larger, while "size" (ie the size of the filter) gets<br>
smaller.<br>
<br>
v14: Removed changes to integral function<br>
<br>
Signed-off-by: Bill Spitzak <<a href="mailto:spitzak@gmail.com">spitzak@gmail.com</a>><br>
Reviewed-by: Oded Gabbay <<a href="mailto:oded.gabbay@gmail.com">oded.gabbay@gmail.com</a>><br>
---<br>
pixman/pixman-filter.c | 18 +++++++++---------<br>
pixman/pixman.h | 6 +++---<br>
2 files changed, 12 insertions(+), 12 deletions(-)<br>
<br>
diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c<br>
index a29116a..c03a7f6 100644<br>
--- a/pixman/pixman-filter.c<br>
+++ b/pixman/pixman-filter.c<br>
@@ -221,7 +221,7 @@ static void<br>
create_1d_filter (int width,<br>
pixman_kernel_t reconstruct,<br>
pixman_kernel_t sample,<br>
- double scale,<br>
+ double size,<br>
int n_phases,<br>
pixman_fixed_t *p)<br>
{<br>
@@ -251,8 +251,8 @@ create_1d_filter (int width,<br>
double pos = x + 0.5 - frac;<br>
double rlow = - filters[reconstruct].width / 2.0;<br>
double rhigh = rlow + filters[reconstruct].width;<br>
- double slow = pos - scale * filters[sample].width / 2.0;<br>
- double shigh = slow + scale * filters[sample].width;<br>
+ double slow = pos - size * filters[sample].width / 2.0;<br>
+ double shigh = slow + size * filters[sample].width;<br>
double c = 0.0;<br>
double ilow, ihigh;<br>
<br>
@@ -262,7 +262,7 @@ create_1d_filter (int width,<br>
ihigh = MIN (shigh, rhigh);<br>
<br>
c = integral (reconstruct, ilow,<br>
- sample, 1.0 / scale, ilow - pos,<br>
+ sample, 1.0 / size, ilow - pos,<br>
ihigh - ilow);<br>
}<br>
<br>
@@ -335,12 +335,12 @@ filter_width (pixman_kernel_t reconstruct, pixman_kernel_t sample, double size)<br>
}<br>
<br>
/* Create the parameter list for a SEPARABLE_CONVOLUTION filter<br>
- * with the given kernels and scale parameters<br>
+ * with the given kernels and size parameters<br>
*/<br>
PIXMAN_EXPORT pixman_fixed_t *<br>
pixman_filter_create_separable_convolution (int *n_values,<br>
- pixman_fixed_t scale_x,<br>
- pixman_fixed_t scale_y,<br>
+ pixman_fixed_t size_x,<br>
+ pixman_fixed_t size_y,<br>
pixman_kernel_t reconstruct_x,<br>
pixman_kernel_t reconstruct_y,<br>
pixman_kernel_t sample_x,<br>
@@ -348,8 +348,8 @@ pixman_filter_create_separable_convolution (int *n_values,<br>
int subsample_bits_x,<br>
int subsample_bits_y)<br>
{<br>
- double sx = fabs (pixman_fixed_to_double (scale_x));<br>
- double sy = fabs (pixman_fixed_to_double (scale_y));<br>
+ double sx = fabs (pixman_fixed_to_double (size_x));<br>
+ double sy = fabs (pixman_fixed_to_double (size_y));<br>
pixman_fixed_t *params;<br>
int subsample_x, subsample_y;<br>
int width, height;<br>
diff --git a/pixman/pixman.h b/pixman/pixman.h<br>
index 509ba5e..b012a33 100644<br>
--- a/pixman/pixman.h<br>
+++ b/pixman/pixman.h<br>
@@ -845,12 +845,12 @@ typedef enum<br>
} pixman_kernel_t;<br>
<br>
/* Create the parameter list for a SEPARABLE_CONVOLUTION filter<br>
- * with the given kernels and scale parameters.<br>
+ * with the given kernels and size parameters.<br>
*/<br>
pixman_fixed_t *<br>
pixman_filter_create_separable_convolution (int *n_values,<br>
- pixman_fixed_t scale_x,<br>
- pixman_fixed_t scale_y,<br>
+ pixman_fixed_t size_x,<br>
+ pixman_fixed_t size_y,<br>
pixman_kernel_t reconstruct_x,<br>
pixman_kernel_t reconstruct_y,<br>
pixman_kernel_t sample_x,<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.1<br>
<br>
_______________________________________________<br>
Pixman mailing list<br>
<a href="mailto:Pixman@lists.freedesktop.org">Pixman@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/pixman" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/pixman</a><br>
</font></span></blockquote></div><br></div>