gegl r2491 - in branches/branch_zhangjb: . gegl/buffer operations/affine operations/frequency operations/frequency/tools tests/frequency



Author: zhangjb
Date: Fri Jun 20 13:03:25 2008
New Revision: 2491
URL: http://svn.gnome.org/viewvc/gegl?rev=2491&view=rev

Log:
Merged r2357 with trunk HEAD. 


Modified:
   branches/branch_zhangjb/ChangeLog
   branches/branch_zhangjb/configure.ac
   branches/branch_zhangjb/gegl/buffer/gegl-sampler-cubic.c
   branches/branch_zhangjb/gegl/buffer/gegl-sampler-lanczos.c
   branches/branch_zhangjb/gegl/buffer/gegl-sampler-linear.c
   branches/branch_zhangjb/gegl/buffer/gegl-sampler-nearest.c
   branches/branch_zhangjb/gegl/buffer/gegl-sampler.c
   branches/branch_zhangjb/gegl/buffer/gegl-sampler.h
   branches/branch_zhangjb/operations/affine/affine.c
   branches/branch_zhangjb/operations/frequency/Makefile.am
   branches/branch_zhangjb/operations/frequency/dft-grey.c
   branches/branch_zhangjb/operations/frequency/dft-inverse-grey.c
   branches/branch_zhangjb/operations/frequency/dft-inverse.c
   branches/branch_zhangjb/operations/frequency/dft.c
   branches/branch_zhangjb/operations/frequency/preview-frequency-grey.c
   branches/branch_zhangjb/operations/frequency/preview-frequency.c
   branches/branch_zhangjb/operations/frequency/tools/Makefile.am
   branches/branch_zhangjb/tests/frequency/hello-world-fourier.c

Modified: branches/branch_zhangjb/configure.ac
==============================================================================
--- branches/branch_zhangjb/configure.ac	(original)
+++ branches/branch_zhangjb/configure.ac	Fri Jun 20 13:03:25 2008
@@ -840,7 +840,6 @@
 operations/external/Makefile
 operations/frequency/Makefile
 operations/frequency/tools/Makefile
-operations/frequency/filters/Makefile
 operations/generated/Makefile
 operations/workshop/Makefile
 operations/workshop/external/Makefile

Modified: branches/branch_zhangjb/gegl/buffer/gegl-sampler-cubic.c
==============================================================================
--- branches/branch_zhangjb/gegl/buffer/gegl-sampler-cubic.c	(original)
+++ branches/branch_zhangjb/gegl/buffer/gegl-sampler-cubic.c	Fri Jun 20 13:03:25 2008
@@ -123,12 +123,13 @@
 {
   GeglSamplerCubic *cubic = (GeglSamplerCubic*)(self);
   GeglRectangle     context_rect;
+  const gint        offsets[16]={-4-64*4, 4, 4, 4,
+                                (64-3)*4, 4, 4, 4,
+                                (64-3)*4, 4, 4, 4,
+                                (64-3)*4, 4, 4, 4};
   gfloat           *sampler_bptr;
   gfloat            factor;
-  gdouble           arecip;
-  gdouble           newval[4];
-  gfloat            abyss = 0.;
-  gfloat            dst[4];
+  gfloat            newval[4];
   gint              u,v;
   gint              dx,dy;
   gint              i;
@@ -137,40 +138,22 @@
   dx = (gint) x;
   dy = (gint) y;
   newval[0] = newval[1] = newval[2] = newval[3] = 0.;
-  for (v=dy+context_rect.y ; v < dy+context_rect.y+context_rect.height ; v++)
-    for (u=dx+context_rect.x ; u < dx+context_rect.x+context_rect.width  ; u++)
+  sampler_bptr = gegl_sampler_get_ptr (self, dx, dy);
+  for (v=dy+context_rect.y, i=0; v < dy+context_rect.y+context_rect.height ; v++)
+    for (u=dx+context_rect.x ; u < dx+context_rect.x+context_rect.width  ; u++, i++)
       {
-        sampler_bptr = gegl_sampler_get_from_buffer (self, u, v);
+        /*sampler_bptr = gegl_sampler_get_from_buffer (self, u, v);*/
+        sampler_bptr += offsets[i];
         factor     = cubicKernel (y - v, cubic->b, cubic->c) *
                      cubicKernel (x - u, cubic->b, cubic->c);
-        newval[0] += factor * sampler_bptr[0] * sampler_bptr[3];
-        newval[1] += factor * sampler_bptr[1] * sampler_bptr[3];
-        newval[2] += factor * sampler_bptr[2] * sampler_bptr[3];
+        newval[0] += factor * sampler_bptr[0];
+        newval[1] += factor * sampler_bptr[1];
+        newval[2] += factor * sampler_bptr[2];
         newval[3] += factor * sampler_bptr[3];
       }
-  if (newval[3] <= abyss)
-    {
-      arecip    = abyss;
-      newval[3] = abyss;
-    }
-  else if (newval[3] > G_MAXDOUBLE)
-    {
-      arecip    = 1.0 / newval[3];
-      newval[3] = G_MAXDOUBLE;
-    }
-  else
-    {
-      arecip = 1.0 / newval[3];
-    }
-
-  for ( i=0 ;  i < 3 ; i++ )
-    newval[i] *= arecip;
-  for ( i=0 ;  i < 4 ; i++ )
-    dst[i] = CLAMP (newval[i], 0, G_MAXDOUBLE);
-
 
   babl_process (babl_fish (self->interpolate_format, self->format),
-                dst, output, 1);
+                newval, output, 1);
 
 }
 
