2012-04-03 23:30:07 -04:00
|
|
|
/*
|
|
|
|
* Copyright 2011-2012 Branimir Karadzic. All rights reserved.
|
|
|
|
* License: http://www.opensource.org/licenses/BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __DDS_H__
|
|
|
|
#define __DDS_H__
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
namespace bgfx
|
|
|
|
{
|
|
|
|
struct Dds
|
|
|
|
{
|
2012-06-09 21:25:50 -04:00
|
|
|
TextureFormat::Enum m_type;
|
2012-04-03 23:30:07 -04:00
|
|
|
uint32_t m_width;
|
|
|
|
uint32_t m_height;
|
|
|
|
uint32_t m_depth;
|
|
|
|
uint8_t m_blockSize;
|
|
|
|
uint8_t m_numMips;
|
2012-05-01 01:35:16 -04:00
|
|
|
uint8_t m_bpp;
|
2012-04-03 23:30:07 -04:00
|
|
|
bool m_hasAlpha;
|
2012-06-09 21:25:50 -04:00
|
|
|
bool m_cubeMap;
|
2012-04-03 23:30:07 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Mip
|
|
|
|
{
|
|
|
|
uint32_t m_width;
|
|
|
|
uint32_t m_height;
|
|
|
|
uint32_t m_blockSize;
|
|
|
|
uint32_t m_size;
|
2012-05-01 01:35:16 -04:00
|
|
|
uint8_t m_bpp;
|
2012-04-03 23:30:07 -04:00
|
|
|
uint8_t m_type;
|
|
|
|
bool m_hasAlpha;
|
|
|
|
const uint8_t* m_data;
|
|
|
|
|
|
|
|
uint32_t getDecodedSize() const;
|
|
|
|
void decode(uint8_t* _dst);
|
|
|
|
};
|
|
|
|
|
|
|
|
bool isDds(const Memory* _mem);
|
|
|
|
bool parseDds(Dds& _dds, const Memory* _mem);
|
2012-06-09 21:25:50 -04:00
|
|
|
bool getRawImageData(const Dds& _dds, uint8_t _side, uint8_t _index, const Memory* _mem, Mip& _mip);
|
2012-04-03 23:30:07 -04:00
|
|
|
|
|
|
|
} // namespace bgfx
|
|
|
|
|
|
|
|
#endif // __DDS_H__
|