MWAWGraphicStyle.hxx Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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() : m_width(0), m_viewBox(), m_path(""), m_isCentered(false)
61 {
62 }
64 Arrow(float w, MWAWBox2i const &box, std::string path, bool centered=false) :
65 m_width(w), m_viewBox(box), m_path(path), m_isCentered(centered)
66 {
67 }
69 static Arrow plain()
70 {
71 return Arrow(5, MWAWBox2i(MWAWVec2i(0,0),MWAWVec2i(20,30)), "m10 0-10 30h20z", false);
72 }
74 friend std::ostream &operator<<(std::ostream &o, Arrow const &arrow)
75 {
76 if (arrow.isEmpty()) return o;
77 o << "w=" << arrow.m_width << ",";
78 o << "viewbox=" << arrow.m_viewBox << ",";
79 o << "path=" << arrow.m_path << ",";
80 if (arrow.m_isCentered) o << "centered,";
81 return o;
82 }
84 bool operator==(Arrow const &arrow) const
85 {
86 return m_width>=arrow.m_width && m_width<=arrow.m_width &&
87 m_viewBox==arrow.m_viewBox && m_path==arrow.m_path && m_isCentered==arrow.m_isCentered;
88 }
90 bool operator!=(Arrow const &arrow) const
91 {
92 return !(*this==arrow);
93 }
95 bool operator<(Arrow const &arrow) const
96 {
97 if (m_isCentered<arrow.m_isCentered) return m_isCentered ? true : false;
98 return m_width<arrow.m_width && m_viewBox<arrow.m_viewBox && m_path < arrow.m_path;
99 }
101 bool operator<=(Arrow const &arrow) const
102 {
103 return *this<arrow || *this==arrow;
104 }
106 bool operator>(Arrow const &arrow) const
107 {
108 return !(*this<=arrow);
109 }
111 bool operator>=(Arrow const &arrow) const
112 {
113 return !(*this<arrow);
114 }
116 bool isEmpty() const
117 {
118 return m_width<=0 || m_path.empty();
119 }
121 void addTo(librevenge::RVNGPropertyList &propList, std::string const &type) const;
122
124 float m_width;
126 MWAWBox2i m_viewBox;
128 std::string m_path;
130 bool m_isCentered;
131 };
132
134 struct GradientStop {
136 GradientStop(float offset=0.0, MWAWColor const &col=MWAWColor::black(), float opacity=1.0) :
137 m_offset(offset), m_color(col), m_opacity(opacity)
138 {
139 }
141 int cmp(GradientStop const &a) const
142 {
143 if (m_offset < a.m_offset) return -1;
144 if (m_offset > a.m_offset) return 1;
145 if (m_color < a.m_color) return -1;
146 if (m_color > a.m_color) return 1;
147 if (m_opacity < a.m_opacity) return -1;
148 if (m_opacity > a.m_opacity) return 1;
149 return 0;
150 }
152 friend std::ostream &operator<<(std::ostream &o, GradientStop const &st)
153 {
154 o << "offset=" << st.m_offset << ",";
155 o << "color=" << st.m_color << ",";
156 if (st.m_opacity<1.0)
157 o << "opacity=" << st.m_opacity*100.f << "%,";
158 return o;
159 }
161 float m_offset;
163 MWAWColor m_color;
165 float m_opacity;
166 };
171 struct Pattern {
173 Pattern() : m_dim(0,0), m_data(), m_picture(), m_pictureAverageColor(MWAWColor::white())
174 {
175 m_colors[0]=MWAWColor::black();
176 m_colors[1]=MWAWColor::white();
177 }
179 Pattern(MWAWVec2i dim, MWAWEmbeddedObject const &picture, MWAWColor const &avColor) :
180 m_dim(dim), m_data(), m_picture(picture), m_pictureAverageColor(avColor)
181 {
182 m_colors[0]=MWAWColor::black();
183 m_colors[1]=MWAWColor::white();
184 }
186 virtual ~Pattern() {}
188 bool empty() const
189 {
190 if (m_dim[0]==0 || m_dim[1]==0) return true;
191 if (!m_picture.m_dataList.empty()) return false;
192 if (m_dim[0]!=8 && m_dim[0]!=16 && m_dim[0]!=32) return true;
193 return m_data.size()!=size_t((m_dim[0]/8)*m_dim[1]);
194 }
196 bool getAverageColor(MWAWColor &col) const;
198 bool getUniqueColor(MWAWColor &col) const;
200 bool getBinary(MWAWEmbeddedObject &picture) const;
201
203 int cmp(Pattern const &a) const
204 {
205 int diff = m_dim.cmp(a.m_dim);
206 if (diff) return diff;
207 if (m_data.size() < a.m_data.size()) return -1;
208 if (m_data.size() > a.m_data.size()) return 1;
209 for (size_t h=0; h < m_data.size(); ++h) {
210 if (m_data[h]<a.m_data[h]) return 1;
211 if (m_data[h]>a.m_data[h]) return -1;
212 }
213 for (int i=0; i<2; ++i) {
214 if (m_colors[i] < a.m_colors[i]) return 1;
215 if (m_colors[i] > a.m_colors[i]) return -1;
216 }
217 if (m_pictureAverageColor < a.m_pictureAverageColor) return 1;
218 if (m_pictureAverageColor > a.m_pictureAverageColor) return -1;
219 diff=m_picture.cmp(a.m_picture);
220 if (diff) return diff;
221 return 0;
222 }
224 friend std::ostream &operator<<(std::ostream &o, Pattern const &pat)
225 {
226 o << "dim=" << pat.m_dim << ",";
227 if (!pat.m_picture.isEmpty()) {
228 o << "pict=" << pat.m_picture << ",";
229 o << "col[average]=" << pat.m_pictureAverageColor << ",";
230 }
231 else {
232 if (!pat.m_colors[0].isBlack()) o << "col0=" << pat.m_colors[0] << ",";
233 if (!pat.m_colors[1].isWhite()) o << "col1=" << pat.m_colors[1] << ",";
234 o << "[";
235 for (size_t h=0; h < pat.m_data.size(); ++h)
236 o << std::hex << (int) pat.m_data[h] << std::dec << ",";
237 o << "],";
238 }
239 return o;
240 }
242 MWAWVec2i m_dim;
243
245 MWAWColor m_colors[2];
247 std::vector<unsigned char> m_data;
248 protected:
250 MWAWEmbeddedObject m_picture;
252 MWAWColor m_pictureAverageColor;
253 };
255 MWAWGraphicStyle() : m_lineWidth(1), m_lineDashWidth(), m_lineCap(C_Butt), m_lineJoin(J_Miter), m_lineOpacity(1), m_lineColor(MWAWColor::black()),
256 m_fillRuleEvenOdd(false), m_surfaceColor(MWAWColor::white()), m_surfaceOpacity(0),
257 m_shadowColor(MWAWColor::black()), m_shadowOpacity(0), m_shadowOffset(1,1),
258 m_pattern(),
259 m_gradientType(G_None), m_gradientStopList(), m_gradientAngle(0), m_gradientBorder(0), m_gradientPercentCenter(0.5f,0.5f), m_gradientRadius(1),
260 m_backgroundColor(MWAWColor::white()), m_backgroundOpacity(-1), m_bordersList(), m_frameName(""), m_frameNextName(""),
261 m_rotate(0), m_extra("")
262 {
263 m_arrows[0]=m_arrows[1]=Arrow();
264 m_flip[0]=m_flip[1]=false;
265 m_gradientStopList.push_back(GradientStop(0.0, MWAWColor::white()));
266 m_gradientStopList.push_back(GradientStop(1.0, MWAWColor::black()));
267 }
269 static MWAWGraphicStyle emptyStyle()
270 {
271 MWAWGraphicStyle res;
272 res.m_lineWidth=0;
273 return res;
274 }
276 virtual ~MWAWGraphicStyle() { }
278 bool hasLine() const
279 {
280 return m_lineWidth>0 && m_lineOpacity>0;
281 }
283 void setSurfaceColor(MWAWColor const &col, float opacity = 1)
284 {
285 m_surfaceColor = col;
286 m_surfaceOpacity = opacity;
287 }
289 bool hasSurfaceColor() const
290 {
291 return m_surfaceOpacity > 0;
292 }
294 void setPattern(Pattern const &pat, float opacity = 1)
295 {
296 m_pattern=pat;
297 m_surfaceOpacity = opacity;
298 }
300 bool hasPattern() const
301 {
302 return !m_pattern.empty() && m_surfaceOpacity > 0;
303 }
305 bool hasGradient(bool complex=false) const
306 {
307 return m_gradientType != G_None && (int) m_gradientStopList.size() >= (complex ? 3 : 2);
308 }
310 bool hasSurface() const
311 {
312 return hasSurfaceColor() || hasPattern() || hasGradient();
313 }
315 void setBackgroundColor(MWAWColor const &col, float opacity = 1)
316 {
317 m_backgroundColor = col;
318 m_backgroundOpacity = opacity;
319 }
321 bool hasBackgroundColor() const
322 {
323 return m_backgroundOpacity > 0;
324 }
326 void setShadowColor(MWAWColor const &col, float opacity = 1)
327 {
328 m_shadowColor = col;
329 m_shadowOpacity = opacity;
330 }
332 bool hasShadow() const
333 {
334 return m_shadowOpacity > 0;
335 }
337 bool hasBorders() const
338 {
339 return !m_bordersList.empty();
340 }
342 bool hasSameBorders() const
343 {
344 if (m_bordersList.empty()) return true;
345 if (m_bordersList.size()!=4) return false;
346 for (size_t i=1; i<m_bordersList.size(); ++i) {
347 if (m_bordersList[i]!=m_bordersList[0])
348 return false;
349 }
350 return true;
351 }
353 std::vector<MWAWBorder> const &borders() const
354 {
355 return m_bordersList;
356 }
358 void resetBorders()
359 {
360 m_bordersList.resize(0);
361 }
363 void setBorders(int wh, MWAWBorder const &border);
365 friend std::ostream &operator<<(std::ostream &o, MWAWGraphicStyle const &st);
367 void addTo(librevenge::RVNGPropertyList &pList, bool only1d=false) const;
369 void addFrameTo(librevenge::RVNGPropertyList &pList) const;
371 int cmp(MWAWGraphicStyle const &a) const;
372
374 float m_lineWidth;
376 std::vector<float> m_lineDashWidth;
378 LineCap m_lineCap;
380 LineJoin m_lineJoin;
382 float m_lineOpacity;
384 MWAWColor m_lineColor;
386 bool m_fillRuleEvenOdd;
388 MWAWColor m_surfaceColor;
390 float m_surfaceOpacity;
391
393 MWAWColor m_shadowColor;
395 float m_shadowOpacity;
397 MWAWVec2f m_shadowOffset;
398
400 Pattern m_pattern;
401
403 GradientType m_gradientType;
405 std::vector<GradientStop> m_gradientStopList;
407 float m_gradientAngle;
409 float m_gradientBorder;
411 MWAWVec2f m_gradientPercentCenter;
413 float m_gradientRadius;
414
416 Arrow m_arrows[2];
417
418 //
419 // related to the frame
420 //
421
423 MWAWColor m_backgroundColor;
425 float m_backgroundOpacity;
427 std::vector<MWAWBorder> m_bordersList;
429 std::string m_frameName;
431 std::string m_frameNextName;
432
433 //
434 // some transformation: must probably be somewhere else
435 //
436
438 float m_rotate;
440 bool m_flip[2];
441
443 std::string m_extra;
444 };
445 #endif
446 // 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:126
MWAWGraphicStyle::Arrow::operator>
bool operator>(Arrow const &arrow) const
operator>
Definition: MWAWGraphicStyle.hxx:106
MWAWGraphicStyle::m_flip
bool m_flip[2]
two bool to indicated we need to flip the shape or not
Definition: MWAWGraphicStyle.hxx:440
MWAWEmbeddedObject::isEmpty
bool isEmpty() const
return true if the picture contains no data
Definition: libmwaw_internal.hxx:428
MWAWGraphicStyle::GradientStop::operator<<
friend std::ostream & operator<<(std::ostream &o, GradientStop const &st)
a print operator
Definition: MWAWGraphicStyle.hxx:152
MWAWGraphicStyle::hasSurfaceColor
bool hasSurfaceColor() const
returns true if the surface is defined
Definition: MWAWGraphicStyle.hxx:289
MWAWGraphicStyle::Pattern::m_dim
MWAWVec2i m_dim
the dimension width x height
Definition: MWAWGraphicStyle.hxx:242
MWAWGraphicStyle::Pattern::empty
bool empty() const
return true if we does not have a pattern
Definition: MWAWGraphicStyle.hxx:188
MWAWGraphicStyle::m_surfaceColor
MWAWColor m_surfaceColor
the surface color
Definition: MWAWGraphicStyle.hxx:388
MWAWGraphicStyle::m_frameNextName
std::string m_frameNextName
the frame next name (if there is a link)
Definition: MWAWGraphicStyle.hxx:431
MWAWGraphicStyle::m_shadowColor
MWAWColor m_shadowColor
the shadow color
Definition: MWAWGraphicStyle.hxx:393
MWAWGraphicStyle::J_Round
Definition: MWAWGraphicStyle.hxx:53
MWAWGraphicStyle::GradientStop::m_opacity
float m_opacity
the opacity
Definition: MWAWGraphicStyle.hxx:165
MWAWGraphicStyle::m_backgroundOpacity
float m_backgroundOpacity
true if the background has some color
Definition: MWAWGraphicStyle.hxx:425
MWAWGraphicStyle::m_frameName
std::string m_frameName
the frame name
Definition: MWAWGraphicStyle.hxx:429
MWAWVec2::cmp
int cmp(MWAWVec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libmwaw_internal.hxx:706
libmwaw_internal.hxx
MWAWEmbeddedObject::m_dataList
std::vector< librevenge::RVNGBinaryData > m_dataList
the picture content: one data by representation
Definition: libmwaw_internal.hxx:454
MWAWGraphicStyle::m_shadowOpacity
float m_shadowOpacity
true if the shadow has some color
Definition: MWAWGraphicStyle.hxx:395
MWAWGraphicStyle::Pattern::Pattern
Pattern()
constructor
Definition: MWAWGraphicStyle.hxx:173
MWAWColor::white
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:225
MWAWGraphicStyle::MWAWGraphicStyle
MWAWGraphicStyle()
constructor
Definition: MWAWGraphicStyle.hxx:255
MWAWGraphicStyle::Arrow::Arrow
Arrow()
constructor ( no arrow)
Definition: MWAWGraphicStyle.hxx:60
MWAWGraphicStyle::G_None
Definition: MWAWGraphicStyle.hxx:55
MWAWGraphicStyle::Pattern::Pattern
Pattern(MWAWVec2i dim, MWAWEmbeddedObject const &picture, MWAWColor const &avColor)
constructor from a binary data
Definition: MWAWGraphicStyle.hxx:179
MWAWGraphicStyle::m_gradientPercentCenter
MWAWVec2f m_gradientPercentCenter
the gradient center
Definition: MWAWGraphicStyle.hxx:411
MWAWGraphicStyle::Pattern::m_picture
MWAWEmbeddedObject m_picture
a picture
Definition: MWAWGraphicStyle.hxx:250
MWAWGraphicStyle::Arrow::plain
static Arrow plain()
returns a basic plain arrow
Definition: MWAWGraphicStyle.hxx:69
MWAWGraphicStyle::setPattern
void setPattern(Pattern const &pat, float opacity=1)
set the pattern
Definition: MWAWGraphicStyle.hxx:294
MWAWGraphicStyle::Pattern::m_colors
MWAWColor m_colors[2]
the two indexed colors
Definition: MWAWGraphicStyle.hxx:245
MWAWGraphicStyle::LineCap
LineCap
an enum used to define the basic line cap
Definition: MWAWGraphicStyle.hxx:51
MWAWGraphicStyle::m_lineJoin
LineJoin m_lineJoin
the line join
Definition: MWAWGraphicStyle.hxx:380
MWAWGraphicStyle::m_arrows
Arrow m_arrows[2]
the two arrows corresponding to start and end extremity
Definition: MWAWGraphicStyle.hxx:416
MWAWGraphicStyle::m_lineColor
MWAWColor m_lineColor
the line color
Definition: MWAWGraphicStyle.hxx:384
MWAWColor::black
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:220
MWAWGraphicStyle::m_gradientRadius
float m_gradientRadius
the gradient radius
Definition: MWAWGraphicStyle.hxx:413
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:130
MWAWGraphicStyle::Arrow::operator<
bool operator<(Arrow const &arrow) const
operator<
Definition: MWAWGraphicStyle.hxx:95
MWAWGraphicStyle::G_Ellipsoid
Definition: MWAWGraphicStyle.hxx:55
MWAWGraphicStyle::Pattern::getUniqueColor
bool getUniqueColor(MWAWColor &col) const
check if the pattern has only one color; if so returns true...
Definition: MWAWGraphicStyle.cxx:82
MWAWVec2i
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:767
MWAWBox2i
MWAWBox2< int > MWAWBox2i
MWAWBox2 of int.
Definition: libmwaw_internal.hxx:1130
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:183
MWAWGraphicStyle::hasSameBorders
bool hasSameBorders() const
return true if the frame has some border
Definition: MWAWGraphicStyle.hxx:342
MWAWGraphicStyle::addFrameTo
void addFrameTo(librevenge::RVNGPropertyList &pList) const
add all the frame parameters to propList: the background and the borders
Definition: MWAWGraphicStyle.cxx:356
MWAWGraphicStyle::operator<<
friend std::ostream & operator<<(std::ostream &o, MWAWGraphicStyle const &st)
a print operator
Definition: MWAWGraphicStyle.cxx:486
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:176
MWAWGraphicStyle::C_Butt
Definition: MWAWGraphicStyle.hxx:51
MWAWGraphicStyle::Arrow::m_width
float m_width
the arrow width in point
Definition: MWAWGraphicStyle.hxx:124
MWAWGraphicStyle::hasGradient
bool hasGradient(bool complex=false) const
returns true if the gradient is defined
Definition: MWAWGraphicStyle.hxx:305
MWAWGraphicStyle::m_rotate
float m_rotate
the rotation
Definition: MWAWGraphicStyle.hxx:438
MWAWGraphicStyle::m_lineDashWidth
std::vector< float > m_lineDashWidth
the dash array: a sequence of (fullsize, emptysize)
Definition: MWAWGraphicStyle.hxx:376
MWAWGraphicStyle::Arrow::operator<<
friend std::ostream & operator<<(std::ostream &o, Arrow const &arrow)
operator<<
Definition: MWAWGraphicStyle.hxx:74
MWAWGraphicStyle::GradientStop
a structure used to define the gradient limit in MWAWGraphicStyle
Definition: MWAWGraphicStyle.hxx:134
MWAWGraphicStyle::Arrow::isEmpty
bool isEmpty() const
returns true if there is no arrow
Definition: MWAWGraphicStyle.hxx:116
MWAWBorder
a border
Definition: libmwaw_internal.hxx:308
MWAWBox2< int >
MWAWGraphicStyle::G_Axial
Definition: MWAWGraphicStyle.hxx:55
MWAWGraphicStyle::m_extra
std::string m_extra
extra data
Definition: MWAWGraphicStyle.hxx:443
MWAWGraphicStyle::hasPattern
bool hasPattern() const
returns true if the pattern is defined
Definition: MWAWGraphicStyle.hxx:300
MWAWGraphicStyle::m_shadowOffset
MWAWVec2f m_shadowOffset
the shadow offset
Definition: MWAWGraphicStyle.hxx:397
MWAWGraphicStyle::m_lineCap
LineCap m_lineCap
the line cap
Definition: MWAWGraphicStyle.hxx:378
MWAWGraphicStyle::m_surfaceOpacity
float m_surfaceOpacity
true if the surface has some color
Definition: MWAWGraphicStyle.hxx:390
MWAWGraphicStyle::m_gradientBorder
float m_gradientBorder
the gradient border opacity
Definition: MWAWGraphicStyle.hxx:409
MWAWGraphicStyle::m_gradientType
GradientType m_gradientType
the gradient type
Definition: MWAWGraphicStyle.hxx:403
MWAWGraphicStyle::m_backgroundColor
MWAWColor m_backgroundColor
the background color
Definition: MWAWGraphicStyle.hxx:423
MWAWGraphicStyle::J_Miter
Definition: MWAWGraphicStyle.hxx:53
MWAWGraphicStyle::m_gradientAngle
float m_gradientAngle
the gradient angle
Definition: MWAWGraphicStyle.hxx:407
MWAWGraphicStyle::hasBackgroundColor
bool hasBackgroundColor() const
returns true if the background is defined
Definition: MWAWGraphicStyle.hxx:321
MWAWGraphicStyle::m_pattern
Pattern m_pattern
the pattern if it exists
Definition: MWAWGraphicStyle.hxx:400
MWAWGraphicStyle::hasBorders
bool hasBorders() const
return true if the frame has some border
Definition: MWAWGraphicStyle.hxx:337
MWAWGraphicStyle::J_Bevel
Definition: MWAWGraphicStyle.hxx:53
MWAWGraphicStyle::setSurfaceColor
void setSurfaceColor(MWAWColor const &col, float opacity=1)
set the surface color
Definition: MWAWGraphicStyle.hxx:283
MWAWGraphicStyle::C_Square
Definition: MWAWGraphicStyle.hxx:51
MWAWGraphicStyle::~MWAWGraphicStyle
virtual ~MWAWGraphicStyle()
virtual destructor
Definition: MWAWGraphicStyle.hxx:276
MWAWGraphicStyle::m_fillRuleEvenOdd
bool m_fillRuleEvenOdd
true if the fill rule is evenod
Definition: MWAWGraphicStyle.hxx:386
MWAWEmbeddedObject
small class use to define a embedded object
Definition: libmwaw_internal.hxx:412
MWAWGraphicStyle::Pattern::getAverageColor
bool getAverageColor(MWAWColor &col) const
return the average color
Definition: MWAWGraphicStyle.cxx:97
MWAWGraphicStyle::hasSurface
bool hasSurface() const
returns true if the interior surface is defined
Definition: MWAWGraphicStyle.hxx:310
MWAWGraphicStyle::G_Square
Definition: MWAWGraphicStyle.hxx:55
MWAWGraphicStyle::Arrow
a structure used to define an arrow
Definition: MWAWGraphicStyle.hxx:58
MWAWEmbeddedObject::cmp
int cmp(MWAWEmbeddedObject const &pict) const
a comparison function
Definition: libmwaw_internal.cxx:389
MWAWGraphicStyle::borders
std::vector< MWAWBorder > const & borders() const
return the frame border: libmwaw::Left | ...
Definition: MWAWGraphicStyle.hxx:353
MWAWGraphicStyle::G_Linear
Definition: MWAWGraphicStyle.hxx:55
MWAWGraphicStyle::Arrow::operator==
bool operator==(Arrow const &arrow) const
operator==
Definition: MWAWGraphicStyle.hxx:84
MWAWGraphicStyle::GradientStop::cmp
int cmp(GradientStop const &a) const
compare two gradient
Definition: MWAWGraphicStyle.hxx:141
MWAWGraphicStyle::GradientStop::m_color
MWAWColor m_color
the color
Definition: MWAWGraphicStyle.hxx:163
MWAWGraphicStyle::G_Rectangular
Definition: MWAWGraphicStyle.hxx:55
MWAWGraphicStyle::Arrow::operator!=
bool operator!=(Arrow const &arrow) const
operator!=
Definition: MWAWGraphicStyle.hxx:90
MWAWGraphicStyle::hasShadow
bool hasShadow() const
returns true if the shadow is defined
Definition: MWAWGraphicStyle.hxx:332
MWAWGraphicStyle::m_bordersList
std::vector< MWAWBorder > m_bordersList
the borders MWAWBorder::Pos (for a frame)
Definition: MWAWGraphicStyle.hxx:427
MWAWGraphicStyle::LineJoin
LineJoin
an enum used to define the basic line join
Definition: MWAWGraphicStyle.hxx:53
MWAWGraphicStyle::setShadowColor
void setShadowColor(MWAWColor const &col, float opacity=1)
set the shadow color
Definition: MWAWGraphicStyle.hxx:326
MWAWGraphicStyle::m_lineOpacity
float m_lineOpacity
the line opacity: 0=transparent
Definition: MWAWGraphicStyle.hxx:382
MWAWGraphicStyle::Pattern::m_pictureAverageColor
MWAWColor m_pictureAverageColor
the picture average color
Definition: MWAWGraphicStyle.hxx:252
MWAWGraphicStyle::Arrow::operator<=
bool operator<=(Arrow const &arrow) const
operator<=
Definition: MWAWGraphicStyle.hxx:101
MWAWGraphicStyle::setBackgroundColor
void setBackgroundColor(MWAWColor const &col, float opacity=1)
set the background color
Definition: MWAWGraphicStyle.hxx:315
MWAWGraphicStyle::m_lineWidth
float m_lineWidth
the linewidth
Definition: MWAWGraphicStyle.hxx:374
MWAWGraphicStyle::Pattern::operator<<
friend std::ostream & operator<<(std::ostream &o, Pattern const &pat)
a print operator
Definition: MWAWGraphicStyle.hxx:224
MWAWColor::isWhite
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:264
MWAWGraphicStyle::Pattern::getBinary
bool getBinary(MWAWEmbeddedObject &picture) const
tries to convert the picture in a binary data ( ppm)
Definition: MWAWGraphicStyle.cxx:124
MWAWColor::isBlack
bool isBlack() const
return true if the color is black
Definition: libmwaw_internal.hxx:259
MWAWGraphicStyle::hasLine
bool hasLine() const
returns true if the border is defined
Definition: MWAWGraphicStyle.hxx:278
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:247
MWAWGraphicStyle::Pattern::cmp
int cmp(Pattern const &a) const
compare two patterns
Definition: MWAWGraphicStyle.hxx:203
MWAWGraphicStyle::GradientStop::GradientStop
GradientStop(float offset=0.0, MWAWColor const &col=MWAWColor::black(), float opacity=1.0)
constructor
Definition: MWAWGraphicStyle.hxx:136
MWAWGraphicStyle::Arrow::Arrow
Arrow(float w, MWAWBox2i const &box, std::string path, bool centered=false)
constructor
Definition: MWAWGraphicStyle.hxx:64
MWAWGraphicStyle::cmp
int cmp(MWAWGraphicStyle const &a) const
compare two styles
Definition: MWAWGraphicStyle.cxx:402
MWAWGraphicStyle::Pattern
a basic pattern used in a MWAWGraphicStyle:
Definition: MWAWGraphicStyle.hxx:171
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::GradientStop::m_offset
float m_offset
the offset
Definition: MWAWGraphicStyle.hxx:161
MWAWGraphicStyle::setBorders
void setBorders(int wh, MWAWBorder const &border)
sets the cell border: wh=libmwaw::LeftBit|...
Definition: MWAWGraphicStyle.cxx:164
MWAWGraphicStyle::G_Radial
Definition: MWAWGraphicStyle.hxx:55
MWAWGraphicStyle::m_gradientStopList
std::vector< GradientStop > m_gradientStopList
the list of gradient limits
Definition: MWAWGraphicStyle.hxx:405
MWAWVec2< int >
MWAWGraphicStyle::Arrow::operator>=
bool operator>=(Arrow const &arrow) const
operator>=
Definition: MWAWGraphicStyle.hxx:111
MWAWGraphicStyle::Arrow::m_path
std::string m_path
the arrow path
Definition: MWAWGraphicStyle.hxx:128
MWAWGraphicStyle::emptyStyle
static MWAWGraphicStyle emptyStyle()
returns an empty style.
Definition: MWAWGraphicStyle.hxx:269
MWAWGraphicStyle::resetBorders
void resetBorders()
reset the border
Definition: MWAWGraphicStyle.hxx:358
MWAWGraphicStyle::Pattern::~Pattern
virtual ~Pattern()
virtual destructor
Definition: MWAWGraphicStyle.hxx:186