[gegl] ops: add reference compositions to replace broken reference chain.



commit ab5f1a0053a912d6f7fadfbd01874636c8d1a1ec
Author: John Marshall <jtm home gmail com>
Date:   Thu Jul 9 19:40:20 2020 +0100

    ops: add reference compositions to replace broken
    reference chain.

 operations/common-gpl3+/antialias.c          | 20 +++++++++++++++++--
 operations/common/exposure.c                 | 23 ++++++++++++++++++++--
 operations/common/newsprint.c                | 28 +++++++++++++++++++++++----
 operations/transform/reflect.c               | 29 +++++++++++++++++++++++++---
 operations/transform/reset-origin.c          | 21 ++++++++++++++++++++
 operations/transform/rotate-on-center.c      | 23 ++++++++++++++++++++--
 operations/transform/rotate.c                | 25 ++++++++++++++++++++++--
 operations/transform/scale-ratio.c           | 26 +++++++++++++++++++++++--
 operations/transform/scale-size-keepaspect.c | 25 +++++++++++++++++++++---
 operations/transform/shear.c                 | 25 ++++++++++++++++++++++--
 operations/transform/translate.c             | 24 +++++++++++++++++++++--
 11 files changed, 245 insertions(+), 24 deletions(-)
---
diff --git a/operations/common-gpl3+/antialias.c b/operations/common-gpl3+/antialias.c
index 59e2687d2..38d1fb179 100644
--- a/operations/common-gpl3+/antialias.c
+++ b/operations/common-gpl3+/antialias.c
@@ -264,6 +264,22 @@ gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass       *operation_class;
   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:antialias'/>"
+    "    <node operation='gegl:threshold'/>"
+    "    <node operation='gegl:load' path='standard-input.png'/>"
+    "  </node>"
+    "  <node operation='gegl:checkerboard'>"
+    "    <params>"
+    "      <param name='color1'>rgb(0.25,0.25,0.25)</param>"
+    "      <param name='color2'>rgb(0.75,0.75,0.75)</param>"
+    "    </params>"
+    "  </node>"    
+    "</gegl>";
 
   operation_class          = GEGL_OPERATION_CLASS (klass);
   filter_class             = GEGL_OPERATION_FILTER_CLASS (klass);
@@ -277,9 +293,9 @@ gegl_op_class_init (GeglOpClass *klass)
     "title",       _("Scale3X Antialiasing"),
     "categories",  "enhance",
     "license",     "GPL3+",
-    "reference-hash", "457b979c0b7f6ff9b41549e05388e67f",
+    "reference-hash", "0d8c2a49014f6083d0e7f145f541ddc0",
+    "reference-composition", composition,
     "description", _("Antialias using the Scale3X edge-extrapolation algorithm"),
-    "reference-chain",    "load path=images/standard-input.png threshold antialias",
     NULL);
 }
 
diff --git a/operations/common/exposure.c b/operations/common/exposure.c
index 89e4449aa..3fbe49b73 100644
--- a/operations/common/exposure.c
+++ b/operations/common/exposure.c
@@ -443,6 +443,25 @@ gegl_op_class_init (GeglOpClass *klass)
   GObjectClass                  *object_class;
   GeglOperationClass            *operation_class;
   GeglOperationPointFilterClass *point_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:exposure'>"
+    "      <params>"
+    "        <param name='exposure'>1.5</param>"
+    "      </params>"
+    "    </node>"
+    "    <node operation='gegl:load' path='standard-input.png'/>"
+    "  </node>"
+    "  <node operation='gegl:checkerboard'>"
+    "    <params>"
+    "      <param name='color1'>rgb(0.25,0.25,0.25)</param>"
+    "      <param name='color2'>rgb(0.75,0.75,0.75)</param>"
+    "    </params>"
+    "  </node>"    
+    "</gegl>";
 
   object_class       = G_OBJECT_CLASS (klass);
   operation_class    = GEGL_OPERATION_CLASS (klass);
