[gegl] cubism: use space



commit 933f64663b02005e3f36ea820e304d4fd6fe9e71
Author: Øyvind Kolås <pippin gimp org>
Date:   Fri Jul 6 11:22:04 2018 +0200

    cubism: use space

 operations/common-gpl3+/cubism.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/operations/common-gpl3+/cubism.c b/operations/common-gpl3+/cubism.c
index b0d6bc55b..5b89c6ee3 100644
--- a/operations/common-gpl3+/cubism.c
+++ b/operations/common-gpl3+/cubism.c
@@ -73,8 +73,9 @@ typedef struct
 static void
 prepare (GeglOperation *operation)
 {
-  GeglProperties              *o       = GEGL_PROPERTIES (operation);
+  GeglProperties          *o       = GEGL_PROPERTIES (operation);
   GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);
+  const Babl              *space   = gegl_operation_get_source_space (operation, "input");
 
   gint tmp;
   /*
@@ -88,8 +89,8 @@ prepare (GeglOperation *operation)
 
   op_area->left = op_area->right = op_area->top = op_area->bottom = tmp;
 
-  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));
 }
 
 static inline gdouble
@@ -450,7 +451,7 @@ process (GeglOperation       *operation,
   GeglSampler             *sampler;
   GeglRectangle            boundary  = get_effective_area (operation);
   GeglRectangle            extended;
-  const Babl              *format    = babl_format ("RGBA float");
+  const Babl              *format    = gegl_operation_get_format (operation, "output");
 
   GRand  *gr = g_rand_new_with_seed (o->seed);
   gfloat  color[4];


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