示例#1
0
文件: path2d.c 项目: erelh/gpac
static void gf_add_n_bezier(GF_Path *gp, GF_Point2D *newpts, u32 nbPoints)
{
	Double mu;
	u32 numPoints, i;
	GF_Point2D end;
	numPoints = (u32) FIX2INT(GF_2D_DEFAULT_RES * gp->fineness);
	mu = 0.0;
	if (numPoints) mu = 1/(Double)numPoints;
	for (i=1; i<numPoints; i++) {
		NBezier(newpts, nbPoints - 1, i*mu, &end);
		gf_path_add_line_to(gp, end.x, end.y);
	}
	gf_path_add_line_to(gp, newpts[nbPoints-1].x, newpts[nbPoints-1].y);
}
示例#2
0
static void m4_add_n_bezier(M4Path *path, M4Point2D *pts, u32 nbPoints)
{
	Double mu;
	u32 numPoints, i;
	M4Point2D start;
	M4Point2D end;
	numPoints = (u32) (path->resolution * path->fineness);
	mu = 0.0;
	if (numPoints) mu = 1/(Double)numPoints;
	start = pts[0];
	for (i=1; i<numPoints; i++) {
		NBezier(pts, nbPoints - 1, i*mu, &end);
		m4_path_add_line_to(path, end.x, end.y);
		start = end;
	}
	m4_path_add_line_to(path, pts[nbPoints-1].x, pts[nbPoints-1].y);
}