Krita Source Code Documentation
Loading...
Searching...
No Matches
KisToolFreehandHelper::Private Struct Reference

Public Member Functions

qreal effectiveSmoothnessDistance (qreal speed) const
 
bool isTentativePixel (const QPoint &currentPixelPos) const
 

Static Public Member Functions

static void setPaintInfoPixelPos (KisPaintInformation &info, const QPoint &pixelPos)
 
static QPoint toPixelPos (const QPointF &pos)
 

Public Attributes

QTimer airbrushingTimer
 
KisAsynchronousStrokeUpdateHelper asyncUpdateHelper
 
QList< qreal > distanceHistory
 
KisRandomSourceSP fakeDabRandomSource
 
KisPerStrokeRandomSourceSP fakeStrokeRandomSource
 
bool hasLastDrawnPixel
 
bool hasPaintAtLeastOnce
 
bool hasTentativePixel
 
bool haveTangent
 
QList< KisPaintInformationhistory
 
KisPaintingInformationBuilderinfoBuilder
 
KisPaintOpUtils::PositionHistory lastCursorPos
 
QPoint lastDrawnPixel
 
KisPaintInformation olderPaintInformation
 
KisPaintInformation previousPaintInformation
 
QPointF previousTangent
 
KoCanvasResourceProviderresourceManager
 
KisResourcesSnapshotSP resources
 
KisSmoothingOptionsSP smoothingOptions
 
KisStabilizedEventsSampler stabilizedSampler
 
KisStabilizerDelayedPaintHelper stabilizerDelayedPaintHelper
 
QQueue< KisPaintInformationstabilizerDeque
 
QTimer stabilizerPollTimer
 
KisStrokeId strokeId
 
QVector< KisFreehandStrokeInfo * > strokeInfos
 
KisStrokesFacadestrokesFacade
 
QElapsedTimer strokeTime
 
QTimer strokeTimeoutTimer
 
KisPaintInformation tentativePaintInformation
 
QPoint tentativePixel
 
KUndo2MagicString transactionText
 
bool usingStabilizer
 

Detailed Description

Definition at line 57 of file kis_tool_freehand_helper.cpp.

Member Function Documentation

◆ effectiveSmoothnessDistance()

qreal KisToolFreehandHelper::Private::effectiveSmoothnessDistance ( qreal speed) const

stabilizer has inverted meaning of the "scalable distance", because it measures "samples", but not "distance"

Definition at line 465 of file kis_tool_freehand_helper.cpp.

466{
467 qreal zoomingCoeff = 1.0;
468
471
472 if ((smoothingOptions->smoothingType() == KisSmoothingOptions::STABILIZER) ^
473 smoothingOptions->useScalableDistance()) {
474
475 zoomingCoeff = 1.0 / resources->effectiveZoom();
476 }
477
478 return zoomingCoeff * ((1.0 - speed) * smoothingOptions->smoothnessDistanceMax() + speed * smoothingOptions->smoothnessDistanceMin());
479}

References KisResourcesSnapshot::effectiveZoom(), resources, smoothingOptions, and KisSmoothingOptions::STABILIZER.

◆ isTentativePixel()

bool KisToolFreehandHelper::Private::isTentativePixel ( const QPoint & currentPixelPos) const
inline

Definition at line 116 of file kis_tool_freehand_helper.cpp.

117 {
118 return abs(currentPixelPos.x() - lastDrawnPixel.x()) <= 1 && abs(currentPixelPos.y() - lastDrawnPixel.y()) <= 1;
119 }
Point abs(const Point &pt)

References lastDrawnPixel.

◆ setPaintInfoPixelPos()

static void KisToolFreehandHelper::Private::setPaintInfoPixelPos ( KisPaintInformation & info,
const QPoint & pixelPos )
inlinestatic

Definition at line 128 of file kis_tool_freehand_helper.cpp.

129 {
130 // Offset the position to the center of the pixel.
131 info.setPos(QPointF(qreal(pixelPos.x()) + 0.5, qreal(pixelPos.y()) + 0.5));
132 }
void setPos(const QPointF &p)

References KisPaintInformation::setPos().

◆ toPixelPos()

static QPoint KisToolFreehandHelper::Private::toPixelPos ( const QPointF & pos)
inlinestatic

Definition at line 121 of file kis_tool_freehand_helper.cpp.

122 {
123 // Don't replace this with QPointF::toPoint, that rounds! Flooring is
124 // the correct operation here.
125 return QPoint(qFloor(pos.x()), qFloor(pos.y()));
126 }

Member Data Documentation

◆ airbrushingTimer

QTimer KisToolFreehandHelper::Private::airbrushingTimer

Definition at line 98 of file kis_tool_freehand_helper.cpp.

◆ asyncUpdateHelper

KisAsynchronousStrokeUpdateHelper KisToolFreehandHelper::Private::asyncUpdateHelper

Definition at line 62 of file kis_tool_freehand_helper.cpp.

◆ distanceHistory

QList<qreal> KisToolFreehandHelper::Private::distanceHistory

Definition at line 101 of file kis_tool_freehand_helper.cpp.

◆ fakeDabRandomSource

KisRandomSourceSP KisToolFreehandHelper::Private::fakeDabRandomSource

