[gegl] transform: add alpha channel to result even when using NEAREST sampler



commit fe2ce4b22a1ce4c77633e60a25d3b016db9727c3
Author: Ell <ell_se yahoo com>
Date:   Fri Feb 22 02:58:36 2019 -0500

    transform: add alpha channel to result even when using NEAREST sampler
    
    In GeglTransformCore, add an alpha channel to the output format
    even when using a NEAREST sampler, unless we're an intermediate/
    translation node.

 operations/transform/transform-core.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/operations/transform/transform-core.c b/operations/transform/transform-core.c
index 8d9c75411..0b87c438d 100644
--- a/operations/transform/transform-core.c
+++ b/operations/transform/transform-core.c
@@ -159,10 +159,14 @@ gegl_transform_prepare (GeglOperation *operation)
   if (gegl_transform_is_intermediate_node (transform) ||
       gegl_transform_matrix3_allow_fast_translate (&matrix) ||
       (gegl_matrix3_is_translate (&matrix) &&
-       transform->sampler == GEGL_SAMPLER_NEAREST) ||
-      (transform->sampler == GEGL_SAMPLER_NEAREST))
+       transform->sampler == GEGL_SAMPLER_NEAREST))
     {
     }
+  else if (transform->sampler == GEGL_SAMPLER_NEAREST)
+    {
+      if (source_format && ! babl_format_has_alpha (source_format))
+        format = gegl_babl_variant (source_format, GEGL_BABL_VARIANT_ALPHA);
+    }
   else
     {
       BablModelFlag model_flags = babl_get_model_flags (source_format);


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