[gegl] workshop: the convolution lenght increases smoothly in gaussian-blur



commit d645ee9fbfff9ea25e35aea2d7f141a10e82afad
Author: Téo Mazars <teomazars gmail com>
Date:   Wed Dec 11 20:00:18 2013 +0100

    workshop: the convolution lenght increases smoothly in gaussian-blur

 operations/workshop/gblur-1d.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/operations/workshop/gblur-1d.c b/operations/workshop/gblur-1d.c
index 77d0801..dd7fdc1 100644
--- a/operations/workshop/gblur-1d.c
+++ b/operations/workshop/gblur-1d.c
@@ -519,7 +519,10 @@ static gint
 fir_calc_convolve_matrix_length (gfloat sigma)
 {
 #if 1
-  return sigma > GEGL_FLOAT_EPSILON ? ceil (sigma) * 6 + 1 : 1;
+  /* an arbitrary precision */
+  gint clen = sigma > GEGL_FLOAT_EPSILON ? ceil (sigma * 6.5) : 1;
+  clen = clen + ((clen + 1) % 2);
+  return clen;
 #else
   if (sigma > GEGL_FLOAT_EPSILON)
     {


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