BMIHeader.h Source File documentation

BMIHeader.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/*
3 * This file is a part of the libzmf project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
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
17namespace libzmf
18{
19
20 class BMIHeader
21{
22public:
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
47private:
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 // BMIHEADER_H_INCLUDED
69
70/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
BMITypes.h
libzmf::BMIHeader::m_offsets
std::vector< BMIOffset > m_offsets
Definition BMIHeader.h:63
libzmf::BMIHeader::m_size
unsigned m_size
Definition BMIHeader.h:52
libzmf::BMIHeader::startOffset
unsigned startOffset() const
Definition BMIHeader.cpp:76
libzmf::BMIHeader::paletteColorCount
unsigned paletteColorCount() const
Definition BMIHeader.cpp:101
libzmf::BMIHeader::size
unsigned size() const
Definition BMIHeader.cpp:71
libzmf::BMIHeader::m_height
unsigned m_height
Definition BMIHeader.h:57
libzmf::BMIHeader::m_signature
std::string m_signature
Definition BMIHeader.h:50
libzmf::BMIHeader::width
unsigned width() const
Definition BMIHeader.cpp:81
libzmf::BMIHeader::load
bool load(const RVNGInputStreamPtr &input)
Definition BMIHeader.cpp:28
libzmf::BMIHeader::isSupported
bool isSupported() const
Definition BMIHeader.cpp:67
libzmf::BMIHeader::isPaletteMode
bool isPaletteMode() const
Definition BMIHeader.cpp:91
libzmf::BMIHeader::BMIHeader
BMIHeader()
Definition BMIHeader.cpp:16
libzmf::BMIHeader::m_colorDepth
unsigned m_colorDepth
Definition BMIHeader.h:61
libzmf::BMIHeader::m_isPaletteMode
bool m_isPaletteMode
Definition BMIHeader.h:59
libzmf::BMIHeader::m_startOffset
unsigned m_startOffset
Definition BMIHeader.h:54
libzmf::BMIHeader::offsets
const std::vector< BMIOffset > & offsets() const
Definition BMIHeader.cpp:106
libzmf::BMIHeader::height
unsigned height() const
Definition BMIHeader.cpp:86
libzmf::BMIHeader::m_width
unsigned m_width
Definition BMIHeader.h:56
libzmf::BMIHeader::reconcileHeight
bool reconcileHeight(unsigned &colorHeight, unsigned &transparencyHeight)
Definition BMIHeader.cpp:182
libzmf::BMIHeader::colorDepth
unsigned colorDepth() const
Definition BMIHeader.cpp:96
libzmf::BMIHeader::reconcileWidth
bool reconcileWidth(unsigned &colorWidth, unsigned &transparencyWidth)
Definition BMIHeader.cpp:177
libzmf::BMIHeader::readOffsets
void readOffsets(const RVNGInputStreamPtr &input, uint16_t offsetCount)
Definition BMIHeader.cpp:111
libzmf_utils.h
libzmf
Definition BMIHeader.cpp:14
libzmf::RVNGInputStreamPtr
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
Definition libzmf_utils.h:80