[gegl] gegl:high-pass do inversion, over and contrast in a non-linear space



commit d469a789c47a2c4775da72ad8d2f3d72d2e3f27d
Author: Øyvind Kolås <pippin gimp org>
Date:   Thu Jan 19 23:19:28 2017 +0100

    gegl:high-pass do inversion, over and contrast in a non-linear space

 operations/common/high-pass.c |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/operations/common/high-pass.c b/operations/common/high-pass.c
index d606151..49ce38e 100644
--- a/operations/common/high-pass.c
+++ b/operations/common/high-pass.c
@@ -43,28 +43,31 @@ property_double (contrast, _("Contrast"), 1.0)
 static void
 attach (GeglOperation *operation)
 {
-  GeglNode *gegl, *input, *output, *invert, *blur, *opacity, *over, *contrast;
+  GeglNode *gegl, *input, *output, *invert, *blur, *opacity, *over, *sub, *mul, *add, *gam0, *gam1;
 
   gegl = operation->node;
   input = gegl_node_get_input_proxy (gegl, "input");
   output = gegl_node_get_output_proxy (gegl, "output");
-  invert = gegl_node_new_child (gegl, "operation", "gegl:invert-linear", NULL);
+  invert = gegl_node_new_child (gegl, "operation", "gegl:invert-gamma", NULL);
   blur = gegl_node_new_child (gegl, "operation", "gegl:gaussian-blur", NULL);
   opacity = gegl_node_new_child (gegl, "operation", "gegl:opacity",
                                  "value", 0.5, NULL);
-  over = gegl_node_new_child (gegl, "operation", "gegl:over", NULL);
-  contrast = gegl_node_new_child (gegl, "operation",
-                                  "gegl:brightness-contrast", NULL);
-
-  gegl_node_link_many (input, invert, blur, opacity, NULL);
+  over = gegl_node_new_child (gegl, "operation", "gegl:over", "srgb", TRUE, NULL);
+  gam0 = gegl_node_new_child (gegl, "operation", "gegl:gamma", "value", 0.4545, NULL);
+  sub = gegl_node_new_child (gegl, "operation", "gegl:add", "value", -0.5, NULL);
+  mul = gegl_node_new_child (gegl, "operation", "gegl:multiply", "value", 1.0, NULL);
+  add = gegl_node_new_child (gegl, "operation", "gegl:add", "value", 0.5, NULL);
+  gam1 = gegl_node_new_child (gegl, "operation", "gegl:gamma", "value", 2.2, NULL);
+
+  gegl_node_link_many (input, blur, invert, opacity, NULL);
   gegl_node_connect_to (opacity, "output", over, "aux");
-  gegl_node_link_many (input, over, contrast, output, NULL);
+  gegl_node_link_many (input, over, gam0, sub, mul, add, gam1, output, NULL);
 
   gegl_operation_meta_redirect (operation, "std-dev", blur, "std-dev-x");
   gegl_operation_meta_redirect (operation, "std-dev", blur, "std-dev-y");
-  gegl_operation_meta_redirect (operation, "contrast", contrast, "contrast");
+  gegl_operation_meta_redirect (operation, "contrast", mul, "value");
 
-  gegl_operation_meta_watch_nodes (operation, invert, blur, opacity, over, contrast, NULL);
+  gegl_operation_meta_watch_nodes (operation, blur, mul, NULL);
 }
 
 static void


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