xoreos  0.0.5
dds.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef GRAPHICS_IMAGES_DDS_H
26 #define GRAPHICS_IMAGES_DDS_H
27 
29 
30 namespace Common {
31  class SeekableReadStream;
32 }
33 
34 namespace Graphics {
35 
44 class DDS : public ImageDecoder {
45 public:
47  ~DDS();
48 
49 private:
50  enum DataType {
53  };
54 
56  struct DDSPixelFormat {
65  };
66 
67  // Loading helpers
69  void readHeader(Common::SeekableReadStream &dds, DataType &dataType);
72  void readData(Common::SeekableReadStream &dds, DataType dataType);
73 
74  void detectFormat(const DDSPixelFormat &format, DataType &dataType);
75 
76  void setSize(MipMap &mipMap);
77 };
78 
79 } // End of namespace Graphics
80 
81 #endif // GRAPHICS_IMAGES_DDS_H
Generic image decoder interface.
uint32 aBitMask
Bit mask for the alpha component.
Definition: dds.h:64
Definition: 2dafile.h:39
uint32 size
The size of the image data in bytes.
Definition: dds.h:57
uint32 bitCount
Number of bits per pixel.
Definition: dds.h:60
uint32 bBitMask
Bit mask for the blue color component.
Definition: dds.h:63
void readStandardHeader(Common::SeekableReadStream &dds, DataType &dataType)
Definition: dds.cpp:77
void readData(Common::SeekableReadStream &dds, DataType dataType)
Definition: dds.cpp:217
DDS texture.
Definition: dds.h:44
The specific pixel format of the included image data.
Definition: dds.h:56
uint32 fourCC
The FourCC to detect the format by.
Definition: dds.h:59
void readHeader(Common::SeekableReadStream &dds, DataType &dataType)
Definition: dds.cpp:68
uint32 flags
Features of the image data.
Definition: dds.h:58
uint32 gBitMask
Bit mask for the green color component.
Definition: dds.h:62
void setSize(MipMap &mipMap)
Definition: dds.cpp:211
void readBioWareHeader(Common::SeekableReadStream &dds, DataType &dataType)
Definition: dds.cpp:140
uint32_t uint32
Definition: types.h:204
uint32 rBitMask
Bit mask for the red color component.
Definition: dds.h:61
A generic interface for image decoders.
Definition: decoder.h:48
DDS(Common::SeekableReadStream &dds)
Definition: dds.cpp:47
Interface for a seekable & readable data stream.
Definition: readstream.h:265
void detectFormat(const DDSPixelFormat &format, DataType &dataType)
Definition: dds.cpp:240
void load(Common::SeekableReadStream &dds)
Definition: dds.cpp:54