[gegl] distance-transform: propagate space



commit 13927dc61a724bdae66f33ca4207ee1aa345b26f
Author: Øyvind Kolås <pippin gimp org>
Date:   Fri Jul 6 00:01:08 2018 +0200

    distance-transform: propagate space

 operations/common/distance-transform.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/operations/common/distance-transform.c b/operations/common/distance-transform.c
index 950d74df4..070b64704 100644
--- a/operations/common/distance-transform.c
+++ b/operations/common/distance-transform.c
@@ -71,7 +71,8 @@ gint   cdt_sep (gint i, gint u, gfloat g_i, gfloat g_u);
 static void
 prepare (GeglOperation *operation)
 {
-  const Babl *format = babl_format ("Y float");
+  const Babl *space = gegl_operation_get_source_space (operation, "input");
+  const Babl *format = babl_format_with_space ("Y float", space);
 
   gegl_operation_set_format (operation, "input", format);
   gegl_operation_set_format (operation, "output", format);
@@ -296,7 +297,7 @@ process (GeglOperation       *operation,
          gint                 level)
 {
   GeglProperties         *o = GEGL_PROPERTIES (operation);
-  const Babl  *input_format = babl_format ("Y float");
+  const Babl  *input_format = gegl_operation_get_format (operation, "output");
   const int bytes_per_pixel = babl_format_get_bytes_per_pixel (input_format);
 
   GeglDistanceMetric metric;


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