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


C++ AffineTransform::transform方法代码示例

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


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

示例1: mapPoints

void DoubleImage::mapPoints(const Triangle* t, TriFit fit, gdImagePtr to, Channel channel) {
	if (gdImageSX(image) != gdImageSX(to) || gdImageSY(image) != gdImageSY(to)) {
		throw logic_error("dimensions don't match!!!");
	}

	switch(sType) {
	case T_BOTHSAMPLE:
	case T_SUBSAMPLE: {
		const vector<Point2D>& points = getPointsInside(t);

//		const AffineTransform trans = AffineTransform(*fit.best, *t, fit.pMap).getInverse();
		const AffineTransform trans = AffineTransform(*t, *fit.best, fit.pMap);

		for (vector<Point2D>::const_iterator it = points.begin(); it != points.end(); it++) {
			mapPoint(to, fit, trans.transform(*it), *it, channel);
		}
		if (sType != T_BOTHSAMPLE) {
			break;
		}
	}
	case T_SUPERSAMPLE: {
		const vector<Point2D>& points = getPointsInside(fit.best);

		const AffineTransform trans = AffineTransform(*fit.best, *t, fit.pMap);

		for (vector<Point2D>::const_iterator it = points.begin(); it != points.end(); it++) {
			mapPoint(to, fit, *it, trans.transform(*it), channel);
		}

		break;
	}
	}
}
开发者ID:allanlw,项目名称:fractal,代码行数:33,代码来源:doubleimage.cpp

示例2: getPointsInside

// result[P000] is the DOMAIN e.g. the larger triangle
map<TriFit::PointMap, vector<double> > DoubleImage::getAllConfigurations(const Triangle* smaller, const Triangle* larger, Channel channel) {
	map<TriFit::PointMap, vector<double> > result;

	const vector<Point2D>& smallerPoints = getPointsInside(smaller);

	for (char i = 0; i < TriFit::NUM_MAPS; i++) {
		const TriFit::PointMap m = TriFit::pointMapFromInt(i);

		result[m] = vector<double>(0);
		vector<double>& v = result[m];

//		const AffineTransform small2large = AffineTransform(*larger, *smaller, m).getInverse();
		const AffineTransform small2large = AffineTransform(*smaller, *larger, m);

		v.reserve(smallerPoints.size());

		for (vector<Point2D>::const_iterator it = smallerPoints.begin(); it != smallerPoints.end(); it++) {
			v.push_back(valueAt(small2large.transform(*it), channel));
		}
	}

	result[TriFit::P000] = vector<double>(0);
	vector<double>& v = result[TriFit::P000];

	v.reserve(smallerPoints.size());

	for (vector<Point2D>::const_iterator it = smallerPoints.begin(); it != smallerPoints.end(); it++) {
		v.push_back(valueAt(*it, channel));
	}

	return result;
}
开发者ID:allanlw,项目名称:fractal,代码行数:33,代码来源:doubleimage.cpp

示例3: convertPosUp

    Vector2 convertPosUp(Actor* src, Actor* dest, const Vector2& pos, bool direction)
    {
        Vector2 locPos = pos;
        AffineTransform t;
        t.identity();
        //t = src->getTransform();
        while (src != dest && src)
        {
            t = src->getTransform() * t;
            src = src->getParent();
        }


        if (direction)
        {
            t.x = 0;
            t.y = 0;
        }

        locPos = t.transform(locPos);
        return locPos;
    }
开发者ID:ivlevAstef,项目名称:PrototypeCarGame,代码行数:22,代码来源:Draggable.cpp


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