gegl r1950 - in trunk: . gegl operations/affine operations/color operations/io operations/meta operations/render tools



Author: ok
Date: Sun Feb  3 19:33:33 2008
New Revision: 1950
URL: http://svn.gnome.org/viewvc/gegl?rev=1950&view=rev

Log:
* gegl/gegl-plugin.h: modified to include the headers for
gegl-operation and it's subclesses (either by #include or directly
through an ifdef, not sure which direction to take yet)
* gegl/gegl-chant.h: modified to only include gegl-plugin.h
* gegl/gegl-old-chant.h: .. here as well.
* operations/affine/affine.h:
* operations/color/remap.c:
* operations/io/load.c:
* operations/meta/layer.c:
* operations/render/text.c:
* tools/operation_reference.c: modified to not include the
gegl-operation-foo.h's directly, but rely on them being made available
by gegl-plugin.h


Modified:
   trunk/ChangeLog
   trunk/gegl/gegl-chant.h
   trunk/gegl/gegl-old-chant.h
   trunk/gegl/gegl-plugin.h
   trunk/operations/affine/affine.h
   trunk/operations/color/remap.c
   trunk/operations/io/load.c
   trunk/operations/meta/layer.c
   trunk/operations/render/text.c
   trunk/tools/operation_reference.c

Modified: trunk/gegl/gegl-chant.h
==============================================================================
--- trunk/gegl/gegl-chant.h	(original)
+++ trunk/gegl/gegl-chant.h	Sun Feb  3 19:33:33 2008
@@ -93,7 +93,6 @@
 
 
 #ifdef GEGL_CHANT_TYPE_OPERATION
