gegl r1813 - in trunk: . gegl gegl/graph gegl/operation operations/affine operations/blur operations/color operations/core operations/enhance operations/io operations/render operations/workshop
- From: ok svn gnome org
- To: svn-commits-list gnome org
- Subject: gegl r1813 - in trunk: . gegl gegl/graph gegl/operation operations/affine operations/blur operations/color operations/core operations/enhance operations/io operations/render operations/workshop
- Date: Mon, 7 Jan 2008 01:44:58 +0000 (GMT)
Author: ok
Date: Mon Jan 7 01:44:57 2008
New Revision: 1813
URL: http://svn.gnome.org/viewvc/gegl?rev=1813&view=rev
Log:
* gegl/graph/gegl-node-context.c: added some extra debug output for
missing formats on pads (to be ignored for some core ops for now, but
gives better guidance when things crash.)
* gegl/operation/gegl-operation-composer.[ch]
* gegl/operation/gegl-operation-filter.[ch]:
* gegl/operation/gegl-operation-sink.[ch]:
* gegl/operation/gegl-operation-source.[ch]: added the buffers being
read from/written to as arguments of the process functions in the base
classes for the common operation types.
The rest of the files modified were modifications to update to never
API.
* gegl/gegl-chant.h:
* gegl/operation/gegl-operation-point-composer.c:
* gegl/operation/gegl-operation-point-filter.c:
* operations/affine/affine.c:
* operations/blur/box-blur.c:
* operations/blur/gaussian-blur.c:
* operations/color/mono-mixer.c:
* operations/color/remap.c:
* operations/color/stretch-contrast.c:
* operations/core/clone.c:
* operations/core/crop.c:
* operations/core/nop.c:
* operations/core/shift.c:
* operations/enhance/bilateral-filter.c:
* operations/enhance/snn-mean.c:
* operations/io/display.c:
* operations/io/exr-load.cpp:
* operations/io/ff-load.c:
* operations/io/jpg-load.c:
* operations/io/load-buffer.c:
* operations/io/magick-load.c:
* operations/io/pixbuf.c:
* operations/io/png-load.c:
* operations/io/png-save.c:
* operations/io/raw-load.c:
* operations/io/save-buffer.c:
* operations/io/save-pixbuf.c:
* operations/io/svg-load.c:
* operations/render/FractalExplorer.c:
* operations/render/checkerboard.c:
* operations/render/color.c:
* operations/render/introspect.c:
* operations/render/noise.c:
* operations/render/text.c:
* operations/workshop/stress.c:
Modified:
trunk/ChangeLog
trunk/gegl/gegl-chant.h
trunk/gegl/graph/gegl-node-context.c
trunk/gegl/operation/gegl-operation-filter.c
trunk/gegl/operation/gegl-operation-filter.h
trunk/gegl/operation/gegl-operation-point-composer.c
trunk/gegl/operation/gegl-operation-point-filter.c
trunk/gegl/operation/gegl-operation-sink.c
trunk/gegl/operation/gegl-operation-sink.h
trunk/gegl/operation/gegl-operation-source.c
trunk/gegl/operation/gegl-operation-source.h
trunk/operations/affine/affine.c
trunk/operations/blur/box-blur.c
trunk/operations/blur/gaussian-blur.c
trunk/operations/color/mono-mixer.c
trunk/operations/color/remap.c
trunk/operations/color/stretch-contrast.c
trunk/operations/core/clone.c
trunk/operations/core/crop.c
trunk/operations/core/nop.c
trunk/operations/core/shift.c
trunk/operations/enhance/bilateral-filter.c
trunk/operations/enhance/snn-mean.c
trunk/operations/io/display.c
trunk/operations/io/exr-load.cpp
trunk/operations/io/ff-load.c
trunk/operations/io/jpg-load.c
trunk/operations/io/load-buffer.c
trunk/operations/io/magick-load.c
trunk/operations/io/pixbuf.c
trunk/operations/io/png-load.c
trunk/operations/io/png-save.c
trunk/operations/io/raw-load.c
trunk/operations/io/save-buffer.c
trunk/operations/io/save-pixbuf.c
trunk/operations/io/svg-load.c
trunk/operations/render/FractalExplorer.c
trunk/operations/render/checkerboard.c
trunk/operations/render/color.c
trunk/operations/render/introspect.c
trunk/operations/render/noise.c
trunk/operations/render/text.c
trunk/operations/workshop/stress.c
Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog (original)
+++ trunk/ChangeLog Mon Jan 7 01:44:57 2008
@@ -1,3 +1,54 @@
+2008-01-07 Ãyvind KolÃs <pippin gimp org>
+
+ * gegl/graph/gegl-node-context.c: added some extra debug output for
+ missing formats on pads (to be ignored for some core ops for now, but
+ gives better guidance when things crash.)
+
+ * gegl/operation/gegl-operation-composer.[ch]
+ * gegl/operation/gegl-operation-filter.[ch]:
+ * gegl/operation/gegl-operation-sink.[ch]:
+ * gegl/operation/gegl-operation-source.[ch]: added the buffers being
+ read from/written to as arguments of the process functions in the base
+ classes for the common operation types.
+
+ The rest of the files modified were modifications to update to never
+ API.
+ * gegl/gegl-chant.h:
+ * gegl/operation/gegl-operation-point-composer.c:
+ * gegl/operation/gegl-operation-point-filter.c:
+ * operations/affine/affine.c:
+ * operations/blur/box-blur.c:
+ * operations/blur/gaussian-blur.c:
+ * operations/color/mono-mixer.c:
+ * operations/color/remap.c:
+ * operations/color/stretch-contrast.c:
+ * operations/core/clone.c:
+ * operations/core/crop.c:
+ * operations/core/nop.c:
+ * operations/core/shift.c:
+ * operations/enhance/bilateral-filter.c:
+ * operations/enhance/snn-mean.c:
+ * operations/io/display.c:
+ * operations/io/exr-load.cpp:
+ * operations/io/ff-load.c:
+ * operations/io/jpg-load.c:
+ * operations/io/load-buffer.c:
+ * operations/io/magick-load.c:
+ * operations/io/pixbuf.c:
+ * operations/io/png-load.c:
+ * operations/io/png-save.c:
+ * operations/io/raw-load.c:
+ * operations/io/save-buffer.c:
+ * operations/io/save-pixbuf.c:
+ * operations/io/svg-load.c:
+ * operations/render/FractalExplorer.c:
+ * operations/render/checkerboard.c:
+ * operations/render/color.c:
+ * operations/render/introspect.c:
+ * operations/render/noise.c:
+ * operations/render/text.c:
+ * operations/workshop/stress.c:
+
2008-01-06 Kevin Cozens <kcozens cvs gnome org>
* operations/workshop/ff-save.c (process): Updated due to changes in
Modified: trunk/gegl/gegl-chant.h
==============================================================================
--- trunk/gegl/gegl-chant.h (original)
+++ trunk/gegl/gegl-chant.h Mon Jan 7 01:44:57 2008
@@ -420,6 +420,32 @@
void *out_buf,
glong samples);
#else
+#ifdef GEGL_CHANT_SINK
+static gboolean process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *input,
+ const GeglRectangle *result);
+#else
+#ifdef GEGL_CHANT_SOURCE
+static gboolean process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *output,
+ const GeglRectangle *result);
+#else
+#ifdef GEGL_CHANT_FILTER
+static gboolean process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *input,
+ GeglBuffer *output,
+ const GeglRectangle *result);
+#else
+#ifdef GEGL_CHANT_AREA_FILTER
+static gboolean process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *input,
+ GeglBuffer *output,
+ const GeglRectangle *result);
+#else
#ifndef GEGL_CHANT_META
static gboolean process (GeglOperation *operation,
GeglNodeContext *context,
@@ -427,6 +453,10 @@
#endif
#endif
#endif
+#endif
+#endif
+#endif
+#endif
static void
gegl_chant_init (GeglChantOperation *self)
Modified: trunk/gegl/graph/gegl-node-context.c
==============================================================================
--- trunk/gegl/graph/gegl-node-context.c (original)
+++ trunk/gegl/graph/gegl-node-context.c Mon Jan 7 01:44:57 2008
@@ -263,6 +263,10 @@
GParamSpec *pspec;
GValue value = {0,};
+ /* FIXME: check that there isn't already an existing
+ * output object/value set?
+ */
+
node = context->node;
operation = node->operation;
pspec = gegl_node_find_property (node, padname);
@@ -319,6 +323,11 @@
pad = gegl_node_get_pad (node, padname);
format = pad->format;
+ if (format == NULL)
+ {
+ g_warning ("no format for %s\n", gegl_node_get_debug_name (node));
+ return NULL;
+ }
g_assert (format != NULL);
g_assert (!strcmp (padname, "output"));
g_assert (context);
@@ -364,10 +373,6 @@
real_input = GEGL_BUFFER (gegl_node_context_get_object (context, padname));
if (!real_input)
return NULL;
-
input = gegl_buffer_create_sub_buffer (real_input, &input_request);
-
return input;
}
-
-
Modified: trunk/gegl/operation/gegl-operation-filter.c
==============================================================================
--- trunk/gegl/operation/gegl-operation-filter.c (original)
+++ trunk/gegl/operation/gegl-operation-filter.c Mon Jan 7 01:44:57 2008
@@ -178,6 +178,7 @@
GeglOperationFilter *gegl_operation_filter;
GeglOperationFilterClass *klass;
GeglBuffer *input;
+ GeglBuffer *output;
gboolean success = FALSE;
gegl_operation_filter = GEGL_OPERATION_FILTER (operation);
@@ -191,10 +192,13 @@
return FALSE;
}
- input = gegl_node_context_get_source (context, "input");
+ input = gegl_node_context_get_source (context, "input");
+ output = gegl_node_context_get_target (context, "output");
if (input != NULL)
{ /* FIXME: perhaps input should really be passed instead of context */
- success = klass->process (operation, context, result);
+ success = klass->process (operation, context,
+ input, output, result);
+ g_object_unref (input);
}
else
{
@@ -202,8 +206,9 @@
* we might legitimatly get NULL (at least layers might)
*/
if (!g_object_get_data (G_OBJECT (operation->node), "graph"))
- g_warning ("%s received NULL input",
- gegl_node_get_debug_name (operation->node));
+ g_warning ("%s got %s %s",
+ gegl_node_get_debug_name (operation->node),
+ input==NULL?"input==NULL":"", output==NULL?"output==NULL":"");
}
return success;
}
Modified: trunk/gegl/operation/gegl-operation-filter.h
==============================================================================
--- trunk/gegl/operation/gegl-operation-filter.h (original)
+++ trunk/gegl/operation/gegl-operation-filter.h Mon Jan 7 01:44:57 2008
@@ -45,6 +45,8 @@
gboolean (* process) (GeglOperation *self,
GeglNodeContext *context,
+ GeglBuffer *input,
+ GeglBuffer *output,
const GeglRectangle *result);
};
Modified: trunk/gegl/operation/gegl-operation-point-composer.c
==============================================================================
--- trunk/gegl/operation/gegl-operation-point-composer.c (original)
+++ trunk/gegl/operation/gegl-operation-point-composer.c Mon Jan 7 01:44:57 2008
@@ -21,8 +21,11 @@
#include "graph/gegl-pad.h"
#include <string.h>
-static gboolean process_inner (GeglOperation *operation,
- GeglNodeContext *context,
+static gboolean process_inner (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *input,
+ GeglBuffer *aux,
+ GeglBuffer *output,
const GeglRectangle *result);
G_DEFINE_TYPE (GeglOperationPointComposer, gegl_operation_point_composer, GEGL_TYPE_OPERATION_COMPOSER)
@@ -64,11 +67,11 @@
static gboolean
process_inner (GeglOperation *operation,
GeglNodeContext *context,
+ GeglBuffer *input,
+ GeglBuffer *aux,
+ GeglBuffer *output,
const GeglRectangle *result)
{
- GeglBuffer *input = gegl_node_context_get_source (context, "input");
- GeglBuffer *aux = gegl_node_context_get_source (context, "aux");
- GeglBuffer *output;
GeglPad *pad;
Babl *in_format;
Babl *aux_format;
@@ -104,15 +107,17 @@
* good idea. NB! some of the OpenRaster meta ops, depends on the
* short-circuiting happening in fast_paths.
* */
- if (fast_paths (operation, context,
- in_format,
- aux_format,
- out_format,
- result))
+ if (0 && fast_paths (operation, context,
+ in_format,
+ aux_format,
+ out_format,
+ result))
return TRUE;
+#if 0
/* retrieve the buffer we're writing to from GEGL */
output = gegl_node_context_get_target (context, "output");
+#endif
if ((result->width > 0) && (result->height > 0))
{
Modified: trunk/gegl/operation/gegl-operation-point-filter.c
==============================================================================
--- trunk/gegl/operation/gegl-operation-point-filter.c (original)
+++ trunk/gegl/operation/gegl-operation-point-filter.c Mon Jan 7 01:44:57 2008
@@ -20,8 +20,10 @@
#include "graph/gegl-node.h"
#include <string.h>
-static gboolean process_inner (GeglOperation *operation,
- GeglNodeContext *context,
+static gboolean process_inner (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *input,
+ GeglBuffer *output,
const GeglRectangle *result);
G_DEFINE_TYPE (GeglOperationPointFilter, gegl_operation_point_filter, GEGL_TYPE_OPERATION_FILTER)
@@ -48,19 +50,16 @@
}
static gboolean
-process_inner (GeglOperation *operation,
- GeglNodeContext *context,
+process_inner (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *input,
+ GeglBuffer *output,
const GeglRectangle *result)
{
- GeglBuffer *input;
-/* = GEGL_BUFFER (gegl_operation_get_data (operation, context_id, "input"));*/
- GeglBuffer *output;
GeglPad *pad;
Babl *in_format;
Babl *out_format;
- input = gegl_node_context_get_source (context, "input");
-
pad = gegl_node_get_pad (operation->node, "input");
in_format = pad->format;
if (!in_format)
@@ -77,8 +76,6 @@
}
g_assert (out_format);
- output = gegl_node_context_get_target (context, "output");
-
if ((result->width > 0) && (result->height > 0))
{
/* eek: this fails,..
@@ -129,6 +126,5 @@
g_free (out_buf);
}
}
- gegl_buffer_destroy (input);
return TRUE;
}
Modified: trunk/gegl/operation/gegl-operation-sink.c
==============================================================================
--- trunk/gegl/operation/gegl-operation-sink.c (original)
+++ trunk/gegl/operation/gegl-operation-sink.c Mon Jan 7 01:44:57 2008
@@ -127,7 +127,8 @@
input = gegl_node_context_get_source (context, "input");
if (input)
{
- success = klass->process (operation, context, result);
+ success = klass->process (operation, context, input, result);
+ g_object_unref (input);
}
return success;
Modified: trunk/gegl/operation/gegl-operation-sink.h
==============================================================================
--- trunk/gegl/operation/gegl-operation-sink.h (original)
+++ trunk/gegl/operation/gegl-operation-sink.h Mon Jan 7 01:44:57 2008
@@ -45,6 +45,7 @@
gboolean (* process) (GeglOperation *self,
GeglNodeContext *context,
+ GeglBuffer *input,
const GeglRectangle *result);
};
Modified: trunk/gegl/operation/gegl-operation-source.c
==============================================================================
--- trunk/gegl/operation/gegl-operation-source.c (original)
+++ trunk/gegl/operation/gegl-operation-source.c Mon Jan 7 01:44:57 2008
@@ -117,6 +117,7 @@
const GeglRectangle *result)
{
GeglOperationSourceClass *klass = GEGL_OPERATION_SOURCE_GET_CLASS (operation);
+ GeglBuffer *output;
gboolean success;
if (strcmp (output_prop, "output"))
@@ -126,7 +127,8 @@
}
g_assert (klass->process);
- success = klass->process (operation, context, result);
+ output = gegl_node_context_get_target (context, "output");
+ success = klass->process (operation, context, output, result);
return success;
}
Modified: trunk/gegl/operation/gegl-operation-source.h
==============================================================================
--- trunk/gegl/operation/gegl-operation-source.h (original)
+++ trunk/gegl/operation/gegl-operation-source.h Mon Jan 7 01:44:57 2008
@@ -43,6 +43,7 @@
gboolean (* process) (GeglOperation *self,
GeglNodeContext *context,
+ GeglBuffer *output,
const GeglRectangle *result);
};
Modified: trunk/operations/affine/affine.c
==============================================================================
--- trunk/operations/affine/affine.c (original)
+++ trunk/operations/affine/affine.c Mon Jan 7 01:44:57 2008
@@ -69,6 +69,8 @@
static gboolean process (GeglOperation *op,
GeglNodeContext *context,
+ GeglBuffer *input,
+ GeglBuffer *output,
const GeglRectangle *result);
static GeglNode * detect (GeglOperation *operation,
gint x,
@@ -658,16 +660,13 @@
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *input,
+ GeglBuffer *output,
const GeglRectangle *result)
{
OpAffine *affine = (OpAffine *) operation;
- GeglBuffer *input;
- GeglBuffer *output;
-
- input = gegl_node_context_get_source (context, "input");
- output = gegl_node_context_get_target (context, "output");
/*g_warning ("%i,%i %ix%i | %i,%i %ix%i | %i,%i %ix%i",
input->x, input->y, input->width, input->height,
Modified: trunk/operations/blur/box-blur.c
==============================================================================
--- trunk/operations/blur/box-blur.c (original)
+++ trunk/operations/blur/box-blur.c Mon Jan 7 01:44:57 2008
@@ -42,28 +42,25 @@
#include <stdio.h>
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *input,
+ GeglBuffer *output,
const GeglRectangle *result)
{
GeglChantOperation *self;
- GeglBuffer *input;
GeglBuffer *temp;
- GeglBuffer *output;
self = GEGL_CHANT_OPERATION (operation);
- input = gegl_node_context_get_source (context, "input");
- output = gegl_node_context_get_target (context, "output");
temp = gegl_buffer_new (gegl_buffer_get_extent (input),
babl_format ("RaGaBaA float"));
hor_blur (input, temp, self->radius);
ver_blur (temp, output, self->radius);
- gegl_buffer_destroy (input);
- gegl_buffer_destroy (temp);
+ g_object_unref (temp);
return TRUE;
}
Modified: trunk/operations/blur/gaussian-blur.c
==============================================================================
--- trunk/operations/blur/gaussian-blur.c (original)
+++ trunk/operations/blur/gaussian-blur.c Mon Jan 7 01:44:57 2008
@@ -84,16 +84,14 @@
static gboolean
process (GeglOperation *operation,
GeglNodeContext *context,
+ GeglBuffer *input,
+ GeglBuffer *output,
const GeglRectangle *result)
{
GeglChantOperation *self;
- GeglBuffer *input;
GeglBuffer *temp;
- GeglBuffer *output;
self = GEGL_CHANT_OPERATION (operation);
- input = gegl_node_context_get_source (context, "input");
- output = gegl_node_context_get_target (context, "output");
temp = gegl_buffer_new (gegl_buffer_get_extent (input),
babl_format ("RaGaBaA float"));
@@ -132,8 +130,7 @@
}
}
- gegl_buffer_destroy (input);
- gegl_buffer_destroy (temp);
+ g_object_unref (temp);
return TRUE;
}
Modified: trunk/operations/color/mono-mixer.c
==============================================================================
--- trunk/operations/color/mono-mixer.c (original)
+++ trunk/operations/color/mono-mixer.c Mon Jan 7 01:44:57 2008
@@ -37,24 +37,21 @@
static gboolean
process (GeglOperation *operation,
GeglNodeContext *context,
+ GeglBuffer *input,
+ GeglBuffer *output,
const GeglRectangle *result)
{
GeglChantOperation *self;
- GeglBuffer *input;
- GeglBuffer *output;
gfloat *in_buf;
gfloat *out_buf;
gfloat red, green, blue;
self = GEGL_CHANT_OPERATION (operation);
- input = gegl_node_context_get_source (context, "input");
red = self->red;
green = self->green;
blue = self->blue;
- output = gegl_buffer_new (result, babl_format ("YA float"));
-
if ((result->width > 0) && (result->height > 0))
{
gint num_pixels = result->width * result->height;
@@ -84,7 +81,6 @@
g_free (out_buf);
}
- gegl_node_context_set_object (context, "output", G_OBJECT (output));
return TRUE;
}
Modified: trunk/operations/color/remap.c
==============================================================================
--- trunk/operations/color/remap.c (original)
+++ trunk/operations/color/remap.c Mon Jan 7 01:44:57 2008
@@ -91,6 +91,8 @@
}
static gboolean process (GeglOperation *operation,
GeglNodeContext *context,
+ GeglBuffer *foo,
+ GeglBuffer *bar,
const GeglRectangle *result);
static void
@@ -126,9 +128,12 @@
return obj;
}
+/* FIXME: this op is broken */
static gboolean
process (GeglOperation *operation,
GeglNodeContext *context,
+ GeglBuffer *foo,
+ GeglBuffer *bar,
const GeglRectangle *result)
{
GeglOperationFilter *filter;
Modified: trunk/operations/color/stretch-contrast.c
==============================================================================
--- trunk/operations/color/stretch-contrast.c (original)
+++ trunk/operations/color/stretch-contrast.c Mon Jan 7 01:44:57 2008
@@ -83,17 +83,13 @@
static gboolean
process (GeglOperation *operation,
GeglNodeContext *context,
+ GeglBuffer *input,
+ GeglBuffer *output,
const GeglRectangle *result)
{
- GeglBuffer *input;
- GeglBuffer *output;
gdouble min, max;
- input = gegl_node_context_get_source (context, "input");
-
buffer_get_min_max (input, &min, &max);
-
- output = gegl_node_context_get_target (context, "output");
{
gint row;
guchar *buf;
Modified: trunk/operations/core/clone.c
==============================================================================
--- trunk/operations/core/clone.c (original)
+++ trunk/operations/core/clone.c Mon Jan 7 01:44:57 2008
@@ -31,19 +31,25 @@
#include "gegl-chant.h"
+/* FIXME: rewrtie without chanting, wihtout deriving from GeglOperationFilter, but
+ * directly from GeglOperation
+ */
+
/* Actual image processing code
************************************************************************/
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *input,
+ GeglBuffer *output, /* ignored */
const GeglRectangle *result)
{
gboolean success = FALSE;
- GeglBuffer *buffer = gegl_node_context_get_source (context, "input");
- if (buffer)
+ if (input)
{
- g_object_ref (buffer);
- gegl_node_context_set_object (context, "output", G_OBJECT (buffer));
+ g_object_ref (input);
+ /* overrides the _set_object, that has occured earlier */
+ gegl_node_context_set_object (context, "output", G_OBJECT (input));
success = TRUE;
}
return success;
Modified: trunk/operations/core/crop.c
==============================================================================
--- trunk/operations/core/crop.c (original)
+++ trunk/operations/core/crop.c Mon Jan 7 01:44:57 2008
@@ -41,19 +41,23 @@
int gegl_chant_foo = 0;
+
+/* FIXME: rewrtie without chanting, wihtout deriving from GeglOperationFilter, but
+ * directly from GeglOperation
+ */
+
/* Actual image processing code
************************************************************************/
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *input,
+ GeglBuffer *ignored, /* crop ignored the normal way of doing things,. */
const GeglRectangle *result)
{
- GeglBuffer *input;
GeglBuffer *output;
GeglChantOperation *crop = GEGL_CHANT_OPERATION (operation);
GeglRectangle extent = {crop->x, crop->y, crop->width, crop->height};
-
- input = gegl_node_context_get_source (context, "input");
g_assert (input);
Modified: trunk/operations/core/nop.c
==============================================================================
--- trunk/operations/core/nop.c (original)
+++ trunk/operations/core/nop.c Mon Jan 7 01:44:57 2008
@@ -26,17 +26,24 @@
#define GEGL_CHANT_CLASS_INIT
#include "gegl-chant.h"
+
+/* FIXME: rewrtie without chanting, wihtout deriving from GeglOperationFilter, but
+ * directly from GeglOperation
+ */
+
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *input,
+ GeglBuffer *output, /*ignored*/
const GeglRectangle *process)
{
gboolean success = FALSE;
- GeglBuffer *buffer = gegl_node_context_get_source (context, "input");
- if (buffer)
+ if (input)
{
- g_object_ref (buffer);
- gegl_node_context_set_object (context, "output", G_OBJECT (buffer));
+ g_object_ref (input);
+ /* overrides earlier context_set */
+ gegl_node_context_set_object (context, "output", G_OBJECT (input));
success = TRUE;
}
return success;
Modified: trunk/operations/core/shift.c
==============================================================================
--- trunk/operations/core/shift.c (original)
+++ trunk/operations/core/shift.c Mon Jan 7 01:44:57 2008
@@ -40,25 +40,28 @@
/*FIXME: check that all rounding done here makes sense */
+/* FIXME: rewrtie without chanting, wihtout deriving from GeglOperationFilter, but
+ * directly from GeglOperation
+ */
+
+
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *input,
+ GeglBuffer *output,
const GeglRectangle *result)
{
- GeglBuffer *input;
- GeglBuffer *output;
GeglChantOperation *translate = GEGL_CHANT_OPERATION (operation);
- input = gegl_node_context_get_source (context, "input");
-
translate->x = floor (translate->x);
translate->y = floor (translate->y);
- g_assert (input);
-
/* XXX: this shifted buffer is a behavior not readily available in the
* pure C (non-gobject) part of the GeglBuffer API.
*/
+
+ /* overwrites presumed output */
output = g_object_new (GEGL_TYPE_BUFFER,
"provider", input,
"shift-x", (int)-translate->x,
@@ -66,6 +69,8 @@
"abyss-width", -1, /* turn of abyss (relying on abyss
of source) */
NULL);
+
+ /* overrides previous context_set_object */
gegl_node_context_set_object (context, "output", G_OBJECT (output));
return TRUE;
}
Modified: trunk/operations/enhance/bilateral-filter.c
==============================================================================
--- trunk/operations/enhance/bilateral-filter.c (original)
+++ trunk/operations/enhance/bilateral-filter.c Mon Jan 7 01:44:57 2008
@@ -44,19 +44,18 @@
#include <stdio.h>
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *input,
+ GeglBuffer *output,
const GeglRectangle *result)
{
GeglOperationFilter *filter;
GeglChantOperation *self;
- GeglBuffer *input;
- GeglBuffer *output;
filter = GEGL_OPERATION_FILTER (operation);
self = GEGL_CHANT_OPERATION (operation);
- input = gegl_node_context_get_source (context, "input");
{
GeglBuffer *temp_in;
GeglRectangle compute;
@@ -72,18 +71,10 @@
{
temp_in = gegl_buffer_create_sub_buffer (input, &compute);
- output = gegl_buffer_new (&compute, babl_format ("RGBA float"));
-
bilateral_filter (temp_in, output, self->blur_radius, self->edge_preservation);
g_object_unref (temp_in);
}
- {
- GeglBuffer *cropped = gegl_buffer_create_sub_buffer (output, result);
-
- gegl_node_context_set_object (context, "output", G_OBJECT (cropped));
- g_object_unref (output);
- }
}
return TRUE;
}
Modified: trunk/operations/enhance/snn-mean.c
==============================================================================
--- trunk/operations/enhance/snn-mean.c (original)
+++ trunk/operations/enhance/snn-mean.c Mon Jan 7 01:44:57 2008
@@ -46,17 +46,16 @@
static gboolean
process (GeglOperation *operation,
GeglNodeContext *context,
+ GeglBuffer *input,
+ GeglBuffer *output,
const GeglRectangle *result)
{
GeglOperationFilter *filter;
GeglChantOperation *self;
- GeglBuffer *input;
- GeglBuffer *output;
filter = GEGL_OPERATION_FILTER (operation);
self = GEGL_CHANT_OPERATION (operation);
- input = gegl_node_context_get_source (context, "input");
{
GeglBuffer *temp_in;
GeglRectangle compute;
@@ -70,17 +69,10 @@
else
{
temp_in = gegl_buffer_create_sub_buffer (input, &compute);
- output = gegl_buffer_new (&compute, babl_format ("RGBA float"));
snn_mean (temp_in, output, self->radius, self->pairs);
g_object_unref (temp_in);
}
-
- {
- GeglBuffer *cropped = gegl_buffer_create_sub_buffer (output, result);
- gegl_node_context_set_object (context, "output", G_OBJECT (cropped));
- g_object_unref (output);
- }
}
return TRUE;
}
Modified: trunk/operations/io/display.c
==============================================================================
--- trunk/operations/io/display.c (original)
+++ trunk/operations/io/display.c Mon Jan 7 01:44:57 2008
@@ -81,17 +81,13 @@
static gboolean
process (GeglOperation *operation,
GeglNodeContext *context,
+ GeglBuffer *input,
const GeglRectangle *result)
{
GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
- GeglBuffer *input;
GeglBuffer *source;
SDL_Surface **sdl_outwin = NULL; //op_sym (op, "sdl_outwin");
- input = gegl_node_context_get_source (context, "input");
-
- g_assert (input);
-
init_sdl ();
if (!self->screen ||
Modified: trunk/operations/io/exr-load.cpp
==============================================================================
--- trunk/operations/io/exr-load.cpp (original)
+++ trunk/operations/io/exr-load.cpp Mon Jan 7 01:44:57 2008
@@ -602,20 +602,18 @@
}
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *output,
const GeglRectangle *result)
{
GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
- GeglBuffer *output;
-
{
gint w,h,ff;
gpointer format;
gboolean ok;
ok = query_exr (self->path, &w, &h, &ff, &format);
- output = gegl_node_context_get_target (context, "output");
if (ok)
{
Modified: trunk/operations/io/ff-load.c
==============================================================================
--- trunk/operations/io/ff-load.c (original)
+++ trunk/operations/io/ff-load.c Mon Jan 7 01:44:57 2008
@@ -345,15 +345,13 @@
static gboolean
process (GeglOperation *operation,
GeglNodeContext *context,
+ GeglBuffer *output,
const GeglRectangle *result)
{
GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
- GeglBuffer *output = NULL;
Priv *p = (Priv*)self->priv;
{
- output = gegl_node_context_get_target (context, "output");
-
if (p->ic && !decode_frame (self, self->frame))
{
gint pxsize;
@@ -375,13 +373,13 @@
#define byteclamp(j) do{if(j<0)j=0; else if(j>255)j=255;}while(0)
#endif
#define YUV82RGB8(Y,U,V,R,G,B)do{\
- R= ((Y<<15) + 37355*(V-128))>>15;\
- G= ((Y<<15) -12911* (U-128) - 19038*(V-128))>>15;\
- B= ((Y<<15) +66454* (U-128) )>>15;\
- byteclamp(R);\
- byteclamp(G);\
- byteclamp(B);\
- }while(0)
+ R= ((Y<<15) + 37355*(V-128))>>15;\
+ G= ((Y<<15) -12911* (U-128) - 19038*(V-128))>>15;\
+ B= ((Y<<15) +66454* (U-128) )>>15;\
+ byteclamp(R);\
+ byteclamp(G);\
+ byteclamp(B);\
+ }while(0)
YUV82RGB8 (*ysrc, *usrc, *vsrc, R, G, B);
Modified: trunk/operations/io/jpg-load.c
==============================================================================
--- trunk/operations/io/jpg-load.c (original)
+++ trunk/operations/io/jpg-load.c Mon Jan 7 01:44:57 2008
@@ -43,12 +43,12 @@
gint *height);
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *output,
const GeglRectangle *result)
{
GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
- GeglBuffer *output;
GeglRectangle rect={0,0};
gint problem;
@@ -61,8 +61,6 @@
return FALSE;
}
- gegl_operation_set_format (operation, "output", babl_format ("R'G'B' u8"));
- output = gegl_node_context_get_target (context, "output");
problem = gegl_buffer_import_jpg (output, self->path, 0, 0);
@@ -85,6 +83,7 @@
GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
gint width, height;
gint status;
+ gegl_operation_set_format (operation, "output", babl_format ("R'G'B' u8"));
status = query_jpg (self->path, &width, &height);
if (status)
Modified: trunk/operations/io/load-buffer.c
==============================================================================
--- trunk/operations/io/load-buffer.c (original)
+++ trunk/operations/io/load-buffer.c Mon Jan 7 01:44:57 2008
@@ -43,8 +43,9 @@
}
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *output,
const GeglRectangle *result)
{
GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
@@ -53,6 +54,8 @@
g_object_ref (self->buffer); /* Add an extra reference, since gegl_operation_set_data
is stealing one.
*/
+
+ /* override core behaviour, by resetting the buffer in the node_context */
gegl_node_context_set_object (context, "output", G_OBJECT (self->buffer));
}
return TRUE;
Modified: trunk/operations/io/magick-load.c
==============================================================================
--- trunk/operations/io/magick-load.c (original)
+++ trunk/operations/io/magick-load.c Mon Jan 7 01:44:57 2008
@@ -73,8 +73,9 @@
}
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *output,
const GeglRectangle *result)
{
GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
@@ -82,6 +83,7 @@
if (!self->priv)
return FALSE;
+ /* overriding the predefined behavior */
gegl_node_context_set_object (context, "output", G_OBJECT (self->priv));
self->priv = NULL;
Modified: trunk/operations/io/pixbuf.c
==============================================================================
--- trunk/operations/io/pixbuf.c (original)
+++ trunk/operations/io/pixbuf.c Mon Jan 7 01:44:57 2008
@@ -31,8 +31,9 @@
#include <gdk-pixbuf/gdk-pixdata.h>
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *output, /* ignored */
const GeglRectangle *result)
{
GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
Modified: trunk/operations/io/png-load.c
==============================================================================
--- trunk/operations/io/png-load.c (original)
+++ trunk/operations/io/png-load.c Mon Jan 7 01:44:57 2008
@@ -48,12 +48,12 @@
gpointer *format);
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *output,
const GeglRectangle *result)
{
GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
- GeglBuffer *output = NULL;
gint problem;
gpointer format;
gint width, height;
@@ -67,8 +67,6 @@
return FALSE;
}
- gegl_operation_set_format (operation, "output", format);
- output = gegl_node_context_get_target (context, "output");
problem = gegl_buffer_import_png (output, self->path, 0, 0,
&width, &height, format);
@@ -102,6 +100,7 @@
height=10;
}
}
+ gegl_operation_set_format (operation, "output", format);
result.width = width;
result.height = height;
return result;
Modified: trunk/operations/io/png-save.c
==============================================================================
--- trunk/operations/io/png-save.c (original)
+++ trunk/operations/io/png-save.c Mon Jan 7 01:44:57 2008
@@ -36,22 +36,19 @@
gint
gegl_buffer_export_png (GeglBuffer *gegl_buffer,
const gchar *path,
- gint compression,
+ gint compression,
gint src_x,
gint src_y,
gint width,
gint height);
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *input,
const GeglRectangle *result)
{
GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
- GeglBuffer *input;
-
- input = gegl_node_context_get_source (context, "input");
- g_assert (input);
gegl_buffer_export_png (input, self->path, self->compression,
result->x, result->y,
Modified: trunk/operations/io/raw-load.c
==============================================================================
--- trunk/operations/io/raw-load.c (original)
+++ trunk/operations/io/raw-load.c Mon Jan 7 01:44:57 2008
@@ -49,8 +49,9 @@
static void load_buffer (GeglChantOperation *op_raw_load);
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *output_ignored,
const GeglRectangle *result)
{
GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
Modified: trunk/operations/io/save-buffer.c
==============================================================================
--- trunk/operations/io/save-buffer.c (original)
+++ trunk/operations/io/save-buffer.c Mon Jan 7 01:44:57 2008
@@ -28,21 +28,19 @@
#include "gegl-chant.h"
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *input,
const GeglRectangle *result)
{
GeglChantOperation *self;
- GeglBuffer *input;
self = GEGL_CHANT_OPERATION (operation);
if (self->buffer)
{
GeglBuffer **output = self->buffer;
- input = gegl_node_context_get_source (context, "input");
-
- g_assert (input);
+
*output = gegl_buffer_create_sub_buffer (input, result);
}
return TRUE;
Modified: trunk/operations/io/save-pixbuf.c
==============================================================================
--- trunk/operations/io/save-pixbuf.c (original)
+++ trunk/operations/io/save-pixbuf.c Mon Jan 7 01:44:57 2008
@@ -31,12 +31,12 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *input,
const GeglRectangle *result)
{
GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
- GeglBuffer *input;
if (self->pixbuf)
{
@@ -50,9 +50,6 @@
gint bps;
guint i;
- input = gegl_node_context_get_source (context, "input");
- g_assert (input);
-
babl = input->format;
format = (BablFormat*) babl;
Modified: trunk/operations/io/svg-load.c
==============================================================================
--- trunk/operations/io/svg-load.c (original)
+++ trunk/operations/io/svg-load.c Mon Jan 7 01:44:57 2008
@@ -63,12 +63,12 @@
gint *height);
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *output,
const GeglRectangle *result_foo)
{
GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
- GeglBuffer *output = NULL;
gint result;
{
@@ -87,6 +87,9 @@
{
GeglRectangle extent={0,0,width,height};
+ /* FIXME: the format should be set on the pad prior to the actual
+ * load
+ */
output = gegl_buffer_new (&extent, babl_format ("R'G'B'A u8"));
}
Modified: trunk/operations/render/FractalExplorer.c
==============================================================================
--- trunk/operations/render/FractalExplorer.c (original)
+++ trunk/operations/render/FractalExplorer.c Mon Jan 7 01:44:57 2008
@@ -386,21 +386,18 @@
}
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *output,
const GeglRectangle *result)
{
GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
- GeglBuffer *output = NULL;
-
{
clrmap colormap;
guchar *buf;
make_color_map (self, colormap);
- output = gegl_node_context_get_target (context, "output");
-
buf = g_new (guchar, result->width * result->height * 4);
{
guchar *dst=buf;
Modified: trunk/operations/render/checkerboard.c
==============================================================================
--- trunk/operations/render/checkerboard.c (original)
+++ trunk/operations/render/checkerboard.c Mon Jan 7 01:44:57 2008
@@ -44,12 +44,12 @@
}
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *output,
const GeglRectangle *result)
{
GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
- GeglBuffer *output = NULL;
{
gfloat *buf;
@@ -71,8 +71,6 @@
&color2[2],
&color2[3]);
- output = gegl_node_context_get_target (context, "output");
-
g_object_get (output, "px-size", &pxsize,
"pixels", &n_pixels,
NULL);
Modified: trunk/operations/render/color.c
==============================================================================
--- trunk/operations/render/color.c (original)
+++ trunk/operations/render/color.c Mon Jan 7 01:44:57 2008
@@ -39,12 +39,12 @@
}
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *output,
const GeglRectangle *result)
{
GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
- GeglBuffer *output = NULL;
{
gfloat *buf;
@@ -56,7 +56,6 @@
&color[2],
&color[3]);
- output = gegl_node_context_get_target (context, "output");
buf = g_malloc (result->width * result->height * 4 * sizeof (gfloat));
{
gfloat *dst=buf;
Modified: trunk/operations/render/introspect.c
==============================================================================
--- trunk/operations/render/introspect.c (original)
+++ trunk/operations/render/introspect.c Mon Jan 7 01:44:57 2008
@@ -38,8 +38,9 @@
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *output, /* ignored */
const GeglRectangle *result)
{
GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
@@ -101,7 +102,7 @@
GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
GeglRectangle result = {0,0, 4096, 4096};
- process (operation, NULL, NULL);
+ process (operation, NULL, NULL, NULL);
if (self->buf)
{
GeglBuffer *buffer = GEGL_BUFFER (self->buf);
Modified: trunk/operations/render/noise.c
==============================================================================
--- trunk/operations/render/noise.c (original)
+++ trunk/operations/render/noise.c Mon Jan 7 01:44:57 2008
@@ -39,17 +39,15 @@
#include "perlin/perlin.h"
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *output,
const GeglRectangle *result)
{
GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
- GeglBuffer *output = NULL;
-
{
gfloat *buf;
- output = gegl_node_context_get_target (context, "output");
buf = g_malloc (result->width * result->height * 4);
{
gfloat *dst=buf;
Modified: trunk/operations/render/text.c
==============================================================================
--- trunk/operations/render/text.c (original)
+++ trunk/operations/render/text.c Mon Jan 7 01:44:57 2008
@@ -149,32 +149,29 @@
}
static gboolean
-process (GeglOperation *operation,
- GeglNodeContext *context,
+process (GeglOperation *operation,
+ GeglNodeContext *context,
+ GeglBuffer *output,
const GeglRectangle *result)
{
GeglChantOperation *self = GEGL_CHANT_OPERATION (operation);
- GeglBuffer *output = NULL;
- output = gegl_node_context_get_target (context, "output");
- {
- guchar *data = g_malloc0 (result->width * result->height * 4);
- cairo_t *cr;
-
- cairo_surface_t *surface = cairo_image_surface_create_for_data (data, CAIRO_FORMAT_ARGB32,
- result->width, result->height, result->width * 4);
- cr = cairo_create (surface);
- cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0);
- cairo_translate (cr, -result->x, -result->y);
- text_layout_text (self, cr, 0, NULL, NULL);
-
- gegl_buffer_set (output, NULL, babl_format ("B'aG'aR'aA u8"), data,
- GEGL_AUTO_ROWSTRIDE);
-
- cairo_destroy (cr);
- cairo_surface_destroy (surface);
- g_free (data);
- }
+ guchar *data = g_malloc0 (result->width * result->height * 4);
+ cairo_t *cr;
+
+ cairo_surface_t *surface = cairo_image_surface_create_for_data (data, CAIRO_FORMAT_ARGB32,
+ result->width, result->height, result->width * 4);
+ cr = cairo_create (surface);
+ cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0);
+ cairo_translate (cr, -result->x, -result->y);
+ text_layout_text (self, cr, 0, NULL, NULL);
+
+ gegl_buffer_set (output, NULL, babl_format ("B'aG'aR'aA u8"), data,
+ GEGL_AUTO_ROWSTRIDE);
+
+ cairo_destroy (cr);
+ cairo_surface_destroy (surface);
+ g_free (data);
return TRUE;
}
Modified: trunk/operations/workshop/stress.c
==============================================================================
--- trunk/operations/workshop/stress.c (original)
+++ trunk/operations/workshop/stress.c Mon Jan 7 01:44:57 2008
@@ -78,7 +78,6 @@
self->strength,
self->gamma);
- gegl_buffer_destroy (input);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]