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
qcolrpaintgraphrenderer_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 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 QCOLRPAINTGRAPHRENDERER_P_H
5#define QCOLRPAINTGRAPHRENDERER_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/qpainter.h>
19#include <QtGui/qpainterpath.h>
20#include <private/qfontengine_p.h>
21
22QT_BEGIN_NAMESPACE
23
24class QColrPaintGraphRenderer
25{
26public:
27 ~QColrPaintGraphRenderer();
28
29 void setBoundingRect(QRectF boundingRect) { m_boundingRect = boundingRect; }
30 QRectF boundingRect() const { return m_boundingRect; }
31
32 QTransform currentTransform() const { return m_currentTransform; }
33 QPainterPath currentPath() const { return m_currentPath; }
34
35 void save();
36 void restore();
37
38 void appendPath(const QPainterPath &path);
39 void setPath(const QPainterPath &path);
40
41 void prependTransform(const QTransform &transform);
42
43 void setSolidColor(QColor color);
44 void setRadialGradient(QPointF c0, qreal r0,
45 QPointF c1, qreal r1,
46 QGradient::Spread spread,
47 const QGradientStops &gradientStops);
48 void setLinearGradient(QPointF p0, QPointF p1, QPointF p2,
49 QGradient::Spread spread,
50 const QGradientStops &gradientStops);
51 void setConicalGradient(QPointF center,
52 qreal startAngle,
53 qreal endAngle,
54 QGradient::Spread spread,
55 const QGradientStops &gradientStops);
56 void setCompositionMode(QPainter::CompositionMode mode);
57
58 void drawCurrentPath();
59 void drawImage(const QImage &image);
60
61 void setClip(QRect rect);
62
63 void beginCalculateBoundingBox();
64 void beginRender(qreal pixelSizeScale, const QTransform &transform);
65 QImage endRender();
66 bool isRendering() const { return m_painter != nullptr; }
67
68private:
69 QImage m_image;
70 QPainter *m_painter = nullptr;
71 QTransform m_currentTransform;
72 QRectF m_boundingRect;
73 QPainterPath m_currentPath;
74
75 QList<QPainterPath> m_oldPaths;
76 QList<QTransform> m_oldTransforms;
77};
78
80
81#endif // QCOLRPAINTGRAPHRENDERER_P_H