1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QQUICK3DTEXTUREDATA_H
5#define QQUICK3DTEXTUREDATA_H
6
7#include <QtQuick3D/qquick3dobject.h>
8
9QT_BEGIN_NAMESPACE
10
11class QQuick3DTextureDataPrivate;
12
13class Q_QUICK3D_EXPORT QQuick3DTextureData : public QQuick3DObject
14{
15 Q_OBJECT
16 Q_DECLARE_PRIVATE(QQuick3DTextureData)
17
18 QML_NAMED_ELEMENT(TextureData)
19 QML_UNCREATABLE("TextureData is Abstract")
20 QML_ADDED_IN_VERSION(6, 0)
21public:
22 enum Format {
23 None,
24 RGBA8,
25 RGBA16F,
26 RGBA32F,
27 RGBE8,
28 R8,
29 R16,
30 R16F,
31 R32F,
32 BC1,
33 BC2,
34 BC3,
35 BC4,
36 BC5,
37 BC6H,
38 BC7,
39 DXT1_RGBA,
40 DXT1_RGB,
41 DXT3_RGBA,
42 DXT5_RGBA,
43 ETC2_RGB8,
44 ETC2_RGB8A1,
45 ETC2_RGBA8,
46 ASTC_4x4,
47 ASTC_5x4,
48 ASTC_5x5,
49 ASTC_6x5,
50 ASTC_6x6,
51 ASTC_8x5,
52 ASTC_8x6,
53 ASTC_8x8,
54 ASTC_10x5,
55 ASTC_10x6,
56 ASTC_10x8,
57 ASTC_10x10,
58 ASTC_12x10,
59 ASTC_12x12,
60 };
61 Q_ENUM(Format)
62
63 QQuick3DTextureData(QQuick3DObject *parent = nullptr);
64 ~QQuick3DTextureData();
65
66 const QByteArray textureData() const;
67 void setTextureData(const QByteArray &data);
68
69 QSize size() const;
70 void setSize(const QSize &size);
71
72 int depth() const;
73 void setDepth(int depth);
74
75 Format format() const;
76 void setFormat(Format format);
77
78 bool hasTransparency() const;
79 void setHasTransparency(bool hasTransparency);
80
81Q_SIGNALS:
82 void textureDataNodeDirty();
83
84protected:
85 QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
86 void markAllDirty() override;
87};
88
89QT_END_NAMESPACE
90
91#endif // QQUICK3DTEXTUREDATA_H
92

source code of qtquick3d/src/quick3d/qquick3dtexturedata.h