@@ -230,7 +213,9 @@
              gfloat c)
  {
   gfloat weight, x2, x3;
-  gfloat ax = (gfloat) fabs (x);
+  gfloat ax = x;
+  if (ax < 0.0)
+    ax *= -1.0;
 
   if (ax > 2) return 0;
 
@@ -247,6 +232,6 @@
              (-12 * b - 48 * c) * ax +
              (8 * b + 24 * c);
 
-  return weight * (1.0 / 6.0);
+  return weight / 6.0;
 }
 

Modified: branches/branch_zhangjb/gegl/buffer/gegl-sampler-lanczos.c
==============================================================================
--- branches/branch_zhangjb/gegl/buffer/gegl-sampler-lanczos.c	(original)
+++ branches/branch_zhangjb/gegl/buffer/gegl-sampler-lanczos.c	Fri Jun 20 13:03:25 2008
@@ -146,10 +146,8 @@
   GeglSamplerLanczos      *lanczos      = GEGL_SAMPLER_LANCZOS (self);
   GeglRectangle            context_rect = self->context_rect;
   gfloat                  *sampler_bptr;
-  gdouble                  x_sum, y_sum, arecip;
-  gdouble                  newval[4];
-
-  gfloat                   dst[4];
+  gdouble                  x_sum, y_sum;
+  gfloat                   newval[4] = {0.0, 0.0, 0.0, 0.0};
   gint                     i, j;
   gint                     spp    = lanczos->lanczos_spp;
   gint                     width  = lanczos->lanczos_width;
@@ -157,7 +155,10 @@
   gint                     dx,dy;
   gint                     u,v;
 
-  gdouble                  x_kernel[width2], /* 1-D kernels of Lanczos window coeffs */
+  /* FIXME: move the initialization of these arrays into the _prepare function
+   * to speed up actual resampling
+   */
+  gfloat                   x_kernel[width2], /* 1-D kernels of Lanczos window coeffs */
                            y_kernel[width2];
 
   self->interpolate_format = babl_format ("RaGaBaA float");
@@ -178,8 +179,6 @@
       x_kernel[i] /= x_sum;
       y_kernel[i] /= y_sum;
     }
-  arecip    = 0.0;
-  newval[0] = newval[1] = newval[2] = newval[3] = 0.0;
 
   dx = (gint) x;
   dy = (gint) y;
