1 | // Copyright (C) 2017 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 | |
4 | #ifndef QKTXHANDLER_H |
5 | #define QKTXHANDLER_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 "qtexturefilehandler_p.h" |
19 | |
20 | QT_BEGIN_NAMESPACE |
21 | |
22 | struct ; |
23 | |
24 | class QKtxHandler : public QTextureFileHandler |
25 | { |
26 | public: |
27 | using QTextureFileHandler::QTextureFileHandler; |
28 | ~QKtxHandler() override; |
29 | |
30 | static bool canRead(const QByteArray &suffix, const QByteArray &block); |
31 | |
32 | QTextureFileData read() override; |
33 | |
34 | private: |
35 | bool checkHeader(const KTXHeader &); |
36 | QMap<QByteArray, QByteArray> decodeKeyValues(QByteArrayView view) const; |
37 | quint32 decode(quint32 val) const; |
38 | |
39 | bool inverseEndian = false; |
40 | }; |
41 | |
42 | QT_END_NAMESPACE |
43 | |
44 | #endif // QKTXHANDLER_H |
45 | |