[gegl/soc-2011-seamless-clone: 36/49] Update the seamless cloning operation to match commit 6f0ce58 of poly2tri-c



commit 54a370cc3adeef6598a193b8a3bda6452b2f2594
Author: Barak Itkin <lightningismyname gmail com>
Date:   Sat Jul 28 16:08:00 2012 +0300

    Update the seamless cloning operation to match commit 6f0ce58 of poly2tri-c

 .../common/seamless-clone/seamless-clone-common.c  |   11 ++++++-----
 .../common/seamless-clone/seamless-clone-common.h  |    4 ++--
 2 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/operations/common/seamless-clone/seamless-clone-common.c b/operations/common/seamless-clone/seamless-clone-common.c
index 548d285..3eb0076 100644
--- a/operations/common/seamless-clone/seamless-clone-common.c
+++ b/operations/common/seamless-clone/seamless-clone-common.c
@@ -44,7 +44,7 @@ sc_compute_UVT_cache (P2trMesh            *mesh,
       config.x_samples = iter->roi[0].width;
       config.y_samples = iter->roi[0].height;
       p2tr_mesh_render_cache_uvt_exact (mesh,
-                                        (P2truvt*) iter->data[0],
+                                        (P2trUVT*) iter->data[0],
                                         iter->length,
                                         &config);
     }
@@ -218,7 +218,7 @@ sc_render_seamless (GeglBuffer          *bg,
     {
       P2trImageConfig  imcfg;
       float           *out_raw, *fg_raw;
-      P2truvt         *uvt_raw;
+      P2trUVT         *uvt_raw;
       int              x, y;
       
       imcfg.min_x = iter->roi[fg_index].x;
@@ -226,13 +226,14 @@ sc_render_seamless (GeglBuffer          *bg,
       imcfg.step_x = imcfg.step_y = 1;
       imcfg.x_samples = iter->roi[fg_index].width;
       imcfg.y_samples = iter->roi[fg_index].height;
-      imcfg.cpp = 4;
+      imcfg.cpp = 3;
+      imcfg.alpha_last = TRUE;
 
       out_raw = (gfloat*)iter->data[out_index];
-      uvt_raw = (P2truvt*)iter->data[uvt_index];
+      uvt_raw = (P2trUVT*)iter->data[uvt_index];
       fg_raw = (gfloat*)iter->data[fg_index];
 
-      p2tr_mesh_render_scanline2 (uvt_raw, out_raw, &imcfg, sc_point_to_color_func, &mesh_render_info);
+      p2tr_mesh_render_from_cache_f (uvt_raw, out_raw, iter->length, &imcfg, sc_point_to_color_func, &mesh_render_info);
 
       for (y = 0; y < imcfg.y_samples; y++)
         {
diff --git a/operations/common/seamless-clone/seamless-clone-common.h b/operations/common/seamless-clone/seamless-clone-common.h
index 1dcaa20..fbf39d7 100644
--- a/operations/common/seamless-clone/seamless-clone-common.h
+++ b/operations/common/seamless-clone/seamless-clone-common.h
@@ -67,7 +67,7 @@ ScCache*   sc_generate_cache (GeglBuffer          *fg,
 
 void       sc_cache_free     (ScCache *cache);
 
-#define SC_BABL_UVT_TYPE   (babl_type_new ("uvt", "bits", sizeof (P2truvt) * 8, NULL))
-#define SC_BABL_UVT_FORMAT (babl_format_n (SC_BABL_UVT_TYPE, 3))
+#define SC_BABL_UVT_TYPE   (babl_type_new ("uvt", "bits", sizeof (P2trUVT) * 8, NULL))
+#define SC_BABL_UVT_FORMAT (babl_format_n (SC_BABL_UVT_TYPE, 1))
 
 #endif



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