Krita Source Code Documentation
Loading...
Searching...
No Matches
KisColorSmudgeStrategyMaskLegacy Class Reference

#include <KisColorSmudgeStrategyMaskLegacy.h>

+ Inheritance diagram for KisColorSmudgeStrategyMaskLegacy:

Public Member Functions

qreal colorRateOpacity (qreal opacity, qreal smudgeRateValue, qreal colorRateValue, qreal maxPossibleSmudgeRateValue) override
 
qreal dullingRateOpacity (qreal opacity, qreal smudgeRateValue) override
 
QString finalCompositeOp (bool smearAlpha) const override
 
qreal finalPainterOpacity (qreal opacity, qreal smudgeRateValue) override
 
 KisColorSmudgeStrategyMaskLegacy (KisPainter *painter, KisImageSP image, bool smearAlpha, bool useDullingMode, bool useOverlayMode)
 
void sampleDullingColor (const QRect &srcRect, qreal sampleRadiusValue, KisColorSmudgeSourceSP sourceDevice, KisFixedPaintDeviceSP tempFixedDevice, KisFixedPaintDeviceSP maskDab, KoColor *resultColor) override
 
QString smearCompositeOp (bool smearAlpha) const override
 
qreal smearRateOpacity (qreal opacity, qreal smudgeRateValue) override
 
- Public Member Functions inherited from KisColorSmudgeStrategyMask
DabColoringStrategycoloringStrategy () override
 
 KisColorSmudgeStrategyMask (KisPainter *painter, KisImageSP image, bool smearAlpha, bool useDullingMode, bool useOverlayMode)
 
void updateMask (KisDabCache *dabCache, const KisPaintInformation &info, const KisDabShape &shape, const QPointF &cursorPoint, QRect *dstDabRect, qreal lightnessStrength) override
 
- Public Member Functions inherited from KisColorSmudgeStrategyWithOverlay
QVector< KisPainter * > finalPainters ()
 
void initializePainting () override
 
 KisColorSmudgeStrategyWithOverlay (KisPainter *painter, KisImageSP image, bool smearAlpha, bool useDullingMode, bool useOverlayMode)
 
QVector< QRect > paintDab (const QRect &srcRect, const QRect &dstRect, const KoColor &currentPaintColor, qreal opacity, qreal colorRateValue, qreal smudgeRateValue, qreal maxPossibleSmudgeRateValue, qreal lightnessStrengthValue, qreal smudgeRadiusValue) override
 
virtual ~KisColorSmudgeStrategyWithOverlay ()
 
- Public Member Functions inherited from KisColorSmudgeStrategyBase
void blendBrush (const QVector< KisPainter * > dstPainters, KisColorSmudgeSourceSP srcSampleDevice, KisFixedPaintDeviceSP maskDab, bool preserveMaskDab, const QRect &srcRect, const QRect &dstRect, const KoColor &currentPaintColor, qreal opacity, qreal smudgeRateValue, qreal maxPossibleSmudgeRateValue, qreal colorRateValue, qreal smudgeRadiusValue)
 
void blendInBackgroundWithDulling (KisFixedPaintDeviceSP dst, KisColorSmudgeSourceSP src, const QRect &dstRect, const KoColor &preparedDullingColor, const qreal smudgeRateOpacity)
 
void blendInBackgroundWithSmearing (KisFixedPaintDeviceSP dst, KisColorSmudgeSourceSP src, const QRect &srcRect, const QRect &dstRect, const qreal smudgeRateOpacity)
 
void initializePaintingImpl (const KoColorSpace *dstColorSpace, bool smearAlpha, const QString &colorRateCompositeOpId)
 
 KisColorSmudgeStrategyBase (bool useDullingMode)
 
const KoColorSpacepreciseColorSpace () const override
 
- Public Member Functions inherited from KisColorSmudgeStrategy
 KisColorSmudgeStrategy ()
 
virtual ~KisColorSmudgeStrategy ()=default
 

Additional Inherited Members

- Protected Attributes inherited from KisColorSmudgeStrategyWithOverlay
QScopedPointer< KisOverlayPaintDeviceWrapperm_layerOverlayDevice
 
KisFixedPaintDeviceSP m_maskDab
 
bool m_shouldPreserveMaskDab = true
 
- Protected Attributes inherited from KisColorSmudgeStrategyBase
const KoCompositeOpm_colorRateOp {nullptr}
 
KoColor m_preparedDullingColor
 
const KoCompositeOpm_smearOp {nullptr}
 
- Protected Attributes inherited from KisColorSmudgeStrategy
KisOptimizedByteArray::MemoryAllocatorSP m_memoryAllocator
 

Detailed Description

Definition at line 13 of file KisColorSmudgeStrategyMaskLegacy.h.

Constructor & Destructor Documentation

◆ KisColorSmudgeStrategyMaskLegacy()

KisColorSmudgeStrategyMaskLegacy::KisColorSmudgeStrategyMaskLegacy ( KisPainter * painter,
KisImageSP image,
bool smearAlpha,
bool useDullingMode,
bool useOverlayMode )

