Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_experiment_paintop.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2010-2011 Lukáš Tvrdý <lukast.dev@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KIS_EXPERIMENT_PAINTOP_H_
8#define KIS_EXPERIMENT_PAINTOP_H_
9
10#include <QPainterPath>
11
12#include <klocalizedstring.h>
14#include <kis_types.h>
15
18
19#include <kis_painter.h>
20
21class QPointF;
22class KisPainter;
23class KisRegion;
24
26{
27
28public:
29
31 ~KisExperimentPaintOp() override;
32
33 void paintLine(const KisPaintInformation& pi1, const KisPaintInformation& pi2, KisDistanceInformation *currentDistance) override;
34
35protected:
37
39
40private:
41 void paintRegion(const KisRegion &changedRegion);
43 const KisPaintInformation& pi2);
44
45
46 static qreal simplifyThreshold(const QRectF &bounds);
47 static QPointF getAngle(const QPointF& p1, const QPointF& p2, qreal distance);
48 static QPainterPath applyDisplace(const QPainterPath& path, int speed);
49
50
51 bool m_displaceEnabled {false};
53 QPainterPath m_lastPaintedPath;
54
55 bool m_windingFill {false};
56 bool m_hardEdge {false};
57
58 bool m_speedEnabled {false};
60 qreal m_savedSpeedCoeff {1.0};
62
63 bool m_smoothingEnabled {false};
67
71
72 bool m_firstRun {true};
73 QPointF m_center;
74
75 QPainterPath m_path;
77
78 bool m_useMirroring {false};
81
83};
84
85#endif // KIS_EXPERIMENT_PAINTOP_H_
QPointF p2
QPointF p1
qreal distance(const QPointF &p1, const QPointF &p2)
void paintLine(const KisPaintInformation &pi1, const KisPaintInformation &pi2, KisDistanceInformation *currentDistance) override
KisPaintDeviceSP m_originalDevice
KisSpacingInformation paintAt(const KisPaintInformation &info) override
QVector< QPointF > m_savedPoints
KisPainter::FillStyle m_fillStyle
QPointF speedCorrectedPosition(const KisPaintInformation &pi1, const KisPaintInformation &pi2)
KisExperimentPaintOp(const KisPaintOpSettingsSP settings, KisPainter *painter, KisNodeSP node, KisImageSP image)
static qreal simplifyThreshold(const QRectF &bounds)
KisExperimentOpOptionData m_experimentOption
void paintRegion(const KisRegion &changedRegion)
KisSpacingInformation updateSpacingImpl(const KisPaintInformation &info) const override
static QPointF getAngle(const QPointF &p1, const QPointF &p2, qreal distance)
static QPainterPath applyDisplace(const QPainterPath &path, int speed)
FillStyle
This enum contains the styles with which we can fill things like polygons and ellipses.
#define bounds(x, a, b)
KisPainter * painter