本文整理汇总了C++中KisImageWSP::nlayers方法的典型用法代码示例。如果您正苦于以下问题:C++ KisImageWSP::nlayers方法的具体用法?C++ KisImageWSP::nlayers怎么用?C++ KisImageWSP::nlayers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisImageWSP
的用法示例。
在下文中一共展示了KisImageWSP::nlayers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testObligeSingleChildImpl
void testObligeSingleChildImpl(bool transpDefaultPixel)
{
QString id = !transpDefaultPixel ?
"single_layer_no_channel_flags_nontransp_def_pixel.kra" :
"single_layer_no_channel_flags_transp_def_pixel.kra";
QString fileName = TestUtil::fetchDataFileLazy(id);
KisDocument *doc = KisPart::instance()->createDocument();
doc->loadNativeFormat(fileName);
KisImageWSP image = doc->image();
QVERIFY(image);
QCOMPARE(image->nlayers(), 2);
KisNodeSP root = image->root();
KisNodeSP child = root->firstChild();
QVERIFY(child);
QCOMPARE(root->original(), root->projection());
if (transpDefaultPixel) {
QCOMPARE(root->original(), child->projection());
} else {
QVERIFY(root->original() != child->projection());
}
delete doc;
}
示例2: testLoading
void KisKraLoaderTest::testLoading()
{
KisDocument *doc = KisPart::instance()->createDocument();
doc->loadNativeFormat(QString(FILES_DATA_DIR) + QDir::separator() + "load_test.kra");
KisImageWSP image = doc->image();
image->lock();
QCOMPARE(image->nlayers(), 12);
QCOMPARE(doc->documentInfo()->aboutInfo("title"), QString("test image for loading"));
QCOMPARE(image->height(), 753);
QCOMPARE(image->width(), 1000);
QCOMPARE(image->colorSpace()->id(), KoColorSpaceRegistry::instance()->rgb8()->id());
KisNodeSP node = image->root()->firstChild();
QVERIFY(node);
QCOMPARE(node->name(), QString("Background"));
QVERIFY(node->inherits("KisPaintLayer"));
node = node->nextSibling();
QVERIFY(node);
QCOMPARE(node->name(), QString("Group 1"));
QVERIFY(node->inherits("KisGroupLayer"));
QCOMPARE((int) node->childCount(), 2);
delete doc;
}