@@ -187,32 +186,14 @@
     for (u=dx+context_rect.x, i = 0; u < dx+context_rect.x+context_rect.width; i++, u++)
       {
          sampler_bptr = gegl_sampler_get_from_buffer (self, u, v);
-         newval[0] += y_kernel[j] * x_kernel[i] * sampler_bptr[0] * sampler_bptr[3];
-         newval[1] += y_kernel[j] * x_kernel[i] * sampler_bptr[1] * sampler_bptr[3];
-         newval[2] += y_kernel[j] * x_kernel[i] * sampler_bptr[2] * sampler_bptr[3];
+         newval[0] += y_kernel[j] * x_kernel[i] * sampler_bptr[0];
+         newval[1] += y_kernel[j] * x_kernel[i] * sampler_bptr[1];
+         newval[2] += y_kernel[j] * x_kernel[i] * sampler_bptr[2];
          newval[3] += y_kernel[j] * x_kernel[i] * sampler_bptr[3];
       }
-  if (newval[3] <= 0.0)
-    {
-      arecip    = 0.0;
-      newval[3] = 0;
-    }
-  else if (newval[3] > G_MAXDOUBLE)
-    {
-      arecip    = 1.0 / newval[3];
-      newval[3] = G_MAXDOUBLE;
-    }
-  else
-    {
-      arecip = 1.0 / newval[3];
-    }
-  for ( i=0 ;  i < 3 ; i++ )
-    newval[i] *= arecip;
-  for ( i=0 ;  i < 4 ; i++ )
-    dst[i] = CLAMP (newval[i], 0, G_MAXDOUBLE);
 
   babl_process (babl_fish (self->interpolate_format, self->format),
-                dst, output, 1);
+                newval, output, 1);
 }
 
 static void

Modified: branches/branch_zhangjb/gegl/buffer/gegl-sampler-linear.c
==============================================================================
--- branches/branch_zhangjb/gegl/buffer/gegl-sampler-linear.c	(original)
+++ branches/branch_zhangjb/gegl/buffer/gegl-sampler-linear.c	Fri Jun 20 13:03:25 2008
@@ -75,13 +75,12 @@
 {
   GeglRectangle      context_rect = self->context_rect;
   gfloat            *sampler_bptr;
-  gfloat             abyss = 0.;
-  gfloat             dst[4];
-  gdouble            arecip;
-  gdouble            newval[4];
-  gdouble            q[4];
-  gdouble            dx,dy;
-  gdouble            uf, vf;
+  const gint         offsets[4]={0,        4,
+                                 (64-1)*4, 4};
+  gfloat             newval[4] = {0.0, 0.0, 0.0, 0.0};
+  gfloat             q[4];
+  gfloat             dx,dy;
+  gfloat             uf, vf;
   gint               u,v;
   gint               i;
 
@@ -95,38 +94,22 @@
   q[3] = uf * vf;
   dx = (gint) x;
   dy = (gint) y;
-  newval[0] = newval[1] = newval[2] = newval[3] = 0.;
+
+  sampler_bptr = gegl_sampler_get_ptr (self, dx, dy);
+
+  /* FIXME: unroll this loop */
   for (i=0, v=dy+context_rect.y; v < dy+context_rect.height ; v++)
     for (u=dx+context_rect.x; u < dx+context_rect.width  ; u++, i++)
       {
-        sampler_bptr = gegl_sampler_get_from_buffer (self, u, v);
-        newval[0] += q[i] * sampler_bptr[0] * sampler_bptr[3];
-        newval[1] += q[i] * sampler_bptr[1] * sampler_bptr[3];
-        newval[2] += q[i] * sampler_bptr[2] * sampler_bptr[3];
+        sampler_bptr += offsets[i];
+        newval[0] += q[i] * sampler_bptr[0];
+        newval[1] += q[i] * sampler_bptr[1];
+        newval[2] += q[i] * sampler_bptr[2];
         newval[3] += q[i] * sampler_bptr[3];
       }
 
-  if (newval[3] <= abyss)
-    {
-      arecip    = abyss;
-      newval[3] = abyss;
-    }
-  else if (newval[3] > G_MAXDOUBLE)
-    {
-      arecip    = 1.0 / newval[3];
-      newval[3] = G_MAXDOUBLE;
-    }
-  else
-    {
-      arecip = 1.0 / newval[3];
-    }
-  for ( i=0 ;  i < 3 ; i++ )
-    newval[i] *= arecip;
-  for ( i=0 ;  i < 4 ; i++ )
-    dst[i] = CLAMP (newval[i], 0, G_MAXDOUBLE);
-
   babl_process (babl_fish (self->interpolate_format, self->format),
-                dst, output, 1);
+                newval, output, 1);
 }
 
 

