本文整理汇总了C++中KisImageWSP::data方法的典型用法代码示例。如果您正苦于以下问题:C++ KisImageWSP::data方法的具体用法?C++ KisImageWSP::data怎么用?C++ KisImageWSP::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisImageWSP
的用法示例。
在下文中一共展示了KisImageWSP::data方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: KisResourcesSnapshot
KisFigurePaintingToolHelper::KisFigurePaintingToolHelper(const KUndo2MagicString &name,
KisImageWSP image,
KisNodeSP currentNode,
KoCanvasResourceManager *resourceManager,
KisPainter::StrokeStyle strokeStyle,
KisPainter::FillStyle fillStyle)
{
m_strokesFacade = image.data();
m_resources =
new KisResourcesSnapshot(image,
currentNode,
resourceManager);
m_resources->setStrokeStyle(strokeStyle);
m_resources->setFillStyle(fillStyle);
PainterInfo *painterInfo = new PainterInfo();
KisStrokeStrategy *stroke =
new FreehandStrokeStrategy(m_resources->needsIndirectPainting(),
m_resources->indirectPaintingCompositeOp(),
m_resources, painterInfo, name);
m_strokeId = m_strokesFacade->startStroke(stroke);
}
示例2: KisResourcesSnapshot
KisFigurePaintingToolHelper::KisFigurePaintingToolHelper(const QString &name,
KisImageWSP image,
KoCanvasResourceManager *resourceManager,
KisPainter::StrokeStyle strokeStyle,
KisPainter::FillStyle fillStyle)
{
m_strokesFacade = image.data();
m_resources =
new KisResourcesSnapshot(image,
image->postExecutionUndoAdapter(),
resourceManager);
m_resources->setStrokeStyle(strokeStyle);
m_resources->setFillStyle(fillStyle);
m_painterInfo =
new PainterInfo(new KisPainter(),
new KisDistanceInformation());
bool indirectPainting = m_resources->needsIndirectPainting();
KisStrokeStrategy *stroke =
new FreehandStrokeStrategy(indirectPainting, m_resources, m_painterInfo, name);
m_strokeId = m_strokesFacade->startStroke(stroke);
}
示例3: KisLayer
KisSelectionBasedLayer::KisSelectionBasedLayer(KisImageWSP image,
const QString &name,
KisSelectionSP selection,
KisFilterConfiguration *filterConfig,
bool useGeneratorRegistry)
: KisLayer(image.data(), name, OPACITY_OPAQUE_U8),
KisNodeFilterInterface(filterConfig, useGeneratorRegistry),
m_d(new Private())
{
if (!selection)
initSelection();
else
setInternalSelection(selection);
m_d->paintDevice = new KisPaintDevice(this, image->colorSpace(), new KisDefaultBounds(image));
}
示例4: run
void KisPasteActionFactory::run(KisView2 *view)
{
KisImageWSP image = view->image();
//figure out where to position the clip
// XXX: Fix this for internal points & zoom! (BSAR)
QWidget * w = view->canvas();
QPoint center = QPoint(w->width() / 2, w->height() / 2);
QPoint bottomright = QPoint(w->width(), w->height());
if (bottomright.x() > image->width())
center.setX(image->width() / 2);
if (bottomright.y() > image->height())
center.setY(image->height() / 2);
const KoCanvasBase* canvasBase = view->canvasBase();
const KoViewConverter* viewConverter = view->canvasBase()->viewConverter();
KisPaintDeviceSP clip = KisClipboard::instance()->clip(
QPoint(
viewConverter->viewToDocumentX(canvasBase->canvasController()->canvasOffsetX()) + center.x(),
viewConverter->viewToDocumentY(canvasBase->canvasController()->canvasOffsetY()) + center.y()));
if (clip) {
// Pasted layer content could be outside image bounds and invisible, if that is the case move content into the bounds
QRect exactBounds = clip->exactBounds();
if (!exactBounds.isEmpty() && !exactBounds.intersects(image->bounds())) {
clip->setX(clip->x() - exactBounds.x());
clip->setY(clip->y() - exactBounds.y());
}
KisPaintLayer *newLayer = new KisPaintLayer(image.data(), image->nextLayerName() + i18n("(pasted)"), OPACITY_OPAQUE_U8, clip);
KisNodeSP aboveNode = view->activeLayer();
KisNodeSP parentNode = aboveNode ? aboveNode->parent() : image->root();
KUndo2Command *cmd = new KisImageLayerAddCommand(image, newLayer, parentNode, aboveNode);
KisProcessingApplicator *ap = beginAction(view, cmd->text());
ap->applyCommand(cmd, KisStrokeJobData::SEQUENTIAL, KisStrokeJobData::NORMAL);
endAction(ap, KisOperationConfiguration(id()).toXML());
} else {
#ifdef __GNUC__
#warning "Add saving of XML data for Paste of shapes"
#endif
view->canvasBase()->toolProxy()->paste();
}
}
示例5: run
void KisPasteActionFactory::run(KisViewManager *view)
{
KisImageWSP image = view->image();
if (!image) return;
KisPaintDeviceSP clip = KisClipboard::instance()->clip(image->bounds(), true);
if (clip) {
KisPaintLayer *newLayer = new KisPaintLayer(image.data(), image->nextLayerName() + i18n("(pasted)"), OPACITY_OPAQUE_U8, clip);
KisNodeSP aboveNode = view->activeLayer();
KisNodeSP parentNode = aboveNode ? aboveNode->parent() : image->root();
KUndo2Command *cmd = new KisImageLayerAddCommand(image, newLayer, parentNode, aboveNode);
KisProcessingApplicator *ap = beginAction(view, cmd->text());
ap->applyCommand(cmd, KisStrokeJobData::SEQUENTIAL, KisStrokeJobData::NORMAL);
endAction(ap, KisOperationConfiguration(id()).toXML());
} else {
// XXX: "Add saving of XML data for Paste of shapes"
view->canvasBase()->toolProxy()->paste();
}
}
示例6: QObject
KisPrintJob::KisPrintJob(KisImageWSP image)
: QObject(image.data())
, m_image(image)
{
m_printer.setFromTo(1, 1);
}