<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 22, 2015 at 2:32 AM, Oded Gabbay <span dir="ltr"><<a href="mailto:oded.gabbay@gmail.com" target="_blank">oded.gabbay@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, Dec 12, 2015 at 8:06 PM, <<a href="mailto:spitzak@gmail.com">spitzak@gmail.com</a>> wrote:<br>
> From: Bill Spitzak <<a href="mailto:spitzak@gmail.com">spitzak@gmail.com</a>><br>
><br>
> The other filters don't range-check, so there is no need for this<br>
> one to either. It is only called with x==0.<br>
<br>
</span>Actually, I tried to stop at this function in gdb and didn't manage to<br>
do it (using the scale demo). I then looked at the code and it seems<br>
to me that the only way to reach this function is when both<br>
reconstruction and sample kernels are IMPLUSE. That's because:<br>
<br>
1. If both reconstruction and sample are *not* IMPLUSE, then of course<br>
we won't reach it.<br>
2. If only one of them is IMPLUSE, than the code will immediately<br>
return the value of the function of the other kernel, which is *not*<br>
IMPLUSE.<br>
<br>
However, when I put both of them to IMPLUSE in the scale demo, the<br>
picture simply disappears *and* the impluse_kernel is still not<br>
reached. Actually, in that case, the integral() func is never reached<br>
as well.<br>
<br>
What am I missing ?<br></blockquote><div><br></div><div>I believe at this point the calling code calculated a width of zero for the filter, and this caused all kinds of problems.<br><br></div><div>I think you are correct that in most or all versions of this code, that impulse function is never called, and it could be a null pointer instead.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Oded<br>
<span class=""><br>
> ---<br>
> pixman/pixman-filter.c | 2 +-<br>
> 1 file changed, 1 insertion(+), 1 deletion(-)<br>
><br>
> diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c<br>
> index fbc657d..00126cd 100644<br>
> --- a/pixman/pixman-filter.c<br>
> +++ b/pixman/pixman-filter.c<br>
> @@ -45,7 +45,7 @@ typedef struct<br>
> static double<br>
> impulse_kernel (double x)<br>
> {<br>
> - return (x == 0.0)? 1.0 : 0.0;<br>
> + return 1;<br>
> }<br>
><br>
> static double<br>
> --<br>
> 1.9.1<br>
><br>
</span>> _______________________________________________<br>
> Pixman mailing list<br>
> <a href="mailto:Pixman@lists.freedesktop.org">Pixman@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/pixman" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/pixman</a><br>
</blockquote></div><br></div></div>