@@ -460,8 +479,8 @@ gegl_op_class_init (GeglOpClass *klass)
     "name",        "gegl:exposure",
     "title",       _("Exposure"),
     "categories",  "color",
-    "reference-hash", "967bd5777363d1fec59f04889f358a99",
-    "reference-chain", "load path=images/standard-input.png exposure exposure=1.5",
+    "reference-hash", "a4ae5d7f933046aa462e0f7659bd1261",
+    "reference-composition", composition,
     "description", _("Change exposure of an image in shutter speed stops"),
     "op-version",  "1:0",
     NULL);
diff --git a/operations/common/newsprint.c b/operations/common/newsprint.c
index 30f13ad8b..a4a16f710 100644
--- a/operations/common/newsprint.c
+++ b/operations/common/newsprint.c
@@ -616,6 +616,28 @@ gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass            *operation_class;
   GeglOperationPointFilterClass *point_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:newsprint'>"
+    "      <params>"
+    "        <param name='period'>6.0</param>"
+    "        <param name='pattern'>pssquare</param>"
+    "        <param name='color-model'>cmyk</param>"
+    "      </params>"
+    "    </node>"
+    "    <node operation='gegl:load' path='standard-input.png'/>"
+    "  </node>"
+    "  <node operation='gegl:checkerboard'>"
+    "    <params>"
+    "      <param name='color1'>rgb(0.25,0.25,0.25)</param>"
+    "      <param name='color2'>rgb(0.75,0.75,0.75)</param>"
+    "    </params>"
+    "  </node>"    
+    "</gegl>";
+
 
   operation_class = GEGL_OPERATION_CLASS (klass);
   point_filter_class = GEGL_OPERATION_POINT_FILTER_CLASS (klass);
@@ -632,11 +654,9 @@ gegl_op_class_init (GeglOpClass *klass)
     "title",              _("Newsprint"),
     "categories" ,        "render",
     "position-dependent", "true",
-    "reference-hash",     "f680e099d412e28dfa26f9b19e34109f",
-    "reference-hashB",    "37755aa95f73b217e0d339a3e4f88044",
+    "reference-hash",     "2792e6d5aec5c2f80e45aea3a610d1f6",
+    "reference-composition", composition,
     "description",        _("Digital halftoning with optional modulations. "),
-    "reference-chain",    "load path=images/standard-input.png newsprint period=6.0 pattern=pssquare 
color-model=cmyk",
-    "position-dependent", "true",
     NULL);
 }
 
diff --git a/operations/transform/reflect.c b/operations/transform/reflect.c
index 6e787c993..681ceef74 100644
--- a/operations/transform/reflect.c
+++ b/operations/transform/reflect.c
@@ -72,6 +72,29 @@ gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass *operation_class;
   OpTransformClass   *transform_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:reflect'>"
+    "      <params>"
+    "        <param name='origin-x'>100</param>"
+    "        <param name='origin-y'>100</param>"
+    "        <param name='x'>0.3</param>"
+    "        <param name='y'>1.2</param>"
+    "      </params>"
+    "    </node>"
+    "    <node operation='gegl:load' path='standard-input.png'/>"
+    "  </node>"
+    "  <node operation='gegl:checkerboard'>"
+    "    <params>"
+    "      <param name='color1'>rgb(0.25,0.25,0.25)</param>"
+    "      <param name='color2'>rgb(0.75,0.75,0.75)</param>"
+    "    </params>"
+    "  </node>"    
+    "</gegl>";
+
 
   operation_class = GEGL_OPERATION_CLASS (klass);
   transform_class = OP_TRANSFORM_CLASS (klass);
@@ -81,11 +104,11 @@ gegl_op_class_init (GeglOpClass *klass)
     "name", "gegl:reflect",
     "title", _("Reflect"),
     "categories", "transform",
