本文整理汇总了C++中KisNodeSP::compositeOpId方法的典型用法代码示例。如果您正苦于以下问题:C++ KisNodeSP::compositeOpId方法的具体用法?C++ KisNodeSP::compositeOpId怎么用?C++ KisNodeSP::compositeOpId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisNodeSP
的用法示例。
在下文中一共展示了KisNodeSP::compositeOpId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testMergeMultiple
void KisImageTest::testMergeMultiple()
{
FlattenTestImage p;
TestUtil::ExternalImageChecker img("flatten", "imagetest");
TestUtil::ExternalImageChecker chk("mergemultiple", "imagetest");
{
QList<KisNodeSP> selectedNodes;
selectedNodes << p.layer2
<< p.group1
<< p.layer6;
{
KisNodeSP newLayer = p.image->mergeMultipleLayers(selectedNodes, 0);
p.image->waitForDone();
QVERIFY(img.checkDevice(p.image->projection(), p.image, "00_initial"));
QVERIFY(chk.checkDevice(newLayer->projection(), p.image, "01_layer8_layerproj"));
QCOMPARE(newLayer->compositeOpId(), COMPOSITE_OVER);
QCOMPARE(newLayer->exactBounds(), QRect(50, 100, 550, 250));
}
}
p.p.undoStore->undo();
p.image->waitForDone();
// Test reversed order, the result must be the same
{
QList<KisNodeSP> selectedNodes;
selectedNodes << p.layer6
<< p.group1
<< p.layer2;
{
KisNodeSP newLayer = p.image->mergeMultipleLayers(selectedNodes, 0);
p.image->waitForDone();
QVERIFY(img.checkDevice(p.image->projection(), p.image, "00_initial"));
QVERIFY(chk.checkDevice(newLayer->projection(), p.image, "01_layer8_layerproj"));
QCOMPARE(newLayer->compositeOpId(), COMPOSITE_OVER);
QCOMPARE(newLayer->exactBounds(), QRect(50, 100, 550, 250));
}
}
}
示例2: setCompositeOp
void KisNodeCommandsAdapter::setCompositeOp(KisNodeSP node,
const KoCompositeOp* compositeOp)
{
Q_ASSERT(m_view->image()->undoAdapter());
m_view->image()->undoAdapter()->addCommand(
new KisNodeCompositeOpCommand(node, node->compositeOpId(),
compositeOp->id()));
}