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
qssglightmapio_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QSSGLIGHTMAPIO_H
5#define QSSGLIGHTMAPIO_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 "qtquick3druntimerenderexports.h"
19
20#include <QByteArray>
21#include <QMap>
22#include <QSharedPointer>
23#include <QIODevice>
24#include <QVariantMap>
25
26QT_BEGIN_NAMESPACE
27
28struct QSSGLoadedTexture;
29struct QSSGRenderTextureFormat;
30
43
44struct Q_QUICK3DRUNTIMERENDER_EXPORT QSSGLightmapLoader
45{
46 ~QSSGLightmapLoader();
47
48 static QSharedPointer<QSSGLightmapLoader> open(const QSharedPointer<QIODevice> &stream);
49 static QSharedPointer<QSSGLightmapLoader> open(const QString &path);
50
51 QByteArray readF32Image(const QString &key, QSSGLightmapIODataTag tag) const;
52 QByteArray readU32Image(const QString &key, QSSGLightmapIODataTag tag) const;
53 QByteArray readData(const QString &key, QSSGLightmapIODataTag tag) const;
54 QVariantMap readMap(const QString &key, QSSGLightmapIODataTag tag) const;
55
56 QList<std::pair<QString, QSSGLightmapIODataTag>> getKeys() const;
57 static QSSGLoadedTexture *createTexture(QSharedPointer<QIODevice> stream, const QSSGRenderTextureFormat &format, const QString &key);
58
59private:
60 QSSGLightmapLoader();
62
63 struct QSSGLightmapIOPrivate *d = nullptr;
64};
65
66struct Q_QUICK3DRUNTIMERENDER_EXPORT QSSGLightmapWriter
67{
68 ~QSSGLightmapWriter();
69
70 static QSharedPointer<QSSGLightmapWriter> open(const QSharedPointer<QIODevice> &stream);
71 static QSharedPointer<QSSGLightmapWriter> open(const QString &path);
72
73 bool writeF32Image(const QString &key, QSSGLightmapIODataTag tag, const QByteArray &imageFP32);
74 bool writeU32Image(const QString &key, QSSGLightmapIODataTag tag, const QByteArray &imageU32);
75 bool writeData(const QString &key, QSSGLightmapIODataTag tag, const QByteArray &buffer);
76 bool writeMap(const QString &key, QSSGLightmapIODataTag tag, const QVariantMap &data);
77
78 bool close() const;
79
80private:
81 Q_DISABLE_COPY(QSSGLightmapWriter)
82 QSSGLightmapWriter();
83
84 struct QSSGLightmapIOPrivate *d = nullptr;
85};
86
87QT_END_NAMESPACE
88
89#endif // QSSGLIGHTMAPIO_H
constexpr char fileSignature[]
static IndexKey keyToIndexKey(const QString &key, QSSGLightmapIODataTag tag)
static QByteArray mapToByteArray(const QVariantMap &map)
static void convertEndian(QByteArray &buffer, int sizeOfDataType)
bool writeType(const QSharedPointer< QIODevice > &stream, T value)
int calculatePitch(int line)
int calculateLine(int width, int bitdepth)
static QVariantMap byteArrayToMap(QByteArray input)
QSSGLightmapIODataTag
QSSGLightmapIODataTag dataTag
bool writeData(const QString &key, QSSGLightmapIODataTag tag, const QByteArray &data)
QByteArray readKey(const IndexKey &indexKey) const
QMap< IndexKey, IndexEntry > entries
QSharedPointer< QIODevice > stream
QList< std::pair< QString, QSSGLightmapIODataTag > > getKeys() const
QByteArray readData(const QString &key, QSSGLightmapIODataTag tag) const
static QSharedPointer< QSSGLightmapLoader > open(const QSharedPointer< QIODevice > &stream)
QByteArray readU32Image(const QString &key, QSSGLightmapIODataTag tag) const
QVariantMap readMap(const QString &key, QSSGLightmapIODataTag tag) const
QByteArray readF32Image(const QString &key, QSSGLightmapIODataTag tag) const
static QSSGLoadedTexture * createTexture(QSharedPointer< QIODevice > stream, const QSSGRenderTextureFormat &format, const QString &key)
bool writeData(const QString &key, QSSGLightmapIODataTag tag, const QByteArray &buffer)
bool writeF32Image(const QString &key, QSSGLightmapIODataTag tag, const QByteArray &imageFP32)
bool writeMap(const QString &key, QSSGLightmapIODataTag tag, const QVariantMap &data)
bool writeU32Image(const QString &key, QSSGLightmapIODataTag tag, const QByteArray &imageU32)