当前位置: 首页>>代码示例>>C++>>正文


C++ KisPaintDeviceSP::createCompositionSourceDevice方法代码示例

本文整理汇总了C++中KisPaintDeviceSP::createCompositionSourceDevice方法的典型用法代码示例。如果您正苦于以下问题:C++ KisPaintDeviceSP::createCompositionSourceDevice方法的具体用法?C++ KisPaintDeviceSP::createCompositionSourceDevice怎么用?C++ KisPaintDeviceSP::createCompositionSourceDevice使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KisPaintDeviceSP的用法示例。


在下文中一共展示了KisPaintDeviceSP::createCompositionSourceDevice方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createDeviceCache

KisPaintDeviceSP TransformStrokeStrategy::createDeviceCache(KisPaintDeviceSP dev)
{
    KisPaintDeviceSP cache;

    if (m_selection) {
        QRect srcRect = m_selection->selectedExactRect();

        cache = dev->createCompositionSourceDevice();
        KisPainter gc(cache);
        gc.setSelection(m_selection);
        gc.bitBlt(srcRect.topLeft(), dev, srcRect);
    } else {
        cache = dev->createCompositionSourceDevice(dev);
    }

    return cache;
}
开发者ID:ChrisJong,项目名称:krita,代码行数:17,代码来源:transform_stroke_strategy.cpp

示例2: initStrokeCallback

void KisFilterStrokeStrategy::initStrokeCallback()
{
    KisPainterBasedStrokeStrategy::initStrokeCallback();

    KisPaintDeviceSP dev = targetDevice();

    if (activeSelection() ||
        (dev->colorSpace() != dev->compositionSourceColorSpace() &&
         !(dev->colorSpace() == dev->compositionSourceColorSpace()))) {

        m_d->filterDevice = dev->createCompositionSourceDevice(dev);
        m_d->secondaryTransaction = new KisTransaction("", m_d->filterDevice);
    } else {
        m_d->filterDevice = dev;
    }
}
开发者ID:crayonink,项目名称:calligra-2,代码行数:16,代码来源:kis_filter_stroke_strategy.cpp

示例3: visitNodeWithPaintDevice

void FillProcessingVisitor::visitNodeWithPaintDevice(KisNode *node, KisUndoAdapter *undoAdapter)
{
    KisPaintDeviceSP device = node->paintDevice();
    Q_ASSERT(device);

    ProgressHelper helper(node);
    QRect fillRect = m_resources->image()->bounds();

    if (!device->defaultBounds()->wrapAroundMode() &&
        !fillRect.contains(m_startPoint)) {

        return;
    }

    if (m_selectionOnly) {
        KisPaintDeviceSP filledDevice = device->createCompositionSourceDevice();
        KisFillPainter fillPainter(filledDevice);
        fillPainter.setProgress(helper.updater());

        if (m_usePattern) {
            fillPainter.fillRect(fillRect, m_resources->currentPattern());
        } else if (m_useBgColor) {
            fillPainter.fillRect(fillRect,
                                 m_resources->currentBgColor(),
                                 m_resources->opacity());
        } else {
            fillPainter.fillRect(fillRect,
                                 m_resources->currentFgColor(),
                                 m_resources->opacity());
        }

        QVector<QRect> dirtyRect = fillPainter.takeDirtyRegion();

        KisPainter painter(device, m_selection);
        painter.beginTransaction();

        m_resources->setupPainter(&painter);

        foreach(const QRect &rc, dirtyRect) {
            painter.bitBlt(rc.topLeft(), filledDevice, rc);
        }

        painter.endTransaction(undoAdapter);

    } else {
开发者ID:TheTypoMaster,项目名称:calligra,代码行数:45,代码来源:fill_processing_visitor.cpp


注:本文中的KisPaintDeviceSP::createCompositionSourceDevice方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。