| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
#ifndef KISMASKEDPAINTINGSTROKEDATA_H |
| 8 |
#define KISMASKEDPAINTINGSTROKEDATA_H |
| 9 |
|
| 10 |
#include "kritaui_export.h" |
| 11 |
|
| 12 |
#include <QVector> |
| 13 |
#include <QSharedPointer> |
| 14 |
|
| 15 |
class KisFreehandStrokeInfo; |
| 16 |
class KisPaintInformation; |
| 17 |
class KisDistanceInformation; |
| 18 |
class QPointF; |
| 19 |
class QRectF; |
| 20 |
class QRect; |
| 21 |
class QPainterPath; |
| 22 |
class QPen; |
| 23 |
class KoColor; |
| 24 |
class KisRunnableStrokeJobData; |
| 25 |
|
| 26 |
class KisPaintOpPreset; |
| 27 |
typedef QSharedPointer<KisPaintOpPreset> KisPaintOpPresetSP; |
| 28 |
|
| 29 |
|
| 30 |
class KRITAUI_EXPORT KisMaskedFreehandStrokePainter |
| 31 |
{ |
| 32 |
public: |
| 33 |
KisMaskedFreehandStrokePainter(KisFreehandStrokeInfo *strokeData, KisFreehandStrokeInfo *maskData); |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
KisPaintOpPresetSP preset() const; |
| 38 |
|
| 39 |
void paintAt(const KisPaintInformation& pi); |
| 40 |
|
| 41 |
void paintLine(const KisPaintInformation &pi1, |
| 42 |
const KisPaintInformation &pi2); |
| 43 |
|
| 44 |
void paintBezierCurve(const KisPaintInformation &pi1, |
| 45 |
const QPointF &control1, |
| 46 |
const QPointF &control2, |
| 47 |
const KisPaintInformation &pi2); |
| 48 |
|
| 49 |
void paintPolyline(const QVector<QPointF> &points, |
| 50 |
int index = 0, int numPoints = -1); |
| 51 |
|
| 52 |
void paintPolygon(const QVector<QPointF> &points); |
| 53 |
void paintRect(const QRectF &rect); |
| 54 |
void paintEllipse(const QRectF &rect); |
| 55 |
void paintPainterPath(const QPainterPath& path); |
| 56 |
|
| 57 |
void drawPainterPath(const QPainterPath& path, const QPen& pen); |
| 58 |
void drawAndFillPainterPath(const QPainterPath& path, const QPen& pen, const KoColor &customColor); |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
std::pair<int, bool> doAsynchronousUpdate(QVector<KisRunnableStrokeJobData*> &jobs); |
| 63 |
bool hasDirtyRegion() const; |
| 64 |
QVector<QRect> takeDirtyRegion(); |
| 65 |
|
| 66 |
bool hasMasking() const; |
| 67 |
|
| 68 |
private: |
| 69 |
template <class Func> |
| 70 |
inline void applyToAllPainters(Func func); |
| 71 |
|
| 72 |
private: |
| 73 |
KisFreehandStrokeInfo *m_stroke = 0; |
| 74 |
KisFreehandStrokeInfo *m_mask = 0; |
| 75 |
}; |
| 76 |
|
| 77 |
#endif |