File indexing completed on 2024-12-22 04:16:04

0001 /*
0002  *  SPDX-FileCopyrightText: 2021 Dmitry Kazakov <dimula73@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef KRITA_KISCOLORSMUDGESTRATEGYWITHOVERLAY_H
0008 #define KRITA_KISCOLORSMUDGESTRATEGYWITHOVERLAY_H
0009 
0010 #include "KisColorSmudgeStrategyBase.h"
0011 #include "kis_painter.h"
0012 
0013 
0014 class KisColorSmudgeStrategyWithOverlay : public KisColorSmudgeStrategyBase
0015 {
0016 public:
0017     KisColorSmudgeStrategyWithOverlay(KisPainter *painter,
0018                                       KisImageSP image,
0019                                       bool smearAlpha,
0020                                       bool useDullingMode,
0021                                       bool useOverlayMode);
0022 
0023     virtual ~KisColorSmudgeStrategyWithOverlay();
0024 
0025     void initializePainting() override;
0026 
0027     QVector<KisPainter*> finalPainters();
0028 
0029     QVector<QRect> paintDab(const QRect &srcRect, const QRect &dstRect, const KoColor &currentPaintColor, qreal opacity,
0030                             qreal colorRateValue, qreal smudgeRateValue, qreal maxPossibleSmudgeRateValue,
0031                             qreal lightnessStrengthValue, qreal smudgeRadiusValue) override;
0032 
0033 protected:
0034     KisFixedPaintDeviceSP m_maskDab;
0035     bool m_shouldPreserveMaskDab = true;
0036     QScopedPointer<KisOverlayPaintDeviceWrapper> m_layerOverlayDevice;
0037 
0038 private:
0039     QScopedPointer<KisOverlayPaintDeviceWrapper> m_imageOverlayDevice;
0040     KisColorSmudgeSourceSP m_sourceWrapperDevice;
0041     KisPainter m_finalPainter;
0042     QScopedPointer<KisPainter> m_overlayPainter;
0043     bool m_smearAlpha = true;
0044     KisPainter *m_initializationPainter = 0;
0045 };
0046 
0047 
0048 #endif //KRITA_KISCOLORSMUDGESTRATEGYWITHOVERLAY_H