Krita Source Code Documentation
Loading...
Searching...
No Matches
hatching_brush.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2008, 2009 Lukáš Tvrdý <lukast.dev@gmail.com>
3 * SPDX-FileCopyrightText: 2010 José Luis Vergara <pentalis@gmail.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
8#ifndef HATCHING_BRUSH_H_
9#define HATCHING_BRUSH_H_
10
11#include <KoColor.h>
12
14
15#include <kis_painter.h>
16#include <kis_paint_device.h>
18
19
21{
22
23public:
27
31 void hatch(KisPaintDeviceSP dev, qreal x, qreal y, double width, double height, double givenAngle, const KoColor &color, qreal additionalScale);
32
33
34private:
35 void init();
37 int m_counter {0};
38 int m_radius {0};
41
43 int thickness {0};
44
46 double angle {0.0};
47
49 double separation {0.0};
50
52 double height_ {0.0};
53
55 double width_ {0.0};
56
58 double origin_x {0.0};
59
61 double origin_y {0.0};
62
65
70 double hotIntercept {0};
71
73 double scanIntercept {0};
74
79 double verticalHotX {0.0};
80
82 double verticalScanX {0.0};
83
85 double slope {0};
86
88 double dx {0};
89
91 double dy {0};
92
97
102 void iterateLines(bool forward, int lineindex, bool oneline);
103
110 void iterateVerticalLines(bool forward, int lineindex, bool oneline);
111
118 double separationAsFunctionOfParameter(double parameter, double separation, int numintervals);
119};
120
121#endif
double baseLineIntercept
HatchingBrush(KisHatchingPaintOpSettingsSP settings)
void iterateLines(bool forward, int lineindex, bool oneline)
KisHatchingPaintOpSettingsSP m_settings
void iterateVerticalLines(bool forward, int lineindex, bool oneline)
double cursorLineIntercept
KisPainter m_painter
HatchingBrush(KoColor inkColor)
void hatch(KisPaintDeviceSP dev, qreal x, qreal y, double width, double height, double givenAngle, const KoColor &color, qreal additionalScale)
double separationAsFunctionOfParameter(double parameter, double separation, int numintervals)