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
ddsheader.h
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// Qt-Security score:critical reason:data-parser
5
6#ifndef DDSHEADER_H
7#define DDSHEADER_H
8
9#include <QtCore/QDataStream>
10
11#ifndef QT_NO_DATASTREAM
12
13QT_BEGIN_NAMESPACE
14
15enum Format {
16 FormatUnknown = 0,
17
18 FormatR8G8B8 = 20,
19 FormatA8R8G8B8 = 21,
20 FormatX8R8G8B8 = 22,
21 FormatR5G6B5 = 23,
22 FormatX1R5G5B5 = 24,
23 FormatA1R5G5B5 = 25,
24 FormatA4R4G4B4 = 26,
25 FormatR3G3B2 = 27,
26 FormatA8 = 28,
27 FormatA8R3G3B2 = 29,
28 FormatX4R4G4B4 = 30,
29 FormatA2B10G10R10 = 31,
30 FormatA8B8G8R8 = 32,
31 FormatX8B8G8R8 = 33,
32 FormatG16R16 = 34,
33 FormatA2R10G10B10 = 35,
34 FormatA16B16G16R16 = 36,
35
36 FormatA8P8 = 40,
37 FormatP8 = 41,
38
39 FormatL8 = 50,
40 FormatA8L8 = 51,
41 FormatA4L4 = 52,
42
43 FormatV8U8 = 60,
44 FormatL6V5U5 = 61,
45 FormatX8L8V8U8 = 62,
46 FormatQ8W8V8U8 = 63,
47 FormatV16U16 = 64,
48 FormatA2W10V10U10 = 67,
49
50 FormatUYVY = 0x59565955, // "UYVY"
51 FormatR8G8B8G8 = 0x47424752, // "RGBG"
52 FormatYUY2 = 0x32595559, // "YUY2"
53 FormatG8R8G8B8 = 0x42475247, // "GRGB"
54 FormatDXT1 = 0x31545844, // "DXT1"
55 FormatDXT2 = 0x32545844, // "DXT2"
56 FormatDXT3 = 0x33545844, // "DXT3"
57 FormatDXT4 = 0x34545844, // "DXT4"
58 FormatDXT5 = 0x35545844, // "DXT5"
59 FormatRXGB = 0x42475852, // "RXGB"
60 FormatATI2 = 0x32495441, // "ATI2"
61
62 FormatD16Lockable = 70,
63 FormatD32 = 71,
64 FormatD15S1 = 73,
65 FormatD24S8 = 75,
66 FormatD24X8 = 77,
67 FormatD24X4S4 = 79,
68 FormatD16 = 80,
69
70 FormatD32FLockable = 82,
71 FormatD24FS8 = 83,
72
73 FormatD32Lockable = 84,
74 FormatS8Lockable = 85,
75
76 FormatL16 = 81,
77
78 FormatVertexData =100,
79 FormatIndex16 =101,
80 FormatIndex32 =102,
81
82 FormatQ16W16V16U16 = 110,
83
84 FormatMulti2ARGB8 = 0x3154454d, // "MET1"
85
86 FormatR16F = 111,
87 FormatG16R16F = 112,
88 FormatA16B16G16R16F = 113,
89
90 FormatR32F = 114,
91 FormatG32R32F = 115,
92 FormatA32B32G32R32F = 116,
93
94 FormatCxV8U8 = 117,
95
96 FormatA1 = 118,
97 FormatA2B10G10R10_XR_BIAS = 119,
98 FormatBinaryBuffer = 199,
99
100 FormatP4,
101 FormatA4P4,
102
103 FormatLast = 0x7fffffff
104};
105
131
132QDataStream &operator>>(QDataStream &s, DDSPixelFormat &pixelFormat);
133QDataStream &operator<<(QDataStream &s, const DDSPixelFormat &pixelFormat);
134
183
184QDataStream &operator>>(QDataStream &s, DDSHeader &header);
185QDataStream &operator<<(QDataStream &s, const DDSHeader &header);
186
195
196QDataStream &operator>>(QDataStream &s, DDSHeaderDX10 &header);
197QDataStream &operator<<(QDataStream &s, const DDSHeaderDX10 &header);
198
199QT_END_NAMESPACE
200
201#endif // QT_NO_DATASTREAM
202
203#endif // DDSHEADER_H
bool canRead() const override
Returns true if an image can be read from the device (i.e., the image format is supported,...
static bool canRead(QIODevice *device)
QVariant option(QImageIOHandler::ImageOption option) const override
Returns the value assigned to option as a QVariant.
int imageCount() const override
For image formats that support animation, this function returns the number of images in the animation...
void setOption(ImageOption option, const QVariant &value) override
Sets the option option with the value value.
bool read(QImage *image) override
Read an image from the device, and stores it in image.
bool jumpToImage(int imageNumber) override
For image formats that support animation, this function jumps to the image whose sequence number is i...
bool supportsOption(QImageIOHandler::ImageOption option) const override
Returns true if the QImageIOHandler supports the option option; otherwise returns false.
bool write(const QImage &image) override
Writes the image image to the assigned device.
QImageIOHandler * create(QIODevice *device, const QByteArray &format=QByteArray()) const override
Creates and returns a QImageIOHandler subclass, with device and format set.
Definition main.cpp:41
QDataStream & operator>>(QDataStream &s, DDSHeaderDX10 &header)
Definition ddsheader.cpp:80
QDataStream & operator>>(QDataStream &s, DDSHeader &header)
Definition ddsheader.cpp:38
QDataStream & operator<<(QDataStream &s, const DDSHeader &header)
Definition ddsheader.cpp:59
QDataStream & operator<<(QDataStream &s, const DDSPixelFormat &pixelFormat)
Definition ddsheader.cpp:25
QDataStream & operator<<(QDataStream &s, const DDSHeaderDX10 &header)
Definition ddsheader.cpp:90
QDataStream & operator>>(QDataStream &s, DDSPixelFormat &pixelFormat)
Definition ddsheader.cpp:12
quint32 arraySize
Definition ddsheader.h:192
quint32 miscFlag
Definition ddsheader.h:191
quint32 resourceDimension
Definition ddsheader.h:190
quint32 dxgiFormat
Definition ddsheader.h:189
quint32 reserved
Definition ddsheader.h:193
quint32 mipMapCount
Definition ddsheader.h:174
@ Caps2CubeMapPositiveY
Definition ddsheader.h:158
@ Caps2CubeMapPositiveX
Definition ddsheader.h:156
@ Caps2CubeMapNegativeX
Definition ddsheader.h:157
@ Caps2CubeMapPositiveZ
Definition ddsheader.h:160
@ Caps2CubeMapNegativeZ
Definition ddsheader.h:161
@ Caps2CubeMapNegativeY
Definition ddsheader.h:159
DDSPixelFormat pixelFormat
Definition ddsheader.h:176
quint32 size
Definition ddsheader.h:168
quint32 caps
Definition ddsheader.h:177
quint32 height
Definition ddsheader.h:170
quint32 magic
Definition ddsheader.h:167
@ FlagPixelFormat
Definition ddsheader.h:142
@ FlagLinearSize
Definition ddsheader.h:144
@ FlagMipmapCount
Definition ddsheader.h:143
quint32 reserved2
Definition ddsheader.h:181
@ ReservedCount
Definition ddsheader.h:165
quint32 caps3
Definition ddsheader.h:179
quint32 flags
Definition ddsheader.h:169
quint32 pitchOrLinearSize
Definition ddsheader.h:172
quint32 caps2
Definition ddsheader.h:178
quint32 width
Definition ddsheader.h:171
quint32 caps4
Definition ddsheader.h:180
quint32 reserved1[ReservedCount]
Definition ddsheader.h:175
quint32 depth
Definition ddsheader.h:173
quint32 gBitMask
Definition ddsheader.h:127
quint32 fourCC
Definition ddsheader.h:124
quint32 rgbBitCount
Definition ddsheader.h:125
quint32 bBitMask
Definition ddsheader.h:128
quint32 rBitMask
Definition ddsheader.h:126
quint32 flags
Definition ddsheader.h:123
quint32 aBitMask
Definition ddsheader.h:129