gegl r1904 - in trunk: . gegl operations/blur operations/color operations/core operations/workshop



Author: ok
Date: Wed Jan 23 23:04:01 2008
New Revision: 1904
URL: http://svn.gnome.org/viewvc/gegl?rev=1904&view=rev

Log:
* gegl/gegl-chant.h: Made the chanting less operation specific.
* operations/core/nop.c: port to new chant system.
* operations/blur/box-blur.c:
* operations/blur/gaussian-blur.c:
* operations/color/invert.c:
* operations/color/mono-mixer.c:
* operations/workshop/box-max.c:
* operations/workshop/box-min.c: updated to new terser chant system.


Modified:
   trunk/ChangeLog
   trunk/gegl/gegl-chant.h
   trunk/operations/blur/box-blur.c
   trunk/operations/blur/gaussian-blur.c
   trunk/operations/color/invert.c
   trunk/operations/color/mono-mixer.c
   trunk/operations/core/nop.c
   trunk/operations/workshop/box-max.c
   trunk/operations/workshop/box-min.c

Modified: trunk/gegl/gegl-chant.h
==============================================================================
--- trunk/gegl/gegl-chant.h	(original)
+++ trunk/gegl/gegl-chant.h	Wed Jan 23 23:04:01 2008
@@ -29,14 +29,14 @@
 #include <gegl-plugin.h>
 
 GType operation_get_type ();
-typedef struct _GeglChantProperties GeglChantProperties;
-typedef struct _GeglChantOperation  GeglChantOperation;
+typedef struct _GeglChantO  GeglChantO;
+typedef struct _GeglChant   GeglChant;
 
 static void operation_register_type (GTypeModule *module);
-static void gegl_chant_init         (GeglChantOperation *self);
-static void gegl_chant_class_init   (gpointer klass);
+static void gegl_chant_init         (GeglChant   *self);
+static void gegl_chant_class_init   (gpointer     klass);
 
-#define GEGL_DEFINE_DYNAMIC_OPERATION(T_P)  GEGL_DEFINE_DYNAMIC_OPERATION_EXTENDED (GEGL_CHANT_C_FILE, GeglChantOperation, operation, T_P, 0, {})
+#define GEGL_DEFINE_DYNAMIC_OPERATION(T_P)  GEGL_DEFINE_DYNAMIC_OPERATION_EXTENDED (GEGL_CHANT_C_FILE, GeglChant, operation, T_P, 0, {})
 #define GEGL_DEFINE_DYNAMIC_OPERATION_EXTENDED(C_FILE, TypeName, type_name, TYPE_PARENT, flags, CODE) \
   static void     type_name##_init              (TypeName        *self); \
 static void     type_name##_class_init        (TypeName##Class *klass); \
@@ -87,13 +87,15 @@
 
 
 #define GEGL_CHANT_PROPERTIES(op) \
-    ((GeglChantProperties*)(((GeglChantOperation*)(op))->properties))
+    ((GeglChantO*)(((GeglChant*)(op))->properties))
+
+#define GEGL_CHANT_O(op) GEGL_CHANT_PROPERTIES(op)
 /****************************************************************************/
 
 
 #ifdef GEGL_CHANT_TYPE_OPERATION
 #include <operation/gegl-operation.h>
-struct _GeglChantOperation
+struct _GeglChant
 {
   GeglOperation parent_instance;
   gpointer      properties;
@@ -102,7 +104,7 @@
 typedef struct
 {
   GeglOperationClass parent_class;
-} GeglChantOperationClass;
+} GeglChantClass;
 
 GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION);
 #endif
@@ -113,12 +115,12 @@
 {
   GeglOperationMeta parent_instance;
   gpointer          properties;
-} GeglChantOperation;
+} GeglChant;
 
 typedef struct
 {
   GeglOperationMetaClass parent_class;
-} GeglChantOperationClass;
+} GeglChantClass;
 
 GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_META);
 #endif
