Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickmaskextruder_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 MASKEXTRUDER_H
5#define MASKEXTRUDER_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//
18#include <private/qquickpixmap_p.h>
19#include <QUrl>
20#include <QImage>
21
23
24class Q_QUICKPARTICLES_EXPORT QQuickMaskExtruder : public QQuickParticleExtruder
25{
27 Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
28 QML_NAMED_ELEMENT(MaskShape)
30public:
31 explicit QQuickMaskExtruder(QObject *parent = nullptr);
32 QPointF extrude(const QRectF &) override;
33 bool contains(const QRectF &bounds, const QPointF &point) override;
34
35 QUrl source() const
36 {
37 return m_source;
38 }
39
41
42 void sourceChanged(const QUrl &arg);
43
44public Q_SLOTS:
45 void setSource(const QUrl &arg);
46
47private Q_SLOTS:
48 void startMaskLoading();
49 void finishMaskLoading();
50
51private:
52 QUrl m_source;
53
54 void ensureInitialized(const QRectF &r);
55 int m_lastWidth;
56 int m_lastHeight;
57 QQuickPixmap m_pix;
58 QImage m_img;
59 QList<QPointF> m_mask;//TODO: More memory efficient datastructures
60 //Perhaps just the mask for the largest bounds is stored, and interpolate up
61};
62
64
65#endif // MASKEXTRUDER_H
\inmodule QtGui
Definition qimage.h:37
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore\reentrant
Definition qpoint.h:217
void sourceChanged(const QUrl &arg)
\inmodule QtCore\reentrant
Definition qrect.h:484
\inmodule QtCore
Definition qurl.h:94
Combined button and popup list for selecting options.
static void ensureInitialized()
static bool contains(const QJsonArray &haystack, unsigned needle)
Definition qopengl.cpp:116
GLboolean r
[2]
GLsizei GLsizei GLchar * source
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
SSL_CTX int void * arg
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
#define explicit