本文整理汇总了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;
}
}
}
示例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;
}
示例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;
}