当前位置: 首页>>代码示例>>C++>>正文


C++ Glyph::affine方法代码示例

本文整理汇总了C++中Glyph::affine方法的典型用法代码示例。如果您正苦于以下问题:C++ Glyph::affine方法的具体用法?C++ Glyph::affine怎么用?C++ Glyph::affine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Glyph的用法示例。


在下文中一共展示了Glyph::affine方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: traceConicBezier

int traceConicBezier(FT_VECTOR_PARAMETER *control, FT_VECTOR_PARAMETER *to, void *obj)
{
	Glyph *glyph = reinterpret_cast<Glyph *>(obj);
	Affine &affine = glyph->affine();
	BezierPathLibart *path = static_cast<BezierPathLibart *>(glyph->modifiableBezierPath());

	int index = path->m_array.count();
	if(!(index > 0))
		return -1;

	path->m_array.resize(index + 1);
	ArtBpath *s = &path->m_array[index - 1];
	ArtBpath *e = &path->m_array[index];

	e->code = ART_CURVETO;

	Point c = affine.mapPoint(Point(control->x, control->y));
	Point p = affine.mapPoint(Point(to->x, to->y));
	e->x3 = p.x();
	e->y3 = p.y();

	path->m_array[index].x1 = c.x() - (c.x() - s->x3) / 3;
	path->m_array[index].y1 = c.y() - (c.y() - s->y3) / 3;
	path->m_array[index].x2 = c.x() + (e->x3 - c.x()) / 3;
	path->m_array[index].y2 = c.y() + (e->y3 - c.y()) / 3;

	return 0;
}
开发者ID:serghei,项目名称:kde3-kdegraphics,代码行数:28,代码来源:GlyphTracerLibart.cpp

示例2: traceLineto

int traceLineto(FT_VECTOR_PARAMETER *to, void *obj)
{
	Glyph *glyph = reinterpret_cast<Glyph *>(obj);
	Affine &affine = glyph->affine();
	BezierPathLibart *path = static_cast<BezierPathLibart *>(glyph->modifiableBezierPath());
	Point p = affine.mapPoint(Point(to->x, to->y));

	int index = path->m_array.count();
	ArtBpath *last = &path->m_array[index - 1];

	if((p.x() != last->x3) || (p.y() != last->y3))
	{
		path->m_array.resize(index + 1);
		path->m_array[index].code = ART_LINETO;
		path->m_array[index].x3 = p.x();
		path->m_array[index].y3 = p.y();
	}

	return 0;
}
开发者ID:serghei,项目名称:kde3-kdegraphics,代码行数:20,代码来源:GlyphTracerLibart.cpp

示例3: traceCubicBezier

int traceCubicBezier(FT_VECTOR_PARAMETER *control1, FT_VECTOR_PARAMETER *control2, FT_VECTOR_PARAMETER *to, void *obj)
{
	Glyph *glyph = reinterpret_cast<Glyph *>(obj);
	Affine &affine = glyph->affine();
	BezierPathLibart *path = static_cast<BezierPathLibart *>(glyph->modifiableBezierPath());

	Point p = affine.mapPoint(Point(to->x, to->y));
	Point c1 = affine.mapPoint(Point(control1->x, control1->y));
	Point c2 = affine.mapPoint(Point(control2->x, control2->y));

	int index = path->m_array.count();
	path->m_array.resize(index + 1);
	path->m_array[index].code = ART_CURVETO;
	path->m_array[index].x1 = c1.x();
	path->m_array[index].y1 = c1.y();
	path->m_array[index].x2 = c2.x();
	path->m_array[index].y2 = c2.y();
	path->m_array[index].x3 = p.x();
	path->m_array[index].y3 = p.y();

	return 0;
}
开发者ID:serghei,项目名称:kde3-kdegraphics,代码行数:22,代码来源:GlyphTracerLibart.cpp


注:本文中的Glyph::affine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。