Modified: branches/branch_zhangjb/gegl/buffer/gegl-sampler-nearest.c
==============================================================================
--- branches/branch_zhangjb/gegl/buffer/gegl-sampler-nearest.c	(original)
+++ branches/branch_zhangjb/gegl/buffer/gegl-sampler-nearest.c	Fri Jun 20 13:03:25 2008
@@ -59,7 +59,7 @@
 gegl_sampler_nearest_init (GeglSamplerNearest *self)
 {
    GEGL_SAMPLER (self)->context_rect = (GeglRectangle){0,0,1,1};
-   GEGL_SAMPLER (self)->interpolate_format = babl_format ("RaGaBaA float");
+   GEGL_SAMPLER (self)->interpolate_format = babl_format ("RGBA float");
 }
 
 void

Modified: branches/branch_zhangjb/gegl/buffer/gegl-sampler.c
==============================================================================
--- branches/branch_zhangjb/gegl/buffer/gegl-sampler.c	(original)
+++ branches/branch_zhangjb/gegl/buffer/gegl-sampler.c	Fri Jun 20 13:03:25 2008
@@ -131,6 +131,11 @@
   if (klass->prepare)
     klass->prepare (self);
 
+  /* this makes the cache rect invalid, in case the data in the buffer has
+   * changed
+  */
+  self->sampler_rectangle.width=0;
+  self->sampler_rectangle.height=0;
 #if 0
   if (self->cache_buffer) /* to force a regetting of the region, even
                              if the cached getter might be valid
@@ -180,6 +185,70 @@
   G_OBJECT_CLASS (gegl_sampler_parent_class)->dispose (gobject);
 }
 
+
+/* gets a pointer to the center pixel, within a buffer that has
+ * a rowstride of 64px * 16bpp
+ */
+gfloat *
+gegl_sampler_get_ptr (GeglSampler         *sampler,
+                      gint                 x,
+                      gint                 y)
+{
+   guchar        *buffer_ptr;
+   gint           dx;
+   gint           dy;
+   gint           bpp;
+   gint           sof;
+
+
+   bpp = sampler->interpolate_format->format.bytes_per_pixel;
+
+   if (sampler->sampler_buffer == NULL ||
+       x + sampler->context_rect.x < sampler->sampler_rectangle.x ||
+       y + sampler->context_rect.y < sampler->sampler_rectangle.y ||
+       x + sampler->context_rect.x + sampler->context_rect.width >= sampler->sampler_rectangle.x + sampler->sampler_rectangle.width ||
+       y + sampler->context_rect.y + sampler->context_rect.height >= sampler->sampler_rectangle.y + sampler->sampler_rectangle.height)
+     {
+       GeglRectangle  fetch_rectangle/* = sampler->context_rect*/;
+
+       fetch_rectangle.x = x + sampler->context_rect.x;
+       fetch_rectangle.y = y + sampler->context_rect.y;
+
+       /* we override the fetch rectangle needed by the sampler, hoping that
+        * the extra pixels we fetch comes in useful in subsequent requests,
+        * we assume that it is more likely that further access is to the right
+        * or down of our currently requested position.
+        */
+       fetch_rectangle.x -= 8;
+       fetch_rectangle.y -= 8;
+       fetch_rectangle.width = 64;
+       fetch_rectangle.height = 64;
+
+
+       if (sampler->sampler_buffer == NULL )
+         { /* we always request the same amount of pixels (64kb worth) */
+           sampler->sampler_buffer = g_malloc0 (fetch_rectangle.width *
+                                                fetch_rectangle.height *
+                                                bpp);
+         }
+
+       gegl_buffer_get (sampler->buffer,
+                        1.0,
+                        &fetch_rectangle,
+                        sampler->interpolate_format,
+                        sampler->sampler_buffer,
+                        GEGL_AUTO_ROWSTRIDE);
+
+       sampler->sampler_rectangle = fetch_rectangle;
+     }
+
+   dx = x - sampler->sampler_rectangle.x;
+   dy = y - sampler->sampler_rectangle.y;
+   buffer_ptr = (guchar *)sampler->sampler_buffer;
+   sof = ( dx +  (dy * sampler->sampler_rectangle.width)) * bpp;
+   return (gfloat*)(buffer_ptr+sof);
+}
+
 #include <math.h>
 
 gfloat *
