All pastes #417513 Raw Edit

Anonymous

public c v1 · immutable
#417513 ·published 2007-03-30 22:27 UTC
rendered paste body
#include <gegl.h>#include <gdk-pixbuf/gdk-pixbuf.h>#define	PNG	"GnomeScanDialog.png"gintmain (gint argc, gchar ** argv){  GeglProcessor *processor;  GeglNode *root;  GeglNode *color, *crop, *save;  gchar *filename = g_strconcat (PNG, ".gegl.png", NULL);  gdouble progress;  gegl_init (&argc, &argv);  root = gegl_node_new ();  color = gegl_node_new_child (root,			       "operation", "color",			       "value", "white",			       NULL);  crop = gegl_node_new_child (root,			      "operation", "crop",			      "x", 0.,			      "y", 0.,			      "width", 500.,			      "height", 500.,			      NULL);  save = gegl_node_new_child (root,			      "operation", "png-save",			      "path", filename,			      NULL);  gegl_node_link_many (color, crop, save, NULL);  processor = gegl_node_new_processor (save, NULL);  while (gegl_processor_work (processor, &progress))    g_debug ("%3.2f%% completed.", progress * 100);  gegl_processor_destroy (processor);  g_free (filename);  gegl_exit ();  return 0;}