本文整理汇总了C++中QuillImage::copy方法的典型用法代码示例。如果您正苦于以下问题:C++ QuillImage::copy方法的具体用法?C++ QuillImage::copy怎么用?C++ QuillImage::copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QuillImage
的用法示例。
在下文中一共展示了QuillImage::copy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testCroppedThumbnailAfterEdit
void ut_croppedthumbnail::testCroppedThumbnailAfterEdit()
{
QTemporaryFile testFile;
testFile.open();
QuillImage image = Unittests::generatePaletteImage();
image.save(testFile.fileName(), "png");
Quill::setPreviewLevelCount(1);
Quill::setPreviewSize(0, QSize(2, 2));
Quill::setMinimumPreviewSize(0, QSize(2, 2));
QuillFile *file = new QuillFile(testFile.fileName());
QuillImageFilter *filter =
QuillImageFilterFactory::createImageFilter(QuillImageFilter::Name_Crop);
filter->setOption(QuillImageFilter::CropRectangle, QRect(0, 0, 4, 2));
file->runFilter(filter);
file->setDisplayLevel(1);
Quill::releaseAndWait(); // load 0
Quill::releaseAndWait(); // crop 0 - bad version
Quill::releaseAndWait(); // load 1
Quill::releaseAndWait(); // crop 1
Quill::releaseAndWait(); // reform 0
file->setDisplayLevel(0);
QCOMPARE(file->allImageLevels().count(), 1);
QCOMPARE(file->allImageLevels().first().size(), QSize(2, 2));
QVERIFY(Unittests::compareImage(file->allImageLevels().first(),
image.copy(1, 0, 2, 2)));
delete file;
}
示例2: testSerialSaver
void ut_serialsaver::testSerialSaver()
{
QTemporaryFile testFile;
testFile.open();
QByteArray metadata = QByteArray();
QuillImage image =
Unittests::generatePaletteImage().transformed(QTransform().rotate(90)).
scaled(QSize(16, 64));
SerialSaver serialSaver(testFile.fileName(), image.size(),metadata);
QVERIFY(serialSaver.process(image.copy(0, 0, 16, 16)));
QVERIFY(serialSaver.process(image.copy(0, 16, 16, 16)));
QVERIFY(serialSaver.process(image.copy(0, 32, 16, 16)));
QVERIFY(serialSaver.process(image.copy(0, 48, 16, 16)));
QImage resultImage(testFile.fileName());
Unittests::compareImage(resultImage, image);
}