Krita Source Code Documentation
Loading...
Searching...
No Matches
KisColorSmudgeStrategyStamp.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
8
10#include "kis_image.h"
12
13
15 bool useDullingMode, bool useOverlayMode)
16 : KisColorSmudgeStrategyWithOverlay(painter, image, smearAlpha, useDullingMode, useOverlayMode)
17 , m_origDab(new KisFixedPaintDevice(m_layerOverlayDevice->overlayColorSpace())) // TODO: check compositionSourceColorSpace!
18{
19}
20
25
27 const KisDabShape &shape, const QPointF &cursorPoint, QRect *dstDabRect, qreal lightnessStrength)
28{
29
30 static KoColor color(Qt::black, m_origDab->colorSpace());
31
33 color,
34 cursorPoint,
35 shape,
36 info,
37 1.0,
38 dstDabRect,
39 lightnessStrength);
40
42
43 const int numPixels = m_origDab->bounds().width() * m_origDab->bounds().height();
44
48
50}
The KisDabCache class provides caching for dabs into the brush paintop.
KisFixedPaintDeviceSP fetchDab(const KoColorSpace *cs, KisColorSource *colorSource, const QPointF &cursorPoint, KisDabShape const &, const KisPaintInformation &info, qreal softnessFactor, QRect *dstDabRect, qreal lightnessStrength=1.0)
void setRect(const QRect &rc)
const KoColorSpace * colorSpace() const
virtual void copyOpacityU8(quint8 *src, quint8 *dst, qint32 nPixels) const =0
void updateMask(KisDabCache *dabCache, const KisPaintInformation &info, const KisDabShape &shape, const QPointF &cursorPoint, QRect *dstDabRect, qreal lightnessStrength) override
DabColoringStrategy & coloringStrategy() override
DabColoringStrategyStamp m_coloringStrategy
KisColorSmudgeStrategyStamp(KisPainter *painter, KisImageSP image, bool smearAlpha, bool useDullingMode, bool useOverlayMode)