本文整理汇总了C++中KisImageWSP::addNode方法的典型用法代码示例。如果您正苦于以下问题:C++ KisImageWSP::addNode方法的具体用法?C++ KisImageWSP::addNode怎么用?C++ KisImageWSP::addNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisImageWSP
的用法示例。
在下文中一共展示了KisImageWSP::addNode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadNodes
KisNodeSP KisKraLoader::loadNodes(const KoXmlElement& element, KisImageWSP image, KisNodeSP parent)
{
KoXmlNode node = element.firstChild();
KoXmlNode child;
if (!node.isNull()) {
if (node.isElement()) {
if (node.nodeName().toUpper() == LAYERS.toUpper() || node.nodeName().toUpper() == MASKS.toUpper()) {
for (child = node.lastChild(); !child.isNull(); child = child.previousSibling()) {
KisNodeSP node = loadNode(child.toElement(), image, parent);
if (node) {
image->nextLayerName(); // Make sure the nameserver is current with the number of nodes.
image->addNode(node, parent);
if (node->inherits("KisLayer") && child.childNodesCount() > 0) {
loadNodes(child.toElement(), image, node);
}
}
}
}
}
}
return parent;
}
示例2: Private
Private(KisDocument *document, int fromTime, int toTime)
: document(document),
image(document->image()),
firstFrame(fromTime),
lastFrame(toTime),
tmpDoc(KisPart::instance()->createDocument()),
exporting(false),
batchMode(false)
{
tmpDoc->setAutoSave(0);
tmpImage = new KisImage(tmpDoc->createUndoStore(),
image->bounds().width(),
image->bounds().height(),
image->colorSpace(),
QString());
tmpImage->setResolution(image->xRes(), image->yRes());
tmpDoc->setCurrentImage(tmpImage);
KisPaintLayer* paintLayer = new KisPaintLayer(tmpImage, "paint device", 255);
tmpImage->addNode(paintLayer, tmpImage->rootLayer(), KisLayerSP(0));
tmpDevice = paintLayer->paintDevice();
}
示例3: createTempImage
void CSVSaver::createTempImage(KisDocument* exportDoc)
{
exportDoc->setAutoSave(0);
exportDoc->setOutputMimeType("image/png");
exportDoc->setFileBatchMode(true);
KisImageWSP exportImage = new KisImage(exportDoc->createUndoStore(),
m_image->width(), m_image->height(), m_image->colorSpace(),
QString());
exportImage->setResolution(m_image->xRes(), m_image->yRes());
exportDoc->setCurrentImage(exportImage);
KisPaintLayer* paintLayer = new KisPaintLayer(exportImage, "paint device", OPACITY_OPAQUE_U8);
exportImage->addNode(paintLayer, exportImage->rootLayer(), KisLayerSP(0));
}
示例4: saveAsImage
void Imagesplit::saveAsImage(QRect imgSize, QString mimeType, QUrl url)
{
KisImageWSP image = m_view->image();
KisDocument *d = KisPart::instance()->createDocument();
d->prepareForImport();
KisImageWSP dst = new KisImage(d->createUndoStore(), imgSize.width(), imgSize.height(), image->colorSpace(), image->objectName());
dst->setResolution(image->xRes(), image->yRes());
d->setCurrentImage(dst);
KisPaintLayer* paintLayer = new KisPaintLayer(dst, dst->nextLayerName(), 255);
KisPainter gc(paintLayer->paintDevice());
gc.bitBlt(QPoint(0, 0), image->projection(), imgSize);
dst->addNode(paintLayer, KisNodeSP(0));
dst->refreshGraph();
d->setOutputMimeType(mimeType.toLatin1());
d->exportDocument(url);
delete d;
}