-    "reference-hash", "ae16c74fdc60c979ee688057b19dcfed",
+    "reference-hash", "2ae152431de90c897ce3ccfcb3093de9",
+    "reference-composition", composition,
     "description", _("Reflect an image about a line, whose direction is "
                      "specified by the vector that is defined by the "
-                     "x and y properties."),
-    "reference-chain", "load path=images/standard-input.png reflet origin-x=100 origin-y=100 x=0.3 y=1.2",
+                     "x and y properties. "),
     NULL);
 }
 
diff --git a/operations/transform/reset-origin.c b/operations/transform/reset-origin.c
index 8498ed3b1..d12a3cdec 100644
--- a/operations/transform/reset-origin.c
+++ b/operations/transform/reset-origin.c
@@ -64,6 +64,26 @@ gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass *operation_class;
   OpTransformClass   *transform_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:reset-origin'>"
+    "      <params>"
+    "        <param name='origin-x'>100</param>"
+    "        <param name='origin-y'>100</param>"
+    "      </params>"
+    "    </node>"
+    "    <node operation='gegl:load' path='standard-input.png'/>"
+    "  </node>"
+    "  <node operation='gegl:checkerboard'>"
+    "    <params>"
+    "      <param name='color1'>rgb(0.25,0.25,0.25)</param>"
+    "      <param name='color2'>rgb(0.75,0.75,0.75)</param>"
+    "    </params>"
+    "  </node>"    
+    "</gegl>";
 
   operation_class = GEGL_OPERATION_CLASS (klass);
   transform_class = OP_TRANSFORM_CLASS (klass);
@@ -74,6 +94,7 @@ gegl_op_class_init (GeglOpClass *klass)
     "name", "gegl:reset-origin",
     "title", _("Reset origin"),
     "categories", "transform",
+    "reference-composition", composition,
     "description", _("Translate top-left to 0,0."),
     NULL);
 }
diff --git a/operations/transform/rotate-on-center.c b/operations/transform/rotate-on-center.c
index a13bf27d6..49d16d252 100644
--- a/operations/transform/rotate-on-center.c
+++ b/operations/transform/rotate-on-center.c
@@ -136,6 +136,25 @@ gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass *operation_class;
   OpTransformClass   *transform_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:rotate-on-center'>"
+    "      <params>"
+    "        <param name='degrees'>30</param>"
+    "      </params>"
+    "    </node>"
+    "    <node operation='gegl:load' path='standard-input.png'/>"
+    "  </node>"
+    "  <node operation='gegl:checkerboard'>"
+    "    <params>"
+    "      <param name='color1'>rgb(0.25,0.25,0.25)</param>"
+    "      <param name='color2'>rgb(0.75,0.75,0.75)</param>"
+    "    </params>"
+    "  </node>"    
+    "</gegl>";
 
   operation_class = GEGL_OPERATION_CLASS (klass);
   transform_class = OP_TRANSFORM_CLASS (klass);
@@ -145,8 +164,8 @@ gegl_op_class_init (GeglOpClass *klass)
     "name",       "gegl:rotate-on-center",
     "title",      _("Rotate on center"),
     "categories", "transform",
-    "reference-hash", "1b5001df3a4e6f964009308c116e7e1f",
-    "reference-hashB", "0ff629645abfee0a8b4289e29ba2f717",
+    "reference-hash", "7e9679f53b23801e6aa6a21092585d31",
+    "reference-composition", composition,
     "description", _("Rotate the buffer around its center, taking care of possible offsets."),
     NULL);
 }
diff --git a/operations/transform/rotate.c b/operations/transform/rotate.c
index 51a4cf3f8..7b5414518 100644
--- a/operations/transform/rotate.c
+++ b/operations/transform/rotate.c
@@ -61,6 +61,27 @@ gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass *operation_class;
   OpTransformClass   *transform_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:rotate'>"
