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
20namespace libzmf
21{
22
24{
25 // disable copying
26 BMIParser(const BMIParser &other) = delete;
27 BMIParser &operator=(const BMIParser &other) = delete;
28
29 struct ColorBitmapHeader;
30
31public:
32 explicit BMIParser(const RVNGInputStreamPtr &input, librevenge::RVNGDrawingInterface *painter = 0);
33
36 bool parse();
37
41
42 const BMIHeader &header() const;
43
44private:
46
47 std::vector<uint8_t> readData(unsigned endOffset);
48
49 std::vector<Color> readColorPalette(unsigned colorDepth);
50
51 bool reconcileDimensions(ColorBitmapHeader &colorHeader, ColorBitmapHeader &transparencyHeader);
52
54 librevenge::RVNGDrawingInterface *m_painter;
55
57};
58
59}
60
61#endif // BMIPARSER_H_INCLUDED
62
63/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Definition BMIHeader.h:21
Definition BMIParser.h:24
Image readImage()
Parse the bitmap and convert it to PNG.
Definition BMIParser.cpp:379
BMIParser(const BMIParser &other)=delete
BMIHeader m_header
Definition BMIParser.h:56
bool reconcileDimensions(ColorBitmapHeader &colorHeader, ColorBitmapHeader &transparencyHeader)
Definition BMIParser.cpp:555
std::vector< Color > readColorPalette(unsigned colorDepth)
Definition BMIParser.cpp:539
ColorBitmap readColorBitmap(const ColorBitmapHeader &header)
Definition BMIParser.cpp:437
BMIParser & operator=(const BMIParser &other)=delete
const BMIHeader & header() const
Definition BMIParser.cpp:432
librevenge::RVNGDrawingInterface * m_painter
Definition BMIParser.h:54
bool parse()
Parse the bitmap and output it as a drawing doc with an inserted image.
Definition BMIParser.cpp:357
const RVNGInputStreamPtr m_input
Definition BMIParser.h:53
std::vector< uint8_t > readData(unsigned endOffset)
Definition BMIParser.cpp:517
Definition BMIHeader.cpp:14
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
Definition libzmf_utils.h:80
Definition BMIParser.cpp:308
Definition BMITypes.h:42
Definition ZMFTypes.h:204

Generated for libzmf by doxygen 1.9.7