本文整理汇总了C++中KisPaintDeviceSP::fastBitBltRough方法的典型用法代码示例。如果您正苦于以下问题:C++ KisPaintDeviceSP::fastBitBltRough方法的具体用法?C++ KisPaintDeviceSP::fastBitBltRough怎么用?C++ KisPaintDeviceSP::fastBitBltRough使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisPaintDeviceSP
的用法示例。
在下文中一共展示了KisPaintDeviceSP::fastBitBltRough方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testFastBitBlt
void KisPaintDeviceTest::testFastBitBlt()
{
QImage image(QString(FILES_DATA_DIR) + QDir::separator() + "hakonepa.png");
const KoColorSpace * cs = KoColorSpaceRegistry::instance()->rgb8();
KisPaintDeviceSP dstDev = new KisPaintDevice(cs);
KisPaintDeviceSP srcDev = new KisPaintDevice(cs);
srcDev->convertFromQImage(image, 0);
QRect cloneRect(100,100,200,200);
QPoint errpoint;
QVERIFY(dstDev->fastBitBltPossible(srcDev));
dstDev->fastBitBlt(srcDev, cloneRect);
QImage srcImage = srcDev->convertToQImage(0, cloneRect.x(), cloneRect.y(),
cloneRect.width(), cloneRect.height());
QImage dstImage = dstDev->convertToQImage(0, cloneRect.x(), cloneRect.y(),
cloneRect.width(), cloneRect.height());
if (!TestUtil::compareQImages(errpoint, srcImage, dstImage)) {
QFAIL(QString("Failed to create identical image, first different pixel: %1,%2 \n").arg(errpoint.x()).arg(errpoint.y()).toLatin1());
}
// Test Rough version
dstDev->clear();
dstDev->fastBitBltRough(srcDev, cloneRect);
srcImage = srcDev->convertToQImage(0, cloneRect.x(), cloneRect.y(),
cloneRect.width(), cloneRect.height());
dstImage = dstDev->convertToQImage(0, cloneRect.x(), cloneRect.y(),
cloneRect.width(), cloneRect.height());
if (!TestUtil::compareQImages(errpoint, srcImage, dstImage)) {
QFAIL(QString("Failed to create identical image, first different pixel: %1,%2 \n").arg(errpoint.x()).arg(errpoint.y()).toLatin1());
}
srcDev->move(10,10);
QVERIFY(!dstDev->fastBitBltPossible(srcDev));
}