gegl r2511 - in branches/branch2_zhangjb: . operations/frequency operations/frequency/tools



Author: zhangjb
Date: Mon Jun 30 02:44:46 2008
New Revision: 2511
URL: http://svn.gnome.org/viewvc/gegl?rev=2511&view=rev

Log:
* operations/frequency/freq-general-filter.c: the property tested.
* operations/frequency/tools/filters.c: modified the parameter table.


Modified:
   branches/branch2_zhangjb/ChangeLog
   branches/branch2_zhangjb/operations/frequency/freq-general-filter.c
   branches/branch2_zhangjb/operations/frequency/tools/filters.c

Modified: branches/branch2_zhangjb/operations/frequency/freq-general-filter.c
==============================================================================
--- branches/branch2_zhangjb/operations/frequency/freq-general-filter.c	(original)
+++ branches/branch2_zhangjb/operations/frequency/freq-general-filter.c	Mon Jun 30 02:44:46 2008
@@ -18,7 +18,7 @@
 
 #ifdef GEGL_CHANT_PROPERTIES
 
-/* no properties */
+gegl_chant_pointer(Hbuf, "Matrix", "The transfer function matrix.")
 
 #else
 
@@ -52,8 +52,8 @@
 static void
 prepare(GeglOperation *operation)
 {
-  Babl *format = babl_format ("frequency double")
-    gegl_operation_set_format(operation, "input", format);
+  Babl *format = babl_format ("frequency double");
+  gegl_operation_set_format(operation, "input", format);
   gegl_operation_set_format(operation, "output", format);
 }
 
@@ -65,12 +65,30 @@
 {
   gint width = gegl_buffer_get_width(input);
   gint height = gegl_buffer_get_height(input);
-
-  src_buf = g_new0(gdouble, 4*width*height);
-  gegl_buffer_get(input, 1.0, NULL, babl_format ("RGBA double"), src_buf,
+  GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+  gdouble *src_buf;
+  gdouble *dst_buf;
+  gdouble *H_buf = o->Hbuf;
+
+  src_buf = g_new0(gdouble, 8*width*height);
+  dst_buf = g_new0(gdouble, 8*width*height);
+  gegl_buffer_get(input, 1.0, NULL, babl_format ("frequency double"), src_buf,
+                  GEGL_AUTO_ROWSTRIDE);
+  
+#if 1
+  gint i;
+  for (i=0; i<(width/2+1)*height; i++)
+    {
+      printf("%lf ", H_buf[i]);
+    }
+  printf("\n");
+#endif
+  
+  gegl_buffer_set(output, NULL, babl_format ("frequency double"), dst_buf,
                   GEGL_AUTO_ROWSTRIDE);
 
   g_free(src_buf);
+  g_free(dst_buf);
   return TRUE;
 }
 

Modified: branches/branch2_zhangjb/operations/frequency/tools/filters.c
==============================================================================
--- branches/branch2_zhangjb/operations/frequency/tools/filters.c	(original)
+++ branches/branch2_zhangjb/operations/frequency/tools/filters.c	Mon Jun 30 02:44:46 2008
@@ -22,8 +22,11 @@
 #define ELEM_ID_HALF_MATRIX(x, y, c) ((y)*(FFT_HALF(c))+(x))
 #endif
 
+gboolean freq_multiply(gdouble, gdouble, gdouble, gint, gint);
+
 gboolean
-freq_multiply(gdouble *X_buf, gdouble *H_buf, gint width, gint height)
+freq_multiply(gdouble *X_buf, gdouble *H_buf, gdouble *Y_buf,
+              gint width, gint height)
 {
   return TRUE;
-}
\ No newline at end of file
+}



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