本文整理汇总了C++中KisImageSP::data方法的典型用法代码示例。如果您正苦于以下问题:C++ KisImageSP::data方法的具体用法?C++ KisImageSP::data怎么用?C++ KisImageSP::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisImageSP
的用法示例。
在下文中一共展示了KisImageSP::data方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testNoUIUpdates
void KisProcessingApplicatorTest::testNoUIUpdates()
{
KisSurrogateUndoStore *undoStore = new KisSurrogateUndoStore();
KisPaintLayerSP paintLayer1;
KisPaintLayerSP paintLayer2;
KisImageSP image = createImage(undoStore, paintLayer1, paintLayer2);
QSignalSpy uiSignalsCounter(image.data(), SIGNAL(sigImageUpdated(const QRect&)));
QRect cropRect1(40,40,86,86);
{
KisProcessingApplicator applicator(image, image->rootLayer(),
KisProcessingApplicator::RECURSIVE |
KisProcessingApplicator::NO_UI_UPDATES);
KisProcessingVisitorSP visitor =
new KisCropProcessingVisitor(cropRect1, true, true);
applicator.applyVisitor(visitor);
applicator.end();
image->waitForDone();
}
QCOMPARE(uiSignalsCounter.size(), 0);
uiSignalsCounter.clear();
undoStore->undo();
image->waitForDone();
QCOMPARE(uiSignalsCounter.size(), 0);
}
示例2: run
void KisPasteNewActionFactory::run(KisView2 *view)
{
Q_UNUSED(view);
KisPaintDeviceSP clip = KisClipboard::instance()->clip(QRect(), true);
if (!clip) return;
QRect rect = clip->exactBounds();
if (rect.isEmpty()) return;
KisDoc2 *doc = new KisDoc2();
if (!doc) return;
KisImageSP image = new KisImage(doc->createUndoStore(),
rect.width(),
rect.height(),
clip->colorSpace(),
i18n("Pasted"));
KisPaintLayerSP layer =
new KisPaintLayer(image.data(), clip->objectName(),
OPACITY_OPAQUE_U8, clip->colorSpace());
KisPainter p(layer->paintDevice());
p.setCompositeOp(COMPOSITE_COPY);
p.bitBlt(0, 0, clip, rect.x(), rect.y(), rect.width(), rect.height());
p.end();
image->addNode(layer.data(), image->rootLayer());
doc->setCurrentImage(image);
KoMainWindow *win = doc->documentPart()->createMainWindow();
win->show();
win->setRootDocument(doc);
}
示例3: run
void KisPasteNewActionFactory::run(KisViewManager *viewManager)
{
Q_UNUSED(viewManager);
KisPaintDeviceSP clip = KisClipboard::instance()->clip(QRect(), true);
if (!clip) return;
QRect rect = clip->exactBounds();
if (rect.isEmpty()) return;
KisDocument *doc = KisPart::instance()->createDocument();
KisImageSP image = new KisImage(doc->createUndoStore(),
rect.width(),
rect.height(),
clip->colorSpace(),
i18n("Pasted"));
KisPaintLayerSP layer =
new KisPaintLayer(image.data(), clip->objectName(),
OPACITY_OPAQUE_U8, clip->colorSpace());
KisPainter::copyAreaOptimized(QPoint(), clip, layer->paintDevice(), rect);
image->addNode(layer.data(), image->rootLayer());
doc->setCurrentImage(image);
KisPart::instance()->addDocument(doc);
KisMainWindow *win = viewManager->mainWindow();
win->addViewAndNotifyLoadingCompleted(doc);
}
示例4: run
void KisPasteNewActionFactory::run(KisView2 *view)
{
Q_UNUSED(view);
KisPaintDeviceSP clip = KisClipboard::instance()->clip(QPoint());
if (!clip) return;
QRect rect = clip->exactBounds();
if (rect.isEmpty()) return;
const QByteArray mimetype = KoServiceProvider::readNativeFormatMimeType();
KoDocumentEntry entry = KoDocumentEntry::queryByMimeType(mimetype);
QString error;
KisPart2* part = dynamic_cast<KisPart2*>(entry.createKoPart(&error));
if (!part) return;
KisDoc2 *doc = new KisDoc2(part);
if (!doc) return;
part->setDocument(doc);
KisImageSP image = new KisImage(doc->createUndoStore(),
rect.width(),
rect.height(),
clip->colorSpace(),
i18n("Pasted"));
KisPaintLayerSP layer =
new KisPaintLayer(image.data(), clip->objectName(),
OPACITY_OPAQUE_U8, clip->colorSpace());
KisPainter p(layer->paintDevice());
p.setCompositeOp(COMPOSITE_COPY);
p.bitBlt(0, 0, clip, rect.x(), rect.y(), rect.width(), rect.height());
p.end();
image->addNode(layer.data(), image->rootLayer());
doc->setCurrentImage(image);
KoMainWindow *win = new KoMainWindow(part->componentData());
win->show();
win->setRootDocument(doc);
}