OSDN Git Service

add tstools.
[rec10/rec10-git.git] / tstools / DtsEdit / src / gpac / path2d.h
1 /*\r
2  *                      GPAC - Multimedia Framework C SDK\r
3  *\r
4  *                      Copyright (c) Jean Le Feuvre 2000-2005\r
5  *                                      All rights reserved\r
6  *\r
7  *  This file is part of GPAC / common tools sub-project\r
8  *\r
9  *  GPAC is free software; you can redistribute it and/or modify\r
10  *  it under the terms of the GNU Lesser General Public License as published by\r
11  *  the Free Software Foundation; either version 2, or (at your option)\r
12  *  any later version.\r
13  *   \r
14  *  GPAC is distributed in the hope that it will be useful,\r
15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
17  *  GNU Lesser General Public License for more details.\r
18  *   \r
19  *  You should have received a copy of the GNU Lesser General Public\r
20  *  License along with this library; see the file COPYING.  If not, write to\r
21  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
22  *\r
23  */\r
24 \r
25 \r
26 #ifndef _GF_PATH2D_H_\r
27 #define _GF_PATH2D_H_\r
28 \r
29 /*!\r
30  *      \file <gpac/path2d.h>\r
31  *      \brief 2D Vectorial Path functions.\r
32  */\r
33 \r
34 \r
35 \r
36 #ifdef __cplusplus\r
37 extern "C" {\r
38 #endif\r
39 \r
40 #include <gpac/math.h>\r
41 #include <gpac/constants.h>\r
42 \r
43 \r
44 /*!\r
45  *\addtogroup path_grp path2d\r
46  *\ingroup utils_grp\r
47  *\brief Vectorial 2D Path manipulation functions\r
48  *\r
49  *This section documents the 2D path object used in the GPAC framework. \r
50  *      @{\r
51  */\r
52 \r
53         \r
54 /*!\brief 2D Path Object\r
55  *\r
56  *The 2D path object is used to construct complex 2D shapes for later drawing\r
57  * or outlining.\r
58  */\r
59 typedef struct\r
60 {\r
61         /*! number of contours in path*/\r
62         u32 n_contours;\r
63         /*! number of points in path and alloc size*/\r
64         u32 n_points, n_alloc_points;\r
65         /*! path points */\r
66         GF_Point2D *points;\r
67         /*! point tags (one per point)*/\r
68         u8 *tags;\r
69         /*! contour end points*/\r
70         u32 *contours;\r
71         /*! path bbox - NEVER USE WITHOUT FIRST CALLING \ref gf_path_get_bounds*/\r
72         GF_Rect bbox;\r
73         /*! path flags*/\r
74         s32 flags;\r
75         /*! fineness to use whenever flattening the path - default is \ref FIX_ONE*/\r
76         Fixed fineness;\r
77 } GF_Path;\r
78 \r
79 \r
80 /*!\r
81  *      \brief path constructor\r
82  *\r
83  *      Constructs an empty 2D path object\r
84  *      \return new path object\r
85  */\r
86 GF_Path *gf_path_new();\r
87 /*!\r
88  *      \brief path destructor\r
89  *\r
90  *      Destructs a 2D path object\r
91  *      \param gp the target path\r
92  */\r
93 void gf_path_del(GF_Path *gp);\r
94 /*!\r
95  *      \brief path reset\r
96  *\r
97  *      Resets the 2D path object\r
98  *      \param gp the target path\r
99  */\r
100 void gf_path_reset(GF_Path *gp);\r
101 /*!\r
102  *      \brief path copy constuctor\r
103  *\r
104  *      Resets a copy of a 2D path object\r
105  *      \param gp the target path\r
106  *      \return new path copy\r
107  */\r
108 GF_Path *gf_path_clone(GF_Path *gp);\r
109 /*!\r
110  *      \brief path close\r
111  *\r
112  *      Closes current path contour\r
113  *      \param gp the target path\r
114  *      \return error code if any error, \ref GF_OK otherwise\r
115  */\r
116 GF_Err gf_path_close(GF_Path *gp);\r
117 /*!\r
118  *      \brief path moveTo\r
119  *\r
120  *      Starts a new contour from the specified point\r
121  *      \param gp the target path\r
122  *      \param x x-coordinate of the new point\r
123  *      \param y y-coordinate of the new point\r
124  *      \return error code if any error, \ref GF_OK otherwise\r
125  */\r
126 GF_Err gf_path_add_move_to(GF_Path *gp, Fixed x, Fixed y);\r
127 /*!\r
128  *      \brief starts new contour\r
129  *\r
130  *      Starts a new contour from the specified point\r
131  *      \param gp the target path\r
132  *      \param pt pointer to the new start point\r
133  *      \return error code if any error, \ref GF_OK otherwise\r
134  */\r
135 GF_Err gf_path_add_move_to_vec(GF_Path *gp, GF_Point2D *pt);\r
136 /*!\r
137  *      \brief adds line to path\r
138  *\r
139  *      Adds a line from the current point in path to the specified point\r
140  *      \param gp the target path\r
141  *      \param x x-coordinate of the line end\r
142  *      \param y y-coordinate of the line end\r
143  *      \return error code if any error, \ref GF_OK otherwise\r
144  */\r
145 GF_Err gf_path_add_line_to(GF_Path *gp, Fixed x, Fixed y);\r
146 /*!\r
147  *      \brief adds line to path\r
148  *\r
149  *      Adds a line from the current point in path to the specified point\r
150  *      \param gp the target path\r
151  *      \param pt line end\r
152  *      \return error code if any error, \ref GF_OK otherwise\r
153  */\r
154 GF_Err gf_path_add_line_to_vec(GF_Path *gp, GF_Point2D *pt);\r
155 /*!\r
156  *      \brief adds cubic to path\r
157  *\r
158  *      Adds a cubic bezier curve to the current contour, starting from the current path point\r
159  *      \param gp the target path\r
160  *      \param c1_x x-coordinate of the first control point of the cubic curve\r
161  *      \param c1_y y-coordinate of the first control point of the cubic curve\r
162  *      \param c2_x x-coordinate of the second control point of the cubic curve\r
163  *      \param c2_y y-coordinate of the second control point of the cubic curve\r
164  *      \param x x-coordinate of the end point of the cubic curve\r
165  *      \param y y-coordinate of the end point of the cubic curve\r
166  *      \return error code if any error, \ref GF_OK otherwise\r
167  */\r
168 GF_Err gf_path_add_cubic_to(GF_Path *gp, Fixed c1_x, Fixed c1_y, Fixed c2_x, Fixed c2_y, Fixed x, Fixed y);\r
169 /*!\r
170  *      \brief adds cubic to path\r
171  *\r
172  *      Adds a cubic bezier curve to the current contour, starting from the current path point\r
173  *      \param gp the target path\r
174  *      \param c1 first control point of the cubic curve\r
175  *      \param c2 second control point of the cubic curve\r
176  *      \param pt end point of the cubic curve\r
177  *      \return error code if any error, \ref GF_OK otherwise\r
178  */\r
179 GF_Err gf_path_add_cubic_to_vec(GF_Path *gp, GF_Point2D *c1, GF_Point2D *c2, GF_Point2D *pt);\r
180 /*!\r
181  *      \brief adds quadratic to path\r
182  *\r
183  *      Adds a quadratic bezier curve to the current contour, starting from the current path point\r
184  *      \param gp the target path\r
185  *      \param c_x x-coordinate of the control point of the quadratic curve\r
186  *      \param c_y y-coordinate of the control point of the quadratic curve\r
187  *      \param x x-coordinate of the end point of the cubic quadratic\r
188  *      \param y y-coordinate of the end point of the cubic quadratic\r
189  *      \return error code if any error, \ref GF_OK otherwise\r
190  */\r
191 GF_Err gf_path_add_quadratic_to(GF_Path *gp, Fixed c_x, Fixed c_y, Fixed x, Fixed y);\r
192 /*!\r
193  *      \brief adds quadratic to path\r
194  *\r
195  *      Adds a quadratic bezier curve to the current contour, starting from the current path point\r
196  *      \param gp the target path\r
197  *      \param c control point of the quadratic curve\r
198  *      \param pt end point of the cubic quadratic\r
199  *      \return error code if any error, \ref GF_OK otherwise\r
200  */\r
201 GF_Err gf_path_add_quadratic_to_vec(GF_Path *gp, GF_Point2D *c, GF_Point2D *pt);\r
202 /*!\r
203  *      \brief adds rectangle to path\r
204  *\r
205  *      Adds a rectangle contour to the path\r
206  *      \param gp the target path\r
207  *      \param cx x-coordinate of the rectangle center\r
208  *      \param cy y-coordinate of the rectangle center\r
209  *      \param w width of the rectangle\r
210  *      \param h height of the rectangle\r
211  *      \return error code if any error, \ref GF_OK otherwise\r
212  */\r
213 GF_Err gf_path_add_rect_center(GF_Path *gp, Fixed cx, Fixed cy, Fixed w, Fixed h);\r
214 /*!\r
215  *      \brief adds rectangle to path\r
216  *\r
217  *      Adds a rectangle contour to the path\r
218  *      \param gp the target path\r
219  *      \param ox left-most coordinate of the rectangle \r
220  *      \param oy top-most coordinate of the rectangle\r
221  *      \param w width of the rectangle\r
222  *      \param h height of the rectangle\r
223  *      \return error code if any error, \ref GF_OK otherwise\r
224  */\r
225 GF_Err gf_path_add_rect(GF_Path *gp, Fixed ox, Fixed oy, Fixed w, Fixed h);\r
226 /*!\r
227  *      \brief adds ellipse to path\r
228  *\r
229  *      Adds an ellipse contour to the path\r
230  *      \param gp the target path\r
231  *      \param cx x-coordinate of the ellipse center\r
232  *      \param cy y-coordinate of the ellipse center\r
233  *      \param a_axis length of the horizontal ellipse axis\r
234  *      \param b_axis length of the vertical ellipse axis\r
235  *      \return error code if any error, \ref GF_OK otherwise\r
236  */\r
237 GF_Err gf_path_add_ellipse(GF_Path *gp, Fixed cx, Fixed cy, Fixed a_axis, Fixed b_axis);\r
238 /*!\r
239  *      \brief adds N-bezier curve to path\r
240  *\r
241  *      Adds an N-degree bezier curve to the path, starting from the current point\r
242  *      \param gp the target path\r
243  *      \param pts points used to define the curve\r
244  *      \param nb_pts number of points used to define the curve. The degree of the curve is therefore (nb_pts-1).\r
245  *      \return error code if any error, \ref GF_OK otherwise\r
246  *      \note the fineness of the path must be set before calling this function.\r
247  */\r
248 GF_Err gf_path_add_bezier(GF_Path *gp, GF_Point2D *pts, u32 nb_pts);\r
249 /*!\r
250  *      \brief adds arc as described in MPEG-4 BIFS to path\r
251  *\r
252  *      Adds an arc contour to the path from focal and end points.\r
253  *      \param gp the target path\r
254  *      \param end_x x-coordinate of the arc end point\r
255  *      \param end_y y-coordinate of the arc end point\r
256  *      \param fa_x x-coordinate of the arc first focal point\r
257  *      \param fa_y y-coordinate of the arc first focal point\r
258  *      \param fb_x x-coordinate of the arc second focal point\r
259  *      \param fb_y y-coordinate of the arc second focal point\r
260  *      \param cw if 1, the arc will be clockwise, otherwise counter-clockwise.\r
261  *      \return error code if any error, \ref GF_OK otherwise\r
262  */\r
263 GF_Err gf_path_add_arc_to(GF_Path *gp, Fixed end_x, Fixed end_y, Fixed fa_x, Fixed fa_y, Fixed fb_x, Fixed fb_y, Bool cw);\r
264 /*!\r
265  *      \brief adds arc as described in SVG to path\r
266  *\r
267  *      Adds an arc contour to the path from end point, radii and 3 parameters.\r
268  *      \param gp the target path\r
269  *      \param end_x x-coordinate of the arc end point\r
270  *      \param end_y y-coordinate of the arc end point\r
271  *      \param r_x x-axis radius\r
272  *      \param r_y y-axis radius \r
273  *      \param x_axis_rotation angle for the x-axis\r
274  *      \param large_arc_flag large or short arc selection\r
275  *      \param sweep_flag if 1, the arc will be clockwise, otherwise counter-clockwise.\r
276  *      \return error code if any error, \ref GF_OK otherwise\r
277  */\r
278 GF_Err gf_path_add_svg_arc_to(GF_Path *gp, Fixed end_x, Fixed end_y, Fixed r_x, Fixed r_y, Fixed x_axis_rotation, Bool large_arc_flag, Bool sweep_flag);\r
279 /*!\r
280  *      \brief adds arc to path\r
281  *\r
282  *      Adds an arc contour to the path.\r
283  *      \param gp the target path\r
284  *      \param radius radius of the arc \r
285  *      \param start_angle start angle of the arc in radians\r
286  *      \param end_angle end angle of the arc in radians\r
287  *      \param close_type closing type: 0 for open arc, 1 for close arc, 2 for pie\r
288  *      \return error code if any error, \ref GF_OK otherwise\r
289  */\r
290 GF_Err gf_path_add_arc(GF_Path *gp, Fixed radius, Fixed start_angle, Fixed end_angle, u32 close_type);\r
291 \r
292 /*!\r
293  *      \brief concatenates path\r
294  *\r
295  *      Adds a sub-path to the path with a given transform.\r
296  *      \param gp the target path\r
297  *      \param subpath the path to add\r
298  *      \param mat Matrix for subpath \r
299  *      \return error code if any error, \ref GF_OK otherwise\r
300  */\r
301 GF_Err gf_path_add_subpath(GF_Path *gp, GF_Path *subpath, GF_Matrix2D *mx);\r
302 /*!\r
303  *      \brief gets path control bounds\r
304  *\r
305  *      Gets the path control bounds, i.e. the rectangle covering all lineTo and bezier control points.\r
306  *      \param gp the target path\r
307  *      \param rc pointer to rectangle receiving the control rectangle\r
308  *      \return error code if any error, \ref GF_OK otherwise\r
309  */\r
310 GF_Err gf_path_get_control_bounds(GF_Path *gp, GF_Rect *rc);\r
311 /*!\r
312  *      \brief gets path bounds\r
313  *\r
314  *      Gets the path bounds, i.e. the rectangle covering all points in path except bezier control points.\r
315  *      \param gp the target path\r
316  *      \param rc pointer to rectangle receiving the control rectangle\r
317  *      \return error code if any error, \ref GF_OK otherwise\r
318  */\r
319 GF_Err gf_path_get_bounds(GF_Path *gp, GF_Rect *rc);\r
320 /*!\r
321  *      \brief flattens path \r
322  *\r
323  *      Flattens the path, i.e. transform all bezier curves to lines according to the path flatness.\r
324  *      \param gp the target path\r
325  */\r
326 void gf_path_flatten(GF_Path *gp);\r
327 /*!\r
328  *      \brief gets flatten copy of path \r
329  *\r
330  *      Gets a flatten copy of the path.\r
331  *      \param gp the target path\r
332  *      \return the flatten path\r
333  */\r
334 GF_Path *gf_path_get_flatten(GF_Path *gp);\r
335 /*!\r
336  *      \brief point over path testing\r
337  *\r
338  *      Tests if a point is over a path or not, according to the path filling rule.\r
339  *      \param gp the target path\r
340  *      \param x x-coordinate of the point to check\r
341  *      \param y y-coordinate of the point to check\r
342  *      \return 1 if the point is over the path, 0 otherwise.\r
343  */\r
344 Bool gf_path_point_over(GF_Path *gp, Fixed x, Fixed y);\r
345 \r
346 /*!\r
347  *      \brief path init testing\r
348  *\r
349  *      Tests if the path is empty or not.\r
350  *      \param gp the target path\r
351  *      \return 1 if the path is empty, 0 otherwise.\r
352  */\r
353 Bool gf_path_is_empty(GF_Path *gp);\r
354 \r
355 /*!\r
356  *      \brief path iterator \r
357  *\r
358  *      The path iterator object is used to compute the length of a given path as well\r
359  * as transformation matrices along this path.\r
360  */\r
361 typedef struct _path_iterator GF_PathIterator;\r
362 \r
363 /*!\r
364  *      \brief path iterator constructor\r
365  *\r
366  *      Creates a new path iterator from a given path\r
367  *      \param gp the target path\r
368  *      \return the path iterator object.\r
369  */\r
370 GF_PathIterator *gf_path_iterator_new(GF_Path *gp);\r
371 /*!\r
372  *      \brief path iterator destructor\r
373  *\r
374  *      Destructs the path iterator object\r
375  *      \param it the target path iterator\r
376  */\r
377 void gf_path_iterator_del(GF_PathIterator *it);\r
378 \r
379 /*!\r
380  *      \brief get path length\r
381  *\r
382  *      Gets a path length from its iterator\r
383  *      \param it the target path iterator\r
384  *      \return the length of the path\r
385  */\r
386 Fixed gf_path_iterator_get_length(GF_PathIterator *it);\r
387 /*!\r
388  *\brief gets transformation matrix at given point on path\r
389  *\r
390  * Gets the transformation of a given point on the path, given by offset from origin. \r
391  *The transform is so that a local system is translated to the given point, its x-axis tangent \r
392  *to the path and in the same direction. The path direction is from first point to last point\r
393  *of the path.\r
394  *      \param it the target path iterator\r
395  *      \param offset length on the path in local system unit\r
396  *      \param follow_tangent indicates if transformation shall be computed if offset indicates a point outside the path (<0 or >path_length). In which case the path shall be virtually extended by the tangent at origin (offset <0) or at end (offset>path_length). Otherwise the transformation is not computed and 0 is returned.\r
397  *      \param mat matrix to be transformed (transformation shall be appended) - the matrix shall not be initialized\r
398  *      \param smooth_edges indicates if discontinuities shall be smoothed. If not set, the rotation angle THETA is the slope (DX/DY) of the current segment found.\r
399  *      \param length_after_point if set and smooth_edges is set, the amount of the object that lies on next segment shall be computed according to length_after_point. \r
400  \code\r
401   Let:\r
402         len_last: length of current checked segment\r
403         len1: length of all previous segments so that len1 + len_last >= offset then if (offset + length_after_point > len1 + len_last) {\r
404         ratio = (len1 + len_last - offset) / length_after_point;\r
405         then THETA = ratio * slope(L1) + (1-ratio) * slope(L2)\r
406 \r
407   Of course care must be taken for PI/2 angles and similar situations \r
408  \endcode\r
409 \r
410  *      \return 1 if matrix has been updated, 0 otherwise, if failure or if point is out of path without tangent extension.\r
411  */\r
412 Bool gf_path_iterator_get_transform(GF_PathIterator *it, Fixed offset, Bool follow_tangent, GF_Matrix2D *mat, Bool smooth_edges, Fixed length_after_point);\r
413 \r
414 \r
415 \r
416 /*! brief gets convexity type for a 2D polygon\r
417  *\r
418  * Gets the convexity type of the given 2D polygon\r
419  * \param pts the points of the polygon\r
420  * \param nb_pts number of points in the polygon\r
421  * \return the convexity type of the polygon\r
422 */\r
423 u32 gf_polygone2d_get_convexity(GF_Point2D *pts, u32 nb_pts);\r
424 \r
425 \r
426 /* 2D Path constants */\r
427 \r
428 /*!\r
429  *2D Path point tags\r
430  *      \hideinitializer\r
431  */\r
432 enum\r
433 {\r
434         /*/! Point is on curve (moveTo, lineTo, end of splines)*/\r
435         GF_PATH_CURVE_ON = 1,\r
436         /*! Point is a contour close*/\r
437         GF_PATH_CLOSE   = 5,\r
438         /*! Point is a quadratic control point*/\r
439         GF_PATH_CURVE_CONIC = 0,\r
440         /*! Point is a cubic control point*/\r
441         GF_PATH_CURVE_CUBIC = 2,\r
442 };\r
443 \r
444 \r
445 /*!\r
446  *2D Path flags\r
447  *      \hideinitializer\r
448  */\r
449 enum\r
450 {\r
451         /*! Path is filled using the zero-nonzero rule. If not set, filling uses odd/even rule*/\r
452         GF_PATH_FILL_ZERO_NONZERO = 1,\r
453         /*! When set bbox must be recomputed. \r
454         \note Read only, used to avoid wasting time on bounds calculation*/\r
455         GF_PATH_BBOX_DIRTY = 2,\r
456         /*! Indicates the path is flattened flattened\r
457         \note Read only, used to avoid wasting time on flattening*/\r
458         GF_PATH_FLATTENED = 4,\r
459 };\r
460 \r
461 /*!\r
462  * 2D Polygon convexity type\r
463  *      \hideinitializer\r
464  */\r
465 enum\r
466 {\r
467         /*! Polygon is either complex or unknown*/\r
468         GF_POLYGON_COMPLEX,\r
469         /*! Polygon is complex, starting in counter-clockwise order*/\r
470         GF_POLYGON_COMPLEX_CCW,\r
471         /*! Polygon is complex, starting in clockwise order*/\r
472         GF_POLYGON_COMPLEX_CW,\r
473         /*! Polygon is a counter-clockwise convex polygon*/\r
474         GF_POLYGON_CONVEX_CCW,\r
475         /*! Polygon is a clockwise convex polygon*/\r
476         GF_POLYGON_CONVEX_CW,\r
477         /*! Polygon is a convex line (degenerated path with all segments aligned)*/\r
478         GF_POLYGON_CONVEX_LINE\r
479 };\r
480 \r
481 /*!\r
482  * Stencil alignment type for outlining\r
483  *      \hideinitializer\r
484  */\r
485 enum\r
486 {       \r
487         /*! outline is centered on the path (default)*/\r
488         GF_PATH_LINE_CENTER = 0,\r
489         /*! outline is inside the path*/\r
490         GF_PATH_LINE_INSIDE,\r
491         /*! outline is outside the path*/\r
492         GF_PATH_LINE_OUTSIDE,\r
493 };\r
494 \r
495 /*!\r
496  * Line cap type for outlining\r
497  *      \hideinitializer\r
498  */\r
499 enum\r
500 {\r
501         /*! End of line is flat (default)*/\r
502         GF_LINE_CAP_FLAT = 0,\r
503         /*! End of line is round*/\r
504         GF_LINE_CAP_ROUND,\r
505         /*! End of line is square*/\r
506         GF_LINE_CAP_SQUARE,\r
507         /*! End of line is triangle*/\r
508         GF_LINE_CAP_TRIANGLE,\r
509 };\r
510 \r
511 /*!\r
512  * Line join type for outlining\r
513  *      \hideinitializer\r
514  */\r
515 enum\r
516 {\r
517         /*! Line join is a miter join (default)*/\r
518         GF_LINE_JOIN_MITER = 0,\r
519         /*! Line join is a round join*/\r
520         GF_LINE_JOIN_ROUND,\r
521         /*! Line join is a bevel join*/\r
522         GF_LINE_JOIN_BEVEL,\r
523         /*! Line join is a miter then bevel join*/\r
524         GF_LINE_JOIN_MITER_SVG\r
525 };\r
526 \r
527 /*!\r
528  * Dash types for outlining\r
529  *      \hideinitializer\r
530  */\r
531 enum\r
532 {\r
533         /*! No dashing is used (default)*/\r
534         GF_DASH_STYLE_PLAIN = 0,\r
535         /*! Predefined dash pattern is used*/\r
536         GF_DASH_STYLE_DASH,\r
537         /*! Predefined dot pattern is used*/\r
538         GF_DASH_STYLE_DOT,\r
539         /*! Predefined dash-dot pattern is used*/\r
540         GF_DASH_STYLE_DASH_DOT,\r
541         /*! Predefined dash-dash-dot pattern is used*/\r
542         GF_DASH_STYLE_DASH_DASH_DOT,\r
543         /*! Predefined dash-dot-dot pattern is used*/\r
544         GF_DASH_STYLE_DASH_DOT_DOT,\r
545         /*! Custom pattern is used. Dash lengths are given in percentage of the pen width*/\r
546         GF_DASH_STYLE_CUSTOM,\r
547         /*! SVG pattern is used. Dash lengths are given in the same unit as the pen width\r
548         and dash offset follows SVG specs (offset in dash pattern)*/\r
549         GF_DASH_STYLE_SVG,\r
550 };\r
551 \r
552 \r
553 /*!\brief Custom dash pattern\r
554  *\r
555  *The custom dash pattern object is used to specify custom dashes when outlining a path.\r
556  */\r
557 typedef struct\r
558 {\r
559         /*! Number of dashes in the pattern*/\r
560         u32 num_dash;\r
561         /*! Value of the pattern dashes. Unit depends on the dash type*/\r
562         Fixed *dashes;\r
563 } GF_DashSettings;\r
564 \r
565 /*!\brief Pen properties \r
566  *\r
567  *The pen properties object is used to specify several parameters used when building\r
568  *the vectorial outline of a path.\r
569  */\r
570 typedef struct\r
571 {\r
572         /*! The width of the outline*/\r
573         Fixed width;\r
574         /*! The style of the lines ends*/\r
575         u8 cap;\r
576         /*! The style of the lines joins*/\r
577         u8 join;\r
578         /*! The alignment of the outline with regard to the path*/\r
579         u8 align;\r
580         /*! The dash style of the line*/\r
581         u8 dash;\r
582         /*! The miter limit of the line joins*/\r
583         Fixed miterLimit;\r
584         /*! The initial dash offset in the outline. All points before this offset will be \r
585         * ignored when building the outline*/\r
586         Fixed dash_offset;\r
587         /*! The dash pattern used for curstom dashing*/\r
588         GF_DashSettings *dash_set;\r
589         /*! The author-specified path length. Ignored if <= 0*/\r
590         Fixed path_length;\r
591 } GF_PenSettings;\r
592 \r
593 /*! brief builds the vectorial outline of a path\r
594  *\r
595  * Builds the vectorial outline of a path for the given settings. The outline of a path is a path.\r
596  * \param path the desired path to outline\r
597  * \param pen the properties of the virtual pen used for outlining\r
598  * \return the outline of the path \r
599 */\r
600 GF_Path *gf_path_get_outline(GF_Path *path, GF_PenSettings pen);\r
601 \r
602 \r
603 /*! @} */\r
604 \r
605 #ifdef __cplusplus\r
606 }\r
607 #endif\r
608 \r
609 \r
610 #endif  /*_GF_PATH2D_H_*/\r
611 \r