本文整理汇总了C++中KisPaintDeviceSP::region方法的典型用法代码示例。如果您正苦于以下问题:C++ KisPaintDeviceSP::region方法的具体用法?C++ KisPaintDeviceSP::region怎么用?C++ KisPaintDeviceSP::region使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisPaintDeviceSP
的用法示例。
在下文中一共展示了KisPaintDeviceSP::region方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doStrokeCallback
void MoveSelectionStrokeStrategy::doStrokeCallback(KisStrokeJobData *data)
{
MoveStrokeStrategy::Data *d = dynamic_cast<MoveStrokeStrategy::Data*>(data);
if (d) {
KisIndirectPaintingSupport *indirect =
static_cast<KisIndirectPaintingSupport*>(m_paintLayer.data());
KisPaintDeviceSP movedDevice = indirect->temporaryTarget();
QRegion dirtyRegion = movedDevice->region();
QPoint currentDeviceOffset(movedDevice->x(), movedDevice->y());
QPoint newDeviceOffset(m_initialDeviceOffset + d->offset);
dirtyRegion |= dirtyRegion.translated(newDeviceOffset - currentDeviceOffset);
movedDevice->setX(newDeviceOffset.x());
movedDevice->setY(newDeviceOffset.y());
m_finalOffset = d->offset;
m_paintLayer->setDirty(dirtyRegion);
} else {
KisStrokeStrategyUndoCommandBased::doStrokeCallback(data);
}
}
示例2: cancelStrokeCallback
void MoveSelectionStrokeStrategy::cancelStrokeCallback()
{
KisIndirectPaintingSupport *indirect =
static_cast<KisIndirectPaintingSupport*>(m_paintLayer.data());
if (indirect) {
KisPaintDeviceSP t = indirect->temporaryTarget();
if (t) {
QRegion dirtyRegion = t->region();
indirect->setTemporaryTarget(0);
m_selection->setVisible(true);
m_paintLayer->setDirty(dirtyRegion);
}
}
KisStrokeStrategyUndoCommandBased::cancelStrokeCallback();
}
示例3: dstIt
void KisMultiwayCut::Private::maskOutKeyStroke(KisPaintDeviceSP keyStrokeDevice, KisPaintDeviceSP mask, const QRect &boundingRect)
{
KIS_ASSERT_RECOVER_RETURN(keyStrokeDevice->pixelSize() == 1);
KIS_ASSERT_RECOVER_RETURN(mask->pixelSize() == 1);
QRegion region =
keyStrokeDevice->region() &
mask->exactBounds() & boundingRect;
Q_FOREACH (const QRect &rc, region.rects()) {
KisSequentialIterator dstIt(keyStrokeDevice, rc);
KisSequentialConstIterator mskIt(mask, rc);
do {
if (*mskIt.rawDataConst() > 0) {
*dstIt.rawData() = 0;
}
} while (dstIt.nextPixel() && mskIt.nextPixel());
}
}
示例4: testRegion
void KisPaintDeviceTest::testRegion()
{
const KoColorSpace * cs = KoColorSpaceRegistry::instance()->rgb8();
KisPaintDeviceSP dev = new KisPaintDevice(cs);
quint8* whitePixel = new quint8[cs->pixelSize()];
cs->fromQColor(Qt::white, whitePixel);
dev->fill(0, 0, 10, 10, whitePixel);
dev->fill(70, 70, 10, 10, whitePixel);
dev->fill(129, 0, 10, 10, whitePixel);
dev->fill(0, 1030, 10, 10, whitePixel);
QRegion referenceRegion;
referenceRegion += QRect(0,0,64,64);
referenceRegion += QRect(64,64,64,64);
referenceRegion += QRect(128,0,64,64);
referenceRegion += QRect(0,1024,64,64);
QCOMPARE(dev->exactBounds(), QRect(0,0,139,1040));
QCOMPARE(dev->region(), referenceRegion);
}