本文整理汇总了C++中TransformationMatrix::applyPerspective方法的典型用法代码示例。如果您正苦于以下问题:C++ TransformationMatrix::applyPerspective方法的具体用法?C++ TransformationMatrix::applyPerspective怎么用?C++ TransformationMatrix::applyPerspective使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransformationMatrix
的用法示例。
在下文中一共展示了TransformationMatrix::applyPerspective方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create
PassRefPtr<TransformOperation> PerspectiveTransformOperation::blend(const TransformOperation* from, double progress, bool blendToIdentity)
{
if (from && !from->isSameType(*this))
return this;
if (blendToIdentity) {
double p = WebCore::blend(m_p, 1., progress); // FIXME: this seems wrong. https://bugs.webkit.org/show_bug.cgi?id=52700
return PerspectiveTransformOperation::create(clampToPositiveInteger(p));
}
const PerspectiveTransformOperation* fromOp = static_cast<const PerspectiveTransformOperation*>(from);
TransformationMatrix fromT;
TransformationMatrix toT;
fromT.applyPerspective(fromOp ? fromOp->m_p : 0);
toT.applyPerspective(m_p);
toT.blend(fromT, progress);
TransformationMatrix::DecomposedType decomp;
toT.decompose(decomp);
if (decomp.perspectiveZ) {
double val = -1.0 / decomp.perspectiveZ;
return PerspectiveTransformOperation::create(clampToPositiveInteger(val));
}
return PerspectiveTransformOperation::create(0);
}
示例2: create
PassRefPtr<TransformOperation> PerspectiveTransformOperation::blend(const TransformOperation* from, double progress, bool blendToIdentity)
{
if (from && !from->isSameType(*this))
return this;
if (blendToIdentity)
return PerspectiveTransformOperation::create(m_p + (1. - m_p) * progress);
const PerspectiveTransformOperation* fromOp = static_cast<const PerspectiveTransformOperation*>(from);
double fromP = fromOp ? fromOp->m_p : 0;
double toP = m_p;
TransformationMatrix fromT;
TransformationMatrix toT;
fromT.applyPerspective(fromP);
toT.applyPerspective(toP);
toT.blend(fromT, progress);
TransformationMatrix::DecomposedType decomp;
toT.decompose(decomp);
return PerspectiveTransformOperation::create(decomp.perspectiveZ ? -1.0 / decomp.perspectiveZ : 0.0);
}