[gegl] operations: gaussian blur doesn't perform strict comparisons on fp values



commit 15a2f4f73de7b2061aa094a00c16e9be7a302ea2
Author: Téo Mazars <teomazars gmail com>
Date:   Tue Dec 3 23:26:10 2013 +0100

    operations: gaussian blur doesn't perform strict comparisons on fp values

 operations/common/gaussian-blur.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/operations/common/gaussian-blur.c b/operations/common/gaussian-blur.c
index eb66b36..6ecc0b1 100644
--- a/operations/common/gaussian-blur.c
+++ b/operations/common/gaussian-blur.c
@@ -76,7 +76,7 @@ iir_young_find_constants (gfloat   sigma,
 {
   gdouble q;
 
-  if (sigma == 0.0)
+  if (GEGL_FLOAT_IS_ZERO (sigma))
     {
       /* to prevent unexpected ringing at tile boundaries,
          we define an (expensive) copy operation here */
@@ -244,7 +244,7 @@ iir_young_ver_blur (GeglBuffer          *src,
 static gint
 fir_calc_convolve_matrix_length (gdouble sigma)
 {
-  return sigma ? ceil (sigma)*6.0+1.0 : 1;
+  return sigma > GEGL_FLOAT_EPSILON ? ceil (sigma) * 6 + 1 : 1;
 }
 
 static gint


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]