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
qquick3dshaderimage_p.h
Go to the documentation of this file.
1// Copyright (C) 2026 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5
6#ifndef QQUICK3DSHADERIMAGE_P_H
7#define QQUICK3DSHADERIMAGE_P_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtCore/qstring.h>
21#include <QtQuick3D/qquick3dobject.h>
22
24
25class Q_QUICK3D_EXPORT QQuick3DShaderImage : public QQuick3DObject
26{
27 Q_OBJECT
28 Q_PROPERTY(ImageShape shape READ shape WRITE setShape NOTIFY shapeChanged FINAL)
29 Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged FINAL)
30 Q_PROPERTY(int height READ height WRITE setHeight NOTIFY heightChanged FINAL)
31 Q_PROPERTY(int depth READ depth WRITE setDepth NOTIFY depthChanged FINAL)
32 Q_PROPERTY(int arraySize READ arraySize WRITE setArraySize NOTIFY arraySizeChanged FINAL)
33 Q_PROPERTY(ImageFormat format READ format WRITE setFormat NOTIFY formatChanged FINAL)
34 QML_NAMED_ELEMENT(ShaderImage)
35 QML_ADDED_IN_VERSION(6, 13)
36
37public:
38 enum ImageShape {
39 Image1D,
40 Image2D,
41 Image3D,
42 Image2DArray,
43 ImageCube,
44 };
45 Q_ENUM(ImageShape)
46
47 enum ImageFormat {
48 RGBA8,
49 R8,
50 RG8,
51 R16,
52 RG16,
53 RGBA16F,
54 RGBA32F,
55 R16F,
56 R32F,
57 RGB10A2,
58 R8SI,
59 R32SI,
60 RG32SI,
61 RGBA32SI,
62 R8UI,
63 R32UI,
64 RG32UI,
65 RGBA32UI,
66 };
67 Q_ENUM(ImageFormat);
68 explicit QQuick3DShaderImage(QQuick3DObject *parent = nullptr);
69 ~QQuick3DShaderImage() override;
70
71 QQuick3DShaderImage::ImageShape shape() const;
72 int width() const;
73 int height() const;
74 int depth() const;
75 int arraySize() const;
76 QQuick3DShaderImage::ImageFormat format() const;
77
78public Q_SLOTS:
79 void setShape(QQuick3DShaderImage::ImageShape shape);
80 void setWidth(int width);
81 void setHeight(int height);
82 void setDepth(int depth);
83 void setArraySize(int arraySize);
84 void setFormat(QQuick3DShaderImage::ImageFormat format);
85
86Q_SIGNALS:
87 void shapeChanged();
88 void widthChanged();
89 void heightChanged();
90 void depthChanged();
91 void arraySizeChanged();
92 void formatChanged();
93
94protected:
95 QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
96 void markAllDirty() override;
97 void markSizeDirty();
98
99private:
100 enum class DirtyFlag {
101 SizeDirty = 1,
102 FormatDirty = 2,
103 };
104 Q_DECLARE_FLAGS(DirtyFlags, DirtyFlag)
105 DirtyFlags m_dirtyFlags = DirtyFlags(DirtyFlag::SizeDirty) | DirtyFlags(DirtyFlag::FormatDirty);
106 QQuick3DShaderImage::ImageShape m_shape = ImageShape::Image2D;
107 int m_width = 1;
108 int m_height = 1;
109 int m_depth = 1;
110 int m_arraySize = 1;
111 QQuick3DShaderImage::ImageFormat m_format = ImageFormat::RGBA8;
112};
113
114QT_END_NAMESPACE
115
116#endif // QQUICK3DSHADERIMAGE_P_H
Combined button and popup list for selecting options.
static QRhiTexture::Format toRhiFormat(QQuick3DShaderImage::ImageFormat imageFormat)
static QSSGRenderImage::ShaderImageShape toRenderShape(QQuick3DShaderImage::ImageShape shape)