WPG1Parser.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwpg
3  * Version: MPL 2.0 / LGPLv2.1+
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  * Major Contributor(s):
10  * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org)
11  * Copyright (C) 2005 Fridrich Strba (fridrich.strba@bluewin.ch)
12  * Copyright (C) 2004 Marc Oude Kotte (marc@solcon.nl)
13  *
14  * For minor contributions see the git repository.
15  *
16  * Alternatively, the contents of this file may be used under the terms
17  * of the GNU Lesser General Public License Version 2.1 or later
18  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
19  * applicable instead of those above.
20  *
21  * For further information visit http://libwpg.sourceforge.net
22  */
23 
24 /* "This product is not manufactured, approved, or supported by
25  * Corel Corporation or Corel Corporation Limited."
26  */
27 
28 #ifndef __WPG1PARSER_H__
29 #define __WPG1PARSER_H__
30 
31 #include <vector>
32 
33 #include <librevenge/librevenge.h>
34 
35 #include "WPGBitmap.h"
36 #include "WPGDashArray.h"
37 #include "WPGXParser.h"
38 
39 class WPG1Parser : public WPGXParser
40 {
41 public:
42  WPG1Parser(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter);
43  bool parse() override;
44 
45 private:
46  void handleStartWPG();
47  void handleEndWPG();
48 
49  void handleFillAttributes();
50  void handleLineAttributes();
51  void handleColormap();
52 
53  void handleLine();
54  void handlePolyline();
55  void handleRectangle();
56  void handlePolygon();
57  void handleEllipse();
58 
59  void handleCurvedPolyline();
60 
61  bool decodeRLE(std::vector<unsigned char> &buffer, unsigned width, unsigned height, unsigned depth);
62  void fillPixels(libwpg::WPGBitmap &bitmap, const unsigned char *buffer, unsigned width, unsigned height, unsigned depth);
63  void handleBitmapTypeOne();
64  void handleBitmapTypeTwo();
67 
72 
73  void resetPalette();
74 
75  // parsing context
78  bool m_success;
79  bool m_exit;
81  int m_width;
82  int m_height;
83  librevenge::RVNGPropertyList m_style;
89  librevenge::RVNGPropertyListVector m_gradient;
90 };
91 
92 #endif // __WPG1PARSER_H__
93 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WPGBitmap.h
WPG1Parser::handleColormap
void handleColormap()
Definition: WPG1Parser.cpp:318
libwpg::WPGColor
Definition: WPGColor.h:35
WPG1Parser::m_penBackColor
libwpg::WPGColor m_penBackColor
Definition: WPG1Parser.h:85
WPGXParser::readVariableLengthInteger
unsigned int readVariableLengthInteger()
Definition: WPGXParser.cpp:79
WPG1Parser::handleCurvedPolyline
void handleCurvedPolyline()
Definition: WPG1Parser.cpp:540
WPG1Parser::handleGraphicsTextTypeOne
void handleGraphicsTextTypeOne()
Definition: WPG1Parser.cpp:943
WPG1Parser::resetPalette
void resetPalette()
Definition: WPG1Parser.cpp:1008
WPG1Parser::handleFillAttributes
void handleFillAttributes()
Definition: WPG1Parser.cpp:339
WPG1Parser::handleBitmapTypeOne
void handleBitmapTypeOne()
Definition: WPG1Parser.cpp:737
libwpg::WPGColor::getColorString
const librevenge::RVNGString getColorString() const
Definition: WPGColor.cpp:68
WPG1Parser::handleEndWPG
void handleEndWPG()
Definition: WPG1Parser.cpp:307
WPG1Parser::m_graphicsStarted
bool m_graphicsStarted
Definition: WPG1Parser.h:80
WPG1Parser::fillPixels
void fillPixels(libwpg::WPGBitmap &bitmap, const unsigned char *buffer, unsigned width, unsigned height, unsigned depth)
Definition: WPG1Parser.cpp:666
WPG1Parser::handlePolygon
void handlePolygon()
Definition: WPG1Parser.cpp:478
WPG1Parser::handleLine
void handleLine()
Definition: WPG1Parser.cpp:387
libwpg::WPGBitmap
Definition: WPGBitmap.h:40
WPGXParser::m_painter
librevenge::RVNGDrawingInterface * m_painter
Definition: WPGXParser.h:57
WPGXParser
Definition: WPGXParser.h:40
WPG1Parser::handleGraphicsTextTypeThree
void handleGraphicsTextTypeThree()
WPG1Parser::WPG1Parser
WPG1Parser(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter)
Definition: WPG1Parser.cpp:145
WPG1Parser.h
WPG1Parser::m_success
bool m_success
Definition: WPG1Parser.h:78
libwpg_utils.h
WPGDashArray.h
WPG1Parser::handleStartWPG
void handleStartWPG()
Definition: WPG1Parser.cpp:286
libwpg::getRemainingLength
unsigned long getRemainingLength(librevenge::RVNGInputStream *const input)
Definition: libwpg_utils.cpp:71
WPG1Parser::handleGraphicsTextAttributes
void handleGraphicsTextAttributes()
Definition: WPG1Parser.cpp:937
WPG1Parser::handlePostscriptTypeOne
void handlePostscriptTypeOne()
Definition: WPG1Parser.cpp:855
WPGXParser::readU16
unsigned short readU16()
Definition: WPGXParser.cpp:53
WPG1Parser::m_recordLength
int m_recordLength
Definition: WPG1Parser.h:76
WPG1Parser::handlePostscriptTypeTwo
void handlePostscriptTypeTwo()
Definition: WPG1Parser.cpp:883
WPG1Parser::m_gradient
librevenge::RVNGPropertyListVector m_gradient
Definition: WPG1Parser.h:89
WPGXParser::m_input
librevenge::RVNGInputStream * m_input
Definition: WPGXParser.h:56
WPG1Parser::handleGraphicsTextTypeTwo
void handleGraphicsTextTypeTwo()
Definition: WPG1Parser.cpp:973
WPG1Parser::parse
bool parse() override
Definition: WPG1Parser.cpp:163
libwpg::WPGBitmap::getDIB
const librevenge::RVNGBinaryData & getDIB() const
Definition: WPGBitmap.cpp:149
defaultWPG1PaletteBlue
static const unsigned char defaultWPG1PaletteBlue[]
Definition: WPG1Parser.cpp:108
WPGXParser.h
WPG1Parser::m_style
librevenge::RVNGPropertyList m_style
Definition: WPG1Parser.h:83
WPG1Parser::handleEllipse
void handleEllipse()
Definition: WPG1Parser.cpp:510
WPG1Parser::m_exit
bool m_exit
Definition: WPG1Parser.h:79
WPG1Parser::decodeRLE
bool decodeRLE(std::vector< unsigned char > &buffer, unsigned width, unsigned height, unsigned depth)
Definition: WPG1Parser.cpp:591
libwpg::WPGDashArray
Definition: WPGDashArray.h:37
libwpg::WPGBitmap::setPixel
void setPixel(int x, int y, const WPGColor &color)
Definition: WPGBitmap.cpp:141
WPG1Parser::handleBitmapTypeTwo
void handleBitmapTypeTwo()
Definition: WPG1Parser.cpp:788
WPG1Parser::m_penForeColor
libwpg::WPGColor m_penForeColor
Definition: WPG1Parser.h:84
WPGXParser::readU8
unsigned char readU8()
Definition: WPGXParser.cpp:41
libwpg::WPGColor::getOpacity
double getOpacity() const
Definition: WPGColor.cpp:75
WPG1Parser::handlePolyline
void handlePolyline()
Definition: WPG1Parser.cpp:420
WPG1Parser::handleRectangle
void handleRectangle()
Definition: WPG1Parser.cpp:449
WPG1Parser::m_brushForeColor
libwpg::WPGColor m_brushForeColor
Definition: WPG1Parser.h:86
WPG1Parser::m_recordEnd
long m_recordEnd
Definition: WPG1Parser.h:77
WPG1Parser::m_height
int m_height
Definition: WPG1Parser.h:82
WPG_DEBUG_MSG
#define WPG_DEBUG_MSG(M)
Definition: libwpg_utils.h:56
WPGXParser::readS16
short readS16()
Definition: WPGXParser.cpp:69
WPG1Parser
Definition: WPG1Parser.h:40
WPG1Parser::m_width
int m_width
Definition: WPG1Parser.h:81
WPG1Parser::m_dashArray
libwpg::WPGDashArray m_dashArray
Definition: WPG1Parser.h:88
WPG1Parser::m_brushBackColor
libwpg::WPGColor m_brushBackColor
Definition: WPG1Parser.h:87
WPGXParser::m_colorPalette
std::map< int, libwpg::WPGColor > m_colorPalette
Definition: WPGXParser.h:58
WPGXParser::readU32
unsigned int readU32()
Definition: WPGXParser.cpp:60
defaultWPG1PaletteRed
static const unsigned char defaultWPG1PaletteRed[]
Definition: WPG1Parser.cpp:36
WPG1Parser::handleLineAttributes
void handleLineAttributes()
Definition: WPG1Parser.cpp:360
defaultWPG1PaletteGreen
static const unsigned char defaultWPG1PaletteGreen[]
Definition: WPG1Parser.cpp:72

Generated for libwpg by doxygen 1.8.18