⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 path2d.h

📁 一个用于智能手机的多媒体库适合S60 WinCE的跨平台开发库
💻 H
📖 第 1 页 / 共 2 页
字号:
/*! *	\brief flattens path  * *	Flattens the path, i.e. transform all bezier curves to lines according to the path flatness. *	\param gp the target path */void gf_path_flatten(GF_Path *gp);/*! *	\brief gets flatten copy of path  * *	Gets a flatten copy of the path. *	\param gp the target path *	\return the flatten path */GF_Path *gf_path_get_flatten(GF_Path *gp);/*! *	\brief point over path testing * *	Tests if a point is over a path or not, according to the path filling rule. *	\param gp the target path *	\param x x-coordinate of the point to check *	\param y y-coordinate of the point to check *	\return 1 if the point is over the path, 0 otherwise. */Bool gf_path_point_over(GF_Path *gp, Fixed x, Fixed y);/*! *	\brief path init testing * *	Tests if the path is empty or not. *	\param gp the target path *	\return 1 if the path is empty, 0 otherwise. */Bool gf_path_is_empty(GF_Path *gp);/*! *	\brief path iterator  * *	The path iterator object is used to compute the length of a given path as well * as transformation matrices along this path. */typedef struct _path_iterator GF_PathIterator;/*! *	\brief path iterator constructor * *	Creates a new path iterator from a given path *	\param gp the target path *	\return the path iterator object. */GF_PathIterator *gf_path_iterator_new(GF_Path *gp);/*! *	\brief path iterator destructor * *	Destructs the path iterator object *	\param it the target path iterator */void gf_path_iterator_del(GF_PathIterator *it);/*! *	\brief get path length * *	Gets a path length from its iterator *	\param it the target path iterator *	\return the length of the path */Fixed gf_path_iterator_get_length(GF_PathIterator *it);/*! *\brief gets transformation matrix at given point on path * * Gets the transformation of a given point on the path, given by offset from origin.  *The transform is so that a local system is translated to the given point, its x-axis tangent  *to the path and in the same direction. The path direction is from first point to last point *of the path. *	\param it the target path iterator *	\param offset length on the path in local system unit *	\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. *	\param mat matrix to be transformed (transformation shall be appended) - the matrix shall not be initialized *	\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. *	\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.  \code  Let:	len_last: length of current checked segment	len1: length of all previous segments so that len1 + len_last >= offset then if (offset + length_after_point > len1 + len_last) {	ratio = (len1 + len_last - offset) / length_after_point;	then THETA = ratio * slope(L1) + (1-ratio) * slope(L2)  Of course care must be taken for PI/2 angles and similar situations  \endcode *	\return 1 if matrix has been updated, 0 otherwise, if failure or if point is out of path without tangent extension. */Bool gf_path_iterator_get_transform(GF_PathIterator *it, Fixed offset, Bool follow_tangent, GF_Matrix2D *mat, Bool smooth_edges, Fixed length_after_point);/*! brief gets convexity type for a 2D polygon * * Gets the convexity type of the given 2D polygon * \param pts the points of the polygon * \param nb_pts number of points in the polygon * \return the convexity type of the polygon*/u32 gf_polygone2d_get_convexity(GF_Point2D *pts, u32 nb_pts);/* 2D Path constants *//*! *2D Path point tags *	\hideinitializer */enum{	/*/! Point is on curve (moveTo, lineTo, end of splines)*/	GF_PATH_CURVE_ON = 1,	/*! Point is a contour close*/	GF_PATH_CLOSE	= 5,	/*! Point is a quadratic control point*/	GF_PATH_CURVE_CONIC = 0,	/*! Point is a cubic control point*/	GF_PATH_CURVE_CUBIC = 2,};/*! *2D Path flags *	\hideinitializer */enum{	/*! Path is filled using the zero-nonzero rule. If not set, filling uses odd/even rule*/	GF_PATH_FILL_ZERO_NONZERO = 1,	/*! When set bbox must be recomputed. 	\note Read only, used to avoid wasting time on bounds calculation*/	GF_PATH_BBOX_DIRTY = 2,	/*! Indicates the path is flattened flattened	\note Read only, used to avoid wasting time on flattening*/	GF_PATH_FLATTENED = 4,};/*! * 2D Polygon convexity type *	\hideinitializer */enum{	/*! Polygon is either complex or unknown*/	GF_POLYGON_COMPLEX,	/*! Polygon is complex, starting in counter-clockwise order*/	GF_POLYGON_COMPLEX_CCW,	/*! Polygon is complex, starting in clockwise order*/	GF_POLYGON_COMPLEX_CW,	/*! Polygon is a counter-clockwise convex polygon*/	GF_POLYGON_CONVEX_CCW,	/*! Polygon is a clockwise convex polygon*/	GF_POLYGON_CONVEX_CW,	/*! Polygon is a convex line (degenerated path with all segments aligned)*/	GF_POLYGON_CONVEX_LINE};/*! * Stencil alignment type for outlining *	\hideinitializer */enum{		/*! outline is centered on the path (default)*/	GF_PATH_LINE_CENTER = 0,	/*! outline is inside the path*/	GF_PATH_LINE_INSIDE,	/*! outline is outside the path*/	GF_PATH_LINE_OUTSIDE,};/*! * Line cap type for outlining *	\hideinitializer */enum{	/*! End of line is flat (default)*/	GF_LINE_CAP_FLAT = 0,	/*! End of line is round*/	GF_LINE_CAP_ROUND,	/*! End of line is square*/	GF_LINE_CAP_SQUARE,	/*! End of line is triangle*/	GF_LINE_CAP_TRIANGLE,};/*! * Line join type for outlining *	\hideinitializer */enum{	/*! Line join is a miter join (default)*/	GF_LINE_JOIN_MITER = 0,	/*! Line join is a round join*/	GF_LINE_JOIN_ROUND,	/*! Line join is a bevel join*/	GF_LINE_JOIN_BEVEL,	/*! Line join is a miter then bevel join*/	GF_LINE_JOIN_MITER_SVG};/*! * Dash types for outlining *	\hideinitializer */enum{	/*! No dashing is used (default)*/	GF_DASH_STYLE_PLAIN = 0,	/*! Predefined dash pattern is used*/	GF_DASH_STYLE_DASH,	/*! Predefined dot pattern is used*/	GF_DASH_STYLE_DOT,	/*! Predefined dash-dot pattern is used*/	GF_DASH_STYLE_DASH_DOT,	/*! Predefined dash-dash-dot pattern is used*/	GF_DASH_STYLE_DASH_DASH_DOT,	/*! Predefined dash-dot-dot pattern is used*/	GF_DASH_STYLE_DASH_DOT_DOT,	/*! Custom pattern is used. Dash lengths are given in percentage of the pen width*/	GF_DASH_STYLE_CUSTOM,	/*! Custom pattern is used. Dash lengths are given in the same unit as the pen width*/	GF_DASH_STYLE_CUSTOM_ABS,};/*!\brief Custom dash pattern * *The custom dash pattern object is used to specify custom dashes when outlining a path. */typedef struct{	/*! Number of dashes in the pattern*/	u32 num_dash;	/*! Value of the pattern dashes. Unit depends on the dash type*/	Fixed *dashes;} GF_DashSettings;/*!\brief Pen properties  * *The pen properties object is used to specify several parameters used when building *the vectorial outline of a path. */typedef struct{	/*! The width of the outline*/	Fixed width;	/*! The style of the lines ends*/	u8 cap;	/*! The style of the lines joins*/	u8 join;	/*! The alignment of the outline with regard to the path*/	u8 align;	/*! The dash style of the line*/	u8 dash;	/*! The miter limit of the line joins*/	Fixed miterLimit;	/*! The initial dash offset in the outline. All points before this offset will be 	* ignored when building the outline*/	Fixed dash_offset;	/*! The dash pattern used for curstom dashing*/	GF_DashSettings *dash_set;	/*! The author-specified path length. Ignored if <= 0*/	Fixed path_length;} GF_PenSettings;/*! brief builds the vectorial outline of a path * * Builds the vectorial outline of a path for the given settings. The outline of a path is a path. * \param path the desired path to outline * \param pen the properties of the virtual pen used for outlining * \return the outline of the path */GF_Path *gf_path_get_outline(GF_Path *path, GF_PenSettings pen);/*! @} */#ifdef __cplusplus}#endif#endif	/*_GF_PATH2D_H_*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -