Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
1.3 KB
Raw Blame
/*
 *  SPDX-FileCopyrightText: 2021 Dmitry Kazakov <[email protected]>
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef KRITA_KISCOLORSMUDGEINTERSTROKEDATA_H
#define KRITA_KISCOLORSMUDGEINTERSTROKEDATA_H

#include "kis_types.h"
#include "KisInterstrokeData.h"
#include "KisOverlayPaintDeviceWrapper.h"

#include <memory>

class KisTransaction;

/**
 * Interstroke data needed for the lightness mode of colorsmudge brush.
 * It stores separate high-precision projections for the heightmap and
 * color layers. The layer itself stores only the low-precision final
 * projection, so as soon as the interstroke data is reset, the paint
 * is considered as "dried-out".
 */
struct KisColorSmudgeInterstrokeData : public KisInterstrokeData
{
    KisPaintDeviceSP colorBlendDevice;
    KisPaintDeviceSP heightmapDevice;
    KisPaintDeviceSP projectionDevice;
    KisOverlayPaintDeviceWrapper overlayDeviceWrapper;

    KisColorSmudgeInterstrokeData(KisPaintDeviceSP source);
    ~KisColorSmudgeInterstrokeData() override;

    void beginTransaction() override;

    KUndo2Command * endTransaction() override;

private:
    std::unique_ptr<KUndo2Command> m_parentCommand;
    QScopedPointer<KisTransaction> m_heightmapDeviceTransaction;
};

#endif //KRITA_KISCOLORSMUDGEINTERSTROKEDATA_H