+    "      <params>"
+    "        <param name='degrees'>30</param>"
+    "        <param name='origin-x'>50</param>"
+    "        <param name='origin-y'>50</param>"
+    "      </params>"
+    "    </node>"
+    "    <node operation='gegl:load' path='standard-input.png'/>"
+    "  </node>"
+    "  <node operation='gegl:checkerboard'>"
+    "    <params>"
+    "      <param name='color1'>rgb(0.25,0.25,0.25)</param>"
+    "      <param name='color2'>rgb(0.75,0.75,0.75)</param>"
+    "    </params>"
+    "  </node>"    
+    "</gegl>";
 
   operation_class = GEGL_OPERATION_CLASS (klass);
   transform_class = OP_TRANSFORM_CLASS (klass);
@@ -70,8 +91,8 @@ gegl_op_class_init (GeglOpClass *klass)
     "name", "gegl:rotate",
     "title", _("Rotate"),
     "categories", "transform",
-    "reference-hash", "4ac5d42bb82187a705a2ecd640353490",
-    "reference-hashB", "d17bf4d606e21691901ac27474b10259",
+    "reference-hash", "577f8ff8bcdd46dc4835097a6afc914b",
+    "reference-composition", composition,
     "description", _("Rotate the buffer around the specified origin."),
     NULL);
 }
diff --git a/operations/transform/scale-ratio.c b/operations/transform/scale-ratio.c
index e41a4a468..6ad7457c2 100644
--- a/operations/transform/scale-ratio.c
+++ b/operations/transform/scale-ratio.c
@@ -62,6 +62,28 @@ gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass *operation_class;
   OpTransformClass   *transform_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:scale-ratio'>"
+    "      <params>"
+    "        <param name='origin-x'>100</param>"
+    "        <param name='origin-y'>100</param>"
+    "        <param name='x'>2.0</param>"
+    "        <param name='y'>2.0</param>"
+    "      </params>"
+    "    </node>"
+    "    <node operation='gegl:load' path='standard-input.png'/>"
+    "  </node>"
+    "  <node operation='gegl:checkerboard'>"
+    "    <params>"
+    "      <param name='color1'>rgb(0.25,0.25,0.25)</param>"
+    "      <param name='color2'>rgb(0.75,0.75,0.75)</param>"
+    "    </params>"
+    "  </node>"    
+    "</gegl>";
 
   operation_class = GEGL_OPERATION_CLASS (klass);
   transform_class = OP_TRANSFORM_CLASS (klass);
@@ -71,8 +93,8 @@ gegl_op_class_init (GeglOpClass *klass)
     "name", "gegl:scale-ratio",
     "title", _("Scale ratio"),
     "categories", "transform",
-    "reference-hash", "bbd9ada0a890f265b66eda5f5a48dc67",
-    "reference-hashB", "c82f17bc90c9ec85b0ba0e46b0433d5d",
+    "reference-hash", "f160b6eca3e2ad9b23eefabd56f86a47",
+    "reference-composition", composition,
     "description", _("Scales the buffer according to a ratio."),
     NULL);
 }
diff --git a/operations/transform/scale-size-keepaspect.c b/operations/transform/scale-size-keepaspect.c
index 6cf683d0a..eb1ab34c0 100644
--- a/operations/transform/scale-size-keepaspect.c
+++ b/operations/transform/scale-size-keepaspect.c
@@ -92,6 +92,26 @@ gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass *operation_class;
   OpTransformClass   *transform_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:scale-size-keepaspect'>"
+    "      <params>"
+    "        <param name='x'>140</param>"
+    "        <param name='y'>100</param>"
+    "      </params>"
+    "    </node>"
+    "    <node operation='gegl:load' path='standard-input.png'/>"
+    "  </node>"
+    "  <node operation='gegl:checkerboard'>"
+    "    <params>"
+    "      <param name='color1'>rgb(0.25,0.25,0.25)</param>"
+    "      <param name='color2'>rgb(0.75,0.75,0.75)</param>"
+    "    </params>"
+    "  </node>"    
+    "</gegl>";
 
   operation_class = GEGL_OPERATION_CLASS (klass);
   transform_class = OP_TRANSFORM_CLASS (klass);
