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
qktxhandler_p.h
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
5#ifndef QKTXHANDLER_H
6#define QKTXHANDLER_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
20
21#include <optional>
22
23QT_BEGIN_NAMESPACE
24
25struct KTXHeader;
26
28{
29public:
30 using QTextureFileHandler::QTextureFileHandler;
31 ~QKtxHandler() override;
32
33 static bool canRead(const QByteArray &suffix, const QByteArray &block);
34
35 QTextureFileData read() override;
36
37private:
38 bool checkHeader(const KTXHeader &header);
39 std::optional<QMap<QByteArray, QByteArray>> decodeKeyValues(QByteArrayView view) const;
40 quint32 decode(quint32 val) const;
41
42 bool inverseEndian = false;
43};
44
45QT_END_NAMESPACE
46
47#endif // QKTXHANDLER_H
static bool canRead(const QByteArray &suffix, const QByteArray &block)
~QKtxHandler() override
QTextureFileData read() override
static const char ktxIdentifier[KTX_IDENTIFIER_LENGTH]
static const std::optional< quint32 > nearestMultipleOf4(quint32 value)
static constexpr quint32 qktxh_headerSize
static QByteArrayView safeView(QByteArrayView view, quint32 start, quint32 length)
#define KTX_IDENTIFIER_LENGTH
static const quint32 platformEndianIdentifier
static const quint32 inversePlatformEndianIdentifier
quint32 endianness
quint32 bytesOfKeyValueData
quint32 glTypeSize
quint32 numberOfArrayElements
quint32 pixelHeight
quint32 numberOfMipmapLevels
quint8 identifier[KTX_IDENTIFIER_LENGTH]
quint32 pixelDepth
quint32 glType
quint32 glFormat
quint32 numberOfFaces
quint32 glBaseInternalFormat
quint32 glInternalFormat
quint32 pixelWidth