本文整理汇总了C++中KisFilterSP::changedRect方法的典型用法代码示例。如果您正苦于以下问题:C++ KisFilterSP::changedRect方法的具体用法?C++ KisFilterSP::changedRect怎么用?C++ KisFilterSP::changedRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisFilterSP
的用法示例。
在下文中一共展示了KisFilterSP::changedRect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: decorateRect
QRect KisFilterMask::decorateRect(KisPaintDeviceSP &src,
KisPaintDeviceSP &dst,
const QRect & rc,
PositionToFilthy maskPos) const
{
Q_UNUSED(maskPos);
KisSafeFilterConfigurationSP filterConfig = filter();
Q_ASSERT(nodeProgressProxy());
Q_ASSERT_X(src != dst, "KisFilterMask::decorateRect",
"src must be != dst, because we cant create transactions "
"during merge, as it breaks reentrancy");
if (!filterConfig) {
return QRect();
}
KisFilterSP filter =
KisFilterRegistry::instance()->value(filterConfig->name());
if (!filter) {
warnKrita << "Could not retrieve filter \"" << filterConfig->name() << "\"";
return QRect();
}
KIS_ASSERT_RECOVER_NOOP(this->busyProgressIndicator());
this->busyProgressIndicator()->update();
filter->process(src, dst, 0, rc, filterConfig.data(), 0);
QRect r = filter->changedRect(rc, filterConfig.data(), dst->defaultBounds()->currentLevelOfDetail());
return r;
}
示例2: changeRect
/**
* FIXME: try to cache filter pointer inside a Private block
*/
QRect KisFilterMask::changeRect(const QRect &rect, PositionToFilthy pos) const
{
/**
* FIXME: This check of the emptiness should be done
* on the higher/lower level
*/
if(rect.isEmpty()) return rect;
QRect filteredRect = rect;
KisSafeFilterConfigurationSP filterConfig = filter();
if (filterConfig) {
KisNodeSP parent = this->parent();
const int lod = parent && parent->projection() ?
parent->projection()->defaultBounds()->currentLevelOfDetail() : 0;
KisFilterSP filter = KisFilterRegistry::instance()->value(filterConfig->name());
filteredRect = filter->changedRect(rect, filterConfig.data(), lod);
}
/**
* We can't paint outside a selection, that is why we call
* KisMask::changeRect to crop actual change area in the end
*/
filteredRect = KisMask::changeRect(filteredRect, pos);
/**
* FIXME: Think over this solution
* Union of rects means that changeRect returns NOT the rect
* changed by this very layer, but an accumulated rect changed
* by all underlying layers. Just take into account and change
* documentation accordingly
*/
return rect | filteredRect;
}