@@ -204,8 +273,8 @@
      {
        GeglRectangle  fetch_rectangle/* = sampler->context_rect*/;
 
-       fetch_rectangle.x = (gint) sampler->x;
-       fetch_rectangle.y = (gint) sampler->y;
+       fetch_rectangle.x = x;
+       fetch_rectangle.y = y;
 
        /* we override the fetch rectangle needed by the sampler, hoping that
         * the extra pixels we fetch comes in useful in subsequent requests,

Modified: branches/branch_zhangjb/gegl/buffer/gegl-sampler.h
==============================================================================
--- branches/branch_zhangjb/gegl/buffer/gegl-sampler.h	(original)
+++ branches/branch_zhangjb/gegl/buffer/gegl-sampler.h	Fri Jun 20 13:03:25 2008
@@ -78,6 +78,10 @@
                                        gint         x,
                                        gint         y);
 
+gfloat *
+gegl_sampler_get_ptr (GeglSampler         *sampler,
+                      gint                 x,
+                      gint                 y);
 GType gegl_sampler_type_from_interpolation (GeglInterpolation interpolation);
 
 G_END_DECLS

Modified: branches/branch_zhangjb/operations/affine/affine.c
==============================================================================
--- branches/branch_zhangjb/operations/affine/affine.c	(original)
+++ branches/branch_zhangjb/operations/affine/affine.c	Fri Jun 20 13:03:25 2008
@@ -740,6 +740,7 @@
     {
       /* XXX: add back more samplers */
       g_object_set(affine->sampler, "buffer", input, NULL);
+      gegl_sampler_prepare (affine->sampler);
       affine_generic (output, input, affine->matrix, affine->sampler);
       g_object_unref(affine->sampler->buffer);
       affine->sampler->buffer = NULL;

Modified: branches/branch_zhangjb/operations/frequency/Makefile.am
==============================================================================
--- branches/branch_zhangjb/operations/frequency/Makefile.am	(original)
+++ branches/branch_zhangjb/operations/frequency/Makefile.am	Fri Jun 20 13:03:25 2008
@@ -1,4 +1,4 @@
-SUBDIRS = tools filters
+SUBDIRS = tools
 include $(top_srcdir)/operations/Makefile-operations.am
 
 INCLUDES = $(FFTW_CFLAGS)

Modified: branches/branch_zhangjb/operations/frequency/dft-grey.c
==============================================================================
--- branches/branch_zhangjb/operations/frequency/dft-grey.c	(original)
+++ branches/branch_zhangjb/operations/frequency/dft-grey.c	Fri Jun 20 13:03:25 2008
@@ -35,7 +35,7 @@
   GeglRectangle *in_rect = gegl_operation_source_get_bounding_box (operation, "input");
   GeglRectangle  result  = *in_rect;
 
-  result.width = 2*((result.width/2)+1);
+  result.width  += 2;
   return result;
 }
 
