Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
4#ifndef QTEXTUREFILEDATA_P_H
5#define QTEXTUREFILEDATA_P_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 <QtGui/qtguiglobal.h>
19#include <QSharedDataPointer>
20#include <QLoggingCategory>
21#include <QDebug>
22#include <private/qglobal_p.h>
23
25
26Q_DECLARE_LOGGING_CATEGORY(lcQtGuiTextureIO)
27
29
30class Q_GUI_EXPORT QTextureFileData
31{
32public:
33 enum Mode { ByteArrayMode, ImageMode };
34
35 QTextureFileData(Mode mode = ByteArrayMode);
37 QTextureFileData &operator=(const QTextureFileData &other);
39
40 bool isNull() const;
41 bool isValid() const;
42
43 void clear();
44
45 QByteArray data() const;
46 void setData(const QByteArray &data);
47 void setData(const QImage &image, int level = 0, int face = 0);
48
49 int dataOffset(int level = 0, int face = 0) const;
50 void setDataOffset(int offset, int level = 0, int face = 0);
51
52 int dataLength(int level = 0, int face = 0) const;
53 void setDataLength(int length, int level = 0, int face = 0);
54
55 QByteArrayView getDataView(int level = 0, int face = 0) const;
56
57 int numLevels() const;
58 void setNumLevels(int num);
59
60 int numFaces() const;
61 void setNumFaces(int num);
62
63 QSize size() const;
64 void setSize(const QSize &size);
65
66 quint32 glFormat() const;
67 void setGLFormat(quint32 format);
68
69 quint32 glInternalFormat() const;
70 void setGLInternalFormat(quint32 format);
71
72 quint32 glBaseInternalFormat() const;
73 void setGLBaseInternalFormat(quint32 format);
74
75 QByteArray logName() const;
76 void setLogName(const QByteArray &name);
77
78 QMap<QByteArray, QByteArray> keyValueMetadata() const;
79 void setKeyValueMetadata(const QMap<QByteArray, QByteArray> &keyValues);
80
81private:
82 QSharedDataPointer<QTextureFileDataPrivate> d;
83 friend Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QTextureFileData &d);
84};
85
87
88Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QTextureFileData &d);
89
91
92#endif // QABSTRACTLAYOUTSTYLEINFO_P_H
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
\inmodule QtGui
Definition qimage.h:37
\inmodule QtCore
Definition qsize.h:25
b clear()
Combined button and popup list for selecting options.
Definition image.cpp:4
#define Q_DECLARE_LOGGING_CATEGORY(name)
GLenum mode
GLenum GLuint GLint level
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei length
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum face
GLenum GLuint GLintptr offset
GLuint name
GLint GLsizei GLsizei GLenum format
GLuint num
Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QTextureFileData &d)
@ Q_RELOCATABLE_TYPE
Definition qtypeinfo.h:158
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:180
unsigned int quint32
Definition qtypes.h:50
QDataStream & operator<<(QDataStream &out, const MyClass &myObj)
[4]
mimeData setData("text/csv", csvData)
QSharedPointer< T > other(t)
[5]