MWAWGraphicStyle.hxx Source File documentation

MWAWGraphicStyle.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2
3 /* libmwaw
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20 * Copyright (C) 2006, 2007 Andrew Ziem
21 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22 *
23 *
24 * All Rights Reserved.
25 *
26 * For minor contributions see the git repository.
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30 * in which case the provisions of the LGPLv2+ are applicable
31 * instead of those above.
32 */
33 #ifndef MWAW_GRAPHIC_STYLE
34 # define MWAW_GRAPHIC_STYLE
35 # include <ostream>
36 # include <string>
37 # include <vector>
38
39 # include "librevenge/librevenge.h"
40 # include "libmwaw_internal.hxx"
41
47 class MWAWGraphicStyle
48 {
49 public:
51 enum LineCap { C_Butt, C_Square, C_Round };
53 enum LineJoin { J_Miter, J_Round, J_Bevel };
55 enum GradientType { G_None, G_Axial, G_Linear, G_Radial, G_Rectangular, G_Square, G_Ellipsoid };
56
58 struct Arrow {
60 Arrow()
61 : m_viewBox()
62 , m_path("")
63 , m_width(0)
64 , m_isCentered(false)
65 {
66 }
68 Arrow(float w, MWAWBox2i const &box, std::string const &path, bool centered=false)
69 : m_viewBox(box)
70 , m_path(path)
71 , m_width(w)
72 , m_isCentered(centered)
73 {
74 }
76 static Arrow plain()
77 {
78 return Arrow(5, MWAWBox2i(MWAWVec2i(0,0),MWAWVec2i(20,30)), "m10 0-10 30h20z", false);
79 }
81 friend std::ostream &operator<<(std::ostream &o, Arrow const &arrow)
82 {
83 if (arrow.isEmpty()) return o;
84 o << "w=" << arrow.m_width << ",";
85 o << "viewbox=" << arrow.m_viewBox << ",";
86 o << "path=" << arrow.m_path << ",";
87 if (arrow.m_isCentered) o << "centered,";
88 return o;
89 }
91 bool operator==(Arrow const &arrow) const
92 {
93 return m_width>=arrow.m_width && m_width<=arrow.m_width &&
94 m_viewBox==arrow.m_viewBox && m_path==arrow.m_path && m_isCentered==arrow.m_isCentered;
95 }
97 bool operator!=(Arrow const &arrow) const
98 {
99 return !(*this==arrow);
100 }
102 bool operator<(Arrow const &arrow) const
103 {
104 if (m_isCentered<arrow.m_isCentered) return m_isCentered ? true : false;
105 return m_width<arrow.m_width && m_viewBox<arrow.m_viewBox && m_path < arrow.m_path;
106 }
108 bool operator<=(Arrow const &arrow) const
109 {
110 return *this<arrow || *this==arrow;
111 }
113 bool operator>(Arrow const &arrow) const
114 {
115 return !(*this<=arrow);
116 }
118 bool operator>=(Arrow const &arrow) const
119 {
120 return !(*this<arrow);
121 }
123 bool isEmpty() const
124 {
125 return m_width<=0 || m_path.empty();
126 }
128 void addTo(librevenge::RVNGPropertyList &propList, std::string const &type) const;
129
131 MWAWBox2i m_viewBox;
133 std::string m_path;
135 float m_width;
137 bool m_isCentered;
138 };
139
141 struct GradientStop {
143 explicit GradientStop(float offset=0.0, MWAWColor const &col=MWAWColor::black(), float opacity=1.0)
144 : m_offset(offset)
145 , m_color(col)
146 , m_opacity(opacity)
147 {
148 }
150 int cmp(GradientStop const &a) const
151 {
152 if (m_offset < a.m_offset) return -1;
153 if (m_offset > a.m_offset) return 1;
154 if (m_color < a.m_color) return -1;
155 if (m_color > a.m_color) return 1;
156 if (m_opacity < a.m_opacity) return -1;
157 if (m_opacity > a.m_opacity) return 1;
158 return 0;
159 }
161 friend std::ostream &operator<<(std::ostream &o, GradientStop const &st)
162 {
163 o << "offset=" << st.m_offset << ",";
164 o << "color=" << st.m_color << ",";
165 if (st.m_opacity<1)
166 o << "opacity=" << st.m_opacity*100.f << "%,";
167 return o;
168 }
170 float m_offset;
172 MWAWColor m_color;
174 float m_opacity;
175 };
180 struct Pattern {
182 Pattern()
183 : m_dim(0,0)
184 , m_data()
185 , m_picture()
186 , m_pictureAverageColor(MWAWColor::white())
187 {
188 m_colors[0]=MWAWColor::black();
189 m_colors[1]=MWAWColor::white();
190 }
192 Pattern(MWAWVec2i dim, MWAWEmbeddedObject const &picture, MWAWColor const &avColor)
193 : m_dim(dim)
194 , m_data()
195 , m_picture(picture)
196 , m_pictureAverageColor(avColor)
197 {
198 m_colors[0]=MWAWColor::black();
199 m_colors[1]=MWAWColor::white();
200 }
202 virtual ~Pattern();
204 bool empty() const
205 {
206 if (m_dim[0]==0 || m_dim[1]==0) return true;
207 if (!m_picture.m_dataList.empty()) return false;
208 if (m_dim[0]!=8 && m_dim[0]!=16 && m_dim[0]!=32) return true;
209 return m_data.size()!=size_t((m_dim[0]/8)*m_dim[1]);
210 }
212 bool getAverageColor(MWAWColor &col) const;
214 bool getUniqueColor(MWAWColor &col) const;
216 bool getBinary(MWAWEmbeddedObject &picture) const;
217
219 int cmp(Pattern const &a) const
220 {
221 int diff = m_dim.cmp(a.m_dim);
222 if (diff) return diff;
223 if (m_data.size() < a.m_data.size()) return -1;
224 if (m_data.size() > a.m_data.size()) return 1;
225 for (size_t h=0; h < m_data.size(); ++h) {
226 if (m_data[h]<a.m_data[h]) return 1;
227 if (m_data[h]>a.m_data[h]) return -1;
228 }
229 for (int i=0; i<2; ++i) {
230 if (m_colors[i] < a.m_colors[i]) return 1;
231 if (m_colors[i] > a.m_colors[i]) return -1;
232 }
233 if (m_pictureAverageColor < a.m_pictureAverageColor) return 1;
234 if (m_pictureAverageColor > a.m_pictureAverageColor) return -1;
235 diff=m_picture.cmp(a.m_picture);
236 if (diff) return diff;
237 return 0;
238 }
240 friend std::ostream &operator<<(std::ostream &o, Pattern const &pat)
241 {
242 o << "dim=" << pat.m_dim << ",";
243 if (!pat.m_picture.isEmpty()) {
244 o << "pict=" << pat.m_picture << ",";
245 o << "col[average]=" << pat.m_pictureAverageColor << ",";
246 }
247 else {
248 if (!pat.m_colors[0].isBlack()) o << "col0=" << pat.m_colors[0] << ",";
249 if (!pat.m_colors[1].isWhite()) o << "col1=" << pat.m_colors[1] << ",";
250 o << "[";
251 for (auto data : pat.m_data)
252 o << std::hex << static_cast<int>(data) << std::dec << ",";
253 o << "],";
254 }
255 return o;
256 }
258 MWAWVec2i m_dim;
259
261 MWAWColor m_colors[2];
263 std::vector<unsigned char> m_data;
264 protected:
266 MWAWEmbeddedObject m_picture;
268 MWAWColor m_pictureAverageColor;
269 };
271 MWAWGraphicStyle()
272 : m_lineDashWidth()
273 , m_lineWidth(1)
274 , m_lineCap(C_Butt)
275 , m_lineJoin(J_Miter)
276 , m_lineOpacity(1)
277 , m_lineColor(MWAWColor::black())
278 , m_surfaceColor(MWAWColor::white())
279 , m_surfaceOpacity(0)
280 , m_shadowColor(MWAWColor::black())
281 , m_shadowOpacity(0)
282 , m_shadowOffset(1,1)
283 , m_gradientType(G_None)
284 , m_pattern()
285 , m_gradientStopList()
286 , m_gradientAngle(0)
287 , m_gradientBorder(0)
288 , m_gradientPercentCenter(0.5f,0.5f)
289 , m_gradientRadius(1)
290 , m_backgroundColor(MWAWColor::white())
291 , m_backgroundOpacity(-1)
292 , m_rotate(0)
293 , m_bordersList()
294 , m_frameName("")
295 , m_frameNextName("")
296 , m_fillRuleEvenOdd(false)
297 , m_extra("")
298 {
299 for (auto &fl : m_flip) fl=false;
300 m_gradientStopList.push_back(GradientStop(0.0, MWAWColor::white()));
301 m_gradientStopList.push_back(GradientStop(1.0, MWAWColor::black()));
302 }
304 static MWAWGraphicStyle emptyStyle()
305 {
306 MWAWGraphicStyle res;
307 res.m_lineWidth=0;
308 return res;
309 }
311 virtual ~MWAWGraphicStyle();
313 bool hasLine() const
314 {
315 return m_lineWidth>0 && m_lineOpacity>0;
316 }
318 void setSurfaceColor(MWAWColor const &col, float opacity = 1)
319 {
320 m_surfaceColor = col;
321 m_surfaceOpacity = opacity;
322 }
324 bool hasSurfaceColor() const
325 {
326 return m_surfaceOpacity > 0;
327 }
329 void setPattern(Pattern const &pat, float opacity = 1)
330 {
331 m_pattern=pat;
332 m_surfaceOpacity = opacity;
333 }
335 bool hasPattern() const
336 {
337 return !m_pattern.empty() && m_surfaceOpacity > 0;
338 }
340 bool hasGradient(bool complex=false) const
341 {
342 return m_gradientType != G_None && static_cast<int>(m_gradientStopList.size()) >= (complex ? 3 : 2);
343 }
345 bool hasSurface() const
346 {
347 return hasSurfaceColor() || hasPattern() || hasGradient();
348 }
350 void setBackgroundColor(MWAWColor const &col, float opacity = 1)
351 {
352 m_backgroundColor = col;
353 m_backgroundOpacity = opacity;
354 }
356 bool hasBackgroundColor() const
357 {
358 return m_backgroundOpacity > 0;
359 }
361 void setShadowColor(MWAWColor const &col, float opacity = 1)
362 {
363 m_shadowColor = col;
364 m_shadowOpacity = opacity;
365 }
367 bool hasShadow() const
368 {
369 return m_shadowOpacity > 0;
370 }
372 bool hasBorders() const
373 {
374 return !m_bordersList.empty();
375 }
377 bool hasSameBorders() const
378 {
379 if (m_bordersList.empty()) return true;
380 if (m_bordersList.size()!=4) return false;
381 for (size_t i=1; i<m_bordersList.size(); ++i) {
382 if (m_bordersList[i]!=m_bordersList[0])
383 return false;
384 }
385 return true;
386 }
388 std::vector<MWAWBorder> const &borders() const
389 {
390 return m_bordersList;
391 }
393 void resetBorders()
394 {
395 m_bordersList.resize(0);
396 }
398 void setBorders(int wh, MWAWBorder const &border);
400 friend std::ostream &operator<<(std::ostream &o, MWAWGraphicStyle const &st);
402 void addTo(librevenge::RVNGPropertyList &pList, bool only1d=false) const;
404 void addFrameTo(librevenge::RVNGPropertyList &pList) const;
406 int cmp(MWAWGraphicStyle const &a) const;
407
409 std::vector<float> m_lineDashWidth;
411 float m_lineWidth;
413 LineCap m_lineCap;
415 LineJoin m_lineJoin;
417 float m_lineOpacity;
419 MWAWColor m_lineColor;
421 MWAWColor m_surfaceColor;
423 float m_surfaceOpacity;
424
426 MWAWColor m_shadowColor;
428 float m_shadowOpacity;
430 MWAWVec2f m_shadowOffset;
432 GradientType m_gradientType;
433
435 Pattern m_pattern;
436
438 std::vector<GradientStop> m_gradientStopList;
440 float m_gradientAngle;
442 float m_gradientBorder;
444 MWAWVec2f m_gradientPercentCenter;
446 float m_gradientRadius;
447
448 //
449 // related to the frame
450 //
451
453 MWAWColor m_backgroundColor;
455 float m_backgroundOpacity;
457 float m_rotate;
459 std::vector<MWAWBorder> m_bordersList;
461 std::string m_frameName;
463 std::string m_frameNextName;
464
466 Arrow m_arrows[2];
467
468 //
469 // some transformation: must probably be somewhere else
470 //
471
473 bool m_flip[2];
474
476 bool m_fillRuleEvenOdd;
478 std::string m_extra;
479 };
480 #endif
481 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWGraphicStyle::Arrow::m_viewBox
MWAWBox2i m_viewBox
the arrow viewbox
Definition: MWAWGraphicStyle.hxx:131
MWAWGraphicStyle::Arrow::addTo
void addTo(librevenge::RVNGPropertyList &propList, std::string const &type) const
add a arrow to the propList knowing the type (start, end)
Definition: MWAWGraphicStyle.cxx:56
MWAWGraphicStyle::m_flip
bool m_flip[2]
two bool to indicated we need to flip the shape or not
Definition: MWAWGraphicStyle.hxx:473
MWAWGraphicStyle::Pattern::~Pattern
virtual ~Pattern()
virtual destructor
Definition: MWAWGraphicStyle.cxx:82
MWAWGraphicStyle::GradientStop::operator<<
friend std::ostream & operator<<(std::ostream &o, GradientStop const &st)
a print operator
Definition: MWAWGraphicStyle.hxx:161
MWAWGraphicStyle::cmp
int cmp(MWAWGraphicStyle const &a) const
compare two styles
Definition: MWAWGraphicStyle.cxx:418
MWAWGraphicStyle::Pattern::m_dim
MWAWVec2i m_dim
the dimension width x height
Definition: MWAWGraphicStyle.hxx:258
MWAWGraphicStyle::m_surfaceColor
MWAWColor m_surfaceColor
the surface color
Definition: MWAWGraphicStyle.hxx:421
MWAWGraphicStyle::m_frameNextName
std::string m_frameNextName
the frame next name (if there is a link)
Definition: MWAWGraphicStyle.hxx:463
MWAWGraphicStyle::m_shadowColor
MWAWColor m_shadowColor
the shadow color
Definition: MWAWGraphicStyle.hxx:426
MWAWGraphicStyle::J_Round
Definition: MWAWGraphicStyle.hxx:53
MWAWEmbeddedObject::cmp
int cmp(MWAWEmbeddedObject const &pict) const
a comparison function
Definition: libmwaw_internal.cxx:598
MWAWGraphicStyle::GradientStop::m_opacity
float m_opacity
the opacity
Definition: MWAWGraphicStyle.hxx:174
MWAWGraphicStyle::m_backgroundOpacity
float m_backgroundOpacity
true if the background has some color
Definition: MWAWGraphicStyle.hxx:455
MWAWGraphicStyle::m_frameName
std::string m_frameName
the frame name
Definition: MWAWGraphicStyle.hxx:461
libmwaw_internal.hxx
MWAWEmbeddedObject::m_dataList
std::vector< librevenge::RVNGBinaryData > m_dataList
the picture content: one data by representation
Definition: libmwaw_internal.hxx:509
MWAWColor::isWhite
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:289
MWAWColor::isBlack
bool isBlack() const
return true if the color is black
Definition: libmwaw_internal.hxx:284
MWAWGraphicStyle::m_shadowOpacity
float m_shadowOpacity
true if the shadow has some color
Definition: MWAWGraphicStyle.hxx:428
MWAWGraphicStyle::Pattern::Pattern
Pattern()
constructor
Definition: MWAWGraphicStyle.hxx:182
MWAWColor::white
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:250
MWAWGraphicStyle::MWAWGraphicStyle
MWAWGraphicStyle()
constructor
Definition: MWAWGraphicStyle.hxx:271
MWAWGraphicStyle::Arrow::Arrow
Arrow()
constructor ( no arrow)
Definition: MWAWGraphicStyle.hxx:60
MWAWGraphicStyle::G_None
Definition: MWAWGraphicStyle.hxx:55
MWAWGraphicStyle::Arrow::operator==
bool operator==(Arrow const &arrow) const
operator==
Definition: MWAWGraphicStyle.hxx:91
MWAWGraphicStyle::Pattern::Pattern
Pattern(MWAWVec2i dim, MWAWEmbeddedObject const &picture, MWAWColor const &avColor)
constructor from a binary data
Definition: MWAWGraphicStyle.hxx:192
MWAWGraphicStyle::m_gradientPercentCenter
MWAWVec2f m_gradientPercentCenter
the gradient center
Definition: MWAWGraphicStyle.hxx:444
MWAWGraphicStyle::Pattern::m_picture
MWAWEmbeddedObject m_picture
a picture
Definition: MWAWGraphicStyle.hxx:266
MWAWGraphicStyle::Arrow::operator<=
bool operator<=(Arrow const &arrow) const
operator<=
Definition: MWAWGraphicStyle.hxx:108
MWAWGraphicStyle::Arrow::plain
static Arrow plain()
returns a basic plain arrow
Definition: MWAWGraphicStyle.hxx:76
MWAWGraphicStyle::setPattern
void setPattern(Pattern const &pat, float opacity=1)
set the pattern
Definition: MWAWGraphicStyle.hxx:329
MWAWGraphicStyle::Pattern::m_colors
MWAWColor m_colors[2]
the two indexed colors
Definition: MWAWGraphicStyle.hxx:261
MWAWGraphicStyle::LineCap
LineCap
an enum used to define the basic line cap
Definition: MWAWGraphicStyle.hxx:51
MWAWGraphicStyle::hasSameBorders
bool hasSameBorders() const
return true if the frame has some border
Definition: MWAWGraphicStyle.hxx:377
MWAWGraphicStyle::m_lineJoin
LineJoin m_lineJoin
the line join
Definition: MWAWGraphicStyle.hxx:415
MWAWGraphicStyle::m_arrows
Arrow m_arrows[2]
the two arrows corresponding to start and end extremity
Definition: MWAWGraphicStyle.hxx:466
MWAWGraphicStyle::m_lineColor
MWAWColor m_lineColor
the line color
Definition: MWAWGraphicStyle.hxx:419
MWAWGraphicStyle::hasShadow
bool hasShadow() const
returns true if the shadow is defined
Definition: MWAWGraphicStyle.hxx:367
MWAWGraphicStyle::borders
std::vector< MWAWBorder > const & borders() const
return the frame border: libmwaw::Left | ...
Definition: MWAWGraphicStyle.hxx:388
MWAWColor::black
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:245
MWAWGraphicStyle::m_gradientRadius
float m_gradientRadius
the gradient radius
Definition: MWAWGraphicStyle.hxx:446
MWAWGraphicStyle
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:47
MWAWGraphicStyle::C_Round
Definition: MWAWGraphicStyle.hxx:51
MWAWGraphicStyle::GradientType
GradientType
an enum used to define the gradient type
Definition: MWAWGraphicStyle.hxx:55
MWAWGraphicStyle::Arrow::m_isCentered
bool m_isCentered
flag to know if the arrow is centered
Definition: MWAWGraphicStyle.hxx:137
MWAWGraphicStyle::hasBackgroundColor
bool hasBackgroundColor() const
returns true if the background is defined
Definition: MWAWGraphicStyle.hxx:356
MWAWGraphicStyle::G_Ellipsoid
Definition: MWAWGraphicStyle.hxx:55
MWAWVec2i
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:834
MWAWBox2i
MWAWBox2< int > MWAWBox2i
MWAWBox2 of int.
Definition: libmwaw_internal.hxx:1187
MWAWGraphicStyle::hasGradient
bool hasGradient(bool complex=false) const
returns true if the gradient is defined
Definition: MWAWGraphicStyle.hxx:340
MWAWGraphicStyle::Arrow::operator<
bool operator<(Arrow const &arrow) const
operator<
Definition: MWAWGraphicStyle.hxx:102
MWAWVec2::cmp
int cmp(MWAWVec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libmwaw_internal.hxx:773
MWAWGraphicStyle::Pattern::getBinary
bool getBinary(MWAWEmbeddedObject &picture) const
tries to convert the picture in a binary data ( ppm)
Definition: MWAWGraphicStyle.cxx:128
MWAWGraphicStyle::operator<<
friend std::ostream & operator<<(std::ostream &o, MWAWGraphicStyle const &st)
a print operator
Definition: MWAWGraphicStyle.cxx:502
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:192
MWAWGraphicStyle::Arrow::operator>
bool operator>(Arrow const &arrow) const
operator>
Definition: MWAWGraphicStyle.hxx:113
MWAWGraphicStyle::C_Butt
Definition: MWAWGraphicStyle.hxx:51
MWAWGraphicStyle::Arrow::m_width
float m_width
the arrow width in point
Definition: MWAWGraphicStyle.hxx:135
MWAWGraphicStyle::addTo
void addTo(librevenge::RVNGPropertyList &pList, bool only1d=false) const
add all the parameters to the propList excepted the frame parameter: the background and the borders ...
Definition: MWAWGraphicStyle.cxx:191
MWAWGraphicStyle::m_rotate
float m_rotate
the rotation
Definition: MWAWGraphicStyle.hxx:457
MWAWGraphicStyle::m_lineDashWidth
std::vector< float > m_lineDashWidth
the dash array: a sequence of (fullsize, emptysize)
Definition: MWAWGraphicStyle.hxx:409
MWAWGraphicStyle::Arrow::operator<<
friend std::ostream & operator<<(std::ostream &o, Arrow const &arrow)
operator<<
Definition: MWAWGraphicStyle.hxx:81
MWAWGraphicStyle::GradientStop
a structure used to define the gradient limit in MWAWGraphicStyle
Definition: MWAWGraphicStyle.hxx:141
MWAWGraphicStyle::Arrow::operator>=
bool operator>=(Arrow const &arrow) const
operator>=
Definition: MWAWGraphicStyle.hxx:118
MWAWBorder
a border
Definition: libmwaw_internal.hxx:333
MWAWBox2< int >
MWAWGraphicStyle::hasSurface
bool hasSurface() const
returns true if the interior surface is defined
Definition: MWAWGraphicStyle.hxx:345
MWAWGraphicStyle::G_Axial
Definition: MWAWGraphicStyle.hxx:55
MWAWGraphicStyle::m_extra
std::string m_extra
extra data
Definition: MWAWGraphicStyle.hxx:478
MWAWGraphicStyle::Pattern::getUniqueColor
bool getUniqueColor(MWAWColor &col) const
check if the pattern has only one color; if so returns true...
Definition: MWAWGraphicStyle.cxx:86
MWAWGraphicStyle::addFrameTo
void addFrameTo(librevenge::RVNGPropertyList &pList) const
add all the frame parameters to propList: the background and the borders
Definition: MWAWGraphicStyle.cxx:370
MWAWGraphicStyle::m_shadowOffset
MWAWVec2f m_shadowOffset
the shadow offset
Definition: MWAWGraphicStyle.hxx:430
MWAWGraphicStyle::m_lineCap
LineCap m_lineCap
the line cap
Definition: MWAWGraphicStyle.hxx:413
MWAWGraphicStyle::m_surfaceOpacity
float m_surfaceOpacity
true if the surface has some color
Definition: MWAWGraphicStyle.hxx:423
MWAWGraphicStyle::Pattern::empty
bool empty() const
return true if we does not have a pattern
Definition: MWAWGraphicStyle.hxx:204
MWAWGraphicStyle::m_gradientBorder
float m_gradientBorder
the gradient border opacity
Definition: MWAWGraphicStyle.hxx:442
MWAWGraphicStyle::m_gradientType
GradientType m_gradientType
the gradient type
Definition: MWAWGraphicStyle.hxx:432
MWAWGraphicStyle::m_backgroundColor
MWAWColor m_backgroundColor
the background color
Definition: MWAWGraphicStyle.hxx:453
MWAWGraphicStyle::J_Miter
Definition: MWAWGraphicStyle.hxx:53
MWAWGraphicStyle::m_gradientAngle
float m_gradientAngle
the gradient angle
Definition: MWAWGraphicStyle.hxx:440
MWAWGraphicStyle::m_pattern
Pattern m_pattern
the pattern if it exists
Definition: MWAWGraphicStyle.hxx:435
MWAWGraphicStyle::hasBorders
bool hasBorders() const
return true if the frame has some border
Definition: MWAWGraphicStyle.hxx:372
MWAWGraphicStyle::J_Bevel
Definition: MWAWGraphicStyle.hxx:53
MWAWGraphicStyle::setSurfaceColor
void setSurfaceColor(MWAWColor const &col, float opacity=1)
set the surface color
Definition: MWAWGraphicStyle.hxx:318
MWAWGraphicStyle::C_Square
Definition: MWAWGraphicStyle.hxx:51
MWAWGraphicStyle::Pattern::cmp
int cmp(Pattern const &a) const
compare two patterns
Definition: MWAWGraphicStyle.hxx:219
MWAWGraphicStyle::m_fillRuleEvenOdd
bool m_fillRuleEvenOdd
true if the fill rule is evenod
Definition: MWAWGraphicStyle.hxx:476
MWAWEmbeddedObject
small class use to define a embedded object
Definition: libmwaw_internal.hxx:467
MWAWGraphicStyle::G_Square
Definition: MWAWGraphicStyle.hxx:55
MWAWGraphicStyle::Arrow
a structure used to define an arrow
Definition: MWAWGraphicStyle.hxx:58
MWAWGraphicStyle::Arrow::operator!=
bool operator!=(Arrow const &arrow) const
operator!=
Definition: MWAWGraphicStyle.hxx:97
MWAWGraphicStyle::G_Linear
Definition: MWAWGraphicStyle.hxx:55
MWAWGraphicStyle::hasLine
bool hasLine() const
returns true if the border is defined
Definition: MWAWGraphicStyle.hxx:313
MWAWGraphicStyle::GradientStop::m_color
MWAWColor m_color
the color
Definition: MWAWGraphicStyle.hxx:172
MWAWGraphicStyle::hasSurfaceColor
bool hasSurfaceColor() const
returns true if the surface is defined
Definition: MWAWGraphicStyle.hxx:324
MWAWGraphicStyle::Pattern::getAverageColor
bool getAverageColor(MWAWColor &col) const
return the average color
Definition: MWAWGraphicStyle.cxx:101
MWAWGraphicStyle::G_Rectangular
Definition: MWAWGraphicStyle.hxx:55
MWAWGraphicStyle::m_bordersList
std::vector< MWAWBorder > m_bordersList
the borders MWAWBorder::Pos (for a frame)
Definition: MWAWGraphicStyle.hxx:459
MWAWGraphicStyle::LineJoin
LineJoin
an enum used to define the basic line join
Definition: MWAWGraphicStyle.hxx:53
MWAWEmbeddedObject::isEmpty
bool isEmpty() const
return true if the picture contains no data
Definition: libmwaw_internal.hxx:483
MWAWGraphicStyle::setShadowColor
void setShadowColor(MWAWColor const &col, float opacity=1)
set the shadow color
Definition: MWAWGraphicStyle.hxx:361
MWAWGraphicStyle::~MWAWGraphicStyle
virtual ~MWAWGraphicStyle()
virtual destructor
Definition: MWAWGraphicStyle.cxx:168
MWAWGraphicStyle::m_lineOpacity
float m_lineOpacity
the line opacity: 0=transparent
Definition: MWAWGraphicStyle.hxx:417
MWAWGraphicStyle::Pattern::m_pictureAverageColor
MWAWColor m_pictureAverageColor
the picture average color
Definition: MWAWGraphicStyle.hxx:268
MWAWGraphicStyle::setBackgroundColor
void setBackgroundColor(MWAWColor const &col, float opacity=1)
set the background color
Definition: MWAWGraphicStyle.hxx:350
MWAWGraphicStyle::m_lineWidth
float m_lineWidth
the linewidth
Definition: MWAWGraphicStyle.hxx:411
MWAWGraphicStyle::Pattern::operator<<
friend std::ostream & operator<<(std::ostream &o, Pattern const &pat)
a print operator
Definition: MWAWGraphicStyle.hxx:240
MWAWGraphicStyle::Arrow::isEmpty
bool isEmpty() const
returns true if there is no arrow
Definition: MWAWGraphicStyle.hxx:123
MWAWGraphicStyle::Arrow::Arrow
Arrow(float w, MWAWBox2i const &box, std::string const &path, bool centered=false)
constructor
Definition: MWAWGraphicStyle.hxx:68
MWAWGraphicStyle::Pattern::m_data
std::vector< unsigned char > m_data
the pattern data: a sequence of data: p[0..7,0],p[8..15,0]...p[0..7,1],p[8..15,1], ...
Definition: MWAWGraphicStyle.hxx:263
MWAWGraphicStyle::GradientStop::GradientStop
GradientStop(float offset=0.0, MWAWColor const &col=MWAWColor::black(), float opacity=1.0)
constructor
Definition: MWAWGraphicStyle.hxx:143
MWAWGraphicStyle::GradientStop::cmp
int cmp(GradientStop const &a) const
compare two gradient
Definition: MWAWGraphicStyle.hxx:150
MWAWGraphicStyle::Pattern
a basic pattern used in a MWAWGraphicStyle:
Definition: MWAWGraphicStyle.hxx:180
MWAWGraphicStyle::hasPattern
bool hasPattern() const
returns true if the pattern is defined
Definition: MWAWGraphicStyle.hxx:335
MWAWGraphicStyle::GradientStop::m_offset
float m_offset
the offset
Definition: MWAWGraphicStyle.hxx:170
MWAWGraphicStyle::setBorders
void setBorders(int wh, MWAWBorder const &border)
sets the cell border: wh=libmwaw::LeftBit|...
Definition: MWAWGraphicStyle.cxx:172
MWAWGraphicStyle::G_Radial
Definition: MWAWGraphicStyle.hxx:55
MWAWGraphicStyle::m_gradientStopList
std::vector< GradientStop > m_gradientStopList
the list of gradient limits
Definition: MWAWGraphicStyle.hxx:438
MWAWVec2< int >
MWAWGraphicStyle::Arrow::m_path
std::string m_path
the arrow path
Definition: MWAWGraphicStyle.hxx:133
MWAWGraphicStyle::emptyStyle
static MWAWGraphicStyle emptyStyle()
returns an empty style.
Definition: MWAWGraphicStyle.hxx:304
MWAWGraphicStyle::resetBorders
void resetBorders()
reset the border
Definition: MWAWGraphicStyle.hxx:393