| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
#ifndef BMIHEADER_H_INCLUDED |
| 11 |
#define BMIHEADER_H_INCLUDED |
| 12 |
|
| 13 |
#include "libzmf_utils.h" |
| 14 |
#include "BMITypes.h" |
| 15 |
#include <vector> |
| 16 |
|
| 17 |
namespace libzmf |
| 18 |
{ |
| 19 |
|
| 20 |
class BMIHeader |
| 21 |
{ |
| 22 |
public: |
| 23 |
BMIHeader(); |
| 24 |
|
| 25 |
bool load(const RVNGInputStreamPtr &input); |
| 26 |
|
| 27 |
bool isSupported() const; |
| 28 |
|
| 29 |
unsigned size() const; |
| 30 |
|
| 31 |
unsigned startOffset() const; |
| 32 |
|
| 33 |
unsigned width() const; |
| 34 |
unsigned height() const; |
| 35 |
|
| 36 |
bool isPaletteMode() const; |
| 37 |
|
| 38 |
unsigned colorDepth() const; |
| 39 |
|
| 40 |
unsigned paletteColorCount() const; |
| 41 |
|
| 42 |
const std::vector<BMIOffset> &offsets() const; |
| 43 |
|
| 44 |
bool reconcileWidth(unsigned &colorWidth, unsigned &transparencyWidth); |
| 45 |
bool reconcileHeight(unsigned &colorHeight, unsigned &transparencyHeight); |
| 46 |
|
| 47 |
private: |
| 48 |
void readOffsets(const RVNGInputStreamPtr &input, uint16_t offsetCount); |
| 49 |
|
| 50 |
std::string m_signature; |
| 51 |
|
| 52 |
unsigned m_size; |
| 53 |
|
| 54 |
unsigned m_startOffset; |
| 55 |
|
| 56 |
unsigned m_width; |
| 57 |
unsigned m_height; |
| 58 |
|
| 59 |
bool m_isPaletteMode; |
| 60 |
|
| 61 |
unsigned m_colorDepth; |
| 62 |
|
| 63 |
std::vector<BMIOffset> m_offsets; |
| 64 |
}; |
| 65 |
|
| 66 |
} |
| 67 |
|
| 68 |
#endif |
| 69 |
|
| 70 |
|