@@ -129,19 +131,19 @@
 {
   GeglOperationSource parent_instance;
   gpointer            properties;
-} GeglChantOperation;
+} GeglChant;
 
 typedef struct
 {
   GeglOperationSourceClass parent_class;
-} GeglChantOperationClass;
+} GeglChantClass;
 
 GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_SOURCE);
 #endif
 
 #ifdef GEGL_CHANT_TYPE_SINK
 #include <operation/gegl-operation-sink.h>
-struct _GeglChantOperation
+struct _GeglChant
 {
   GeglOperationSink parent_instance;
   gpointer          properties;
@@ -150,14 +152,14 @@
 typedef struct
 {
   GeglOperationSinkClass parent_class;
-} GeglChantOperationClass;
+} GeglChantClass;
 
 GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_SINK);
 #endif
 
 #ifdef GEGL_CHANT_TYPE_FILTER
 #include <operation/gegl-operation-filter.h>
-struct _GeglChantOperation
+struct _GeglChant
 {
   GeglOperationFilter parent_instance;
   gpointer            properties;
@@ -166,14 +168,14 @@
 typedef struct
 {
   GeglOperationFilterClass parent_class;
-} GeglChantOperationClass;
+} GeglChantClass;
 
 GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_FILTER);
 #endif
 
 #ifdef GEGL_CHANT_TYPE_COMPOSER
 #include <operation/gegl-operation-composer.h>
-struct _GeglChantOperation
+struct _GeglChant
 {
   GeglOperationComposer parent_instance;
   gpointer              properties;
@@ -182,7 +184,7 @@
 typedef struct
 {
   GeglOperationComposerClass parent_class;
-} GeglChantOperationClass;
+} GeglChantClass;
 
 GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_COMPOSER);
 
@@ -190,7 +192,7 @@
 
 #ifdef GEGL_CHANT_TYPE_POINT_FILTER
 #include <operation/gegl-operation-point-filter.h>
-struct _GeglChantOperation
+struct _GeglChant
 {
   GeglOperationPointFilter parent_instance;
   gpointer                 properties;
@@ -199,7 +201,7 @@
 typedef struct
 {
   GeglOperationPointFilterClass parent_class;
-} GeglChantOperationClass;
+} GeglChantClass;
 
 GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_POINT_FILTER);
 
@@ -207,7 +209,7 @@
 
 #ifdef GEGL_CHANT_TYPE_AREA_FILTER
 #include <operation/gegl-operation-area-filter.h>
-struct _GeglChantOperation
+struct _GeglChant
 {
   GeglOperationAreaFilter parent_instance;
   gpointer                properties;
@@ -216,23 +218,23 @@
 typedef struct
 {
   GeglOperationAreaFilterClass parent_class;
-} GeglChantOperationClass;
+} GeglChantClass;
 GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_AREA_FILTER);
 #endif
 
 
 #ifdef GEGL_CHANT_TYPE_POINT_COMPOSER
 #include <operation/gegl-operation-point-composer.h>
-struct _GeglChantOperation
+struct _GeglChant
 {
   GeglOperationPointComposer parent_instance;
   gpointer                   properties;
-} GeglChantOperation;
+} GeglChant;
 
 typedef struct
 {
   GeglOperationPointComposerClass parent_class;
-} GeglChantOperationClass;
+} GeglChantClass;
 GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_POINT_COMPOSER);
 #endif
 
@@ -243,13 +245,13 @@
  */
 #ifndef GEGL_CHANT_CUSTOM
 static void
-operation_init (GeglChantOperation *self)
+operation_init (GeglChant *self)
 {
   gegl_chant_init (self);
 }
 
 static void
-operation_class_finalize (GeglChantOperationClass *self)
+operation_class_finalize (GeglChantClass *self)
 {
 }
 
@@ -274,7 +276,7 @@
 #endif
 
 
