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
qtexturefiledata_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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#ifndef QTEXTUREFILEDATA_P_H
6#define QTEXTUREFILEDATA_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtGui/qtguiglobal.h>
20#include <QSharedDataPointer>
21#include <QLoggingCategory>
22#include <private/qglobal_p.h>
23
24QT_BEGIN_NAMESPACE
25
26class QDebug;
27
28Q_DECLARE_LOGGING_CATEGORY(lcQtGuiTextureIO)
29
31QT_DECLARE_QSDP_SPECIALIZATION_DTOR(QTextureFileDataPrivate)
32
33class Q_GUI_EXPORT QTextureFileData
34{
35public:
36 enum Mode { ByteArrayMode, ImageMode };
37
38 QTextureFileData(Mode mode = ByteArrayMode);
39 QTextureFileData(const QTextureFileData &other);
40 QTextureFileData(QTextureFileData &&) = default;
41 QTextureFileData &operator=(const QTextureFileData &other);
42 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QTextureFileData)
43 ~QTextureFileData();
44
45 void swap(QTextureFileData &other) noexcept { d.swap(other.d); }
46
47 bool isNull() const;
48 bool isValid() const;
49
50 void clear();
51
52 QByteArray data() const;
53 void setData(const QByteArray &data);
54 void setData(const QImage &image, int level = 0, int face = 0);
55
56 int dataOffset(int level = 0, int face = 0) const;
57 void setDataOffset(int offset, int level = 0, int face = 0);
58
59 int dataLength(int level = 0, int face = 0) const;
60 void setDataLength(int length, int level = 0, int face = 0);
61
62 QByteArrayView getDataView(int level = 0, int face = 0) const;
63
64 int numLevels() const;
65 void setNumLevels(int num);
66
67 int numFaces() const;
68 void setNumFaces(int num);
69
70 QSize size() const;
71 void setSize(const QSize &size);
72
73 quint32 glFormat() const;
74 void setGLFormat(quint32 format);
75
76 quint32 glInternalFormat() const;
77 void setGLInternalFormat(quint32 format);
78
79 quint32 glBaseInternalFormat() const;
80 void setGLBaseInternalFormat(quint32 format);
81
82 QByteArray logName() const;
83 void setLogName(const QByteArray &name);
84
85 QMap<QByteArray, QByteArray> keyValueMetadata() const;
86 void setKeyValueMetadata(const QMap<QByteArray, QByteArray> &keyValues);
87
88private:
89 QSharedDataPointer<QTextureFileDataPrivate> d;
90 friend Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QTextureFileData &d);
91};
92
94
95Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QTextureFileData &d);
96
97QT_END_NAMESPACE
98
99#endif // QABSTRACTLAYOUTSTYLEINFO_P_H
static bool canRead(const QByteArray &suffix, const QByteArray &block)
QTextureFileData read() override
~QAstcHandler() override
QIODevice * device() const
virtual ~QTextureFileHandler()
QByteArray logName() const
virtual QTextureFileData read()=0
Combined button and popup list for selecting options.
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition qdir.cpp:2582
quint8 ySize[3]
quint8 blockDimZ
quint8 magic[4]
quint8 xSize[3]
quint8 zSize[3]
quint8 blockDimX
quint8 blockDimY