本文整理汇总了C++中KisLayerSP::data方法的典型用法代码示例。如果您正苦于以下问题:C++ KisLayerSP::data方法的具体用法?C++ KisLayerSP::data怎么用?C++ KisLayerSP::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisLayerSP
的用法示例。
在下文中一共展示了KisLayerSP::data方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mergeToLayer
void KisIndirectPaintingSupport::mergeToLayer(KisLayerSP layer, const QRegion ®ion, const QString &transactionText)
{
/**
* We do not apply selection here, because it has already
* been taken into account in a tool code
*/
KisPainter gc(layer->paintDevice());
gc.setCompositeOp(d->compositeOp);
gc.setOpacity(d->compositeOpacity);
gc.setChannelFlags(layer->channelFlags());
if (KisPaintLayer* paintLayer = dynamic_cast<KisPaintLayer*>(layer.data())) {
if (paintLayer->alphaLocked()) {
gc.setLockAlpha(paintLayer->alphaLocked());
}
}
d->lock.lockForWrite();
if(layer->image()) {
gc.beginTransaction(transactionText);
}
foreach(const QRect& rc, region.rects()) {
gc.bitBlt(rc.topLeft(), d->temporaryTarget, rc);
}
d->temporaryTarget = 0;
// in the scratchpad the layer has no image and there is no undo adapter
if(layer->image()) {
gc.endTransaction(layer->image()->undoAdapter());
}
d->lock.unlock();
}
示例2: findNode
KisNodeSP findNode(KisNodeSP node, const QPoint &point, bool wholeGroup, bool editableOnly)
{
KisNodeSP foundNode = 0;
while (node) {
KisLayerSP layer = dynamic_cast<KisLayer*>(node.data());
if (!layer || !layer->isEditable()) {
node = node->prevSibling();
continue;
}
KoColor color(layer->projection()->colorSpace());
layer->projection()->pixel(point.x(), point.y(), &color);
KisGroupLayerSP group = dynamic_cast<KisGroupLayer*>(layer.data());
if ((group && group->passThroughMode()) || color.opacityU8() != OPACITY_TRANSPARENT_U8) {
if (layer->inherits("KisGroupLayer") && (!editableOnly || layer->isEditable())) {
// if this is a group and the pixel is transparent, don't even enter it
foundNode = findNode(node->lastChild(), point, wholeGroup, editableOnly);
}
else {
foundNode = !wholeGroup ? node : node->parent();
}
}
if (foundNode) break;
node = node->prevSibling();
}
return foundNode;
}
示例3:
KoShapeManager* KisCanvas2::shapeManager() const
{
if (!m_d->view) return m_d->shapeManager;
if (!m_d->view->layerManager()) return m_d->shapeManager;
KisLayerSP activeLayer = m_d->view->layerManager()->activeLayer();
if (activeLayer) {
KisShapeLayer * shapeLayer = dynamic_cast<KisShapeLayer*>(activeLayer.data());
if (shapeLayer) {
dbgUI << "Current shape manager belongs to a shape layer " << shapeLayer->shapeManager();
return shapeLayer->shapeManager();
}
if (activeLayer->selection() && activeLayer->selection()->hasShapeSelection()) {
KoShapeManager* m = static_cast<KisShapeSelection*>(activeLayer->selection()->shapeSelection())->shapeManager();
dbgUI << "Current shape manager belongs to a shape selection " << m;
return m;
}
}
dbgUI << "current shape manager belongs to the main canvas " << m_d->shapeManager;
return m_d->shapeManager;
}