本文整理汇总了C++中QScopedPointer::filterAction方法的典型用法代码示例。如果您正苦于以下问题:C++ QScopedPointer::filterAction方法的具体用法?C++ QScopedPointer::filterAction怎么用?C++ QScopedPointer::filterAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScopedPointer
的用法示例。
在下文中一共展示了QScopedPointer::filterAction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: filterImage
void FilterActionFilter::filterImage()
{
d->appliedActions.clear();
d->errorMessage = QString();
const float progressIncrement = 1.0 / qMax(1,d->actions.size());
float progress = 0;
postProgress(0);
DImg img = m_orgImage;
foreach (const FilterAction& action, d->actions)
{
kDebug() << "Replaying action" << action.identifier();
if (action.isNull())
{
continue;
}
if (DImgBuiltinFilter::isSupported(action.identifier()))
{
DImgBuiltinFilter filter(action);
if (!filter.isValid())
{
d->errorMessage = i18n("Built-in transformation not supported");
if (d->continueOnError)
{
continue;
}
else
{
break;
}
}
filter.apply(img);
d->appliedActions << filter.filterAction();
}
else
{
QScopedPointer<DImgThreadedFilter> filter
(DImgFilterManager::instance()->createFilter(action.identifier(), action.version()));
if (!filter)
{
d->errorMessage = i18n("Filter identifier or version is not supported");
if (d->continueOnError)
{
continue;
}
else
{
break;
}
}
filter->readParameters(action);
if (!filter->parametersSuccessfullyRead())
{
d->errorMessage = filter->readParametersError(action);
if (d->continueOnError)
{
continue;
}
else
{
break;
}
}
// compute
filter->setupAndStartDirectly(img, this, (int)progress, (int)(progress+progressIncrement));
img = filter->getTargetImage();
d->appliedActions << filter->filterAction();
}
progress += progressIncrement;
postProgress((int)progress);
}
m_destImage = img;
}