[gegl/soc-2011-seamless-clone] Also build the poly2tri-c command line program (p2tc)



commit e82d7d06a75ef4a7aa93b3f088c3e180e5aeb281
Author: Barak Itkin <lightningismyname gmail com>
Date:   Wed Aug 10 08:42:15 2011 +0300

    Also build the poly2tri-c command line program (p2tc)

 .../common/seamless-clone/poly2tri-c/Makefile.am   |    5 +++++
 operations/common/seamless-clone/poly2tri-c/main.c |   16 +++++++++++++---
 .../seamless-clone/poly2tri-c/render/Makefile.am   |    4 +++-
 3 files changed, 21 insertions(+), 4 deletions(-)
---
diff --git a/operations/common/seamless-clone/poly2tri-c/Makefile.am b/operations/common/seamless-clone/poly2tri-c/Makefile.am
index eeb159f..f3abca2 100644
--- a/operations/common/seamless-clone/poly2tri-c/Makefile.am
+++ b/operations/common/seamless-clone/poly2tri-c/Makefile.am
@@ -13,3 +13,8 @@ libpoly2tri_c_la_LIBADD  = \
 	refine/libpoly2tri-c-refine.la	\
 	render/libpoly2tri-c-render.la
 libpoly2tri_c_la_CFLAGS  = $(DEP_CFLAGS) -fPIC
+
+bin_PROGRAMS = p2tc
+p2tc_SOURCES = main.c poly2tri.h
+p2tc_LDADD = libpoly2tri-c.la $(GLIB_LIBS) -lm
+p2tc_CFLAGS = $(DEP_CFLAGS) -fPIC
diff --git a/operations/common/seamless-clone/poly2tri-c/main.c b/operations/common/seamless-clone/poly2tri-c/main.c
index 001a276..dc786a2 100755
--- a/operations/common/seamless-clone/poly2tri-c/main.c
+++ b/operations/common/seamless-clone/poly2tri-c/main.c
@@ -56,7 +56,7 @@ static GOptionEntry entries[] =
   { "verbose",          'v', 0, G_OPTION_ARG_NONE,     &verbose,          "Print output?",                     NULL },
   { "debug",            'd', 0, G_OPTION_ARG_NONE,     &debug_print,      "Enable debug printing",             NULL },
   { "input",            'i', 0, G_OPTION_ARG_FILENAME, &input_file,       "Use input file at FILE_IN",         "FILE_IN" },
-  { "output",           'o', 0, G_OPTION_ARG_FILENAME, &output_file,      "Use output file at FILE_IN",        "FILE_OUT" },
+  { "output",           'o', 0, G_OPTION_ARG_FILENAME, &output_file,      "Use output file at FILE_OUT",       "FILE_OUT" },
   { NULL }
 };
 
@@ -155,6 +155,16 @@ read_points_file (const gchar  *path,
     g_print ("Read %d points and %d colors\n", countPts, countCls);
 }
 
+/* In order to find the maximal length of a filename path, most
+ * platforms have either the macro MAX_PATH, or PATH_MAX. This is a
+ * guess which tries them both */
+ 
+#ifdef MAX_PATH
+#define P2TC_MAX_PATH MAX_PATH
+#else
+#define P2TC_MAX_PATH PATH_MAX
+#endif
+
 gint main (int argc, char *argv[])
 {
   FILE *out;
@@ -167,7 +177,7 @@ gint main (int argc, char *argv[])
   P2tRTriangulation *T;
 
   gint i;
-  gchar buf[MAX_PATH+1];
+  gchar buf[P2TC_MAX_PATH+1];
   gfloat *im;
 
   context = g_option_context_new ("- Create a fine mesh from a given PSLG");
@@ -247,4 +257,4 @@ gint main (int argc, char *argv[])
   g_ptr_array_free (pts, TRUE);
   g_array_free (colors, TRUE);
   
-}
\ No newline at end of file
+}
diff --git a/operations/common/seamless-clone/poly2tri-c/render/Makefile.am b/operations/common/seamless-clone/poly2tri-c/render/Makefile.am
index 97346e8..e2c4f01 100644
--- a/operations/common/seamless-clone/poly2tri-c/render/Makefile.am
+++ b/operations/common/seamless-clone/poly2tri-c/render/Makefile.am
@@ -2,7 +2,9 @@ noinst_LTLIBRARIES = libpoly2tri-c-render.la
 
 libpoly2tri_c_render_la_SOURCES =	\
 	mesh-render.c					\
-	mesh-render.h
+	mesh-render.h					\
+	svg-plot.c						\
+	svg-plot.h
 
 libpoly2tri_c_render_la_CFLAGS = $(GLIB_CFLAGS)
 



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