gegl r2574 - in branches/branch2_zhangjb: . operations/frequency



Author: zhangjb
Date: Sat Aug  9 14:27:18 2008
New Revision: 2574
URL: http://svn.gnome.org/viewvc/gegl?rev=2574&view=rev

Log:


Added:
   branches/branch2_zhangjb/operations/frequency/dft-backward.c
      - copied, changed from r2564, /branches/branch2_zhangjb/operations/frequency/idft.c
   branches/branch2_zhangjb/operations/frequency/dft-forward.c
      - copied, changed from r2564, /branches/branch2_zhangjb/operations/frequency/dft.c
   branches/branch2_zhangjb/operations/frequency/gaussian-bandpass-filter.c
      - copied, changed from r2564, /branches/branch2_zhangjb/operations/frequency/bandpass-gaussian.c
   branches/branch2_zhangjb/operations/frequency/gaussian-highpass-filter.c
      - copied, changed from r2564, /branches/branch2_zhangjb/operations/frequency/highpass-gaussian.c
   branches/branch2_zhangjb/operations/frequency/gaussian-lowpass-filter.c
      - copied, changed from r2564, /branches/branch2_zhangjb/operations/frequency/lowpass-gaussian.c
   branches/branch2_zhangjb/operations/frequency/gaussian-lowpass.c
Removed:
   branches/branch2_zhangjb/operations/frequency/bandpass-gaussian.c
   branches/branch2_zhangjb/operations/frequency/dft.c
   branches/branch2_zhangjb/operations/frequency/highpass-gaussian.c
   branches/branch2_zhangjb/operations/frequency/idft.c
   branches/branch2_zhangjb/operations/frequency/lowpass-gaussian.c
Modified:
   branches/branch2_zhangjb/ChangeLog

Copied: branches/branch2_zhangjb/operations/frequency/dft-backward.c (from r2564, /branches/branch2_zhangjb/operations/frequency/idft.c)
==============================================================================
--- /branches/branch2_zhangjb/operations/frequency/idft.c	(original)
+++ branches/branch2_zhangjb/operations/frequency/dft-backward.c	Sat Aug  9 14:27:18 2008
@@ -23,7 +23,7 @@
 #else
 
 #define GEGL_CHANT_TYPE_FILTER
-#define GEGL_CHANT_C_FILE       "idft.c"
+#define GEGL_CHANT_C_FILE       "dft-backward.c"
 
 #include "gegl-chant.h"
 #include "tools/fourier.c"
@@ -111,7 +111,7 @@
   operation_class->get_required_for_output= get_required_for_output;
   operation_class->get_cached_region = get_cached_region;
 
-  operation_class->name = "idft";
+  operation_class->name = "dft-backward";
   operation_class->categories = "frequency";
   operation_class->description
     = "Perform 2-D inverse Discrete Fourier Transform for the image.\n";

Copied: branches/branch2_zhangjb/operations/frequency/dft-forward.c (from r2564, /branches/branch2_zhangjb/operations/frequency/dft.c)
==============================================================================
--- /branches/branch2_zhangjb/operations/frequency/dft.c	(original)
+++ branches/branch2_zhangjb/operations/frequency/dft-forward.c	Sat Aug  9 14:27:18 2008
@@ -23,7 +23,7 @@
 #else
 
 #define GEGL_CHANT_TYPE_FILTER
-#define GEGL_CHANT_C_FILE       "dft.c"
+#define GEGL_CHANT_C_FILE       "dft-forward.c"
 
 #include <gegl-chant.h>
 #include "tools/fourier.c"
@@ -112,7 +112,7 @@
   operation_class->get_required_for_output= get_required_for_output;
   operation_class->get_cached_region = get_cached_region;
 
-  operation_class->name = "dft";
+  operation_class->name = "dft-forward";
   operation_class->categories = "frequency";
   operation_class->description
     = "Perform 2-D Discrete Fourier Transform for a RGBA image.";

Copied: branches/branch2_zhangjb/operations/frequency/gaussian-bandpass-filter.c (from r2564, /branches/branch2_zhangjb/operations/frequency/bandpass-gaussian.c)
==============================================================================
--- /branches/branch2_zhangjb/operations/frequency/bandpass-gaussian.c	(original)
+++ branches/branch2_zhangjb/operations/frequency/gaussian-bandpass-filter.c	Sat Aug  9 14:27:18 2008
@@ -28,7 +28,7 @@
 #else
 
 #define GEGL_CHANT_TYPE_FILTER
-#define GEGL_CHANT_C_FILE       "bandpass-gaussian.c"
+#define GEGL_CHANT_C_FILE       "gaussian-bandpass-filter.c"
 
 #include "gegl-chant.h"
 #include "tools/component.c"
@@ -105,7 +105,7 @@
   filter_class->process = process;
   operation_class->prepare = prepare;
 
-  operation_class->name = "bandpass-gaussian";
+  operation_class->name = "gaussian-bandpass-filter";
   operation_class->categories = "frequency";
   operation_class->description = "Bandpass Gaussian Filter.";
 }