-#include <operation/gegl-operation.h>
 struct _GeglChant
 {
   GeglOperation parent_instance;
@@ -125,7 +124,6 @@
 #endif
 
 #ifdef GEGL_CHANT_TYPE_SOURCE
-#include <operation/gegl-operation-source.h>
 struct _GeglChant
 {
   GeglOperationSource parent_instance;
@@ -141,7 +139,6 @@
 #endif
 
 #ifdef GEGL_CHANT_TYPE_SINK
-#include <operation/gegl-operation-sink.h>
 struct _GeglChant
 {
   GeglOperationSink parent_instance;
@@ -157,7 +154,6 @@
 #endif
 
 #ifdef GEGL_CHANT_TYPE_FILTER
-#include <operation/gegl-operation-filter.h>
 struct _GeglChant
 {
   GeglOperationFilter parent_instance;
@@ -173,7 +169,6 @@
 #endif
 
 #ifdef GEGL_CHANT_TYPE_COMPOSER
-#include <operation/gegl-operation-composer.h>
 struct _GeglChant
 {
   GeglOperationComposer parent_instance;
@@ -190,7 +185,6 @@
 #endif
 
 #ifdef GEGL_CHANT_TYPE_POINT_FILTER
-#include <operation/gegl-operation-point-filter.h>
 struct _GeglChant
 {
   GeglOperationPointFilter parent_instance;
@@ -207,7 +201,6 @@
 #endif
 
 #ifdef GEGL_CHANT_TYPE_AREA_FILTER
-#include <operation/gegl-operation-area-filter.h>
 struct _GeglChant
 {
   GeglOperationAreaFilter parent_instance;
@@ -223,7 +216,6 @@
 
 
 #ifdef GEGL_CHANT_TYPE_POINT_COMPOSER
-#include <operation/gegl-operation-point-composer.h>
 struct _GeglChant
 {
   GeglOperationPointComposer parent_instance;

Modified: trunk/gegl/gegl-old-chant.h
==============================================================================
--- trunk/gegl/gegl-old-chant.h	(original)
+++ trunk/gegl/gegl-old-chant.h	Sun Feb  3 19:33:33 2008
@@ -34,57 +34,48 @@
 
 
 #ifdef GEGL_CHANT_SOURCE
-  #include <operation/gegl-operation-source.h>
-  #include <operation/gegl-extension-handler.h>
   #define GEGL_CHANT_PARENT_TypeName      GeglOperationSource
   #define GEGL_CHANT_PARENT_TypeNameClass GeglOperationSourceClass
   #define GEGL_CHANT_PARENT_TYPE          GEGL_TYPE_OPERATION_SOURCE
   #define GEGL_CHANT_PARENT_CLASS         GEGL_OPERATION_SOURCE_CLASS
 #endif
 #ifdef GEGL_CHANT_SINK
-  #include <operation/gegl-operation-sink.h>
   #define GEGL_CHANT_PARENT_TypeName      GeglOperationSink
   #define GEGL_CHANT_PARENT_TypeNameClass GeglOperationSinkClass
   #define GEGL_CHANT_PARENT_TYPE          GEGL_TYPE_OPERATION_SINK
   #define GEGL_CHANT_PARENT_CLASS         GEGL_OPERATION_SINK_CLASS
 #endif
 #ifdef GEGL_CHANT_FILTER
-  #include <operation/gegl-operation-filter.h>
   #define GEGL_CHANT_PARENT_TypeName      GeglOperationFilter
   #define GEGL_CHANT_PARENT_TypeNameClass GeglOperationFilterClass
   #define GEGL_CHANT_PARENT_TYPE          GEGL_TYPE_OPERATION_FILTER
   #define GEGL_CHANT_PARENT_CLASS         GEGL_OPERATION_FILTER_CLASS
 #endif
 #ifdef GEGL_CHANT_POINT_FILTER
-  #include <operation/gegl-operation-point-filter.h>
   #define GEGL_CHANT_PARENT_TypeName      GeglOperationPointFilter
   #define GEGL_CHANT_PARENT_TypeNameClass GeglOperationPointFilterClass
   #define GEGL_CHANT_PARENT_TYPE          GEGL_TYPE_OPERATION_POINT_FILTER
   #define GEGL_CHANT_PARENT_CLASS         GEGL_OPERATION_POINT_FILTER_CLASS
 #endif
 #ifdef GEGL_CHANT_AREA_FILTER
-  #include <operation/gegl-operation-area-filter.h>
   #define GEGL_CHANT_PARENT_TypeName      GeglOperationAreaFilter
   #define GEGL_CHANT_PARENT_TypeNameClass GeglOperationAreaFilterClass
   #define GEGL_CHANT_PARENT_TYPE          GEGL_TYPE_OPERATION_AREA_FILTER
   #define GEGL_CHANT_PARENT_CLASS         GEGL_OPERATION_AREA_FILTER_CLASS
 #endif
 #ifdef GEGL_CHANT_COMPOSER
-  #include <operation/gegl-operation-composer.h>
   #define GEGL_CHANT_PARENT_TypeName      GeglOperationComposer
   #define GEGL_CHANT_PARENT_TypeNameClass GeglOperationComposerClass
   #define GEGL_CHANT_PARENT_TYPE          GEGL_TYPE_OPERATION_COMPOSER
   #define GEGL_CHANT_PARENT_CLASS         GEGL_OPERATION_COMPOSER_CLASS
 #endif
 #ifdef GEGL_CHANT_POINT_COMPOSER
-  #include <operation/gegl-operation-point-composer.h>
   #define GEGL_CHANT_PARENT_TypeName      GeglOperationPointComposer
   #define GEGL_CHANT_PARENT_TypeNameClass GeglOperationPointComposerClass
   #define GEGL_CHANT_PARENT_TYPE          GEGL_TYPE_OPERATION_POINT_COMPOSER
   #define GEGL_CHANT_PARENT_CLASS         GEGL_OPERATION_POINT_COMPOSER_CLASS
 #endif
 #ifdef GEGL_CHANT_META
-  #include <operation/gegl-operation-meta.h>
   #define GEGL_CHANT_PARENT_TypeName      GeglOperationMeta
   #define GEGL_CHANT_PARENT_TypeNameClass GeglOperationMetaClass
   #define GEGL_CHANT_PARENT_TYPE          GEGL_TYPE_OPERATION_META

Modified: trunk/gegl/gegl-plugin.h
==============================================================================
--- trunk/gegl/gegl-plugin.h	(original)
+++ trunk/gegl/gegl-plugin.h	Sun Feb  3 19:33:33 2008
@@ -30,7 +30,6 @@
 typedef struct _GeglPad              GeglPad;
 typedef struct _GeglConnection       GeglConnection;
 
-#include <operation/gegl-operation.h>
 #include <gegl-utils.h>
 #include <gegl-buffer.h>
 #include <gegl-paramspecs.h>
@@ -104,4 +103,431 @@
 const gchar * gegl_extension_handler_get      (const gchar *extension);
 
 
+#if 1
+
+#include <glib-object.h>
+#include <babl/babl.h>
+#include <operation/gegl-operation.h>
+#include <operation/gegl-operation-filter.h>
+#include <operation/gegl-operation-area-filter.h>
+#include <operation/gegl-operation-point-filter.h>
+#include <operation/gegl-operation-composer.h>
+#include <operation/gegl-operation-point-composer.h>
+#include <operation/gegl-operation-source.h>
+#include <operation/gegl-operation-sink.h>
+#include <operation/gegl-operation-meta.h>
+
+#else
+
+/***** ***/
+
+
+#include <glib-object.h>
+#include <babl/babl.h>
+
+
+
+#define GEGL_TYPE_OPERATION            (gegl_operation_get_type ())
+#define GEGL_OPERATION(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_OPERATION, GeglOperation))
+#define GEGL_OPERATION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GEGL_TYPE_OPERATION, GeglOperationClass))
+#define GEGL_IS_OPERATION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_OPERATION))
+#define GEGL_IS_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_OPERATION))
+#define GEGL_OPERATION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_OPERATION, GeglOperationClass))
+
+typedef struct _GeglOperationClass GeglOperationClass;
+
+struct _GeglOperation
+{
+  GObject parent_instance;
+
+  /*< private >*/
+  GeglNode *node;  /* the node that this operation object is communicated
+                      with through */
+};
+
+/***
+ * fnord
+ */
+
+/***
+ * fnord
+ */
+struct _GeglOperationClass
+{
+  GObjectClass  parent_class;
+
+  const gchar  *name;            /* name used to refer to this type of
+                                    operation in GEGL */
+  const gchar  *description;     /* textual description of the operation */
+  const gchar  *categories;      /* a colon seperated list of categories */
+
+
+  gboolean          no_cache;    /* do not create a cache for this operation */
+
+  /* attach this operation with a GeglNode, override this if you are creating a
+   * GeglGraph, it is already defined for Filters/Sources/Composers.
+   */
+  void            (*attach)               (GeglOperation *operation);
+
+  /* prepare() is called on each operation providing data to a node that
+   * is requested to provide a rendered result. When prepare is called all
+   * properties are known. This is the time to set desired pixel formats
+   * for input and output pads.
+   */
+  void            (*prepare)              (GeglOperation *operation);
+
+  /* Returns the bounding rectangle for the data that is defined by this op.
+   * (is already implemented in GeglOperationPointFilter and
+   * GeglOperationPointComposer, GeglOperationAreaFilter base classes.
+   */
+  GeglRectangle   (*get_defined_region)   (GeglOperation *operation);
+
+  /* Computes the region in output (same affected rect assumed for all outputs)
+   * when a given region has changed on an input. Used to aggregate dirt in the
+   * graph. A default implementation of this, if not provided should probably
+   * be to report that the entire defined region is dirtied.
+   */
+  GeglRectangle   (*compute_affected_region)  (GeglOperation       *operation,
+                                               const gchar         *input_pad,
+                                               const GeglRectangle *input_region);
+
+  /* computes the rectangle needed to be correctly computed in a buffer
+   * on the named input_pad, for a given result rectangle
+   */
+  GeglRectangle   (*compute_input_request) (GeglOperation       *operation,
+                                            const gchar         *input_pad,
+                                            const GeglRectangle *roi);
+
+  /* Adjust result rect, adapts the rectangle used for computing results.
+   * (useful for global operations like contrast stretching, as well as
+   * file loaders to force caching of the full raster).
+   */
+  GeglRectangle   (*adjust_result_region)  (GeglOperation       *operation,
+                                            const GeglRectangle *roi);
+
+  /* XXX: What is GeglNode doing in this part of the API?
+   * Returns the node providing data for a specific location within the
+   * operations output. Does this recurse?, perhaps it should only point
+   * out which pad the data is coming from?
+   */
+  GeglNode*       (*detect)                (GeglOperation       *operation,
+                                            gint                 x,
+                                            gint                 y);
+
+  /* Perform processing for the @output_pad, pad The result_rect provides
+   * the region to process. For sink operations @output_pad can be ignored
+   * but the result_rect is then then indicating the data available for
+   * consumption.
+   */
+  gboolean        (*process)               (GeglOperation       *operation,
+                                            GeglNodeContext     *context,
+                                            const gchar         *output_pad,
+                                            const GeglRectangle *result_rect);
+};
+
+GType           gegl_operation_get_type             (void) G_GNUC_CONST;
+
+/* retrieves the bounding box of a connected input */
+GeglRectangle * gegl_operation_source_get_defined_region (GeglOperation *operation,
+                                                          const gchar   *pad_name);
+
+
+/* sets the ROI needed to be computed on one of the sources */
+void            gegl_operation_set_source_region    (GeglOperation       *operation,
+                                                     gpointer             context_id,
+                                                     const gchar         *pad_name,
+                                                     const GeglRectangle *region);
+
+
+/* retrieves the node providing data to a named input pad */
+GeglNode      * gegl_operation_get_source_node      (GeglOperation *operation,
+                                                     const gchar   *pad_name);
+GeglRectangle   gegl_operation_compute_affected_region (GeglOperation *operation,
+                                                     const gchar   *input_pad,
+                                                     const GeglRectangle *input_region);
+GeglRectangle   gegl_operation_get_defined_region   (GeglOperation *operation);
+GeglRectangle   gegl_operation_adjust_result_region (GeglOperation *operation,
+                                                     const GeglRectangle *roi);
+
+GeglRectangle   gegl_operation_compute_input_request(GeglOperation *operation,
+                                                     const gchar   *input_pad,
+                                                     const GeglRectangle *roi);
+
+GeglNode       *gegl_operation_detect               (GeglOperation *operation,
+                                                     gint           x,
+                                                     gint           y);
+
+
+/* virtual method invokers that change behavior based on the roi being computed,
+ * needs a context_id being based that is used for storing context data.
+ */
+
+void            gegl_operation_attach               (GeglOperation       *operation,
+                                                     GeglNode            *node);
+void            gegl_operation_prepare              (GeglOperation       *operation);
+gboolean        gegl_operation_process              (GeglOperation       *operation,
+                                                     GeglNodeContext     *context,
+                                                     const gchar         *output_pad,
+                                                     const GeglRectangle *result_rect);
+
+/* create a pad for a specified property for this operation, this method is
+ * to be called from the attach method of operations, most operations do not
+ * have to care about this since a super class like filter, sink, source or
+ * composer already does so.
+ */
+void       gegl_operation_create_pad                (GeglOperation *operation,
+                                                     GParamSpec    *param_spec);
+
+/* specify the bablformat for a pad on this operation (XXX: document when
+ * this is legal, at the moment, only used internally in some ops,. but might
+ * turn into a global mechanism) */
+void       gegl_operation_set_format                (GeglOperation *operation,
+                                                     const gchar   *pad_name,
+                                                     const Babl    *format);
+
+const Babl * gegl_operation_get_format              (GeglOperation *operation,
+                                                     const gchar   *pad_name);
+
+
+
+#define GEGL_TYPE_OPERATION_SOURCE            (gegl_operation_source_get_type ())
+#define GEGL_OPERATION_SOURCE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_OPERATION_SOURCE, GeglOperationSource))
+#define GEGL_OPERATION_SOURCE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GEGL_TYPE_OPERATION_SOURCE, GeglOperationSourceClass))
+#define GEGL_IS_OPERATION_SOURCE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_OPERATION_SOURCE, GeglOperationSource))
+#define GEGL_IS_OPERATION_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_OPERATION_SOURCE, GeglOperationSourceClass))
+#define GEGL_OPERATION_SOURCE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_OPERATION_SOURCE, GeglOperationSourceClass))
+
+typedef struct _GeglOperationSource  GeglOperationSource;
+struct _GeglOperationSource
+{
+  GeglOperation parent_instance;
+};
+
+typedef struct _GeglOperationSourceClass GeglOperationSourceClass;
+struct _GeglOperationSourceClass
+{
+  GeglOperationClass parent_class;
+
+  gboolean (* process) (GeglOperation       *self,
+                        GeglNodeContext     *context,
+                        GeglBuffer          *output,
+                        const GeglRectangle *result);
+};
+
+GType gegl_operation_source_get_type (void) G_GNUC_CONST;
+
+
+
+#define GEGL_TYPE_OPERATION_SINK            (gegl_operation_sink_get_type ())
+#define GEGL_OPERATION_SINK(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_OPERATION_SINK, GeglOperationSink))
+#define GEGL_OPERATION_SINK_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GEGL_TYPE_OPERATION_SINK, GeglOperationSinkClass))
+#define GEGL_IS_OPERATION_SINK(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_OPERATION_SINK))
+#define GEGL_IS_OPERATION_SINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_OPERATION_SINK))
+#define GEGL_OPERATION_SINK_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_OPERATION_SINK, GeglOperationSinkClass))
+
+typedef struct _GeglOperationSink  GeglOperationSink;
+struct _GeglOperationSink
+{
+  GeglOperation parent_instance;
+};
+
+typedef struct _GeglOperationSinkClass GeglOperationSinkClass;
+struct _GeglOperationSinkClass
+{
+  GeglOperationClass parent_class;
+
+  gboolean           needs_full;
+
+  gboolean (* process) (GeglOperation       *self,
+                        GeglBuffer          *input,
+                        const GeglRectangle *result);
+};
+
+GType    gegl_operation_sink_get_type   (void) G_GNUC_CONST;
+
+gboolean gegl_operation_sink_needs_full (GeglOperation *operation);
+
+
+
+#define GEGL_TYPE_OPERATION_FILTER            (gegl_operation_filter_get_type ())
+#define GEGL_OPERATION_FILTER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_OPERATION_FILTER, GeglOperationFilter))
+#define GEGL_OPERATION_FILTER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GEGL_TYPE_OPERATION_FILTER, GeglOperationFilterClass))
+#define GEGL_IS_OPERATION_FILTER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_OPERATION_FILTER))
+#define GEGL_IS_OPERATION_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_OPERATION_FILTER))
+#define GEGL_OPERATION_FILTER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_OPERATION_FILTER, GeglOperationFilterClass))
+
+typedef struct _GeglOperationFilter  GeglOperationFilter;
+struct _GeglOperationFilter
+{
+  GeglOperation parent_instance;
+};
+
+typedef struct _GeglOperationFilterClass GeglOperationFilterClass;
+struct _GeglOperationFilterClass
+{
+  GeglOperationClass parent_class;
+
+  gboolean (* process) (GeglOperation       *self,
+                        GeglBuffer          *input,
+                        GeglBuffer          *output,
+                        const GeglRectangle *result);
+};
+
+GType gegl_operation_filter_get_type (void) G_GNUC_CONST;
+
+
+#define GEGL_TYPE_OPERATION_COMPOSER            (gegl_operation_composer_get_type ())
+#define GEGL_OPERATION_COMPOSER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_OPERATION_COMPOSER, GeglOperationComposer))
+#define GEGL_OPERATION_COMPOSER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GEGL_TYPE_OPERATION_COMPOSER, GeglOperationComposerClass))
+#define GEGL_IS_OPERATION_COMPOSER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_OPERATION_COMPOSER))
+#define GEGL_IS_OPERATION_COMPOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_OPERATION_COMPOSER))
+#define GEGL_OPERATION_COMPOSER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_OPERATION_COMPOSER, GeglOperationComposerClass))
+
+typedef struct _GeglOperationComposer  GeglOperationComposer;
+struct _GeglOperationComposer
+{
+  GeglOperation parent_instance;
+};
+
+typedef struct _GeglOperationComposerClass GeglOperationComposerClass;
+struct _GeglOperationComposerClass
+{
+  GeglOperationClass parent_class;
+
+  gboolean (* process) (GeglOperation       *self,
+                        GeglBuffer          *input,
+                        GeglBuffer          *aux,
+                        GeglBuffer          *output,
+                        const GeglRectangle *result);
+};
+
+GType gegl_operation_composer_get_type (void) G_GNUC_CONST;
+
+
+
+
+#define GEGL_TYPE_OPERATION_POINT_COMPOSER            (gegl_operation_point_composer_get_type ())
+#define GEGL_OPERATION_POINT_COMPOSER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_OPERATION_POINT_COMPOSER, GeglOperationPointComposer))
+#define GEGL_OPERATION_POINT_COMPOSER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GEGL_TYPE_OPERATION_POINT_COMPOSER, GeglOperationPointComposerClass))
+#define GEGL_IS_OPERATION_POINT_COMPOSER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_OPERATION_POINT_COMPOSER))
+#define GEGL_IS_OPERATION_POINT_COMPOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_OPERATION_POINT_COMPOSER))
+#define GEGL_OPERATION_POINT_COMPOSER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_OPERATION_POINT_COMPOSER, GeglOperationPointComposerClass))
+
+typedef struct _GeglOperationPointComposer  GeglOperationPointComposer;
+struct _GeglOperationPointComposer
+{
+  GeglOperationComposer parent_instance;
+
+  /*< private >*/
+};
+
+typedef struct _GeglOperationPointComposerClass GeglOperationPointComposerClass;
+struct _GeglOperationPointComposerClass
+{
+  GeglOperationComposerClass parent_class;
+
+  gboolean (* process) (GeglOperation *self,      /* for parameters      */
+                        void          *in,
+                        void          *aux,
+                        void          *out,
+                        glong          samples);  /* number of samples   */
+
+};
+
+GType gegl_operation_point_composer_get_type (void) G_GNUC_CONST;
+
+
+
+
+#define GEGL_TYPE_OPERATION_POINT_FILTER            (gegl_operation_point_filter_get_type ())
+#define GEGL_OPERATION_POINT_FILTER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_OPERATION_POINT_FILTER, GeglOperationPointFilter))
+#define GEGL_OPERATION_POINT_FILTER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GEGL_TYPE_OPERATION_POINT_FILTER, GeglOperationPointFilterClass))
+#define GEGL_IS_OPERATION_POINT_FILTER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_OPERATION_POINT_FILTER))
+#define GEGL_IS_OPERATION_POINT_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_OPERATION_POINT_FILTER))
+#define GEGL_OPERATION_POINT_FILTER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_OPERATION_POINT_FILTER, GeglOperationPointFilterClass))
+
+typedef struct _GeglOperationPointFilter  GeglOperationPointFilter;
+struct _GeglOperationPointFilter
+{
+  GeglOperationFilter parent_instance;
+};
+
+typedef struct _GeglOperationPointFilterClass GeglOperationPointFilterClass;
+struct _GeglOperationPointFilterClass
+{
+  GeglOperationFilterClass parent_class;
+
+  gboolean (* process) (GeglOperation *self,      /* for parameters      */
+                        void          *in_buf,    /* input buffer */
+                        void          *out_buf,   /* output buffer */
+                        glong          samples);  /* number of samples   */
+};
+
+GType gegl_operation_point_filter_get_type (void) G_GNUC_CONST;
+
+
+
+#define GEGL_TYPE_OPERATION_AREA_FILTER            (gegl_operation_area_filter_get_type ())
+#define GEGL_OPERATION_AREA_FILTER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_OPERATION_AREA_FILTER, GeglOperationAreaFilter))
+#define GEGL_OPERATION_AREA_FILTER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GEGL_TYPE_OPERATION_AREA_FILTER, GeglOperationAreaFilterClass))
+#define GEGL_IS_OPERATION_AREA_FILTER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_OPERATION_AREA_FILTER))
+#define GEGL_IS_OPERATION_AREA_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_OPERATION_AREA_FILTER))
+#define GEGL_OPERATION_AREA_FILTER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_OPERATION_AREA_FILTER, GeglOperationAreaFilterClass))
+
+typedef struct _GeglOperationAreaFilter  GeglOperationAreaFilter;
+struct _GeglOperationAreaFilter
+{
+  GeglOperationFilter parent_instance;
+
+  gint                left;
+  gint                right;
+  gint                top;
+  gint                bottom;
+};
+
+typedef struct _GeglOperationAreaFilterClass GeglOperationAreaFilterClass;
+struct _GeglOperationAreaFilterClass
+{
+  GeglOperationFilterClass parent_class;
+};
+
+GType gegl_operation_area_filter_get_type (void) G_GNUC_CONST;
+
+
+#define GEGL_TYPE_OPERATION_META            (gegl_operation_meta_get_type ())
+#define GEGL_OPERATION_META(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_OPERATION_META, GeglOperationMeta))
+#define GEGL_OPERATION_META_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GEGL_TYPE_OPERATION_META, GeglOperationMetaClass))
+#define GEGL_IS_OPERATION_META(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_OPERATION_META))
+#define GEGL_IS_OPERATION_META_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_OPERATION_META))
+#define GEGL_OPERATION_META_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_OPERATION_META, GeglOperationMetaClass))
+
+typedef struct _GeglOperationMeta  GeglOperationMeta;
+struct _GeglOperationMeta
+{
+  GeglOperation parent_instance;
+  GSList       *redirects;
+};
+
+typedef struct _GeglOperationMetaClass GeglOperationMetaClass;
+struct _GeglOperationMetaClass
+{
+  GeglOperationClass parent_class;
+};
+
+
+GType gegl_operation_meta_get_type         (void) G_GNUC_CONST;
+
+void  gegl_operation_meta_redirect         (GeglOperation     *operation,
+                                            const gchar       *name,
+                                            GeglNode          *internal,
+                                            const gchar       *internal_name);
+
+void  gegl_operation_meta_property_changed (GeglOperationMeta *self,
+                                            GParamSpec        *arg1,
+                                            gpointer           user_data);
+
+
+
+#endif
+
 #endif  /* __GEGL_PLUGIN_H__ */

Modified: trunk/operations/affine/affine.h
==============================================================================
--- trunk/operations/affine/affine.h	(original)
+++ trunk/operations/affine/affine.h	Sun Feb  3 19:33:33 2008
@@ -1,8 +1,6 @@
 #ifndef __OP_AFFINE_H__
 #define __OP_AFFINE_H__
 
-#include <gegl/operation/gegl-operation-filter.h>
-
 #include "matrix.h"
 
 G_BEGIN_DECLS

Modified: trunk/operations/color/remap.c
==============================================================================
--- trunk/operations/color/remap.c	(original)
+++ trunk/operations/color/remap.c	Sun Feb  3 19:33:33 2008
@@ -16,166 +16,21 @@
  * Copyright 2006 Ãyvind KolÃs
  */
 
-#ifndef __GEGL_OPERATION_REMAP_H__
-#define __GEGL_OPERATION_REMAP_H__
+#ifdef GEGL_CHANT_PROPERTIES
 
-#include <gegl-plugin.h>
+//gegl_chant_string ("xlow",  "hm", "low description")
+//gegl_chant_string ("xhigh", "hm", "high description")
 
-G_BEGIN_DECLS
+#else
 
-#define GEGL_TYPE_OPERATION_REMAP            (gegl_operation_remap_get_type ())
-#define GEGL_OPERATION_REMAP(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_OPERATION_REMAP, GeglOperationRemap))
-#define GEGL_OPERATION_REMAP_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GEGL_TYPE_OPERATION_REMAP, GeglOperationRemapClass))
-#define GEGL_IS_OPERATION_REMAP(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_OPERATION_REMAP))
-#define GEGL_IS_OPERATION_REMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_OPERATION_REMAP))
-#define GEGL_OPERATION_REMAP_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_OPERATION_REMAP, GeglOperationRemapClass))
+#define GEGL_CHANT_TYPE_OPERATION
+#define GEGL_CHANT_C_FILE       "remap.c"
 
-typedef struct _GeglOperationRemap      GeglOperationRemap;
-typedef struct _GeglOperationRemapClass GeglOperationRemapClass;
-
-struct _GeglOperationRemap
-{
-  GeglOperation parent_instance;
-};
-
-struct _GeglOperationRemapClass
-{
-  GeglOperationClass parent_class;
-};
-
-GType gegl_operation_remap_get_type (void) G_GNUC_CONST;
-
-G_END_DECLS
-
-#endif /* __GEGL_OPERATION_REMAP_H__ */
-
-/***************************************************************************/
-
-#if 0
-#include "gegl-types.h"  /* FIXME: this include should not be needed */
-#include "graph/gegl-pad.h"  /*FIXME: neither should these */
-#include "graph/gegl-node.h"
-#endif
+#include "gegl-chant.h"
 #include <math.h>
 #include <string.h>
 
 
-enum
-{
-  PROP_0,
-  PROP_LOW,
-  PROP_HIGH,
-  PROP_INPUT,
-  PROP_OUTPUT,
-};
-
-static gboolean        process                 (GeglOperation       *operation,
-                                                GeglNodeContext     *context,
-                                                const gchar         *output_prop,
-                                                const GeglRectangle *result);
-static void            attach                  (GeglOperation       *operation);
-static void            prepare                 (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 (GeglOperationRemap, gegl_operation_remap, GEGL_TYPE_OPERATION)
-
-static void
-gegl_operation_remap_class_init (GeglOperationRemapClass *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->name                  = "remap";
-  operation_class->categories            = "core";
-  operation_class->no_cache              = TRUE;
-  operation_class->process               = process;
-  operation_class->attach                = attach;
-  operation_class->prepare               = prepare;
-  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;
-
-
-
-  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_LOW,
-                                   g_param_spec_object ("input",
-                                                        "Input",
-                                                        "Input pad, for image",
-                                                        GEGL_TYPE_BUFFER,
-                                                        G_PARAM_READWRITE |
-                                                        GEGL_PARAM_PAD_INPUT));
-
-  g_object_class_install_property (object_class, PROP_LOW,
-                                   g_param_spec_object ("low",
-                                                        "Low",
-                                                        "Input pad, for minimum envelope",
-                                                        GEGL_TYPE_BUFFER,
-                                                        G_PARAM_READWRITE |
-                                                        GEGL_PARAM_PAD_INPUT));
-
-  g_object_class_install_property (object_class, PROP_HIGH,
-                                   g_param_spec_object ("high",
-                                                        "High",
-                                                        "Input pad, for maximum envelope",
-                                                        GEGL_TYPE_BUFFER,
-                                                        G_PARAM_READWRITE |
-                                                        GEGL_PARAM_PAD_INPUT));
-
-}
-
-static void
-gegl_operation_remap_class_finalize (GeglOperationRemapClass *klass)
-{
-}
-
-static void
-gegl_operation_remap_init (GeglOperationRemap *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)
 {
@@ -206,8 +61,8 @@
         gint           x,
         gint           y)
 {
-  GeglNode           *input_node;
-  GeglOperation      *input_operation;
+  GeglNode      *input_node;
+  GeglOperation *input_operation;
 
   input_node = gegl_operation_get_source_node (operation, "input");
 
@@ -220,69 +75,6 @@
   return operation->node;
 }
 
-
-static gboolean
-process (GeglOperation       *operation,
-         GeglNodeContext     *context,
-         const gchar         *output_prop,
-         const GeglRectangle *result)
-{
-  GeglBuffer *input;
-  GeglBuffer *low;
-  GeglBuffer *high;
-  GeglBuffer *output;
-
-  input = gegl_node_context_get_source (context, "input");
-  low = gegl_node_context_get_source (context, "low");
-  high = gegl_node_context_get_source (context, "high");
-
-    {
-      gfloat *buf;
-      gfloat *min;
-      gfloat *max;
-      gint pixels = result->width  * result->height;
-      gint i;
-
-      buf = g_new (gfloat, pixels * 4);
-      min = g_new (gfloat, pixels * 3);
-      max = g_new (gfloat, pixels * 3);
-
-      gegl_buffer_get (input, 1.0, result, babl_format ("RGBA float"), buf, GEGL_AUTO_ROWSTRIDE);
-      gegl_buffer_get (low,   1.0, result, babl_format ("RGB float"), min, GEGL_AUTO_ROWSTRIDE);
-      gegl_buffer_get (high,  1.0, result, babl_format ("RGB float"), max, GEGL_AUTO_ROWSTRIDE);
-
-      output = gegl_node_context_get_target (context, "output");
-
-      for (i = 0; i < pixels; i++)
-        {
-          gint c;
-
-          for (c = 0; c < 3; c++)
-            {
-              gfloat delta = max[i*3+c]-min[i*3+c];
-
-              if (delta > 0.0001 || delta < -0.0001)
-                {
-                  buf[i*4+c] = (buf[i*4+c]-min[i*3+c]) / delta;
-                }
-              /*else
-                buf[i*4+c] = buf[i*4+c];*/
-            }
-        }
-
-      gegl_buffer_set (output, result, babl_format ("RGBA float"), buf,
-                       GEGL_AUTO_ROWSTRIDE);
-
-      g_free (buf);
-      g_free (min);
-      g_free (max);
-    }
-  g_object_unref (input);
-  g_object_unref (high);
-  g_object_unref (low);
-  return TRUE;
-}
-
 static GeglRectangle
 get_defined_region (GeglOperation *operation)
 {
@@ -314,21 +106,88 @@
   return *roi;
 }
 
-static const GeglModuleInfo modinfo =
+static gboolean
+process (GeglOperation       *operation,
+         GeglNodeContext     *context,
+         const gchar         *output_prop,
+         const GeglRectangle *result)
 {
-  GEGL_MODULE_ABI_VERSION, "remap", "", ""
-};
+  GeglBuffer *input;
+  GeglBuffer *low;
+  GeglBuffer *high;
+  GeglBuffer *output;
+  gfloat     *buf;
+  gfloat     *min;
+  gfloat     *max;
+  gint        pixels = result->width * result->height;
+  gint        i;
 
-G_MODULE_EXPORT const GeglModuleInfo *
-gegl_module_query (GTypeModule *module)
-{
-  return &modinfo;
+  input = gegl_node_context_get_source (context, "input");
+  low = gegl_node_context_get_source (context, "low");
+  high = gegl_node_context_get_source (context, "high");
+
+  buf = g_new (gfloat, pixels * 4);
+  min = g_new (gfloat, pixels * 3);
+  max = g_new (gfloat, pixels * 3);
+
+  gegl_buffer_get (input, 1.0, result, babl_format ("RGBA float"), buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_get (low,   1.0, result, babl_format ("RGB float"), min, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_get (high,  1.0, result, babl_format ("RGB float"), max, GEGL_AUTO_ROWSTRIDE);
+
+  output = gegl_node_context_get_target (context, "output");
+
+  for (i = 0; i < pixels; i++)
+    {
+      gint c;
+
+      for (c = 0; c < 3; c++)
+        {
+          gfloat delta = max[i*3+c]-min[i*3+c];
+
+          if (delta > 0.0001 || delta < -0.0001)
+            {
+              buf[i*4+c] = (buf[i*4+c]-min[i*3+c]) / delta;
+            }
+          /*else
+            buf[i*4+c] = buf[i*4+c];*/
+        }
+    }
+
+  gegl_buffer_set (output, result, babl_format ("RGBA float"), buf,
+                   GEGL_AUTO_ROWSTRIDE);
+
+  g_free (buf);
+  g_free (min);
+  g_free (max);
+
+  g_object_unref (input);
+  g_object_unref (high);
+  g_object_unref (low);
+
+  return TRUE;
 }
 
-G_MODULE_EXPORT gboolean
-gegl_module_register (GTypeModule *module)
+
+static void
+operation_class_init (GeglChantClass *klass)
 {
-  gegl_operation_remap_register_type (module);
+  GeglOperationClass *operation_class;
 
-  return TRUE;
+  operation_class = GEGL_OPERATION_CLASS (klass);
+
+  operation_class->process = process;
+  operation_class->attach  = attach;
+  operation_class->prepare = prepare;
+  operation_class->detect  = detect;
+  operation_class->get_defined_region = get_defined_region;
+  operation_class->compute_affected_region = compute_affected_region;
+  operation_class->compute_input_request = compute_input_request;
+
+  operation_class->name        = "remap";
+  operation_class->categories  = "color";
+  operation_class->description =
+        "Linearly remap the R,G,B based on per pixel minimum and maximum"
+        " values from the high/low input pads";
 }
+
+#endif

Modified: trunk/operations/io/load.c
==============================================================================
--- trunk/operations/io/load.c	(original)
+++ trunk/operations/io/load.c	Sun Feb  3 19:33:33 2008
@@ -24,7 +24,6 @@
 #define GEGL_CHANT_C_FILE       "load.c"
 
 #include "gegl-plugin.h"
-#include <operation/gegl-operation-meta.h>
 
 struct _GeglChant
 {

Modified: trunk/operations/meta/layer.c
==============================================================================
--- trunk/operations/meta/layer.c	(original)
+++ trunk/operations/meta/layer.c	Sun Feb  3 19:33:33 2008
@@ -31,7 +31,6 @@
 #else
 
 #include <gegl-plugin.h>
-#include <operation/gegl-operation-meta.h>
 struct _GeglChant
 {
   GeglOperationMeta parent_instance;

Modified: trunk/operations/render/text.c
==============================================================================
--- trunk/operations/render/text.c	(original)
+++ trunk/operations/render/text.c	Sun Feb  3 19:33:33 2008
@@ -36,7 +36,6 @@
 #else
 
 #include <gegl-plugin.h>
-#include <gegl-operation-source.h>
 #include <cairo.h>
 #include <pango/pango-attributes.h>
 #include <pango/pangocairo.h>

Modified: trunk/tools/operation_reference.c
==============================================================================
--- trunk/tools/operation_reference.c	(original)
+++ trunk/tools/operation_reference.c	Sun Feb  3 19:33:33 2008
@@ -6,9 +6,6 @@
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#include "operation/gegl-operation-filter.h"
-#include "operation/gegl-operation-source.h"
-#include "operation/gegl-operation-composer.h"
 
 static GList *
 gegl_operations_build (GList *list, GType type)



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