-struct _GeglChantProperties
+struct _GeglChantO
 {
   gpointer dummy_filler; /* to avoid empty struct, can be done a bit more cleverly to
                             avoid adding it when there is actual properties*/
@@ -346,7 +348,7 @@
               GValue       *value,
               GParamSpec   *pspec)
 {
-  GeglChantProperties *properties;
+  GeglChantO *properties;
 
   properties = GEGL_CHANT_PROPERTIES(gobject);
 
@@ -422,7 +424,7 @@
               const GValue *value,
               GParamSpec   *pspec)
 {
-  GeglChantProperties *properties;
+  GeglChantO *properties;
 
   properties = GEGL_CHANT_PROPERTIES(gobject);
 
@@ -513,7 +515,7 @@
 
 static void gegl_chant_destroy_notify (gpointer data)
 {
-  GeglChantProperties *properties;
+  GeglChantO *properties;
 
   properties = GEGL_CHANT_PROPERTIES (data);
 
@@ -605,7 +607,7 @@
   object_class->get_property = get_property;
   object_class->constructor  = gegl_chant_constructor;
 
-/*  g_type_class_add_private (klass, sizeof (GeglChantProperties));*/
+/*  g_type_class_add_private (klass, sizeof (GeglChantO));*/
 
 #define gegl_chant_int(name, min, max, def, blurb)                          \
   g_object_class_install_property (object_class, PROP_##name,               \
@@ -712,9 +714,9 @@
 
 
 static void
-gegl_chant_init (GeglChantOperation *self)
+gegl_chant_init (GeglChant *self)
 {
-  self->properties = g_new0 (GeglChantProperties, 1);
+  self->properties = g_new0 (GeglChantO, 1);
 }
 
 /****************************************************************************/

Modified: trunk/operations/blur/box-blur.c
==============================================================================
--- trunk/operations/blur/box-blur.c	(original)
+++ trunk/operations/blur/box-blur.c	Wed Jan 23 23:04:01 2008
@@ -41,14 +41,14 @@
          GeglBuffer          *output,
          const GeglRectangle *result)
 {
-  GeglChantProperties *properties = GEGL_CHANT_PROPERTIES (operation);
-  GeglBuffer          *temp;
+  GeglChantO *o = GEGL_CHANT_O (operation);
+  GeglBuffer *temp;
 
   temp  = gegl_buffer_new (gegl_buffer_get_extent (input),
                            babl_format ("RaGaBaA float"));
 
-  hor_blur (input, temp,  properties->radius);
-  ver_blur (temp, output, properties->radius);
+  hor_blur (input, temp,  o->radius);
+  ver_blur (temp, output, o->radius);
 
   g_object_unref (temp);
   return  TRUE;
@@ -226,15 +226,21 @@
 
 static void tickle (GeglOperation *operation)
 {
-  GeglOperationAreaFilter *area = GEGL_OPERATION_AREA_FILTER (operation);
-  GeglChantProperties     *properties = GEGL_CHANT_PROPERTIES (operation);
-  area->left = area->right = area->top = area->bottom =
-      ceil (properties->radius);
+  GeglChantO              *o;
+  GeglOperationAreaFilter *op_area;
+
+  op_area = GEGL_OPERATION_AREA_FILTER (operation);
+  o       = GEGL_CHANT_O (operation);
+
+  op_area->left   =
+  op_area->right  =
+  op_area->top    =
+  op_area->bottom = ceil (o->radius);
 }
 
 
 static void
-operation_class_init (GeglChantOperationClass *klass)
+operation_class_init (GeglChantClass *klass)
 {
   GeglOperationClass       *operation_class;
   GeglOperationFilterClass *filter_class;

Modified: trunk/operations/blur/gaussian-blur.c
==============================================================================
--- trunk/operations/blur/gaussian-blur.c	(original)
+++ trunk/operations/blur/gaussian-blur.c	Wed Jan 23 23:04:01 2008
@@ -83,44 +83,43 @@
          GeglBuffer          *output,
          const GeglRectangle *result)
 {
-  GeglChantProperties *properties = GEGL_CHANT_PROPERTIES (operation);
-  GeglBuffer          *temp;
-  gdouble              B, b[4];
-  gdouble             *cmatrix;
-  gint                 cmatrix_len;
+  GeglChantO *o= GEGL_CHANT_O (operation);
+  GeglBuffer *temp;
+  gdouble     B, b[4];
+  gdouble    *cmatrix;
+  gint        cmatrix_len;
 
   temp  = gegl_buffer_new (gegl_buffer_get_extent (input),
                            babl_format ("RaGaBaA float"));
 
-  gchar   *filter = properties->filter;
-  gboolean force_iir = filter && !strcmp (filter, "iir");
-  gboolean force_fir = filter && !strcmp (filter, "fir");
+  gboolean force_iir = o->filter && !strcmp (o->filter, "iir");
+  gboolean force_fir = o->filter && !strcmp (o->filter, "fir");
 
-  if ((force_iir || properties->std_dev_x > 1.0) && !force_fir)
+  if ((force_iir || o->std_dev_x > 1.0) && !force_fir)
     {
-      iir_young_find_constants (properties->std_dev_x, &B, b);
+      iir_young_find_constants (o->std_dev_x, &B, b);
       iir_young_hor_blur (input, temp,   B, b);
     }
   else
     {
       cmatrix_len =
-          fir_gen_convolve_matrix (properties->std_dev_x, &cmatrix);
+          fir_gen_convolve_matrix (o->std_dev_x, &cmatrix);
       fir_hor_blur (input, temp, cmatrix, cmatrix_len);
       g_free (cmatrix);
     }
-  if ((force_iir || properties->std_dev_y > 1.0) && !force_fir)
+  if ((force_iir || o->std_dev_y > 1.0) && !force_fir)
     {
-      iir_young_find_constants (properties->std_dev_y, &B, b);
+      iir_young_find_constants (o->std_dev_y, &B, b);
       iir_young_ver_blur (temp, output, B, b,
-                          properties->std_dev_x * RADIUS_SCALE);
+                          o->std_dev_x * RADIUS_SCALE);
     }
   else
     {
       cmatrix_len =
-          fir_gen_convolve_matrix (properties->std_dev_y, &cmatrix);
+          fir_gen_convolve_matrix (o->std_dev_y, &cmatrix);
       fir_ver_blur (temp, output, cmatrix, cmatrix_len,
-       properties->std_dev_x * RADIUS_SCALE,
-       properties->std_dev_y * RADIUS_SCALE);
+       o->std_dev_x * RADIUS_SCALE,
+       o->std_dev_y * RADIUS_SCALE);
       g_free (cmatrix);
     }
 
@@ -448,14 +447,14 @@
 static void tickle (GeglOperation *operation)
 {
   GeglOperationAreaFilter *area = GEGL_OPERATION_AREA_FILTER (operation);
-  GeglChantProperties     *blur = GEGL_CHANT_PROPERTIES (operation);
-  area->left = area->right = ceil (blur->std_dev_x * RADIUS_SCALE);
-  area->top = area->bottom = ceil (blur->std_dev_y * RADIUS_SCALE);
+  GeglChantO              *o    = GEGL_CHANT_O (operation);
+  area->left = area->right = ceil (o->std_dev_x * RADIUS_SCALE);
+  area->top = area->bottom = ceil (o->std_dev_y * RADIUS_SCALE);
 }
 
 
 static void
-operation_class_init (GeglChantOperationClass *klass)
+operation_class_init (GeglChantClass *klass)
 {
   GeglOperationClass       *operation_class;
   GeglOperationFilterClass *filter_class;

Modified: trunk/operations/color/invert.c
==============================================================================
--- trunk/operations/color/invert.c	(original)
+++ trunk/operations/color/invert.c	Wed Jan 23 23:04:01 2008
@@ -51,7 +51,7 @@
 }
 
 static void
-operation_class_init (GeglChantOperationClass *klass)
+operation_class_init (GeglChantClass *klass)
 {
   GeglOperationClass            *operation_class;
   GeglOperationPointFilterClass *point_filter_class;

Modified: trunk/operations/color/mono-mixer.c
==============================================================================
--- trunk/operations/color/mono-mixer.c	(original)
+++ trunk/operations/color/mono-mixer.c	Wed Jan 23 23:04:01 2008
@@ -32,14 +32,14 @@
          GeglBuffer          *output,
          const GeglRectangle *result)
 {
-  GeglChantProperties *properties = GEGL_CHANT_PROPERTIES (operation);
-  gfloat              *in_buf;
-  gfloat              *out_buf;
-  gfloat               red, green, blue;
-
-  red = properties->red;
-  green = properties->green;
-  blue = properties->blue;
+  GeglChantO *o     = GEGL_CHANT_O (operation);
+
+  gfloat      red   = o->red;
+  gfloat      green = o->green;
+  gfloat      blue  = o->blue;
+
+  gfloat     *in_buf;
+  gfloat     *out_buf;
 
  if ((result->width > 0) && (result->height > 0))
  {
@@ -81,7 +81,7 @@
 }
 
 static void
-operation_class_init (GeglChantOperationClass *klass)
+operation_class_init (GeglChantClass *klass)
 {
   GeglOperationClass       *operation_class;
   GeglOperationFilterClass *filter_class;

Modified: trunk/operations/core/nop.c
==============================================================================
--- trunk/operations/core/nop.c	(original)
+++ trunk/operations/core/nop.c	Wed Jan 23 23:04:01 2008
@@ -1,4 +1,4 @@
-/* This file is part of GEGL
+/* 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
@@ -13,174 +13,15 @@
  * 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
+ * Copyright 2006 Ãyvind KolÃs <pippin gimp org>
  */
-
-#ifndef __GEGL_OPERATION_NOP_H__
-#define __GEGL_OPERATION_NOP_H__
-
-#include <gegl-plugin.h>
-
-G_BEGIN_DECLS
-
-#define GEGL_TYPE_OPERATION_NOP            (gegl_operation_nop_get_type ())
-#define GEGL_OPERATION_NOP(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_OPERATION_NOP, GeglOperationNop))
-#define GEGL_OPERATION_NOP_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GEGL_TYPE_OPERATION_NOP, GeglOperationNopClass))
-#define GEGL_IS_OPERATION_NOP(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_OPERATION_NOP))
-#define GEGL_IS_OPERATION_NOP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_OPERATION_NOP))
-#define GEGL_OPERATION_NOP_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_OPERATION_NOP, GeglOperationNopClass))
-
-typedef struct _GeglOperationNop      GeglOperationNop;
-typedef struct _GeglOperationNopClass GeglOperationNopClass;
-
-struct _GeglOperationNop
-{
-  GeglOperation parent_instance;
-};
-
-struct _GeglOperationNopClass
-{
-  GeglOperationClass parent_class;
-};
-
-GType gegl_operation_nop_get_type (void) G_GNUC_CONST;
-
-G_END_DECLS
-
-#endif /* __GEGL_OPERATION_NOP_H__ */
-
-/***************************************************************************/
-
-#include "graph/gegl-pad.h"
-#include "graph/gegl-node.h"
-#include <math.h>
-#include <string.h>
-
-
-enum
-{
-  PROP_0,
-  PROP_OUTPUT,
-  PROP_INPUT
-};
-
-static gboolean        process                 (GeglOperation       *operation,
-                                                GeglNodeContext     *context,
-                                                const gchar         *output_prop,
-                                                const GeglRectangle *result);
-static void            attach                  (GeglOperation       *operation);
-static GeglNode      * detect                  (GeglOperation       *operation,
-                                                gint                 x,
-                                                gint                 y);
-static GeglRectangle   get_defined_region      (GeglOperation       *operation);
-static GeglRectangle   compute_input_request   (GeglOperation       *operation,
-                                                const gchar         *input_pad,
-                                                const GeglRectangle *roi);
-static GeglRectangle   compute_affected_region (GeglOperation       *operation,
-                                                const gchar         *input_pad,
-                                                const GeglRectangle *input_region);
-static void            get_property            (GObject             *object,
-                                                guint                prop_id,
-                                                GValue              *value,
-                                                GParamSpec          *pspec);
-static void            set_property            (GObject             *object,
-                                                guint                prop_id,
-                                                const GValue        *value,
-                                                GParamSpec          *pspec);
-
-G_DEFINE_DYNAMIC_TYPE (GeglOperationNop, gegl_operation_nop, GEGL_TYPE_OPERATION)
-
-static void
-gegl_operation_nop_class_init (GeglOperationNopClass *klass)
-{
-  GObjectClass       *object_class    = G_OBJECT_CLASS (klass);
-  GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
-
-  object_class->get_property             = get_property;
-  object_class->set_property             = set_property;
-
-  operation_class->categories            = "core";
-  operation_class->no_cache              = TRUE;
-  operation_class->process               = process;
-  operation_class->attach                = attach;
-  operation_class->detect                = detect;
-  operation_class->get_defined_region    = get_defined_region;
-  operation_class->compute_input_request = compute_input_request;
-  operation_class->compute_affected_region = compute_affected_region;
-
-  gegl_operation_class_set_name (operation_class, "nop");
-
-
-  g_object_class_install_property (object_class, PROP_OUTPUT,
-                                   g_param_spec_object ("output",
-                                                        "Output",
-                                                        "Ouput pad for generated image buffer.",
-                                                        GEGL_TYPE_BUFFER,
-                                                        G_PARAM_READABLE |
-                                                        GEGL_PARAM_PAD_OUTPUT));
-
-  g_object_class_install_property (object_class, PROP_INPUT,
-                                   g_param_spec_object ("input",
-                                                        "Input",
-                                                        "Input pad, for image buffer input.",
-                                                        GEGL_TYPE_BUFFER,
-                                                        G_PARAM_READWRITE |
-                                                        GEGL_PARAM_PAD_INPUT));
-
-}
-
-static void
-gegl_operation_nop_class_finalize (GeglOperationNopClass *klass)
-{
-}
-
-static void
-gegl_operation_nop_init (GeglOperationNop *self)
-{
-}
-
-static void            get_property            (GObject             *object,
-                                                guint                prop_id,
-                                                GValue              *value,
-                                                GParamSpec          *pspec)
-{
-}
-
-static void            set_property            (GObject             *object,
-                                                guint                prop_id,
-                                                const GValue        *value,
-                                                GParamSpec          *pspec)
-{
-}
-
-static void
-attach (GeglOperation *operation)
-{
-  GObjectClass *object_class = G_OBJECT_GET_CLASS (operation);
-
-  gegl_operation_create_pad (operation,
-                             g_object_class_find_property (object_class,
-                                                           "output"));
-  gegl_operation_create_pad (operation,
-                             g_object_class_find_property (object_class,
-                                                           "input"));
-}
-
-
-static GeglNode *
-detect (GeglOperation *operation,
-        gint           x,
-        gint           y)
-{
-  GeglNode           *input_node;
-
-  input_node = gegl_operation_get_source_node (operation, "input");
-
-  if (input_node)
-    return gegl_operation_detect (input_node->operation, x, y);
-
-  return operation->node;
-}
+#ifdef GEGL_CHANT_PROPERTIES
+   /* no properties */
+#else
+
+#define GEGL_CHANT_C_FILE        "nop.c"
+#define GEGL_CHANT_TYPE_FILTER
+#include "gegl-chant.h"
 
 
 static gboolean
@@ -208,52 +49,17 @@
   return TRUE;
 }
 
-static GeglRectangle
-get_defined_region (GeglOperation *operation)
-{
-  GeglRectangle  result = { 0, 0, 0, 0 };
-  GeglRectangle *in_rect;
-
-  in_rect = gegl_operation_source_get_defined_region (operation, "input");
-  if (in_rect)
-    {
-      result = *in_rect;
-    }
-
-  return result;
-}
-
-static GeglRectangle
-compute_affected_region (GeglOperation       *operation,
-                         const gchar         *input_pad,
-                         const GeglRectangle *input_region)
-{
-  return *input_region;
-}
-
-static GeglRectangle
-compute_input_request (GeglOperation       *operation,
-                       const gchar         *input_pad,
-                       const GeglRectangle *roi)
+static void
+operation_class_init (GeglChantClass *klass)
 {
-  return *roi;
-}
+  GeglOperationClass *operation_class;
 
-static const GeglModuleInfo modinfo =
-{
-  GEGL_MODULE_ABI_VERSION, "nop", "", ""
-};
+  operation_class = GEGL_OPERATION_CLASS (klass);
+  operation_class->process = process;
 
-G_MODULE_EXPORT const GeglModuleInfo *
-gegl_module_query (GTypeModule *module)
-{
-  return &modinfo;
+  operation_class->name       = "nop";
+  operation_class->categories = "core";
+  operation_class->description = "no operation (can be used as a routing point)";
 }
 
-G_MODULE_EXPORT gboolean
-gegl_module_register (GTypeModule *module)
-{
-  gegl_operation_nop_register_type (module);
-
-  return TRUE;
-}
+#endif

Modified: trunk/operations/workshop/box-max.c
==============================================================================
--- trunk/operations/workshop/box-max.c	(original)
+++ trunk/operations/workshop/box-max.c	Wed Jan 23 23:04:01 2008
@@ -43,14 +43,14 @@
          GeglBuffer          *output,
          const GeglRectangle *result)
 {
-  GeglChantProperties *properties = GEGL_CHANT_PROPERTIES (operation);
-  GeglBuffer          *temp;
+  GeglChantO *o = GEGL_CHANT_O (operation);
+  GeglBuffer *temp;
 
   temp = gegl_buffer_new (gegl_buffer_get_extent (input),
                           babl_format ("RGBA float"));
 
-  hor_max (input, temp,  properties->radius);
-  ver_max (temp, output, properties->radius);
+  hor_max (input, temp,  o->radius);
+  ver_max (temp, output, o->radius);
 
   g_object_unref (temp);
 
@@ -174,9 +174,9 @@
 static void tickle (GeglOperation *operation)
 {
   GeglOperationAreaFilter *area = GEGL_OPERATION_AREA_FILTER (operation);
-  GeglChantProperties     *properties = GEGL_CHANT_PROPERTIES (operation);
+
   area->left = area->right = area->top = area->bottom =
-      ceil (properties->radius);
+      ceil (GEGL_CHANT_O (operation)->radius);
 }
 
 
@@ -186,7 +186,7 @@
 }
 
 static void
-operation_class_init (GeglChantOperationClass *klass)
+operation_class_init (GeglChantClass *klass)
 {
   GeglOperationClass       *operation_class;
   GeglOperationFilterClass *filter_class;

Modified: trunk/operations/workshop/box-min.c
==============================================================================
--- trunk/operations/workshop/box-min.c	(original)
+++ trunk/operations/workshop/box-min.c	Wed Jan 23 23:04:01 2008
@@ -44,14 +44,14 @@
          GeglBuffer          *output,
          const GeglRectangle *result)
 {
-  GeglChantProperties *properties = GEGL_CHANT_PROPERTIES (operation);
-  GeglBuffer          *temp;
+  GeglChantO *o = GEGL_CHANT_O (operation);
+  GeglBuffer *temp;
 
   temp = gegl_buffer_new (gegl_buffer_get_extent (input),
                           babl_format ("RGBA float"));
 
-  hor_min (input, temp,  properties->radius);
-  ver_min (temp, output, properties->radius);
+  hor_min (input, temp,  o->radius);
+  ver_min (temp, output, o->radius);
 
   g_object_unref (temp);
 
@@ -175,9 +175,11 @@
 static void tickle (GeglOperation *operation)
 {
   GeglOperationAreaFilter *area = GEGL_OPERATION_AREA_FILTER (operation);
-  GeglChantProperties     *properties = GEGL_CHANT_PROPERTIES (operation);
-  area->left = area->right = area->top = area->bottom =
-      ceil (properties->radius);
+
+  area->left  =
+  area->right =
+  area->top   =
+  area->bottom = GEGL_CHANT_O (operation)->radius;
 }
 
 
@@ -187,7 +189,7 @@
 }
 
 static void
-operation_class_init (GeglChantOperationClass *klass)
+operation_class_init (GeglChantClass *klass)
 {
   GeglOperationClass       *operation_class;
   GeglOperationFilterClass *filter_class;



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