[gegl] fill, stroke, path: use GEGL G for reference composition



commit eafd995172016c9e3f95baa9c8dfc4c59897b688
Author: Øyvind Kolås <pippin gimp org>
Date:   Fri May 23 13:46:03 2014 +0200

    fill, stroke, path: use GEGL G for reference composition

 operations/external/path.c          |   20 ++++++++++++++++++++
 operations/external/vector-fill.c   |    8 +++++++-
 operations/external/vector-stroke.c |   18 ++++++++++++++++++
 3 files changed, 45 insertions(+), 1 deletions(-)
---
diff --git a/operations/external/path.c b/operations/external/path.c
index 52677d0..d76c836 100644
--- a/operations/external/path.c
+++ b/operations/external/path.c
@@ -497,6 +497,25 @@ gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass       *operation_class;
   GeglOperationFilterClass *filter_class;
+  const gchar *composition =
+    "<gegl>"
+    "<node operation='gegl:crop' width='200' height='200'/>"
+    "<node operation='gegl:over'>"
+    "<node operation='gegl:translate' x='40' y='40'/>"
+    "<node operation='gegl:path'>"
+    "  <params>"
+    "    <param name='fill'>rgba(1,1,1,0.2)</param>"
+    "    <param name='stroke'>rgba(0,0,1,0.5)</param>"
+    "    <param name='stroke-hardness'>0.0</param>"
+    "    <param name='stroke-width'>8.0</param>"
+    "    <param name='d'>"
+    "M0,50 C0,78 24,100 50,100 C77,100 100,78 100,50 C100,45 99,40 98,35 C82,35 66,35 50,35 C42,35 35,42 
35,50 C35,58 42,65 50,65 C56,65 61,61 64,56 C67,51 75,55 73,60 C69,  69 60,75 50,75 C36,75 25,64 25,50 C25,36 
36,25 50,25 L93,25 C83,9 67,0 49,0 C25,0 0,20 0,50   z"
+    "                    </param>"
+    "  </params>"
+    "</node>"
+    "</node>"
+    "<node operation='gegl:checkerboard' color1='rgb(0.25,0.25,0.25)' color2='rgb(0.75,0.75,0.75)'/>"
+    "</gegl>";
 
   operation_class = GEGL_OPERATION_CLASS (klass);
   filter_class    = GEGL_OPERATION_FILTER_CLASS (klass);
@@ -510,6 +529,7 @@ gegl_op_class_init (GeglOpClass *klass)
   gegl_operation_class_set_keys (operation_class,
     "name"        , "gegl:path",
     "categories"  , "render",
+    "reference-composition", composition,
     "description" , _("Renders a brush stroke"),
     NULL);
 }
diff --git a/operations/external/vector-fill.c b/operations/external/vector-fill.c
index ee65883..d93bd99 100644
--- a/operations/external/vector-fill.c
+++ b/operations/external/vector-fill.c
@@ -246,16 +246,22 @@ gegl_op_class_init (GeglOpClass *klass)
   GeglOperationFilterClass *filter_class;
   gchar                    *composition = "<?xml version='1.0' encoding='UTF-8'?>"
     "<gegl>"
+    "<node operation='gegl:crop' width='200' height='200'/>"
+    "<node operation='gegl:over'>"
+    "<node operation='gegl:translate' x='40' y='40'/>"
     "<node operation='gegl:fill-path'>"
     "  <params>"
+    "    <param name='color'>rgb(0.0, 0.6, 1.0)</param>"
     "    <param name='d'>"
     "M0,50 C0,78 24,100 50,100 C77,100 100,78 100,50 C100,45 99,40 98,35 C82,35 66,35 50,35 C42,35 35,42 
35,50 C35,58 42,65 50,65 C56,65 61,61 64,56 C67,51 75,55 73,60 C69,  69 60,75 50,75 C36,75 25,64 25,50 C25,36 
36,25 50,25 L93,25 C83,9 67,0 49,0 C25,0 0,20 0,50   z"
     "                    </param>"
-    "    <param name='color'>rgb(0.0, 0.6, 1.0)</param>"
     "  </params>"
     "</node>"
+    "</node>"
+    "<node operation='gegl:checkerboard' color1='rgb(0.25,0.25,0.25)' color2='rgb(0.75,0.75,0.75)'/>"
     "</gegl>";
 
+
   operation_class = GEGL_OPERATION_CLASS (klass);
   filter_class    = GEGL_OPERATION_FILTER_CLASS (klass);
 
diff --git a/operations/external/vector-stroke.c b/operations/external/vector-stroke.c
index 5f8c444..0bbf322 100644
--- a/operations/external/vector-stroke.c
+++ b/operations/external/vector-stroke.c
@@ -262,6 +262,23 @@ static GeglNode *detect (GeglOperation *operation,
   return NULL;
 }
 
+  gchar                    *composition = "<?xml version='1.0' encoding='UTF-8'?>"
+    "<gegl>"
+    "<node operation='gegl:crop' width='200' height='200'/>"
+    "<node operation='gegl:over'>"
+    "<node operation='gegl:translate' x='40' y='40'/>"
+    "<node operation='gegl:stroke-path'>"
+    "  <params>"
+    "    <param name='color'>rgb(0.0, 0.6, 1.0)</param>"
+    "    <param name='d'>"
+    "M0,50 C0,78 24,100 50,100 C77,100 100,78 100,50 C100,45 99,40 98,35 C82,35 66,35 50,35 C42,35 35,42 
35,50 C35,58 42,65 50,65 C56,65 61,61 64,56 C67,51 75,55 73,60 C69,  69 60,75 50,75 C36,75 25,64 25,50 C25,36 
36,25 50,25 L93,25 C83,9 67,0 49,0 C25,0 0,20 0,50   z"
+    "                    </param>"
+    "  </params>"
+    "</node>"
+    "</node>"
+    "<node operation='gegl:checkerboard' color1='rgb(0.25,0.25,0.25)' color2='rgb(0.75,0.75,0.75)'/>"
+    "</gegl>";
+
 static void
 gegl_op_class_init (GeglOpClass *klass)
 {
@@ -278,6 +295,7 @@ gegl_op_class_init (GeglOpClass *klass)
   /*operation_class->no_cache = TRUE;*/
 
   gegl_operation_class_set_keys (operation_class,
+    "reference-composition", composition,
     "name"        , "gegl:vector-stroke",
     "categories"  , "render",
     "description" , _("Renders a vector stroke"),


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