Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qcosmeticstroker_p.h
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
ifndef
QCOSMETICSTROKER_P_H
6
#
define
QCOSMETICSTROKER_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
<
QtGui
/
private
/
qtguiglobal_p
.
h
>
20
#
include
<
private
/
qdrawhelper_p
.
h
>
21
#
include
<
private
/
qvectorpath_p
.
h
>
22
#
include
<
private
/
qpaintengine_raster_p
.
h
>
23
#
include
<
qpen
.
h
>
24
25
QT_BEGIN_NAMESPACE
26
27
28
class
QCosmeticStroker
;
29
30
31
typedef
bool
(*
StrokeLine
)(
QCosmeticStroker
*stroker, qreal x1, qreal y1, qreal x2, qreal y2,
int
caps);
32
33
class
QCosmeticStroker
34
{
35
public
:
36
struct
Point
{
37
int
x
;
38
int
y
;
39
};
40
struct
PointF
{
41
qreal
x
;
42
qreal
y
;
43
};
44
45
enum
Caps
{
46
NoCaps
= 0,
47
CapBegin
= 0x1,
48
CapEnd
= 0x2
49
};
50
51
// used to avoid drop outs or duplicated points
52
enum
Direction
{
53
NoDirection
= 0,
54
TopToBottom
= 0x1,
55
BottomToTop
= 0x2,
56
LeftToRight
= 0x4,
57
RightToLeft
= 0x8,
58
VerticalMask
= 0x3,
59
HorizontalMask
= 0xc
60
};
61
62
QCosmeticStroker
(QRasterPaintEngineState *s,
const
QRect &dr,
const
QRect &dr_unclipped)
63
:
state
(
s
),
64
deviceRect
(
dr_unclipped
),
65
clip
(
dr
),
66
pattern
(
nullptr
),
67
reversePattern
(
nullptr
),
68
patternSize
(0),
69
patternLength
(0),
70
patternOffset
(0),
71
current_span
(0),
72
lastDir
(
NoDirection
),
73
lastAxisAligned
(
false
)
74
{ setup(); }
75
76
~
QCosmeticStroker
() { free(
pattern
); free(
reversePattern
); }
77
78
void
drawLine
(
const
QPointF &p1,
const
QPointF &p2);
79
void
drawPath
(
const
QVectorPath &path);
80
void
drawPoints
(
const
QPoint *points,
int
num);
81
void
drawPoints
(
const
QPointF *points,
int
num);
82
83
84
QRasterPaintEngineState
*
state
;
85
QRect
deviceRect
;
86
QRect
clip
;
87
// clip bounds in real
88
qreal
xmin
,
xmax
;
89
qreal
ymin
,
ymax
;
90
91
StrokeLine
stroke
;
92
bool
drawCaps
;
93
94
int
*
pattern
;
95
int
*
reversePattern
;
96
int
patternSize
;
97
int
patternLength
;
98
int
patternOffset
;
99
100
enum
{
NSPANS
= 255 };
101
QT_FT_Span
spans
[
NSPANS
];
102
int
current_span
;
103
ProcessSpans
blend
;
104
105
int
opacity
;
106
107
uint
color
;
108
uint
*
pixels
;
109
int
ppl
;
110
111
Direction
lastDir
;
112
Point
lastPixel
;
113
bool
lastAxisAligned
;
114
115
private
:
116
void
setup();
117
118
void
renderCubic(
const
QPointF &p1,
const
QPointF &p2,
const
QPointF &p3,
const
QPointF &p4,
int
caps);
119
void
renderCubicSubdivision(
PointF
*points,
int
level,
int
caps);
120
// used for closed subpaths
121
void
calculateLastPoint(qreal rx1, qreal ry1, qreal rx2, qreal ry2);
122
123
public
:
124
bool
clipLine
(qreal &x1, qreal &y1, qreal &x2, qreal &y2);
125
};
126
127
QT_END_NAMESPACE
128
129
#
endif
// QCOSMETICLINE_H
QCosmeticStroker
Definition
qcosmeticstroker_p.h:34
QCosmeticStroker::spans
QT_FT_Span spans[NSPANS]
Definition
qcosmeticstroker_p.h:101
QCosmeticStroker::xmin
qreal xmin
Definition
qcosmeticstroker_p.h:88
QCosmeticStroker::lastPixel
Point lastPixel
Definition
qcosmeticstroker_p.h:112
QCosmeticStroker::reversePattern
int * reversePattern
Definition
qcosmeticstroker_p.h:95
QCosmeticStroker::ppl
int ppl
Definition
qcosmeticstroker_p.h:109
QCosmeticStroker::ymin
qreal ymin
Definition
qcosmeticstroker_p.h:89
QCosmeticStroker::QCosmeticStroker
QCosmeticStroker(QRasterPaintEngineState *s, const QRect &dr, const QRect &dr_unclipped)
Definition
qcosmeticstroker_p.h:62
QCosmeticStroker::Caps
Caps
Definition
qcosmeticstroker_p.h:45
QCosmeticStroker::NoCaps
@ NoCaps
Definition
qcosmeticstroker_p.h:46
QCosmeticStroker::CapEnd
@ CapEnd
Definition
qcosmeticstroker_p.h:48
QCosmeticStroker::CapBegin
@ CapBegin
Definition
qcosmeticstroker_p.h:47
QCosmeticStroker::current_span
int current_span
Definition
qcosmeticstroker_p.h:102
QCosmeticStroker::opacity
int opacity
Definition
qcosmeticstroker_p.h:105
QCosmeticStroker::drawPath
void drawPath(const QVectorPath &path)
Definition
qcosmeticstroker.cpp:508
QCosmeticStroker::state
QRasterPaintEngineState * state
Definition
qcosmeticstroker_p.h:84
QCosmeticStroker::deviceRect
QRect deviceRect
Definition
qcosmeticstroker_p.h:85
QCosmeticStroker::pixels
uint * pixels
Definition
qcosmeticstroker_p.h:108
QCosmeticStroker::lastAxisAligned
bool lastAxisAligned
Definition
qcosmeticstroker_p.h:113
QCosmeticStroker::xmax
qreal xmax
Definition
qcosmeticstroker_p.h:88
QCosmeticStroker::patternSize
int patternSize
Definition
qcosmeticstroker_p.h:96
QCosmeticStroker::color
uint color
Definition
qcosmeticstroker_p.h:107
QCosmeticStroker::patternOffset
int patternOffset
Definition
qcosmeticstroker_p.h:98
QCosmeticStroker::drawCaps
bool drawCaps
Definition
qcosmeticstroker_p.h:92
QCosmeticStroker::~QCosmeticStroker
~QCosmeticStroker()
Definition
qcosmeticstroker_p.h:76
QCosmeticStroker::Direction
Direction
Definition
qcosmeticstroker_p.h:52
QCosmeticStroker::TopToBottom
@ TopToBottom
Definition
qcosmeticstroker_p.h:54
QCosmeticStroker::LeftToRight
@ LeftToRight
Definition
qcosmeticstroker_p.h:56
QCosmeticStroker::HorizontalMask
@ HorizontalMask
Definition
qcosmeticstroker_p.h:59
QCosmeticStroker::BottomToTop
@ BottomToTop
Definition
qcosmeticstroker_p.h:55
QCosmeticStroker::NoDirection
@ NoDirection
Definition
qcosmeticstroker_p.h:53
QCosmeticStroker::RightToLeft
@ RightToLeft
Definition
qcosmeticstroker_p.h:57
QCosmeticStroker::VerticalMask
@ VerticalMask
Definition
qcosmeticstroker_p.h:58
QCosmeticStroker::clipLine
bool clipLine(qreal &x1, qreal &y1, qreal &x2, qreal &y2)
Definition
qcosmeticstroker.cpp:298
QCosmeticStroker::clip
QRect clip
Definition
qcosmeticstroker_p.h:86
QCosmeticStroker::pattern
int * pattern
Definition
qcosmeticstroker_p.h:94
QCosmeticStroker::blend
ProcessSpans blend
Definition
qcosmeticstroker_p.h:103
QCosmeticStroker::drawPoints
void drawPoints(const QPoint *points, int num)
Definition
qcosmeticstroker.cpp:374
QCosmeticStroker::ymax
qreal ymax
Definition
qcosmeticstroker_p.h:89
QCosmeticStroker::stroke
StrokeLine stroke
Definition
qcosmeticstroker_p.h:91
QCosmeticStroker::NSPANS
@ NSPANS
Definition
qcosmeticstroker_p.h:100
QCosmeticStroker::patternLength
int patternLength
Definition
qcosmeticstroker_p.h:97
QCosmeticStroker::lastDir
Direction lastDir
Definition
qcosmeticstroker_p.h:111
QCosmeticStroker::drawLine
void drawLine(const QPointF &p1, const QPointF &p2)
Definition
qcosmeticstroker.cpp:354
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
subPath
static const QPainterPath::ElementType * subPath(const QPainterPath::ElementType *t, const QPainterPath::ElementType *end, const qreal *points, bool *closed)
Definition
qcosmeticstroker.cpp:488
drawLineAA
static bool drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps)
Definition
qcosmeticstroker.cpp:923
strokeLine
static StrokeLine strokeLine(int strokeSelection)
Definition
qcosmeticstroker.cpp:180
StrokeSelection
StrokeSelection
Definition
qcosmeticstroker.cpp:171
Dashed
@ Dashed
Definition
qcosmeticstroker.cpp:175
AntiAliased
@ AntiAliased
Definition
qcosmeticstroker.cpp:173
RegularDraw
@ RegularDraw
Definition
qcosmeticstroker.cpp:176
Aliased
@ Aliased
Definition
qcosmeticstroker.cpp:172
Solid
@ Solid
Definition
qcosmeticstroker.cpp:174
FastDraw
@ FastDraw
Definition
qcosmeticstroker.cpp:177
FDot16
QT_BEGIN_NAMESPACE typedef int FDot16
Definition
qcosmeticstroker.cpp:29
drawPixelARGB32Opaque
void drawPixelARGB32Opaque(QCosmeticStroker *stroker, int x, int y, int)
Definition
qcosmeticstroker.cpp:161
capAdjust
static void capAdjust(int caps, int &x1, int &x2, FDot16 &y, FDot16 yinc)
Definition
qcosmeticstroker.cpp:705
sourceOver
static uint sourceOver(uint d, uint color)
Definition
qcosmeticstroker.cpp:34
drawPixel
void drawPixel(QCosmeticStroker *stroker, int x, int y, int coverage)
Definition
qcosmeticstroker.cpp:119
toF26Dot6
#define toF26Dot6(x)
Definition
qcosmeticstroker.cpp:32
swapCaps
static int swapCaps(int caps)
Definition
qcosmeticstroker.cpp:698
drawPixelARGB32
void drawPixelARGB32(QCosmeticStroker *stroker, int x, int y, int coverage)
Definition
qcosmeticstroker.cpp:150
DrawPixel
void(*) DrawPixel(QCosmeticStroker *stroker, int x, int y, int coverage)
Definition
qcosmeticstroker.cpp:50
drawLine
static bool drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps)
Definition
qcosmeticstroker.cpp:721
FDot16FixedDiv
static FDot16 FDot16FixedDiv(int x, int y)
Definition
qcosmeticstroker.cpp:39
splitCubic
static void splitCubic(QCosmeticStroker::PointF *points)
Definition
qcosmeticstroker.cpp:651
StrokeLine
bool(*) StrokeLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps)
Definition
qcosmeticstroker_p.h:31
QCosmeticStroker::PointF
Definition
qcosmeticstroker_p.h:40
QCosmeticStroker::PointF::y
qreal y
Definition
qcosmeticstroker_p.h:42
QCosmeticStroker::PointF::x
qreal x
Definition
qcosmeticstroker_p.h:41
QCosmeticStroker::Point
Definition
qcosmeticstroker_p.h:36
QCosmeticStroker::Point::x
int x
Definition
qcosmeticstroker_p.h:37
QCosmeticStroker::Point::y
int y
Definition
qcosmeticstroker_p.h:38
qtbase
src
gui
painting
qcosmeticstroker_p.h
Generated on
for Qt by
1.18.0