Update Portuguese translation
[gegl.git] / examples / 2geglbuffer.c
blob4cb0d458507768a12b3bd2c2bd214a7fda03b9e2
1 #include <stdlib.h>
2 #include <glib.h>
3 #include <gegl.h>
5 gint
6 main (gint argc,
7 gchar **argv)
9 GeglBuffer *buffer;
10 GeglNode *gegl, *load_file, *save_file;
12 gegl_init (&argc, &argv);
15 if (argv[1]==NULL ||
16 argv[2]==NULL)
18 g_print ("\nusage: %s in.png out.gegl\n\nCreates a GeglBuffer from an image file.\n\n", argv[0]);
19 exit (-1);
22 gegl = gegl_node_new ();
23 load_file = gegl_node_new_child (gegl,
24 "operation", "gegl:load",
25 "path", argv[1],
26 NULL);
27 save_file = gegl_node_new_child (gegl,
28 "operation", "gegl:buffer-sink",
29 "buffer", &buffer,
30 NULL);
32 gegl_node_link_many (load_file, save_file, NULL);
33 gegl_node_process (save_file);
36 gegl_buffer_save (buffer, argv[2], NULL);
37 return 0;