Definition at line 15 of file KisColorSmudgeStrategyMaskLegacy.cpp.

19 image,
20 smearAlpha,
21 useDullingMode,
22 useOverlayMode)
23{
24}
KisColorSmudgeStrategyMask(KisPainter *painter, KisImageSP image, bool smearAlpha, bool useDullingMode, bool useOverlayMode)

Member Function Documentation

◆ colorRateOpacity()

qreal KisColorSmudgeStrategyMaskLegacy::colorRateOpacity ( qreal opacity,
qreal smudgeRateValue,
qreal colorRateValue,
qreal maxPossibleSmudgeRateValue )
overridevirtual

Reimplemented from KisColorSmudgeStrategyBase.

Definition at line 55 of file KisColorSmudgeStrategyMaskLegacy.cpp.

57{
58 Q_UNUSED(smudgeRateValue);
59
60 const qreal maxColorRate = qMax<qreal>(1.0 - maxPossibleSmudgeRateValue, 0.2);
61
62 return qBound(OPACITY_TRANSPARENT_F,
63 KisAlgebra2D::lerp(0.0, maxColorRate, colorRateValue * opacity),
65}
const qreal OPACITY_OPAQUE_F
const qreal OPACITY_TRANSPARENT_F
Point lerp(const Point &pt1, const Point &pt2, qreal t)

References KisAlgebra2D::lerp(), OPACITY_OPAQUE_F, and OPACITY_TRANSPARENT_F.

◆ dullingRateOpacity()

qreal KisColorSmudgeStrategyMaskLegacy::dullingRateOpacity ( qreal opacity,
qreal smudgeRateValue )
overridevirtual

Reimplemented from KisColorSmudgeStrategyBase.

Definition at line 67 of file KisColorSmudgeStrategyMaskLegacy.cpp.

68{
69 Q_UNUSED(opacity);
70 Q_UNUSED(smudgeRateValue);
71
72 return OPACITY_OPAQUE_F;
73}

References OPACITY_OPAQUE_F.

◆ finalCompositeOp()

QString KisColorSmudgeStrategyMaskLegacy::finalCompositeOp ( bool smearAlpha) const
overridevirtual

Reimplemented from KisColorSmudgeStrategyBase.

Definition at line 43 of file KisColorSmudgeStrategyMaskLegacy.cpp.

44{
45 return smearAlpha ? COMPOSITE_COPY : COMPOSITE_OVER;
46}
const QString COMPOSITE_OVER
const QString COMPOSITE_COPY

References COMPOSITE_COPY, and COMPOSITE_OVER.

◆ finalPainterOpacity()

qreal KisColorSmudgeStrategyMaskLegacy::finalPainterOpacity ( qreal opacity,
qreal smudgeRateValue )
overridevirtual

Reimplemented from KisColorSmudgeStrategyBase.

Definition at line 48 of file KisColorSmudgeStrategyMaskLegacy.cpp.

49{
50 return qBound(OPACITY_TRANSPARENT_F,
51 smudgeRateValue * opacity,
53}

References OPACITY_OPAQUE_F, and OPACITY_TRANSPARENT_F.

◆ sampleDullingColor()

void KisColorSmudgeStrategyMaskLegacy::sampleDullingColor ( const QRect & srcRect,
qreal sampleRadiusValue,
KisColorSmudgeSourceSP sourceDevice,
KisFixedPaintDeviceSP tempFixedDevice,
KisFixedPaintDeviceSP maskDab,
KoColor * resultColor )
overridevirtual

Reimplemented from KisColorSmudgeStrategyBase.

Definition at line 26 of file KisColorSmudgeStrategyMaskLegacy.cpp.

30{
31 using namespace KisColorSmudgeSampleUtils;
32 sampleColor<AveragedSampleWrapper>(srcRect, sampleRadiusValue,
33 sourceDevice, tempFixedDevice,
34 maskDab, resultColor);
35}

◆ smearCompositeOp()

QString KisColorSmudgeStrategyMaskLegacy::smearCompositeOp ( bool smearAlpha) const
overridevirtual

Reimplemented from KisColorSmudgeStrategyBase.

Definition at line 37 of file KisColorSmudgeStrategyMaskLegacy.cpp.

38{
39 Q_UNUSED(smearAlpha);
40 return COMPOSITE_COPY;
41}

References COMPOSITE_COPY.

◆ smearRateOpacity()

qreal KisColorSmudgeStrategyMaskLegacy::smearRateOpacity ( qreal opacity,
qreal smudgeRateValue )
overridevirtual

Reimplemented from KisColorSmudgeStrategyBase.

Definition at line 75 of file KisColorSmudgeStrategyMaskLegacy.cpp.

76{
77 Q_UNUSED(opacity);
78 Q_UNUSED(smudgeRateValue);
79
80 return OPACITY_OPAQUE_F;
81}

References OPACITY_OPAQUE_F.


The documentation for this class was generated from the following files: