Qt 6.x
The Qt SDK
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
4#ifndef QCOSMETICSTROKER_P_H
5#define QCOSMETICSTROKER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtGui/private/qtguiglobal_p.h>
19#include <private/qdrawhelper_p.h>
20#include <private/qvectorpath_p.h>
21#include <private/qpaintengine_raster_p.h>
22#include <qpen.h>
23
25
26
28
29
30typedef bool (*StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps);
31
33{
34public:
35 struct Point {
36 int x;
37 int y;
38 };
39 struct PointF {
42 };
43
44 enum Caps {
45 NoCaps = 0,
46 CapBegin = 0x1,
47 CapEnd = 0x2
48 };
49
50 // used to avoid drop outs or duplicated points
51 enum Direction {
58 HorizontalMask = 0xc
59 };
60
61 QCosmeticStroker(QRasterPaintEngineState *s, const QRect &dr, const QRect &dr_unclipped)
62 : state(s),
63 deviceRect(dr_unclipped),
64 clip(dr),
67 patternSize(0),
70 current_span(0),
73 { setup(); }
74
76
77 void drawLine(const QPointF &p1, const QPointF &p2);
78 void drawPath(const QVectorPath &path);
79 void drawPoints(const QPoint *points, int num);
80 void drawPoints(const QPointF *points, int num);
81
82
86 // clip bounds in real
89
92
93 int *pattern;
98
99 enum { NSPANS = 255 };
103
105
108 int ppl;
109
113
114private:
115 void setup();
116
117 void renderCubic(const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4, int caps);
118 void renderCubicSubdivision(PointF *points, int level, int caps);
119 // used for closed subpaths
120 void calculateLastPoint(qreal rx1, qreal ry1, qreal rx2, qreal ry2);
121
122public:
123 bool clipLine(qreal &x1, qreal &y1, qreal &x2, qreal &y2);
124};
125
127
128#endif // QCOSMETICLINE_H
QT_FT_Span spans[NSPANS]
QCosmeticStroker(QRasterPaintEngineState *s, const QRect &dr, const QRect &dr_unclipped)
void drawPath(const QVectorPath &path)
QRasterPaintEngineState * state
bool clipLine(qreal &x1, qreal &y1, qreal &x2, qreal &y2)
void drawPoints(const QPoint *points, int num)
void drawLine(const QPointF &p1, const QPointF &p2)
\inmodule QtCore\reentrant
Definition qpoint.h:214
\inmodule QtCore\reentrant
Definition qpoint.h:23
\inmodule QtCore\reentrant
Definition qrect.h:30
QPixmap p2
QPixmap p1
[0]
Combined button and popup list for selecting options.
bool(* StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps)
QT_FT_SpanFunc ProcessSpans
GLenum GLuint GLint level
GLuint GLfloat GLfloat GLfloat GLfloat y1
GLuint GLfloat GLfloat GLfloat x1
GLfixed GLfixed GLint GLint GLfixed points
GLfixed GLfixed GLfixed y2
GLfixed GLfixed x2
GLsizei const GLchar *const * path
GLdouble s
[6]
Definition qopenglext.h:235
GLuint num
GLubyte * pattern
unsigned int uint
Definition qtypes.h:29
double qreal
Definition qtypes.h:92
QObject::connect nullptr