@@ -56,7 +56,7 @@
   GeglRectangle *in_rect = gegl_operation_source_get_bounding_box (operation, "input");
   GeglRectangle  result  = *in_rect;
 
-  result.width = 2*((result.width/2)+1);
+  result.width  += 2;
   return result;
 }
 

Modified: branches/branch_zhangjb/operations/frequency/dft-inverse-grey.c
==============================================================================
--- branches/branch_zhangjb/operations/frequency/dft-inverse-grey.c	(original)
+++ branches/branch_zhangjb/operations/frequency/dft-inverse-grey.c	Fri Jun 20 13:03:25 2008
@@ -35,8 +35,7 @@
   GeglRectangle *in_rect = gegl_operation_source_get_bounding_box (operation, "input");
   GeglRectangle  result  = *in_rect;
 
-  result.width = 2*((result.width/2)-1)
-;
+  result.width -= 2;
   return result;
 }
 
@@ -47,8 +46,7 @@
   GeglRectangle *in_rect = gegl_operation_source_get_bounding_box (operation, "input");
   GeglRectangle  result  = *in_rect;
 
-  result.width = 2*((result.width/2)-1)
-;
+  result.width  -= 2;
   return result;
 }
 
@@ -83,7 +81,7 @@
         GeglBuffer *output,
         const GeglRectangle *result)
 {
-  gint width = 2*(gegl_buffer_get_width(input)/2-1);
+  gint width = gegl_buffer_get_width(input)-2;
   gint height = gegl_buffer_get_height(input);
   gdouble *src_buf;
   gdouble *dst_buf;

Modified: branches/branch_zhangjb/operations/frequency/dft-inverse.c
==============================================================================
--- branches/branch_zhangjb/operations/frequency/dft-inverse.c	(original)
+++ branches/branch_zhangjb/operations/frequency/dft-inverse.c	Fri Jun 20 13:03:25 2008
@@ -36,7 +36,7 @@
   GeglRectangle *in_rect = gegl_operation_source_get_bounding_box (operation, "input");
   GeglRectangle  result  = *in_rect;
 
-  result.width = 2*((result.width/2)-1);
+  result.width -= 2;
   return result;
 }
 
@@ -47,7 +47,7 @@
   GeglRectangle *in_rect = gegl_operation_source_get_bounding_box (operation, "input");
   GeglRectangle  result  = *in_rect;
 
-  result.width = 2*((result.width/2)-1);
+  result.width  -= 2;
   return result;
 }
 
@@ -75,7 +75,7 @@
                         GeglBuffer *output,
                         const GeglRectangle *result)
 {
-  gint width = 2*(gegl_buffer_get_width(input)/2-1); /* width always refers to the image's (not buffer's) width. */
+  gint width = gegl_buffer_get_width(input)-2; /* width always refers to the image's (not buffer's) width. */
   gint height = gegl_buffer_get_height(input);
   gdouble *src_buf;
   gdouble *dst_buf;

Modified: branches/branch_zhangjb/operations/frequency/dft.c
==============================================================================
--- branches/branch_zhangjb/operations/frequency/dft.c	(original)
+++ branches/branch_zhangjb/operations/frequency/dft.c	Fri Jun 20 13:03:25 2008
@@ -36,7 +36,7 @@
   GeglRectangle *in_rect = gegl_operation_source_get_bounding_box (operation, "input");
   GeglRectangle  result  = *in_rect;
 
-  result.width  = 2*((result.width/2)+1);
+  result.width  += 2;
   return result;
 }
 
@@ -57,7 +57,7 @@
   GeglRectangle *in_rect = gegl_operation_source_get_bounding_box (operation, "input");
   GeglRectangle  result  = *in_rect;
 
-  result.width += 2*((result.width/2)+1);
+  result.width  += 2;
   return result;
 }
 
