Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/tool/strokes/kis_color_picker_stroke_strategy.h
Context not available. | |||||
23 | #include "kis_simple_stroke_strategy.h" | 23 | #include "kis_simple_stroke_strategy.h" | ||
---|---|---|---|---|---|
24 | #include "kis_lod_transform.h" | 24 | #include "kis_lod_transform.h" | ||
25 | #include "KoColor.h" | 25 | #include "KoColor.h" | ||
26 | #include "kis_tool_utils.h" | ||||
26 | 27 | | |||
27 | class KisColorPickerStrokeStrategy : public QObject, public KisSimpleStrokeStrategy | 28 | class KisColorPickerStrokeStrategy : public QObject, public KisSimpleStrokeStrategy | ||
28 | { | 29 | { | ||
Context not available. | |||||
30 | public: | 31 | public: | ||
31 | class Data : public KisStrokeJobData { | 32 | class Data : public KisStrokeJobData { | ||
32 | public: | 33 | public: | ||
33 | Data(KisPaintDeviceSP _dev, const QPoint _pt, KoColor _currentColor) | 34 | Data(KisPaintDeviceSP _dev, KisCanvas2 *_canvas, const QPoint _pt, KoColor _currentColor, int _radius, int _mix, bool _pure) | ||
34 | : dev(_dev), pt(_pt), currentColor(_currentColor) | 35 | : dev(_dev) | ||
36 | , canvas(_canvas) | ||||
37 | , pt(_pt) | ||||
38 | , currentColor(_currentColor) | ||||
39 | , radius(_radius) | ||||
40 | , mix(_mix) | ||||
41 | , pure(_pure) | ||||
35 | {} | 42 | {} | ||
36 | 43 | | |||
37 | KisStrokeJobData* createLodClone(int levelOfDetail) override { | 44 | KisStrokeJobData* createLodClone(int levelOfDetail) override { | ||
38 | KisLodTransform t(levelOfDetail); | 45 | KisLodTransform t(levelOfDetail); | ||
39 | const QPoint realPoint = t.map(pt); | 46 | const QPoint realPoint = t.map(pt); | ||
40 | 47 | | |||
41 | return new Data(dev, realPoint, currentColor); | 48 | return new Data(dev, canvas, realPoint, currentColor, radius, mix, pure); | ||
42 | } | 49 | } | ||
43 | 50 | | |||
44 | KisPaintDeviceSP dev; | 51 | KisPaintDeviceSP dev; | ||
45 | QPoint pt; | 52 | KisCanvas2 *canvas; | ||
46 | KoColor currentColor; // Used for color picker blending. | 53 | QPoint pt; | ||
54 | KoColor currentColor; // Used for color picker mixing. | ||||
55 | int radius; | ||||
56 | int mix; | ||||
57 | bool pure; // Used for temporary bypass of radius/mixing. | ||||
47 | }; | 58 | }; | ||
48 | public: | 59 | public: | ||
49 | KisColorPickerStrokeStrategy(int lod = 0); | 60 | KisColorPickerStrokeStrategy(); | ||
50 | ~KisColorPickerStrokeStrategy() override; | 61 | ~KisColorPickerStrokeStrategy() override; | ||
51 | 62 | | |||
52 | void doStrokeCallback(KisStrokeJobData *data) override; | 63 | void doStrokeCallback(KisStrokeJobData *data) override; | ||
Context not available. |