[gegl] gegl:render_mapping: small correction



commit c87ed6ae49a46675a68339ef3b8a5c87f3d80bb0
Author: Michael Muré <batolettre gmail com>
Date:   Sat Aug 7 14:52:32 2010 +0200

    gegl:render_mapping: small correction

 operations/common/render_mapping.c |   31 ++++++++++++++++++++++++-------
 1 files changed, 24 insertions(+), 7 deletions(-)
---
diff --git a/operations/common/render_mapping.c b/operations/common/render_mapping.c
index 4e8f9d5..494ce5c 100644
--- a/operations/common/render_mapping.c
+++ b/operations/common/render_mapping.c
@@ -31,7 +31,7 @@
 
 #else
 
-#define GEGL_CHANT_TYPE_POINT_COMPOSER
+#define GEGL_CHANT_TYPE_COMPOSER
 #define GEGL_CHANT_C_FILE       "render_mapping.c"
 
 #include "gegl-chant.h"
@@ -46,6 +46,12 @@ static void prepare (GeglOperation *operation)
   gegl_operation_set_format (operation, "output", format);
 }
 
+static void
+get_required_for_output (GeglOperation *operation)
+{
+  //TODO
+}
+
 static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
@@ -90,12 +96,23 @@ process (GeglOperation       *operation,
       
       for (i=0; i<n_pixels; i++)
       {
-        sample = gegl_sampler_get_from_buffer (sampler, coords[0], coords[1]);
-        
-        out[0] = sample[0];
-        out[1] = sample[1];
-        out[2] = sample[2];
-        out[3] = sample[3];
+        /* FIXME coords[0] > 0 for test, need to be coords[0] >= 0 */
+        if (coords[0] > 0 && coords[1] > 0)
+        {
+          sample = gegl_sampler_get_from_buffer (sampler, coords[0], coords[1]);
+          
+          out[0] = sample[0];
+          out[1] = sample[1];
+          out[2] = sample[2];
+          out[3] = sample[3];
+        }
+        else
+        {
+          out[0] = 0.0;
+          out[1] = 0.0;
+          out[2] = 0.0;
+          out[3] = 0.0;
+        }
         
         coords += 2;
         out += 4;



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