Definition at line 92 of file kis_tool_freehand_helper.cpp.

◆ fakeStrokeRandomSource

KisPerStrokeRandomSourceSP KisToolFreehandHelper::Private::fakeStrokeRandomSource

Definition at line 93 of file kis_tool_freehand_helper.cpp.

◆ hasLastDrawnPixel

bool KisToolFreehandHelper::Private::hasLastDrawnPixel

Definition at line 86 of file kis_tool_freehand_helper.cpp.

◆ hasPaintAtLeastOnce

bool KisToolFreehandHelper::Private::hasPaintAtLeastOnce

Definition at line 69 of file kis_tool_freehand_helper.cpp.

◆ hasTentativePixel

bool KisToolFreehandHelper::Private::hasTentativePixel

Definition at line 87 of file kis_tool_freehand_helper.cpp.

◆ haveTangent

bool KisToolFreehandHelper::Private::haveTangent

Definition at line 66 of file kis_tool_freehand_helper.cpp.

◆ history

QList<KisPaintInformation> KisToolFreehandHelper::Private::history

Definition at line 100 of file kis_tool_freehand_helper.cpp.

◆ infoBuilder

KisPaintingInformationBuilder* KisToolFreehandHelper::Private::infoBuilder

Definition at line 60 of file kis_tool_freehand_helper.cpp.

◆ lastCursorPos

KisPaintOpUtils::PositionHistory KisToolFreehandHelper::Private::lastCursorPos

Definition at line 105 of file kis_tool_freehand_helper.cpp.

◆ lastDrawnPixel

QPoint KisToolFreehandHelper::Private::lastDrawnPixel

Definition at line 84 of file kis_tool_freehand_helper.cpp.

◆ olderPaintInformation

KisPaintInformation KisToolFreehandHelper::Private::olderPaintInformation

Definition at line 80 of file kis_tool_freehand_helper.cpp.

◆ previousPaintInformation

KisPaintInformation KisToolFreehandHelper::Private::previousPaintInformation

Definition at line 78 of file kis_tool_freehand_helper.cpp.

◆ previousTangent

QPointF KisToolFreehandHelper::Private::previousTangent

Definition at line 67 of file kis_tool_freehand_helper.cpp.

◆ resourceManager

KoCanvasResourceProvider* KisToolFreehandHelper::Private::resourceManager

Definition at line 59 of file kis_tool_freehand_helper.cpp.

◆ resources

KisResourcesSnapshotSP KisToolFreehandHelper::Private::resources

Definition at line 75 of file kis_tool_freehand_helper.cpp.

◆ smoothingOptions

KisSmoothingOptionsSP KisToolFreehandHelper::Private::smoothingOptions

Definition at line 89 of file kis_tool_freehand_helper.cpp.

◆ stabilizedSampler

KisStabilizedEventsSampler KisToolFreehandHelper::Private::stabilizedSampler

Definition at line 111 of file kis_tool_freehand_helper.cpp.

◆ stabilizerDelayedPaintHelper

KisStabilizerDelayedPaintHelper KisToolFreehandHelper::Private::stabilizerDelayedPaintHelper

Definition at line 112 of file kis_tool_freehand_helper.cpp.

◆ stabilizerDeque

QQueue<KisPaintInformation> KisToolFreehandHelper::Private::stabilizerDeque

Definition at line 109 of file kis_tool_freehand_helper.cpp.

◆ stabilizerPollTimer

QTimer KisToolFreehandHelper::Private::stabilizerPollTimer

Definition at line 110 of file kis_tool_freehand_helper.cpp.

◆ strokeId

KisStrokeId KisToolFreehandHelper::Private::strokeId

Definition at line 76 of file kis_tool_freehand_helper.cpp.

◆ strokeInfos

QVector<KisFreehandStrokeInfo*> KisToolFreehandHelper::Private::strokeInfos

Definition at line 74 of file kis_tool_freehand_helper.cpp.

◆ strokesFacade

KisStrokesFacade* KisToolFreehandHelper::Private::strokesFacade

Definition at line 61 of file kis_tool_freehand_helper.cpp.

◆ strokeTime

QElapsedTimer KisToolFreehandHelper::Private::strokeTime

Definition at line 71 of file kis_tool_freehand_helper.cpp.

◆ strokeTimeoutTimer

QTimer KisToolFreehandHelper::Private::strokeTimeoutTimer

Definition at line 72 of file kis_tool_freehand_helper.cpp.

◆ tentativePaintInformation

KisPaintInformation KisToolFreehandHelper::Private::tentativePaintInformation

Definition at line 82 of file kis_tool_freehand_helper.cpp.

◆ tentativePixel

QPoint KisToolFreehandHelper::Private::tentativePixel

Definition at line 85 of file kis_tool_freehand_helper.cpp.

◆ transactionText

KUndo2MagicString KisToolFreehandHelper::Private::transactionText

Definition at line 64 of file kis_tool_freehand_helper.cpp.

◆ usingStabilizer

bool KisToolFreehandHelper::Private::usingStabilizer

Definition at line 108 of file kis_tool_freehand_helper.cpp.


The documentation for this struct was generated from the following file: