|
Krita Source Code Documentation
|
#include <hatching_brush.h>
Public Member Functions | |
| void | hatch (KisPaintDeviceSP dev, qreal x, qreal y, double width, double height, double givenAngle, const KoColor &color, qreal additionalScale) |
| HatchingBrush (KisHatchingPaintOpSettingsSP settings) | |
| HatchingBrush (KoColor inkColor) | |
| ~HatchingBrush () | |
Private Member Functions | |
| void | init () |
| void | iterateLines (bool forward, int lineindex, bool oneline) |
| void | iterateVerticalLines (bool forward, int lineindex, bool oneline) |
| double | separationAsFunctionOfParameter (double parameter, double separation, int numintervals) |
Private Attributes | |
| double | angle {0.0} |
| double | baseLineIntercept {0} |
| double | cursorLineIntercept {0} |
| double | dx {0} |
| double | dy {0} |
| double | height_ {0.0} |
| double | hotIntercept {0} |
| int | m_counter {0} |
| KoColor | m_inkColor |
| KisPainter | m_painter |
| int | m_radius {0} |
| KisHatchingPaintOpSettingsSP | m_settings |
| double | origin_x {0.0} |
| double | origin_y {0.0} |
| double | scanIntercept {0} |
| double | separation {0.0} |
| double | slope {0} |
| int | thickness {0} |
| double | verticalHotX {0.0} |
| double | verticalScanX {0.0} |
| double | width_ {0.0} |
Definition at line 20 of file hatching_brush.h.
| HatchingBrush::HatchingBrush | ( | KisHatchingPaintOpSettingsSP | settings | ) |
Definition at line 25 of file hatching_brush.cpp.
| HatchingBrush::~HatchingBrush | ( | ) |
Definition at line 34 of file hatching_brush.cpp.
| HatchingBrush::HatchingBrush | ( | KoColor | inkColor | ) |
| void HatchingBrush::hatch | ( | KisPaintDeviceSP | dev, |
| qreal | x, | ||
| qreal | y, | ||
| double | width, | ||
| double | height, | ||
| double | givenAngle, | ||
| const KoColor & | color, | ||
| qreal | additionalScale ) |
Performs a single hatching pass according to specifications
Definition at line 42 of file hatching_brush.cpp.
References angle, baseLineIntercept, KisPainter::begin(), cursorLineIntercept, dy, KisHatchingPaintOpSettings::enabledcurveseparation, KisPainter::FillStyleForegroundColor, height_, hotIntercept, iterateLines(), iterateVerticalLines(), m_painter, M_PI, m_settings, origin_x, origin_y, separation, KisHatchingPaintOpSettings::separation, separationAsFunctionOfParameter(), KisHatchingPaintOpSettings::separationintervals, KisHatchingPaintOpSettings::separationsensorvalue, KisPainter::setBackgroundColor(), KisPainter::setFillStyle(), KisPainter::setMaskImageSize(), KisPainter::setPaintColor(), slope, KisHatchingPaintOpSettings::subpixelprecision, thickness, KisHatchingPaintOpSettings::thickness, KisHatchingPaintOpSettings::thicknesssensorvalue, verticalHotX, and width_.
|
private |
Definition at line 38 of file hatching_brush.cpp.
|
private |
Function that begins exploring the field from hotIntercept and moves in the direction of dy (forward==true) or -dy (forward==false) to draw all the lines it finds to KisPaintDeviceSP 'dev'
Definition at line 93 of file hatching_brush.cpp.
References A, KisHatchingPaintOpSettings::antialias, B, KisPainter::drawLine(), KisPainter::drawThickLine(), dy, height_, hotIntercept, m_painter, m_settings, myround(), scanIntercept, slope, KisHatchingPaintOpSettings::subpixelprecision, thickness, and width_.
|
private |
Function that begins exploring the field from verticalHotX and moves in the direction of separation (forward==true) or -separation (forward==false) to draw all the lines it finds to KisPaintDeviceSP 'dev'. This function should only be called when (angle == 90) or (angle == -90)
Definition at line 192 of file hatching_brush.cpp.
References A, KisHatchingPaintOpSettings::antialias, B, KisPainter::drawLine(), KisPainter::drawThickLine(), height_, m_painter, m_settings, myround(), separation, KisHatchingPaintOpSettings::subpixelprecision, thickness, verticalHotX, verticalScanX, and width_.
|
private |
Simple function that returns a new distance equal to a multiple or divisor of separation depending on the magnitude of 'parameter' and the number of intervals of its magnitude. The multiples and divisors used are all powers of 2 to prevent desynchronization of the lines during drawing.
Definition at line 246 of file hatching_brush.cpp.
References dbgKrita, and separation.
|
private |
Angle in degrees of all the lines in a single hatching pass
Definition at line 46 of file hatching_brush.h.
|
private |
|
private |
Intercept of the line that extends from the mouse cursor position, calculated from the point (x, y) of the cursor and 'slope'
Definition at line 96 of file hatching_brush.h.
|
private |
Unused variable, distance separating non-vertical lines in the X axis
Definition at line 88 of file hatching_brush.h.
|
private |
Distance separating non-vertical lines in the Y axis
Definition at line 91 of file hatching_brush.h.
|
private |
Height of the imaginary square to be hatched, the "hatching area"
Definition at line 52 of file hatching_brush.h.
|
private |
Intercept of the first line found to pass or be neighbour of a line that passes through the hatching area, this line is used as a base to start iterating with HatchingBrush::iterateLines()
Definition at line 70 of file hatching_brush.h.
|
private |
Definition at line 37 of file hatching_brush.h.
|
private |
Definition at line 36 of file hatching_brush.h.
|
private |
Definition at line 40 of file hatching_brush.h.
|
private |
Definition at line 38 of file hatching_brush.h.
|
private |
Definition at line 39 of file hatching_brush.h.
|
private |
X coordinate of the point that determines the base line
Definition at line 58 of file hatching_brush.h.
|
private |
Y coordinate of the point that determines the base line
Definition at line 61 of file hatching_brush.h.
|
private |
Intercept of each line as it is scanned, this value changes constantly
Definition at line 73 of file hatching_brush.h.
|
private |
Distance separating one line from the other, in pixels
Definition at line 49 of file hatching_brush.h.
|
private |
Angle of the lines expressed algebraically, as in slope*x + intercept = y
Definition at line 85 of file hatching_brush.h.
|
private |
|
private |
X position of the first vertical line found to pass or be neighbour of a line that passes through the hatching area, this line is used as a base to start iterating with HatchingBrush::iterateVerticalLines()
Definition at line 79 of file hatching_brush.h.
|
private |
X position of the vertical lines as they are scanned, this value changes constantly
Definition at line 82 of file hatching_brush.h.
|
private |
Width of the imaginary square to be hatched, the "hatching area"
Definition at line 55 of file hatching_brush.h.