BMIParser.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 BMIPARSER_H_INCLUDED
11 #define BMIPARSER_H_INCLUDED
12 
13 #include <librevenge/librevenge.h>
14 
15 #include "libzmf_utils.h"
16 
17 #include "BMIHeader.h"
18 #include "ZMFTypes.h"
19 
20 namespace libzmf
21 {
22 
23 class BMIParser
24 {
25  // disable copying
26  BMIParser(const BMIParser &other);
27  BMIParser &operator=(const BMIParser &other);
28 
29 public:
30  explicit BMIParser(const RVNGInputStreamPtr &input, librevenge::RVNGDrawingInterface *painter = 0);
31 
34  bool parse();
35 
38  Image readImage();
39 
40  const BMIHeader &header() const;
41 
42 private:
44 
45  std::vector<uint8_t> readData(unsigned endOffset);
46 
47  std::vector<Color> readColorPalette(unsigned colorDepth);
48 
50  librevenge::RVNGDrawingInterface *m_painter;
51 
53 };
54 
55 }
56 
57 #endif // BMIPARSER_H_INCLUDED
58 
59 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
BMIParser(const BMIParser &other)
ColorBitmap readColorBitmap(BMIOffset offset)
Definition: BMIParser.cpp:370
std::vector< uint8_t > readData(unsigned endOffset)
Definition: BMIParser.cpp:458
BMIHeader m_header
Definition: BMIParser.h:52
librevenge::RVNGDrawingInterface * m_painter
Definition: BMIParser.h:50
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
Definition: libzmf_utils.h:72
BMIParser & operator=(const BMIParser &other)
Definition: BMITypes.h:27
Definition: BMITypes.h:41
Definition: BMIHeader.cpp:13
bool parse()
Parse the bitmap and output it as a drawing doc with an inserted image.
Definition: BMIParser.cpp:306
std::vector< Color > readColorPalette(unsigned colorDepth)
Definition: BMIParser.cpp:480
const BMIHeader & header() const
Definition: BMIParser.cpp:365
const RVNGInputStreamPtr m_input
Definition: BMIParser.h:49
Definition: BMIHeader.h:20
Definition: ZMFTypes.h:203
Image readImage()
Parse the bitmap and convert it to PNG.
Definition: BMIParser.cpp:328
Definition: BMIParser.h:23

Generated for libzmf by doxygen 1.8.13