Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qpaintengine_alpha_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 QPAINTENGINE_ALPHA_P_H
5#define QPAINTENGINE_ALPHA_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 for the convenience
12// of other Qt classes. 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 <QtPrintSupport/private/qtprintsupportglobal_p.h>
19
20#ifndef QT_NO_PRINTER
21#include "private/qpaintengine_p.h"
22#include <QtPrintSupport/qtprintsupportglobal.h>
23
25
27
28class Q_PRINTSUPPORT_EXPORT QAlphaPaintEngine : public QPaintEngine
29{
30 Q_DECLARE_PRIVATE(QAlphaPaintEngine)
31public:
33
34 bool begin(QPaintDevice *pdev) override;
35 bool end() override;
36
37 void updateState(const QPaintEngineState &state) override;
38
39 void drawPath(const QPainterPath &path) override;
40
41 void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override;
42
43 void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override;
44 void drawTextItem(const QPointF &p, const QTextItem &textItem) override;
45 void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override;
46
47protected:
48 QAlphaPaintEngine(QAlphaPaintEnginePrivate &data, PaintEngineFeatures devcaps = { });
49 QRegion alphaClipping() const;
50 bool continueCall() const;
51 void flushAndInit(bool init = true);
52 void cleanUp();
53};
54
56{
57 Q_DECLARE_PUBLIC(QAlphaPaintEngine)
58public:
61
62 int m_pass;
66
67 QPaintEngine::PaintEngineFeatures m_savedcaps;
69
75
85
88
89 void addAlphaRect(const QRectF &rect);
90 void addDirtyRect(const QRectF &rect) { m_dirtyRects.append(rect.toAlignedRect()); }
91 bool canSeeTroughBackground(bool somethingInRectHasAlpha, const QRectF &rect) const;
92
94 void drawAlphaImage(const QRectF &rect);
95 QRect toRect(const QRectF &rect) const;
96 bool fullyContained(const QRectF &rect) const;
97
98 void resetState(QPainter *p);
99};
100
102
103#endif // QT_NO_PRINTER
104
105#endif // QPAINTENGINE_ALPHA_P_H
void drawAlphaImage(const QRectF &rect)
QPaintEngine::PaintEngineFeatures m_savedcaps
QRectF addPenWidth(const QPainterPath &path)
void addDirtyRect(const QRectF &rect)
void addAlphaRect(const QRectF &rect)
bool fullyContained(const QRectF &rect) const
QRect toRect(const QRectF &rect) const
bool canSeeTroughBackground(bool somethingInRectHasAlpha, const QRectF &rect) const
Definition qlist.h:74
void append(parameter_type t)
Definition qlist.h:441
The QPaintEngineState class provides information about the active paint engine's current state....
\inmodule QtGui
virtual void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s)
Reimplement this function to draw the pixmap in the given rect, starting at the given p.
virtual void updateState(const QPaintEngineState &state)=0
Reimplement this function to update the state of a paint engine.
virtual void drawTextItem(const QPointF &p, const QTextItem &textItem)
This function draws the text item textItem at position p.
PolygonDrawMode
\value OddEvenMode The polygon should be drawn using OddEven fill rule.
virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr)=0
Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r.
virtual bool begin(QPaintDevice *pdev)=0
Reimplement this function to initialise your paint engine when painting is to start on the paint devi...
virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode)
Reimplement this virtual function to draw the polygon defined by the pointCount first points in point...
virtual bool end()=0
Reimplement this function to finish painting on the current paint device.
virtual void drawPath(const QPainterPath &path)
The default implementation ignores the path and does nothing.
\inmodule QtGui
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
\inmodule QtGui
Definition qpen.h:25
The QPicture class is a paint device that records and replays QPainter commands.
Definition qpicture.h:19
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
\inmodule QtCore\reentrant
Definition qpoint.h:214
\inmodule QtCore\reentrant
Definition qrect.h:483
\inmodule QtCore\reentrant
Definition qrect.h:30
The QRegion class specifies a clip region for a painter.
Definition qregion.h:27
\inmodule QtGui
The QTransform class specifies 2D transformations of a coordinate system.
Definition qtransform.h:20
rect
[4]
else opt state
[0]
Combined button and popup list for selecting options.
GLenum mode
GLboolean r
[2]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLfixed GLfixed GLint GLint GLfixed points
GLsizei const GLchar *const * path
GLdouble s
[6]
Definition qopenglext.h:235
GLfloat GLfloat p
[1]
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
widget render & pixmap