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
ddsheader.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// Copyright (C) 2016 Ivan Komissarov.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#include "ddsheader.h"
6
7#ifndef QT_NO_DATASTREAM
8
10
12{
13 s >> pixelFormat.size;
14 s >> pixelFormat.flags;
15 s >> pixelFormat.fourCC;
16 s >> pixelFormat.rgbBitCount;
17 s >> pixelFormat.rBitMask;
18 s >> pixelFormat.gBitMask;
19 s >> pixelFormat.bBitMask;
20 s >> pixelFormat.aBitMask;
21 return s;
22}
23
25{
26 s << pixelFormat.size;
27 s << pixelFormat.flags;
28 s << pixelFormat.fourCC;
29 s << pixelFormat.rgbBitCount;
30 s << pixelFormat.rBitMask;
31 s << pixelFormat.gBitMask;
32 s << pixelFormat.bBitMask;
33 s << pixelFormat.aBitMask;
34 return s;
35}
36
38{
39 s >> header.magic;
40 s >> header.size;
41 s >> header.flags;
42 s >> header.height;
43 s >> header.width;
44 s >> header.pitchOrLinearSize;
45 s >> header.depth;
46 s >> header.mipMapCount;
47 for (int i = 0; i < DDSHeader::ReservedCount; i++)
48 s >> header.reserved1[i];
49 s >> header.pixelFormat;
50 s >> header.caps;
51 s >> header.caps2;
52 s >> header.caps3;
53 s >> header.caps4;
54 s >> header.reserved2;
55 return s;
56}
57
59{
60 s << header.magic;
61 s << header.size;
62 s << header.flags;
63 s << header.height;
64 s << header.width;
65 s << header.pitchOrLinearSize;
66 s << header.depth;
67 s << header.mipMapCount;
68 for (int i = 0; i < DDSHeader::ReservedCount; i++)
69 s << header.reserved1[i];
70 s << header.pixelFormat;
71 s << header.caps;
72 s << header.caps2;
73 s << header.caps3;
74 s << header.caps4;
75 s << header.reserved2;
76 return s;
77}
78
80{
81 s >> header.dxgiFormat;
82 s >> header.resourceDimension;
83 s >> header.miscFlag;
84 s >> header.arraySize;
85 s >> header.reserved;
86 return s;
87}
88
90{
91 s << header.dxgiFormat;
92 s << header.resourceDimension;
93 s << header.miscFlag;
94 s << header.arraySize;
95 s << header.reserved;
96 return s;
97}
98
100
101#endif // QT_NO_DATASTREAM
\inmodule QtCore\reentrant
Definition qdatastream.h:46
QDataStream & operator<<(QDataStream &s, const DDSPixelFormat &pixelFormat)
Definition ddsheader.cpp:24
QT_BEGIN_NAMESPACE QDataStream & operator>>(QDataStream &s, DDSPixelFormat &pixelFormat)
Definition ddsheader.cpp:11
Combined button and popup list for selecting options.
static QString header(const QString &name)
GLdouble s
[6]
Definition qopenglext.h:235
@ ReservedCount
Definition ddsheader.h:164
quint32 gBitMask
Definition ddsheader.h:126
quint32 fourCC
Definition ddsheader.h:123
quint32 rgbBitCount
Definition ddsheader.h:124
quint32 bBitMask
Definition ddsheader.h:127
quint32 rBitMask
Definition ddsheader.h:125
quint32 flags
Definition ddsheader.h:122
quint32 aBitMask
Definition ddsheader.h:128