10 #ifndef __CDRTYPES_H__
11 #define __CDRTYPES_H__
16 #include <librevenge/librevenge.h>
31 : m_x(0.0), m_y(0.0), m_w(0.0), m_h(0.0) {}
32 CDRBox(
double x0,
double y0,
double x1,
double y1)
33 : m_x(x0 < x1 ? x0 : x1), m_y(y0 < y1 ? y0 : y1), m_w(fabs(x1-x0)), m_h(fabs(y1-y0)) {}
58 CDRColor(
unsigned short colorModel,
unsigned short colorPalette,
unsigned colorValue)
59 : m_colorModel(colorModel), m_colorPalette(colorPalette), m_colorValue(colorValue) {}
61 : m_colorModel(0), m_colorPalette(0), m_colorValue(0) {}
62 CDRColor(
unsigned short colorModel,
unsigned colorValue)
63 : m_colorModel(colorModel), m_colorPalette(0), m_colorValue(colorValue) {}
72 : m_color(color), m_offset(offset) {}
86 : m_type(0), m_mode(0), m_angle(0.0), m_midPoint(0.0), m_edgeOffset(0), m_centerXOffset(0), m_centerYOffset(0), m_stops() {}
99 CDRImageFill() : id(0), width(0.0), height(0.0), isRelative(false), xOffset(0.0), yOffset(0.0), rcpOffset(0.0), flags(0)
101 CDRImageFill(
unsigned i,
double w,
double h,
bool r,
double x,
double y,
double o,
unsigned char f)
102 : id(i), width(w), height(h), isRelative(r), xOffset(x), yOffset(y), rcpOffset(o), flags(f) {}
112 : fillType((unsigned short)-1), color1(), color2(), gradient(), imageFill() {}
114 : fillType(ft), color1(c1), color2(c2), gradient(gr), imageFill(img) {}
130 : lineType((unsigned short)-1), capsType(0), joinType(0), lineWidth(0.0),
131 stretch(0.0), angle(0.0), color(), dashArray(),
132 startMarker(), endMarker() {}
134 double lw,
double st,
double a,
const CDRColor &c,
const std::vector<unsigned> &da,
136 : lineType(lt), capsType(ct), joinType(jt), lineWidth(lw),
137 stretch(st), angle(a), color(c), dashArray(da),
138 startMarker(sm), endMarker(em) {}
152 : m_charSet((unsigned short)-1), m_fontName(),
153 m_fontSize(0.0), m_align(0), m_leftIndent(0.0), m_firstIndent(0.0),
154 m_rightIndent(0.0), m_lineStyle(), m_fillStyle(), m_parentId(0)
160 if (
override.m_charSet != (
unsigned short)-1 ||
override.m_fontName.len())
162 m_charSet =
override.m_charSet;
163 m_fontName =
override.m_fontName;
166 m_fontSize =
override.m_fontSize;
167 if (
override.m_align)
168 m_align =
override.m_align;
169 if (
override.m_leftIndent != 0.0 &&
override.m_firstIndent != 0.0 &&
override.m_rightIndent != 0.0)
171 m_leftIndent =
override.m_leftIndent;
172 m_firstIndent =
override.m_firstIndent;
173 m_rightIndent =
override.m_rightIndent;
175 if (
override.m_lineStyle.
lineType != (
unsigned short)-1)
176 m_lineStyle =
override.m_lineStyle;
177 if (
override.m_fillStyle.
fillType != (
unsigned short)-1)
178 m_fillStyle =
override.m_fillStyle;
190 CDRPolygon() : m_numAngles(0), m_nextPoint(0), m_rx(0.0), m_ry(0.0), m_cx(0.0), m_cy(0.0) {}
191 CDRPolygon(
unsigned numAngles,
unsigned nextPoint,
double rx,
double ry,
double cx,
double cy)
192 : m_numAngles(numAngles), m_nextPoint(nextPoint), m_rx(rx), m_ry(ry), m_cx(cx), m_cy(cy) {}
203 CDRImage() : m_image(), m_x1(0.0), m_x2(0.0), m_y1(0.0), m_y2(0.0) {}
204 CDRImage(
const librevenge::RVNGBinaryData &image,
double x1,
double x2,
double y1,
double y2)
205 : m_image(image), m_x1(x1), m_x2(x2), m_y1(y1), m_y2(y2) {}
208 return (m_x1 + m_x2) / 2.0;
212 return (m_y1 + m_y2) / 2.0;
226 CDRPattern(
unsigned w,
unsigned h,
const std::vector<unsigned char> &p)
227 : width(w), height(h), pattern(p) {}
238 CDRBitmap() : colorModel(0), width(0), height(0), bpp(0), palette(), bitmap() {}
239 CDRBitmap(
unsigned cm,
unsigned w,
unsigned h,
unsigned b,
const std::vector<unsigned> &p,
const std::vector<unsigned char> &bmp)
240 : colorModel(cm), width(w), height(h), bpp(b), palette(p), bitmap(bmp) {}
249 CDRPage() : width(0.0), height(0.0), offsetX(0.0), offsetY(0.0) {}
250 CDRPage(
double w,
double h,
double ox,
double oy)
251 : width(w), height(h), offsetX(ox), offsetY(oy) {}
256 std::vector<std::pair<double, double> >
points;
259 CDRSplineData(
const std::vector<std::pair<double, double> > &ps,
const std::vector<unsigned> &kntv)
260 : points(ps), knotVector(kntv) {}
268 return (points.empty() || knotVector.empty());
286 unsigned short child,
unsigned short parent,
unsigned short flags,
287 double x0,
double y0,
double x1,
double y1,
const CDRTransform &trafo)
309 :
c(cyan),
m(magenta),
y(yellow),
k(black) {}
320 :
r(red),
g(green),
b(blue) {}
330 :
L(l),
a(A),
b(B) {}
340 :
L(l),
a(A),
b(B) {}
374 CDRFont(
const librevenge::RVNGString &name,
unsigned short encoding)
double getMiddleX() const
Definition: CDRTypes.h:206
int m_centerYOffset
Definition: CDRTypes.h:83
CDRBitmap()
Definition: CDRTypes.h:238
double m_rightIndent
Definition: CDRTypes.h:147
void append(const CDRText &text)
Definition: CDRTypes.h:360
CDRTextLine(const CDRTextLine &line)
Definition: CDRTypes.h:359
CDRImage()
Definition: CDRTypes.h:203
void create(CDRPath &path) const
Definition: CDRTypes.cpp:54
Definition: CDRTypes.h:371
unsigned m_nextPoint
Definition: CDRTypes.h:185
double m_x
Definition: CDRTypes.h:26
librevenge::RVNGString m_text
Definition: CDRTypes.h:352
unsigned char type
Definition: CDRTypes.h:278
unsigned id
Definition: CDRTypes.h:279
CDRLab2Color(double l, double A, double B)
Definition: CDRTypes.h:329
double a
Definition: CDRTypes.h:333
double m_x1
Definition: CDRTypes.h:199
Definition: CDRTypes.h:306
double r
Definition: CDRTypes.h:322
double yOffset
Definition: CDRTypes.h:96
~CDRLab2Color()
Definition: CDRTypes.h:331
double getMiddleY() const
Definition: CDRTypes.h:210
~CDRRGBColor()
Definition: CDRTypes.h:321
unsigned width
Definition: CDRTypes.h:222
CDRColor color
Definition: CDRTypes.h:125
CDRPattern()
Definition: CDRTypes.h:225
Definition: CDRTypes.h:24
CDRFont(const librevenge::RVNGString &name, unsigned short encoding)
Definition: CDRTypes.h:374
unsigned short m_parent
Definition: CDRTypes.h:297
WaldoRecordType1()
Definition: CDRTypes.h:290
double width
Definition: CDRTypes.h:92
CDRColor color1
Definition: CDRTypes.h:108
unsigned short m_previous
Definition: CDRTypes.h:295
CDRColor color2
Definition: CDRTypes.h:108
CDRPath endMarker
Definition: CDRTypes.h:128
double angle
Definition: CDRTypes.h:124
CDRRGBColor(double red, double green, double blue)
Definition: CDRTypes.h:319
Definition: CDRTypes.h:347
double y
Definition: CDRTypes.h:313
unsigned colorModel
Definition: CDRTypes.h:232
std::vector< unsigned char > bitmap
Definition: CDRTypes.h:237
Definition: CDRTypes.h:243
double m_y0
Definition: CDRTypes.h:300
double m_x2
Definition: CDRTypes.h:200
WaldoRecordInfo(unsigned char t, unsigned i, unsigned o)
Definition: CDRTypes.h:275
unsigned short m_next
Definition: CDRTypes.h:294
CDRSplineData()
Definition: CDRTypes.h:258
Definition: CDRTypes.h:89
double m_cy
Definition: CDRTypes.h:189
double m
Definition: CDRTypes.h:312
Definition: CDRTypes.h:317
bool isRelative
Definition: CDRTypes.h:94
void clear()
Definition: CDRTypes.h:364
Definition: CDRTypes.h:356
double getHeight() const
Definition: CDRTypes.h:38
CDRFont()
Definition: CDRTypes.h:373
CDRImageFill()
Definition: CDRTypes.h:99
unsigned short m_flags
Definition: CDRTypes.h:298
double width
Definition: CDRTypes.h:245
unsigned m_id
Definition: CDRTypes.h:293
Definition: CDRTypes.h:254
double m_fontSize
Definition: CDRTypes.h:145
Definition: CDRTypes.h:327
CDRColor m_color
Definition: CDRTypes.h:68
unsigned short capsType
Definition: CDRTypes.h:120
librevenge::RVNGString m_fontName
Definition: CDRTypes.h:144
CDRImageFill(unsigned i, double w, double h, bool r, double x, double y, double o, unsigned char f)
Definition: CDRTypes.h:101
double offsetX
Definition: CDRTypes.h:247
~CDRCMYKColor()
Definition: CDRTypes.h:310
Definition: CDRTypes.h:105
double height
Definition: CDRTypes.h:93
CDRPage()
Definition: CDRTypes.h:249
double getMinX() const
Definition: CDRTypes.h:42
CDRPolygon(unsigned numAngles, unsigned nextPoint, double rx, double ry, double cx, double cy)
Definition: CDRTypes.h:191
CDRLineStyle()
Definition: CDRTypes.h:129
Definition: CDRTypes.h:182
unsigned short joinType
Definition: CDRTypes.h:121
double rcpOffset
Definition: CDRTypes.h:97
CDRLineStyle m_lineStyle
Definition: CDRTypes.h:148
CDRGradient gradient
Definition: CDRTypes.h:109
CDRFillStyle(unsigned short ft, CDRColor c1, CDRColor c2, const CDRGradient &gr, const CDRImageFill &img)
Definition: CDRTypes.h:113
CDRText()
Definition: CDRTypes.h:349
double xOffset
Definition: CDRTypes.h:95
double m_cx
Definition: CDRTypes.h:188
unsigned char m_mode
Definition: CDRTypes.h:78
double m_x0
Definition: CDRTypes.h:299
CDRColor()
Definition: CDRTypes.h:60
CDRFillStyle()
Definition: CDRTypes.h:111
librevenge::RVNGString m_name
Definition: CDRTypes.h:378
double getMinY() const
Definition: CDRTypes.h:46
CDRPage(double w, double h, double ox, double oy)
Definition: CDRTypes.h:250
unsigned bpp
Definition: CDRTypes.h:235
CDRGradientStop(const CDRColor &color, double offset)
Definition: CDRTypes.h:71
std::vector< unsigned > dashArray
Definition: CDRTypes.h:126
Definition: CDRTypes.h:283
Definition: CDRCollector.h:24
double m_h
Definition: CDRTypes.h:29
double L
Definition: CDRTypes.h:332
unsigned short m_colorModel
Definition: CDRTypes.h:55
CDRColor(unsigned short colorModel, unsigned short colorPalette, unsigned colorValue)
Definition: CDRTypes.h:58
unsigned short m_colorPalette
Definition: CDRTypes.h:56
double b
Definition: CDRTypes.h:334
int m_edgeOffset
Definition: CDRTypes.h:81
double m_y1
Definition: CDRTypes.h:302
librevenge::RVNGBinaryData m_image
Definition: CDRTypes.h:198
unsigned offset
Definition: CDRTypes.h:280
CDRTextLine()
Definition: CDRTypes.h:358
Definition: CDRTypes.h:337
Definition: CDRTypes.h:273
double m_ry
Definition: CDRTypes.h:187
unsigned short lineType
Definition: CDRTypes.h:119
bool empty()
Definition: CDRTypes.h:266
CDRText(const librevenge::RVNGString &text, const CDRStyle &style)
Definition: CDRTypes.h:350
CDRGradientStop()
Definition: CDRTypes.h:70
void clear()
Definition: CDRTypes.h:261
CDRStyle()
Definition: CDRTypes.h:151
std::vector< CDRGradientStop > m_stops
Definition: CDRTypes.h:84
WaldoRecordInfo()
Definition: CDRTypes.h:277
unsigned char m_type
Definition: CDRTypes.h:77
CDRBitmap(unsigned cm, unsigned w, unsigned h, unsigned b, const std::vector< unsigned > &p, const std::vector< unsigned char > &bmp)
Definition: CDRTypes.h:239
unsigned id
Definition: CDRTypes.h:91
double m_y1
Definition: CDRTypes.h:201
unsigned m_align
Definition: CDRTypes.h:146
double m_rx
Definition: CDRTypes.h:186
double getWidth() const
Definition: CDRTypes.h:34
CDRPath startMarker
Definition: CDRTypes.h:127
double m_midPoint
Definition: CDRTypes.h:80
CDRLab4Color(double l, double A, double B)
Definition: CDRTypes.h:339
unsigned short fillType
Definition: CDRTypes.h:107
CDRGradient()
Definition: CDRTypes.h:85
#define CDR_ALMOST_ZERO(m)
Definition: libcdr_utils.h:31
double L
Definition: CDRTypes.h:342
CDRImageFill imageFill
Definition: CDRTypes.h:110
unsigned height
Definition: CDRTypes.h:223
CDRTransform m_trafo
Definition: CDRTypes.h:303
double stretch
Definition: CDRTypes.h:123
WaldoRecordType1(unsigned id, unsigned short next, unsigned short previous, unsigned short child, unsigned short parent, unsigned short flags, double x0, double y0, double x1, double y1, const CDRTransform &trafo)
Definition: CDRTypes.h:285
unsigned short m_encoding
Definition: CDRTypes.h:379
std::vector< CDRText > m_line
Definition: CDRTypes.h:368
double b
Definition: CDRTypes.h:324
unsigned width
Definition: CDRTypes.h:233
std::vector< unsigned char > pattern
Definition: CDRTypes.h:224
CDRCMYKColor(double cyan, double magenta, double yellow, double black)
Definition: CDRTypes.h:308
double m_y2
Definition: CDRTypes.h:202
double b
Definition: CDRTypes.h:344
CDRBox()
Definition: CDRTypes.h:30
double g
Definition: CDRTypes.h:323
unsigned m_colorValue
Definition: CDRTypes.h:57
CDRFillStyle m_fillStyle
Definition: CDRTypes.h:149
double m_x1
Definition: CDRTypes.h:301
CDRImage(const librevenge::RVNGBinaryData &image, double x1, double x2, double y1, double y2)
Definition: CDRTypes.h:204
double a
Definition: CDRTypes.h:343
Definition: CDRTypes.h:117
int m_centerXOffset
Definition: CDRTypes.h:82
unsigned m_numAngles
Definition: CDRTypes.h:184
double m_y
Definition: CDRTypes.h:27
void create(CDRPath &path) const
Definition: CDRTypes.cpp:14
unsigned height
Definition: CDRTypes.h:234
CDRLineStyle(unsigned short lt, unsigned short ct, unsigned short jt, double lw, double st, double a, const CDRColor &c, const std::vector< unsigned > &da, const CDRPath &sm, const CDRPath &em)
Definition: CDRTypes.h:133
unsigned short m_charSet
Definition: CDRTypes.h:143
unsigned char flags
Definition: CDRTypes.h:98
double k
Definition: CDRTypes.h:314
Definition: CDRTypes.h:230
Definition: CDRTypes.h:53
double c
Definition: CDRTypes.h:311
CDRStyle m_style
Definition: CDRTypes.h:353
CDRPolygon()
Definition: CDRTypes.h:190
CDRFont & operator=(const CDRFont &font)=default
Definition: CDRTypes.h:220
double m_w
Definition: CDRTypes.h:28
std::vector< unsigned > knotVector
Definition: CDRTypes.h:257
CDRPattern(unsigned w, unsigned h, const std::vector< unsigned char > &p)
Definition: CDRTypes.h:226
double height
Definition: CDRTypes.h:246
Definition: CDRTypes.h:75
void overrideStyle(const CDRStyle &override)
Definition: CDRTypes.h:158
CDRBox(double x0, double y0, double x1, double y1)
Definition: CDRTypes.h:32
Definition: CDRTypes.h:196
double m_offset
Definition: CDRTypes.h:69
double m_leftIndent
Definition: CDRTypes.h:147
std::vector< unsigned > palette
Definition: CDRTypes.h:236
double lineWidth
Definition: CDRTypes.h:122
Definition: CDRTypes.h:66
double m_angle
Definition: CDRTypes.h:79
double m_firstIndent
Definition: CDRTypes.h:147
unsigned m_parentId
Definition: CDRTypes.h:150
CDRSplineData(const std::vector< std::pair< double, double > > &ps, const std::vector< unsigned > &kntv)
Definition: CDRTypes.h:259
double offsetY
Definition: CDRTypes.h:248
~CDRLab4Color()
Definition: CDRTypes.h:341
CDRColor(unsigned short colorModel, unsigned colorValue)
Definition: CDRTypes.h:62
Definition: CDRTypes.h:141
std::vector< std::pair< double, double > > points
Definition: CDRTypes.h:256
const librevenge::RVNGBinaryData & getImage() const
Definition: CDRTypes.h:214
unsigned short m_child
Definition: CDRTypes.h:296