@@ -94,7 +94,7 @@
     {
       get_component(src_buf, tmp_src_buf, i, width*height);
       dft(tmp_src_buf, (fftw_complex *)tmp_dst_buf, width, height);
-      set_component(tmp_dst_buf, dst_buf, i, (2*((width/2)+1))*height);
+      set_component(tmp_dst_buf, dst_buf, i, (width+2)*height);
     }
   
   gegl_buffer_set(output, NULL, babl_format ("RGBA double"), dst_buf, GEGL_AUTO_ROWSTRIDE);

Modified: branches/branch_zhangjb/operations/frequency/preview-frequency-grey.c
==============================================================================
--- branches/branch_zhangjb/operations/frequency/preview-frequency-grey.c	(original)
+++ branches/branch_zhangjb/operations/frequency/preview-frequency-grey.c	Fri Jun 20 13:03:25 2008
@@ -35,7 +35,7 @@
   GeglRectangle *in_rect = gegl_operation_source_get_bounding_box (operation, "input");
   GeglRectangle  result  = *in_rect;
 
-  result.width = 2*((result.width/2)-1);
+  result.width -= 2;
   return result;
 }
 
@@ -46,7 +46,7 @@
   GeglRectangle *in_rect = gegl_operation_source_get_bounding_box (operation, "input");
   GeglRectangle  result  = *in_rect;
 
-  result.width = 2*((result.width/2)-1);
+  result.width  -= 2;
   return result;
 }
 
@@ -81,7 +81,7 @@
         GeglBuffer *output,
         const GeglRectangle *result)
 {
-  gint width = 2*(gegl_buffer_get_width(input)/2-1);
+  gint width = gegl_buffer_get_width(input)-2;
   gint height = gegl_buffer_get_height(input);
   gdouble *src_buf;
   gdouble *dst_buf;

Modified: branches/branch_zhangjb/operations/frequency/preview-frequency.c
==============================================================================
--- branches/branch_zhangjb/operations/frequency/preview-frequency.c	(original)
+++ branches/branch_zhangjb/operations/frequency/preview-frequency.c	Fri Jun 20 13:03:25 2008
@@ -36,7 +36,7 @@
   GeglRectangle *in_rect = gegl_operation_source_get_bounding_box (operation, "input");
   GeglRectangle  result  = *in_rect;
 
-  result.width = 2*((result.width/2)-1);
+  result.width -= 2;
   return result;
 }
 
@@ -47,7 +47,7 @@
   GeglRectangle *in_rect = gegl_operation_source_get_bounding_box (operation, "input");
   GeglRectangle  result  = *in_rect;
 
-  result.width = 2*((result.width/2)-1);
+  result.width  -= 2;
   return result;
 }
 
@@ -75,7 +75,7 @@
         GeglBuffer *output,
         const GeglRectangle *result)
 {
-  gint width = 2*(gegl_buffer_get_width(input)/2-1);
+  gint width = gegl_buffer_get_width(input)-2;
   gint height = gegl_buffer_get_height(input);
   gdouble *src_buf;
   gdouble *dst_buf;

Modified: branches/branch_zhangjb/operations/frequency/tools/Makefile.am
==============================================================================
--- branches/branch_zhangjb/operations/frequency/tools/Makefile.am	(original)
+++ branches/branch_zhangjb/operations/frequency/tools/Makefile.am	Fri Jun 20 13:03:25 2008
@@ -1,5 +1,4 @@
 EXTRA_DIST = \
-	filter.c	\
 	fourier.c	\
 	display.c	\
 	component.c
\ No newline at end of file

Modified: branches/branch_zhangjb/tests/frequency/hello-world-fourier.c
==============================================================================
--- branches/branch_zhangjb/tests/frequency/hello-world-fourier.c	(original)
+++ branches/branch_zhangjb/tests/frequency/hello-world-fourier.c	Fri Jun 20 13:03:25 2008
@@ -26,7 +26,7 @@
                                   "test_result.png",
                                   NULL);
 
-      gegl_node_link_many(image, dft, idft, save, NULL);
+      gegl_node_link_many(image, dft, preview, save, NULL);
       gegl_node_process(save);
 
       g_object_unref(gegl);



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