[gegl] stretch-contrast: propagate space



commit 951f29e02e1e0df84ae47367f0af04df80e4c476
Author: Øyvind Kolås <pippin gimp org>
Date:   Thu Jul 5 22:55:29 2018 +0200

    stretch-contrast: propagate space

 operations/common/stretch-contrast.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/operations/common/stretch-contrast.c b/operations/common/stretch-contrast.c
index 9cea907aa..238f7a8a4 100644
--- a/operations/common/stretch-contrast.c
+++ b/operations/common/stretch-contrast.c
@@ -94,16 +94,17 @@ reduce_min_max_global (gfloat *min,
 
 static void prepare (GeglOperation *operation)
 {
+  const Babl *space = gegl_operation_get_source_space (operation, "input");
   GeglProperties *o = GEGL_PROPERTIES (operation);
   if (o->perceptual)
    {
-     gegl_operation_set_format (operation, "input", babl_format ("R'G'B'A float"));
-     gegl_operation_set_format (operation, "output", babl_format ("R'G'B'A float"));
+     gegl_operation_set_format (operation, "input", babl_format_with_space ("R'G'B'A float", space));
+     gegl_operation_set_format (operation, "output", babl_format_with_space ("R'G'B'A float", space));
    }
   else
    {
-     gegl_operation_set_format (operation, "input", babl_format ("RGBA float"));
-     gegl_operation_set_format (operation, "output", babl_format ("RGBA float"));
+     gegl_operation_set_format (operation, "input", babl_format_with_space ("RGBA float", space));
+     gegl_operation_set_format (operation, "output", babl_format_with_space ("RGBA float", space));
    }
 }
 


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