Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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
26
27
29
30
31typedef bool (*StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps);
32
34{
35public:
36 struct Point {
37 int x;
38 int y;
39 };
40 struct PointF {
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
61
62 QCosmeticStroker(QRasterPaintEngineState *s, const QRect &dr, const QRect &dr_unclipped)
63 : state(s),
65 clip(dr),
66 pattern(nullptr),
67 reversePattern(nullptr),
68 patternSize(0),
71 current_span(0),
73 lastAxisAligned(false)
74 { setup(); }
75
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
87 // clip bounds in real
90
93
94 int *pattern;
99
100 enum { NSPANS = 255 };
104
106
109 int ppl;
110
114
115private:
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
123public:
124 bool clipLine(qreal &x1, qreal &y1, qreal &x2, qreal &y2);
125};
126
127QT_END_NAMESPACE
128
129#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)
Combined button and popup list for selecting options.
static const QPainterPath::ElementType * subPath(const QPainterPath::ElementType *t, const QPainterPath::ElementType *end, const qreal *points, bool *closed)
static bool drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps)
static StrokeLine strokeLine(int strokeSelection)
StrokeSelection
@ AntiAliased
@ RegularDraw
QT_BEGIN_NAMESPACE typedef int FDot16
void drawPixelARGB32Opaque(QCosmeticStroker *stroker, int x, int y, int)
static void capAdjust(int caps, int &x1, int &x2, FDot16 &y, FDot16 yinc)
static uint sourceOver(uint d, uint color)
void drawPixel(QCosmeticStroker *stroker, int x, int y, int coverage)
#define toF26Dot6(x)
static int swapCaps(int caps)
void drawPixelARGB32(QCosmeticStroker *stroker, int x, int y, int coverage)
void(* DrawPixel)(QCosmeticStroker *stroker, int x, int y, int coverage)
static bool drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps)
static FDot16 FDot16FixedDiv(int x, int y)
static void splitCubic(QCosmeticStroker::PointF *points)
bool(* StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps)