Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qquickshadereffectmesh_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
#
include
<
private
/
qtquickglobal_p
.
h
>
6
7
QT_REQUIRE_CONFIG
(
quick_shadereffect
);
8
9
#
include
"qqmlparserstatus.h"
10
11
#
include
<
QtQuick
/
qtquickglobal
.
h
>
12
#
include
<
QtGui
/
qcolor
.
h
>
13
#
include
<
QtCore
/
qobject
.
h
>
14
#
include
<
QtCore
/
qsize
.
h
>
15
#
include
<
QtCore
/
qvector
.
h
>
16
#
include
<
QtCore
/
qbytearray
.
h
>
17
#
include
<
QtQml
/
qqml
.
h
>
18
19
#
ifndef
QQUICKSHADEREFFECTMESH_P_H
20
#
define
QQUICKSHADEREFFECTMESH_P_H
21
22
//
23
// W A R N I N G
24
// -------------
25
//
26
// This file is not part of the Qt API. It exists purely as an
27
// implementation detail. This header file may change from version to
28
// version without notice, or even be removed.
29
//
30
// We mean it.
31
//
32
33
QT_BEGIN_NAMESPACE
34
35
Q_QUICK_EXPORT
const
char
*qtPositionAttributeName();
36
Q_QUICK_EXPORT
const
char
*
qtTexCoordAttributeName
();
37
38
class
QSGGeometry;
39
class
QRectF;
40
41
class
Q_QUICK_EXPORT
QQuickShaderEffectMesh
:
public
QObject
42
{
43
Q_OBJECT
44
45
QML_NAMED_ELEMENT(ShaderEffectMesh)
46
QML_ADDED_IN_VERSION(2, 0)
47
QML_UNCREATABLE(
"Cannot create instance of abstract class ShaderEffectMesh."
)
48
49
public
:
50
QQuickShaderEffectMesh(QObject *parent =
nullptr
);
51
virtual
bool
validateAttributes(
const
QList<QByteArray> &attributes,
int
*posIndex) = 0;
52
// If 'geometry' != 0, 'attrCount' is the same as last time the function was called.
53
virtual
QSGGeometry *updateGeometry(QSGGeometry *geometry,
int
attrCount,
int
posIndex,
54
const
QRectF &srcRect,
const
QRectF &rect) = 0;
55
// If updateGeometry() fails, the reason should appear in the log.
56
virtual
QString log()
const
{
return
QString(); }
57
58
Q_SIGNALS:
59
// Emitted when the geometry needs to be updated.
60
void
geometryChanged();
61
62
protected
:
63
QQuickShaderEffectMesh(QObjectPrivate &dd, QObject *parent =
nullptr
);
64
};
65
66
class
Q_QUICK_EXPORT
QQuickGridMesh
:
public
QQuickShaderEffectMesh
67
{
68
Q_OBJECT
69
Q_PROPERTY(QSize resolution READ resolution WRITE setResolution NOTIFY resolutionChanged)
70
QML_NAMED_ELEMENT(GridMesh)
71
QML_ADDED_IN_VERSION(2, 0)
72
public
:
73
QQuickGridMesh(QObject *parent =
nullptr
);
74
bool
validateAttributes(
const
QList<QByteArray> &attributes,
int
*posIndex) override;
75
QSGGeometry *updateGeometry(QSGGeometry *geometry,
int
attrCount,
int
posIndex,
76
const
QRectF &srcRect,
const
QRectF &rect) override;
77
QString log()
const
override {
return
m_log; }
78
79
void
setResolution(
const
QSize &res);
80
QSize resolution()
const
;
81
82
Q_SIGNALS:
83
void
resolutionChanged();
84
85
private
:
86
QSize m_resolution;
87
QString m_log;
88
};
89
90
class
QQuickScaleGrid;
91
class
QQuickBorderImageMesh
:
public
QQuickShaderEffectMesh
92
{
93
Q_OBJECT
94
95
Q_PROPERTY(QQuickScaleGrid *border READ border CONSTANT)
96
Q_PROPERTY
(
QSize
size
READ
size
WRITE
setSize
NOTIFY
sizeChanged
)
97
Q_PROPERTY
(
TileMode
horizontalTileMode
READ
horizontalTileMode
WRITE
setHorizontalTileMode
NOTIFY
horizontalTileModeChanged
)
98
Q_PROPERTY
(
TileMode
verticalTileMode
READ
verticalTileMode
WRITE
setVerticalTileMode
NOTIFY
verticalTileModeChanged
)
99
100
QML_NAMED_ELEMENT
(
BorderImageMesh
)
101
QML_ADDED_IN_VERSION
(2, 8)
102
103
public
:
104
QQuickBorderImageMesh
(
QObject
*
parent
=
nullptr
);
105
106
bool
validateAttributes
(
const
QList<QByteArray> &attributes,
int
*posIndex)
override
;
107
QSGGeometry *
updateGeometry
(QSGGeometry *geometry,
int
attrCount,
int
posIndex,
108
const
QRectF &srcRect,
const
QRectF &rect)
override
;
109
110
QQuickScaleGrid *
border
()
const
;
111
112
enum
TileMode
{
Stretch
=
Qt
::
StretchTile
,
Repeat
=
Qt
::
RepeatTile
,
Round
=
Qt
::
RoundTile
};
113
Q_ENUM
(
TileMode
)
114
115
QSize
size
()
const
;
116
void
setSize
(
const
QSize &size);
117
118
TileMode
horizontalTileMode
()
const
;
119
void
setHorizontalTileMode
(
TileMode
);
120
121
TileMode
verticalTileMode
()
const
;
122
void
setVerticalTileMode
(
TileMode
);
123
124
Q_SIGNALS
:
125
void
sizeChanged
();
126
void
horizontalTileModeChanged
();
127
void
verticalTileModeChanged
();
128
129
private
:
130
QQuickScaleGrid *m_border;
131
QSize m_size;
132
TileMode
m_horizontalTileMode;
133
TileMode
m_verticalTileMode;
134
};
135
136
inline
QColor
qt_premultiply_color
(
const
QColor &c)
137
{
138
float
r, g, b, a;
139
c.getRgbF(&r, &g, &b, &a);
140
return
QColor::fromRgbF(r * a, g * a, b * a, a);
141
}
142
143
144
QT_END_NAMESPACE
145
146
#
endif
// QQUICKSHADEREFFECTMESH_P_H
QQuickBorderImageMesh
Definition
qquickshadereffectmesh_p.h:92
QQuickBorderImageMesh::validateAttributes
bool validateAttributes(const QList< QByteArray > &attributes, int *posIndex) override
Definition
qquickshadereffectmesh.cpp:289
QQuickBorderImageMesh::verticalTileMode
TileMode verticalTileMode() const
Definition
qquickshadereffectmesh.cpp:403
QQuickBorderImageMesh::setSize
void setSize(const QSize &size)
Definition
qquickshadereffectmesh.cpp:365
QQuickBorderImageMesh::border
QQuickScaleGrid * border() const
Definition
qquickshadereffectmesh.cpp:349
QQuickBorderImageMesh::setVerticalTileMode
void setVerticalTileMode(TileMode)
Definition
qquickshadereffectmesh.cpp:408
QQuickBorderImageMesh::TileMode
TileMode
Definition
qquickshadereffectmesh_p.h:112
QQuickBorderImageMesh::Round
@ Round
Definition
qquickshadereffectmesh_p.h:112
QQuickBorderImageMesh::Repeat
@ Repeat
Definition
qquickshadereffectmesh_p.h:112
QQuickBorderImageMesh::Stretch
@ Stretch
Definition
qquickshadereffectmesh_p.h:112
QQuickBorderImageMesh::verticalTileModeChanged
void verticalTileModeChanged()
QQuickBorderImageMesh::horizontalTileModeChanged
void horizontalTileModeChanged()
QQuickBorderImageMesh::horizontalTileMode
TileMode horizontalTileMode() const
\qmlproperty enumeration QtQuick::BorderImageMesh::horizontalTileMode \qmlproperty enumeration QtQuic...
Definition
qquickshadereffectmesh.cpp:389
QQuickBorderImageMesh::updateGeometry
QSGGeometry * updateGeometry(QSGGeometry *geometry, int attrCount, int posIndex, const QRectF &srcRect, const QRectF &rect) override
Definition
qquickshadereffectmesh.cpp:296
QQuickBorderImageMesh::setHorizontalTileMode
void setHorizontalTileMode(TileMode)
Definition
qquickshadereffectmesh.cpp:394
QQuickGridMesh
Definition
qquickshadereffectmesh_p.h:67
QQuickShaderEffectMesh
Definition
qquickshadereffectmesh_p.h:42
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qt_texcoord_attribute_name
static const char qt_texcoord_attribute_name[]
Definition
qquickshadereffectmesh.cpp:15
qtTexCoordAttributeName
const char * qtTexCoordAttributeName()
Definition
qquickshadereffectmesh.cpp:22
qt_position_attribute_name
static QT_BEGIN_NAMESPACE const char qt_position_attribute_name[]
Definition
qquickshadereffectmesh.cpp:14
qtPositionAttributeName
const char * qtPositionAttributeName()
Definition
qquickshadereffectmesh.cpp:17
QT_REQUIRE_CONFIG
QT_REQUIRE_CONFIG(quick_shadereffect)
qt_premultiply_color
QColor qt_premultiply_color(const QColor &c)
Definition
qquickshadereffectmesh_p.h:136
qtdeclarative
src
quick
items
qquickshadereffectmesh_p.h
Generated on
for Qt by
1.18.0