| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
#ifndef __COMMONPARSER_H__ |
| 11 |
#define __COMMONPARSER_H__ |
| 12 |
|
| 13 |
#include <utility> |
| 14 |
#include <vector> |
| 15 |
|
| 16 |
#include <librevenge-stream/librevenge-stream.h> |
| 17 |
|
| 18 |
namespace libcdr |
| 19 |
{ |
| 20 |
|
| 21 |
class CDRCollector; |
| 22 |
class CDRPath; |
| 23 |
|
| 24 |
enum CoordinatePrecision |
| 25 |
{ PRECISION_UNKNOWN = 0, PRECISION_16BIT, PRECISION_32BIT }; |
| 26 |
|
| 27 |
class CommonParser |
| 28 |
{ |
| 29 |
public: |
| 30 |
CommonParser(CDRCollector *collector); |
| 31 |
virtual ~CommonParser(); |
| 32 |
|
| 33 |
private: |
| 34 |
CommonParser(); |
| 35 |
CommonParser(const CommonParser &); |
| 36 |
CommonParser &operator=(const CommonParser &); |
| 37 |
|
| 38 |
|
| 39 |
protected: |
| 40 |
double readCoordinate(librevenge::RVNGInputStream *input, bool bigEndian = false); |
| 41 |
unsigned readUnsigned(librevenge::RVNGInputStream *input, bool bigEndian = false); |
| 42 |
unsigned short readUnsignedShort(librevenge::RVNGInputStream *input, bool bigEndian = false); |
| 43 |
int readInteger(librevenge::RVNGInputStream *input, bool bigEndian = false); |
| 44 |
double readAngle(librevenge::RVNGInputStream *input, bool bigEndian = false); |
| 45 |
void readRImage(unsigned &colorModel, unsigned &width, unsigned &height, unsigned &bpp, |
| 46 |
std::vector<unsigned> &palette, std::vector<unsigned char> &bitmap, |
| 47 |
librevenge::RVNGInputStream *input, bool bigEndian = false); |
| 48 |
void readBmpPattern(unsigned &width, unsigned &height, std::vector<unsigned char> &pattern, |
| 49 |
unsigned length, librevenge::RVNGInputStream *input, bool bigEndian = false); |
| 50 |
|
| 51 |
void processPath(const std::vector<std::pair<double, double> > &points, const std::vector<unsigned char> &types, CDRPath &path); |
| 52 |
void outputPath(const std::vector<std::pair<double, double> > &points, const std::vector<unsigned char> &types); |
| 53 |
|
| 54 |
CDRCollector *m_collector; |
| 55 |
CoordinatePrecision m_precision; |
| 56 |
}; |
| 57 |
} |
| 58 |
|
| 59 |
#endif |
| 60 |
|