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
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
19
20#include <optional>
21
22QT_BEGIN_NAMESPACE
23
24struct KTXHeader;
25
27{
28public:
29 using QTextureFileHandler::QTextureFileHandler;
30 ~QKtxHandler() override;
31
32 static bool canRead(const QByteArray &suffix, const QByteArray &block);
33
34 QTextureFileData read() override;
35
36private:
37 bool checkHeader(const KTXHeader &header);
38 std::optional<QMap<QByteArray, QByteArray>> decodeKeyValues(QByteArrayView view) const;
39 quint32 decode(quint32 val) const;
40
41 bool inverseEndian = false;
42};
43
44QT_END_NAMESPACE
45
46#endif // QKTXHANDLER_H
static bool canRead(const QByteArray &suffix, const QByteArray &block)
~QKtxHandler() override
QTextureFileData read() override
Combined button and popup list for selecting options.
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