@@ -101,10 +121,9 @@ gegl_op_class_init (GeglOpClass *klass)
     "name", "gegl:scale-size-keepaspect",
     "title", _("Scale size keep aspect"),
     "categories", "transform",
-    "reference-hash", "21055a7509bb983967ab03a37200931a",
-    "reference-hashB", "8bc4e3d798e6becb9933c3340a6d9122",
+    "reference-hash", "9d8a7fe1ff90704f7ebcfdd5dae7e9c2",
+    "reference-composition", composition,
     "description", _("Scales the buffer to a size, preserving aspect ratio"),
-    "reference-chain", "load path=images/standard-input.png scale-size-keepaspect x=140 y=-1",
     NULL);
 }
 
diff --git a/operations/transform/shear.c b/operations/transform/shear.c
index 1e45fea33..421673bdb 100644
--- a/operations/transform/shear.c
+++ b/operations/transform/shear.c
@@ -60,6 +60,27 @@ gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass *operation_class;
   OpTransformClass   *transform_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:shear'>"
+    "      <params>"
+    "        <param name='origin-x'>100</param>"
+    "        <param name='origin-y'>100</param>"
+    "        <param name='x'>1.12</param>"
+    "      </params>"
+    "    </node>"
+    "    <node operation='gegl:load' path='standard-input.png'/>"
+    "  </node>"
+    "  <node operation='gegl:checkerboard'>"
+    "    <params>"
+    "      <param name='color1'>rgb(0.25,0.25,0.25)</param>"
+    "      <param name='color2'>rgb(0.75,0.75,0.75)</param>"
+    "    </params>"
+    "  </node>"    
+    "</gegl>";
 
   operation_class = GEGL_OPERATION_CLASS (klass);
   transform_class = OP_TRANSFORM_CLASS (klass);
@@ -69,8 +90,8 @@ gegl_op_class_init (GeglOpClass *klass)
     "name", "gegl:shear",
     "title", _("Shear"),
     "categories", "transform",
-    "reference-hash", "3d26408e0d03bb534fe1492453409519",
-    "reference-hashB", "8962a6cc2e96474e81190a016459e156",
+    "reference-hash", "d8560daa3efce1f2e1ab3ba2af373aa2",
+    "reference-composition", composition,
     "description", _("Shears the buffer. "),
     NULL);
 }
diff --git a/operations/transform/translate.c b/operations/transform/translate.c
index ff93cc49b..cb083389e 100644
--- a/operations/transform/translate.c
+++ b/operations/transform/translate.c
@@ -64,6 +64,26 @@ gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass *operation_class;
   OpTransformClass   *transform_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'>"
+    "      <params>"
+    "        <param name='x'>23.0</param>"
+    "        <param name='y'>42.0</param>"
+    "      </params>"
+    "    </node>"
+    "    <node operation='gegl:load' path='standard-input.png'/>"
+    "  </node>"
+    "  <node operation='gegl:checkerboard'>"
+    "    <params>"
+    "      <param name='color1'>rgb(0.25,0.25,0.25)</param>"
+    "      <param name='color2'>rgb(0.75,0.75,0.75)</param>"
+    "    </params>"
+    "  </node>"    
+    "</gegl>";
 
   operation_class = GEGL_OPERATION_CLASS (klass);
   transform_class = OP_TRANSFORM_CLASS (klass);
@@ -73,9 +93,9 @@ gegl_op_class_init (GeglOpClass *klass)
     "name", "gegl:translate",
     "title", _("Translate"),
     "categories", "transform",
-    "reference-hash", "8d3700ec06e9cbba3cb2b4a9f3061a10",
+    "reference-hash", "392c8ca820940075e3ccfdeba347da2d",
+    "reference-composition", composition,
     "description", _("Repositions the buffer (with subpixel precision), if integer coordinates are passed a 
fast-path without resampling is used"),
-    "reference-chain", "load path=images/standard-input.png translate x=23.0 y=42.0 clip-to-input=true",
     NULL);
 }
 


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