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)) {}
57 CDRColor() : m_colorModel(0), m_colorValue(0) {}
58 CDRColor(
unsigned short colorModel,
unsigned colorValue)
59 : m_colorModel(colorModel), m_colorValue(colorValue) {}
68 : m_color(color), m_offset(offset) {}
82 : 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() {}
95 CDRImageFill() : id(0), width(0.0), height(0.0), isRelative(false), xOffset(0.0), yOffset(0.0), rcpOffset(0.0), flags(0)
97 CDRImageFill(
unsigned i,
double w,
double h,
bool r,
double x,
double y,
double o,
unsigned char f)
98 : id(i), width(w), height(h), isRelative(r), xOffset(x), yOffset(y), rcpOffset(o), flags(f) {}
108 : fillType((unsigned short)-1), color1(), color2(), gradient(), imageFill() {}
110 : fillType(ft), color1(c1), color2(c2), gradient(gr), imageFill(img) {}
126 : lineType((unsigned short)-1), capsType(0), joinType(0), lineWidth(0.0),
127 stretch(0.0), angle(0.0), color(), dashArray(),
128 startMarker(), endMarker() {}
130 double lw,
double st,
double a,
const CDRColor &c,
const std::vector<unsigned> &da,
132 : lineType(lt), capsType(ct), joinType(jt), lineWidth(lw),
133 stretch(st), angle(a), color(c), dashArray(da),
134 startMarker(sm), endMarker(em) {}
148 : m_charSet((unsigned short)-1), m_fontName(),
149 m_fontSize(0.0), m_align(0), m_leftIndent(0.0), m_firstIndent(0.0),
150 m_rightIndent(0.0), m_lineStyle(), m_fillStyle(), m_parentId(0)
156 if (
override.m_charSet != (
unsigned short)-1 ||
override.m_fontName.len())
158 m_charSet =
override.m_charSet;
159 m_fontName =
override.m_fontName;
162 m_fontSize =
override.m_fontSize;
163 if (
override.m_align)
164 m_align =
override.m_align;
165 if (
override.m_leftIndent != 0.0 &&
override.m_firstIndent != 0.0 &&
override.m_rightIndent != 0.0)
167 m_leftIndent =
override.m_leftIndent;
168 m_firstIndent =
override.m_firstIndent;
169 m_rightIndent =
override.m_rightIndent;
171 if (
override.m_lineStyle.
lineType != (
unsigned short)-1)
172 m_lineStyle =
override.m_lineStyle;
173 if (
override.m_fillStyle.
fillType != (
unsigned short)-1)
174 m_fillStyle =
override.m_fillStyle;
186 CDRPolygon() : m_numAngles(0), m_nextPoint(0), m_rx(0.0), m_ry(0.0), m_cx(0.0), m_cy(0.0) {}
187 CDRPolygon(
unsigned numAngles,
unsigned nextPoint,
double rx,
double ry,
double cx,
double cy)
188 : m_numAngles(numAngles), m_nextPoint(nextPoint), m_rx(rx), m_ry(ry), m_cx(cx), m_cy(cy) {}
189 void create(
CDRPath &path)
const;
199 CDRImage() : m_image(), m_x1(0.0), m_x2(0.0), m_y1(0.0), m_y2(0.0) {}
200 CDRImage(
const librevenge::RVNGBinaryData &image,
double x1,
double x2,
double y1,
double y2)
201 : m_image(image), m_x1(x1), m_x2(x2), m_y1(y1), m_y2(y2) {}
204 return (m_x1 + m_x2) / 2.0;
208 return (m_y1 + m_y2) / 2.0;
222 CDRPattern(
unsigned w,
unsigned h,
const std::vector<unsigned char> &p)
223 : width(w), height(h), pattern(p) {}
234 CDRBitmap() : colorModel(0), width(0), height(0), bpp(0), palette(), bitmap() {}
235 CDRBitmap(
unsigned cm,
unsigned w,
unsigned h,
unsigned b,
const std::vector<unsigned> &p,
const std::vector<unsigned char> &bmp)
236 : colorModel(cm), width(w), height(h), bpp(b), palette(p), bitmap(bmp) {}
245 CDRPage() : width(0.0), height(0.0), offsetX(0.0), offsetY(0.0) {}
246 CDRPage(
double w,
double h,
double ox,
double oy)
247 : width(w), height(h), offsetX(ox), offsetY(oy) {}
252 std::vector<std::pair<double, double> >
points;
255 CDRSplineData(
const std::vector<std::pair<double, double> > &ps,
const std::vector<unsigned> &kntv)
256 : points(ps), knotVector(kntv) {}
264 return (points.empty() || knotVector.empty());
266 void create(
CDRPath &path)
const;
272 : type(t), id(i), offset(o) {}
282 unsigned short child,
unsigned short parent,
unsigned short flags,
283 double x0,
double y0,
double x1,
double y1,
const CDRTransform &trafo)
284 : m_id(id), m_next(next), m_previous(previous), m_child(child), m_parent(parent),
285 m_flags(flags), m_x0(x0), m_y0(y0), m_x1(x1), m_y1(y1), m_trafo(trafo) {}
287 : m_id(0), m_next(0), m_previous(0), m_child(0), m_parent(0), m_flags(0),
288 m_x0(0.0), m_y0(0.0), m_x1(0.0), m_y1(0.0), m_trafo() {}
305 : c(cyan), m(magenta), y(yellow), k(black) {}
316 : r(red), g(green), b(blue) {}
326 : L(l), a(A), b(B) {}
336 : L(l), a(A), b(B) {}
347 : m_text(text), m_style(style) {}
358 m_line.push_back(text);
370 CDRFont(
const librevenge::RVNGString &name,
unsigned short encoding)
371 : m_name(name), m_encoding(encoding) {}
373 : m_name(font.m_name), m_encoding(font.m_encoding) {}
int m_centerYOffset
Definition: CDRTypes.h:79
CDRBitmap()
Definition: CDRTypes.h:234
double m_rightIndent
Definition: CDRTypes.h:143
void append(const CDRText &text)
Definition: CDRTypes.h:356
CDRTextLine(const CDRTextLine &line)
Definition: CDRTypes.h:355
CDRImage()
Definition: CDRTypes.h:199
Definition: CDRTypes.h:367
unsigned m_nextPoint
Definition: CDRTypes.h:181
double m_x
Definition: CDRTypes.h:26
librevenge::RVNGString m_text
Definition: CDRTypes.h:348
unsigned char type
Definition: CDRTypes.h:274
unsigned id
Definition: CDRTypes.h:275
CDRLab2Color(double l, double A, double B)
Definition: CDRTypes.h:325
double a
Definition: CDRTypes.h:329
double m_x1
Definition: CDRTypes.h:195
Definition: CDRTypes.h:302
double r
Definition: CDRTypes.h:318
double yOffset
Definition: CDRTypes.h:92
~CDRLab2Color()
Definition: CDRTypes.h:327
double getMiddleY() const
Definition: CDRTypes.h:206
~CDRRGBColor()
Definition: CDRTypes.h:317
unsigned width
Definition: CDRTypes.h:218
CDRColor color
Definition: CDRTypes.h:121
CDRPattern()
Definition: CDRTypes.h:221
Definition: CDRTypes.h:24
CDRFont(const librevenge::RVNGString &name, unsigned short encoding)
Definition: CDRTypes.h:370
unsigned short m_parent
Definition: CDRTypes.h:293
WaldoRecordType1()
Definition: CDRTypes.h:286
double width
Definition: CDRTypes.h:88
unsigned short m_previous
Definition: CDRTypes.h:291
CDRColor color2
Definition: CDRTypes.h:104
CDRPath endMarker
Definition: CDRTypes.h:124
double angle
Definition: CDRTypes.h:120
CDRRGBColor(double red, double green, double blue)
Definition: CDRTypes.h:315
Definition: CDRTypes.h:343
double getHeight() const
Definition: CDRTypes.h:38
double y
Definition: CDRTypes.h:309
unsigned colorModel
Definition: CDRTypes.h:228
std::vector< unsigned char > bitmap
Definition: CDRTypes.h:233
Definition: CDRTypes.h:239
double m_y0
Definition: CDRTypes.h:296
double m_x2
Definition: CDRTypes.h:196
WaldoRecordInfo(unsigned char t, unsigned i, unsigned o)
Definition: CDRTypes.h:271
unsigned short m_next
Definition: CDRTypes.h:290
CDRSplineData()
Definition: CDRTypes.h:254
Definition: CDRTypes.h:85
double m_cy
Definition: CDRTypes.h:185
double m
Definition: CDRTypes.h:308
Definition: CDRTypes.h:313
bool isRelative
Definition: CDRTypes.h:90
void clear()
Definition: CDRTypes.h:360
Definition: CDRTypes.h:352
CDRFont()
Definition: CDRTypes.h:369
CDRImageFill()
Definition: CDRTypes.h:95
unsigned short m_flags
Definition: CDRTypes.h:294
double width
Definition: CDRTypes.h:241
unsigned m_id
Definition: CDRTypes.h:289
Definition: CDRTypes.h:250
double m_fontSize
Definition: CDRTypes.h:141
Definition: CDRTypes.h:323
CDRColor m_color
Definition: CDRTypes.h:64
CDRFont(const CDRFont &font)
Definition: CDRTypes.h:372
unsigned short capsType
Definition: CDRTypes.h:116
librevenge::RVNGString m_fontName
Definition: CDRTypes.h:140
CDRImageFill(unsigned i, double w, double h, bool r, double x, double y, double o, unsigned char f)
Definition: CDRTypes.h:97
double offsetX
Definition: CDRTypes.h:243
~CDRCMYKColor()
Definition: CDRTypes.h:306
Definition: CDRTypes.h:101
double height
Definition: CDRTypes.h:89
CDRPage()
Definition: CDRTypes.h:245
const librevenge::RVNGBinaryData & getImage() const
Definition: CDRTypes.h:210
CDRPolygon(unsigned numAngles, unsigned nextPoint, double rx, double ry, double cx, double cy)
Definition: CDRTypes.h:187
CDRLineStyle()
Definition: CDRTypes.h:125
Definition: CDRTypes.h:178
unsigned short joinType
Definition: CDRTypes.h:117
double rcpOffset
Definition: CDRTypes.h:93
CDRLineStyle m_lineStyle
Definition: CDRTypes.h:144
CDRGradient gradient
Definition: CDRTypes.h:105
CDRFillStyle(unsigned short ft, CDRColor c1, CDRColor c2, const CDRGradient &gr, const CDRImageFill &img)
Definition: CDRTypes.h:109
CDRText()
Definition: CDRTypes.h:345
double xOffset
Definition: CDRTypes.h:91
double m_cx
Definition: CDRTypes.h:184
double getMinY() const
Definition: CDRTypes.h:46
unsigned char m_mode
Definition: CDRTypes.h:74
double m_x0
Definition: CDRTypes.h:295
double getMiddleX() const
Definition: CDRTypes.h:202
CDRColor()
Definition: CDRTypes.h:57
CDRFillStyle()
Definition: CDRTypes.h:107
librevenge::RVNGString m_name
Definition: CDRTypes.h:374
CDRPage(double w, double h, double ox, double oy)
Definition: CDRTypes.h:246
unsigned bpp
Definition: CDRTypes.h:231
CDRGradientStop(const CDRColor &color, double offset)
Definition: CDRTypes.h:67
std::vector< unsigned > dashArray
Definition: CDRTypes.h:122
Definition: CDRTypes.h:279
Definition: CDRCollector.h:24
double m_h
Definition: CDRTypes.h:29
double L
Definition: CDRTypes.h:328
unsigned short m_colorModel
Definition: CDRTypes.h:55
double b
Definition: CDRTypes.h:330
int m_edgeOffset
Definition: CDRTypes.h:77
double m_y1
Definition: CDRTypes.h:298
librevenge::RVNGBinaryData m_image
Definition: CDRTypes.h:194
unsigned offset
Definition: CDRTypes.h:276
CDRTextLine()
Definition: CDRTypes.h:354
Definition: CDRTypes.h:333
Definition: CDRTypes.h:269
double m_ry
Definition: CDRTypes.h:183
unsigned short lineType
Definition: CDRTypes.h:115
double getMinX() const
Definition: CDRTypes.h:42
bool empty()
Definition: CDRTypes.h:262
CDRText(const librevenge::RVNGString &text, const CDRStyle &style)
Definition: CDRTypes.h:346
CDRGradientStop()
Definition: CDRTypes.h:66
void clear()
Definition: CDRTypes.h:257
double getWidth() const
Definition: CDRTypes.h:34
CDRStyle()
Definition: CDRTypes.h:147
std::vector< CDRGradientStop > m_stops
Definition: CDRTypes.h:80
WaldoRecordInfo()
Definition: CDRTypes.h:273
unsigned char m_type
Definition: CDRTypes.h:73
CDRBitmap(unsigned cm, unsigned w, unsigned h, unsigned b, const std::vector< unsigned > &p, const std::vector< unsigned char > &bmp)
Definition: CDRTypes.h:235
unsigned id
Definition: CDRTypes.h:87
double m_y1
Definition: CDRTypes.h:197
unsigned m_align
Definition: CDRTypes.h:142
double m_rx
Definition: CDRTypes.h:182
CDRPath startMarker
Definition: CDRTypes.h:123
double m_midPoint
Definition: CDRTypes.h:76
CDRLab4Color(double l, double A, double B)
Definition: CDRTypes.h:335
unsigned short fillType
Definition: CDRTypes.h:103
CDRGradient()
Definition: CDRTypes.h:81
#define CDR_ALMOST_ZERO(m)
Definition: libcdr_utils.h:31
double L
Definition: CDRTypes.h:338
CDRImageFill imageFill
Definition: CDRTypes.h:106
unsigned height
Definition: CDRTypes.h:219
CDRTransform m_trafo
Definition: CDRTypes.h:299
double stretch
Definition: CDRTypes.h:119
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:281
unsigned short m_encoding
Definition: CDRTypes.h:375
std::vector< CDRText > m_line
Definition: CDRTypes.h:364
double b
Definition: CDRTypes.h:320
unsigned width
Definition: CDRTypes.h:229
std::vector< unsigned char > pattern
Definition: CDRTypes.h:220
CDRCMYKColor(double cyan, double magenta, double yellow, double black)
Definition: CDRTypes.h:304
double m_y2
Definition: CDRTypes.h:198
double b
Definition: CDRTypes.h:340
CDRBox()
Definition: CDRTypes.h:30
double g
Definition: CDRTypes.h:319
unsigned m_colorValue
Definition: CDRTypes.h:56
CDRFillStyle m_fillStyle
Definition: CDRTypes.h:145
double m_x1
Definition: CDRTypes.h:297
CDRImage(const librevenge::RVNGBinaryData &image, double x1, double x2, double y1, double y2)
Definition: CDRTypes.h:200
double a
Definition: CDRTypes.h:339
Definition: CDRTypes.h:113
int m_centerXOffset
Definition: CDRTypes.h:78
unsigned m_numAngles
Definition: CDRTypes.h:180
double m_y
Definition: CDRTypes.h:27
unsigned height
Definition: CDRTypes.h:230
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:129
unsigned short m_charSet
Definition: CDRTypes.h:139
unsigned char flags
Definition: CDRTypes.h:94
double k
Definition: CDRTypes.h:310
Definition: CDRTypes.h:226
Definition: CDRTypes.h:53
double c
Definition: CDRTypes.h:307
CDRStyle m_style
Definition: CDRTypes.h:349
CDRPolygon()
Definition: CDRTypes.h:186
Definition: CDRTypes.h:216
double m_w
Definition: CDRTypes.h:28
std::vector< unsigned > knotVector
Definition: CDRTypes.h:253
CDRPattern(unsigned w, unsigned h, const std::vector< unsigned char > &p)
Definition: CDRTypes.h:222
double height
Definition: CDRTypes.h:242
Definition: CDRTypes.h:71
void overrideStyle(const CDRStyle &override)
Definition: CDRTypes.h:154
CDRBox(double x0, double y0, double x1, double y1)
Definition: CDRTypes.h:32
Definition: CDRTypes.h:192
double m_offset
Definition: CDRTypes.h:65
std::vector< unsigned > palette
Definition: CDRTypes.h:232
double lineWidth
Definition: CDRTypes.h:118
Definition: CDRTypes.h:62
double m_angle
Definition: CDRTypes.h:75
unsigned m_parentId
Definition: CDRTypes.h:146
CDRSplineData(const std::vector< std::pair< double, double > > &ps, const std::vector< unsigned > &kntv)
Definition: CDRTypes.h:255
double offsetY
Definition: CDRTypes.h:244
~CDRLab4Color()
Definition: CDRTypes.h:337
CDRColor(unsigned short colorModel, unsigned colorValue)
Definition: CDRTypes.h:58
Definition: CDRTypes.h:137
std::vector< std::pair< double, double > > points
Definition: CDRTypes.h:252
unsigned short m_child
Definition: CDRTypes.h:292