[gimp] app: add gimp_scan_convert_add_bezier() which adds a GimpBezierDesc



commit 1a4ffb3d21b2e05ef2656b38a848deafb9f7b27e
Author: Michael Natterer <mitch gimp org>
Date:   Sun Apr 10 19:07:04 2011 +0200

    app: add gimp_scan_convert_add_bezier() which adds a GimpBezierDesc
    
    Also remove unused member num_nodes.

 app/core/gimpscanconvert.c |   23 +++++++++++++++++++++--
 app/core/gimpscanconvert.h |    2 ++
 2 files changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/app/core/gimpscanconvert.c b/app/core/gimpscanconvert.c
index bb0b060..7ec97e0 100644
--- a/app/core/gimpscanconvert.c
+++ b/app/core/gimpscanconvert.c
@@ -31,6 +31,7 @@
 #include "base/pixel-region.h"
 #include "base/tile-manager.h"
 
+#include "gimpbezierdesc.h"
 #include "gimpscanconvert.h"
 
 
@@ -53,7 +54,6 @@ struct _GimpScanConvert
   gdouble         dash_offset;
   GArray         *dash_info;
 
-  guint           num_nodes;
   GArray         *path_data;
 };
 
@@ -182,7 +182,6 @@ gimp_scan_convert_add_polyline (GimpScanConvert   *sc,
           pd.point.x = points[i].x;
           pd.point.y = points[i].y;
           sc->path_data = g_array_append_val (sc->path_data, pd);
-          sc->num_nodes++;
           prev = points[i];
         }
     }
@@ -196,6 +195,26 @@ gimp_scan_convert_add_polyline (GimpScanConvert   *sc,
     }
 }
 
+/**
+ * gimp_scan_convert_add_polyline:
+ * @sc:     a #GimpScanConvert context
+ * @bezier: a #GimpBezierDesc
+ *
+ * Adds a @bezier path to @sc.
+ *
+ * Please note that you should use gimp_scan_convert_stroke() if you
+ * specify open paths.
+ **/
+void
+gimp_scan_convert_add_bezier (GimpScanConvert       *sc,
+                              const GimpBezierDesc  *bezier)
+{
+  g_return_if_fail (sc != NULL);
+  g_return_if_fail (bezier != NULL);
+
+  sc->path_data = g_array_append_vals (sc->path_data,
+                                       bezier->data, bezier->num_data);
+}
 
 /**
  * gimp_scan_convert_stroke:
diff --git a/app/core/gimpscanconvert.h b/app/core/gimpscanconvert.h
index 8e4a906..d1972da 100644
--- a/app/core/gimpscanconvert.h
+++ b/app/core/gimpscanconvert.h
@@ -33,6 +33,8 @@ void      gimp_scan_convert_add_polyline       (GimpScanConvert   *sc,
                                                 guint              n_points,
                                                 const GimpVector2 *points,
                                                 gboolean           closed);
+void      gimp_scan_convert_add_bezier         (GimpScanConvert      *sc,
+                                                const GimpBezierDesc *bezier);
 void      gimp_scan_convert_stroke             (GimpScanConvert   *sc,
                                                 gdouble            width,
                                                 GimpJoinStyle      join,



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