1 #ifndef __SP_BEZIER_UTILS_H__
2 #define __SP_BEZIER_UTILS_H__
4 /*
5 * An Algorithm for Automatically Fitting Digitized Curves
6 * by Philip J. Schneider
7 * from "Graphics Gems", Academic Press, 1990
8 *
9 * Authors:
10 * Philip J. Schneider
11 * Lauris Kaplinski <lauris@ximian.com>
12 *
13 * Copyright (C) 1990 Philip J. Schneider
14 * Copyright (C) 2001 Lauris Kaplinski and Ximian, Inc.
15 *
16 * Released under GNU GPL
17 */
19 #include <libnr/nr-forward.h>
20 #include <glib/gtypes.h>
22 /* Bezier approximation utils */
23 NR::Point bezier_pt(unsigned degree, NR::Point const V[], gdouble t);
25 gint sp_bezier_fit_cubic(NR::Point bezier[], NR::Point const data[], gint len, gdouble error);
27 gint sp_bezier_fit_cubic_r(NR::Point bezier[], NR::Point const data[], gint len, gdouble error,
28 unsigned max_beziers);
30 gint sp_bezier_fit_cubic_full(NR::Point bezier[], int split_points[], NR::Point const data[], gint len,
31 NR::Point const &tHat1, NR::Point const &tHat2,
32 gdouble error, unsigned max_beziers);
34 NR::Point sp_darray_left_tangent(NR::Point const d[], unsigned const len);
35 NR::Point sp_darray_left_tangent(NR::Point const d[], unsigned const len, double const tolerance_sq);
36 NR::Point sp_darray_right_tangent(NR::Point const d[], unsigned const length, double const tolerance_sq);
39 #endif /* __SP_BEZIER_UTILS_H__ */
41 /*
42 Local Variables:
43 mode:c++
44 c-file-style:"stroustrup"
45 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
46 indent-tabs-mode:nil
47 fill-column:99
48 End:
49 */
50 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :