<div dir="ltr">Because the integral function is relying on the range being clamped to the non-zero portion for impulse filters and for box, and range checks are missing for some of the other filter functions, I would be tempted to remove the range check from here, and also from the impulse function (it would return 1 for all x). Oded did not like that idea but I wonder if you have any opinion.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 11, 2016 at 7:36 PM, Søren Sandmann Pedersen <span dir="ltr"><<a href="mailto:soren.sandmann@gmail.com" target="_blank">soren.sandmann@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>
v11: Restored range checks<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 | 14 ++++++++------<br>
1 file changed, 8 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c<br>
index 4abd05f..db4ab6e 100644<br>
--- a/pixman/pixman-filter.c<br>
+++ b/pixman/pixman-filter.c<br>
@@ -109,14 +109,16 @@ general_cubic (double x, double B, double C)<br>
<br>
if (ax < 1)<br>
{<br>
- return ((12 - 9 * B - 6 * C) * ax * ax * ax +<br>
- (-18 + 12 * B + 6 * C) * ax * ax + (6 - 2 * B)) / 6;<br>
+ return (((12 - 9 * B - 6 * C) * ax +<br>
+ (-18 + 12 * B + 6 * C)) * ax * ax +<br>
+ (6 - 2 * B)) / 6;<br>
}<br>
- else if (ax >= 1 && ax < 2)<br>
+ else if (ax < 2)<br>
{<br>
- return ((-B - 6 * C) * ax * ax * ax +<br>
- (6 * B + 30 * C) * ax * ax + (-12 * B - 48 * C) *<br>
- ax + (8 * B + 24 * C)) / 6;<br>
+ return ((((-B - 6 * C) * ax +<br>
+ (6 * B + 30 * C)) * ax +<br>
+ (-12 * B - 48 * C)) * ax +<br>
+ (8 * B + 24 * C)) / 6;<br>
}<br>
else<br>
{<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.11.7<br>
<br>
</font></span></blockquote></div><br></div>