Gimp Plugin semi-flatten ported to Gegl op.
Hello,
I am Shivani and have ported the gimp plugin 'semi-flatten' to Gegl op. This
is in addition to the task( posted earlier to the list ) - giving the code
review and algorithm description as mentioned in Gsoc
tasks
list.
Kindly review the patch -
diff --git a/semi-flatten.c b/semi-flatten.c
index e69de29..ff18455 100644
--- a/semi-flatten.c
+++ b/semi-flatten.c
@@ -0,0 +1,70 @@
+/* Semi-flatten plugin using gegl op
+ *
+ * Shivani Maheshwari
+ *
+ */
+
+#include "config.h"
+#include
+
+#ifdef GEGL_CHANT_PROPERTIES
+
+#else
+
+#define GEGL_CHANT_TYPE_POINT_FILTER
+
+#define GEGL_CHANT_C_FILE "semi-flatten.c"
+
+#include "gegl-chant.h"
+
+static void prepare (GeglOperation *operation)
+{
+ gegl_operation_set_format (operation, "input", babl_format ("RGBA
float"));
+ gegl_operation_set_format (operation, "output", babl_format ("RGBA
float"));
+}
+
+static gboolean
+process (GeglOperation *op,
+ void *in_buf,
+ void *out_buf,
+ glong n_pixels,
+ const GeglRectangle *roi)
+{
+ GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ gfloat *GEGL_ALIGNED in_pixel;
+ gfloat *GEGL_ALIGNED out_pixel;
+ glong i;
+
+ in_pixel = in_buf;
+ out_pixel = out_buf;
+
+ for (i=0; iprepare = prepare;
+ point_filter_class->process = process;
+
+ operation_class->name = "gegl:semi-flatten";
+ operation_class->categories = "color";
+ operation_class->description = _("Semi flattens the image");
+}
+
+#endif