Copied: branches/branch2_zhangjb/operations/frequency/gaussian-highpass-filter.c (from r2564, /branches/branch2_zhangjb/operations/frequency/highpass-gaussian.c)
==============================================================================
--- /branches/branch2_zhangjb/operations/frequency/highpass-gaussian.c	(original)
+++ branches/branch2_zhangjb/operations/frequency/gaussian-highpass-filter.c	Sat Aug  9 14:27:18 2008
@@ -26,7 +26,7 @@
 #else
 
 #define GEGL_CHANT_TYPE_FILTER
-#define GEGL_CHANT_C_FILE       "highpass-gaussian.c"
+#define GEGL_CHANT_C_FILE       "gaussian-highpass-filter.c"
 
 #include "gegl-chant.h"
 #include "tools/component.c"
@@ -102,7 +102,7 @@
   filter_class->process = process;
   operation_class->prepare = prepare;
 
-  operation_class->name = "highpass-gaussian";
+  operation_class->name = "gaussian-highpass-filter";
   operation_class->categories = "frequency";
   operation_class->description = "Highpass Gaussian Filter.";
 }

Copied: branches/branch2_zhangjb/operations/frequency/gaussian-lowpass-filter.c (from r2564, /branches/branch2_zhangjb/operations/frequency/lowpass-gaussian.c)
==============================================================================
--- /branches/branch2_zhangjb/operations/frequency/lowpass-gaussian.c	(original)
+++ branches/branch2_zhangjb/operations/frequency/gaussian-lowpass-filter.c	Sat Aug  9 14:27:18 2008
@@ -26,7 +26,7 @@
 #else
 
 #define GEGL_CHANT_TYPE_FILTER
-#define GEGL_CHANT_C_FILE       "lowpass-gaussian.c"
+#define GEGL_CHANT_C_FILE       "gaussian-lowpass-filter.c"
 
 #include "gegl-chant.h"
 #include "tools/component.c"
@@ -102,7 +102,7 @@
   filter_class->process = process;
   operation_class->prepare = prepare;
 
-  operation_class->name = "lowpass-gaussian";
+  operation_class->name = "gaussian-lowpass-filter";
   operation_class->categories = "frequency";
   operation_class->description = "Lowpass Gaussian Filter.";
 }

Added: branches/branch2_zhangjb/operations/frequency/gaussian-lowpass.c
==============================================================================
--- (empty file)
+++ branches/branch2_zhangjb/operations/frequency/gaussian-lowpass.c	Sat Aug  9 14:27:18 2008
@@ -0,0 +1,92 @@
+/* This file is an image processing operation for GEGL
+ *
+ * GEGL is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * GEGL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GEGL; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright 2006 ?yvind KolÃs <pippin gimp org>
+ */
+#ifdef GEGL_CHANT_PROPERTIES
+
+gegl_chant_int(cutoff, "cutoff", 0, G_MAXINT, 0, "The cutoff frequency of gaussian lowpass.")
+gegl_chant_int(flag, "Flag", 0, 15, 14,
+               "Decide which componet need to process. Example: if flag=14, "
+               "14==0b1110, so we filter on componets RGB, do not filter on A.")
+
+#else
+
+#define GEGL_CHANT_TYPE_META
+#define GEGL_CHANT_C_FILE       "gaussian-lowpass.c"
+
+#include "gegl-chant.h"
+
+typedef struct _Priv Priv;
+struct _Priv
+{
+  GeglNode *self;
+  GeglNode *input;
+  GeglNode *output;
+
+  GeglNode *dft_forward;
+  GeglNode *glpf_filter;
+  GeglNode *dft_backward;
+
+};
+
+static void attach (GeglOperation *operation)
+{
+  GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+  Priv       *priv = g_malloc0 (sizeof (Priv));
+
+  o->chant_data = (void*) priv;
+
+    {
+      GeglNode *gegl;
+      gegl = operation->node;
+
+      priv->input = gegl_node_get_input_proxy (gegl, "input");
+      priv->output = gegl_node_get_output_proxy (gegl, "output");
+      priv->dft_forward = gegl_node_new_child (gegl,
+                                            "operation", "dft-forward",
+                                            NULL);
+      priv->glpf_filter = gegl_node_new_child (gegl,
+					    "operation","gaussian-lowpass-filter",
+					    NULL);
+      priv->dft_backward = gegl_node_new_child (gegl,
+                                            "operation", "dft-backward",
+                                            NULL);
+
+      gegl_node_link_many (priv->input, priv->dft_forward, priv->glpf_filter, 
+			   priv->dft_backward, priv->output,NULL);
+      gegl_operation_meta_redirect (operation, "cutoff", priv->glpf_filter, "cutoff");
+      gegl_operation_meta_redirect (operation, "flag", priv->glpf_filter, "flag");
+    }
+}
+
+
+static void
+gegl_chant_class_init (GeglChantClass *klass)
+{
+  GObjectClass       *object_class;
+  GeglOperationClass *operation_class;
+
+  object_class    = G_OBJECT_CLASS (klass);
+  operation_class = GEGL_OPERATION_CLASS (klass);
+  operation_class->attach = attach;
+
+  operation_class->name        = "gaussian-lowpass";
+  operation_class->categories  = "meta:enhance";
+  operation_class->description =
+        "Performs an gaussian lowpass filter.";
+}
+
+#endif



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