1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QSSGRENDERTEXTUREDATA_H
5#define QSSGRENDERTEXTUREDATA_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//
17
18#include <QtQuick3DRuntimeRender/private/qssgrendergraphobject_p.h>
19#include <QtQuick3DRuntimeRender/private/qssgrenderimagetexture_p.h>
20#include <QtQuick3DRuntimeRender/private/qssgrenderbuffermanager_p.h>
21#include <QtQuick3DUtils/private/qssgrenderbasetypes_p.h>
22#include <QtCore/qsize.h>
23#include <QtCore/qbytearray.h>
24
25QT_BEGIN_NAMESPACE
26
27class Q_QUICK3DRUNTIMERENDER_EXPORT QSSGRenderTextureData : public QSSGRenderGraphObject
28{
29public:
30 explicit QSSGRenderTextureData();
31 // it's specially used for Type::Skin
32 explicit QSSGRenderTextureData(QSSGRenderGraphObject::Type inType);
33 virtual ~QSSGRenderTextureData();
34
35 const QByteArray &textureData() const;
36 void setTextureData(const QByteArray &data);
37
38 QSize size() const;
39 void setSize(const QSize &size);
40
41 int depth() const;
42 void setDepth(int depth);
43
44 QSSGRenderTextureFormat format() const;
45 void setFormat(QSSGRenderTextureFormat format);
46
47 bool hasTransparancy() const;
48 void setHasTransparency(bool hasTransparency);
49
50 uint32_t generationId() const;
51
52 QString debugObjectName;
53
54protected:
55 Q_DISABLE_COPY(QSSGRenderTextureData)
56
57 void markDirty();
58
59 QByteArray m_textureData;
60 QSize m_size;
61 int m_depth = 0;
62 QSSGRenderTextureFormat m_format = QSSGRenderTextureFormat::Unknown;
63 bool m_hasTransparency = false;
64 uint32_t m_generationId = 1;
65};
66
67QT_END_NAMESPACE
68
69#endif // QSSGRENDERTEXTUREDATA_H
70

source code of qtquick3d/src/runtimerender/graphobjects/qssgrendertexturedata_p.h