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
48{
49public:
57
59 struct Arrow {
62 : m_viewBox()
63 , m_path("")
64 , m_width(0)
65 , m_isCentered(false)
66 {
67 }
69 Arrow(float w, MWAWBox2i const &box, std::string const &path, bool centered=false)
70 : m_viewBox(box)
71 , m_path(path)
72 , m_width(w)
73 , m_isCentered(centered)
74 {
75 }
77 static Arrow plain()
78 {
79 return Arrow(5, MWAWBox2i(MWAWVec2i(0,0),MWAWVec2i(20,30)), "m10 0-10 30h20z", false);
80 }
82 friend std::ostream &operator<<(std::ostream &o, Arrow const &arrow)
83 {
84 if (arrow.isEmpty()) return o;
85 o << "w=" << arrow.m_width << ",";
86 o << "viewbox=" << arrow.m_viewBox << ",";
87 o << "path=" << arrow.m_path << ",";
88 if (arrow.m_isCentered) o << "centered,";
89 return o;
90 }
92 bool operator==(Arrow const &arrow) const
93 {
94 return m_width>=arrow.m_width && m_width<=arrow.m_width &&
95 m_viewBox==arrow.m_viewBox && m_path==arrow.m_path && m_isCentered==arrow.m_isCentered;
96 }
98 bool operator!=(Arrow const &arrow) const
99 {
100 return !(*this==arrow);
101 }
103 bool operator<(Arrow const &arrow) const
104 {
105 if (m_isCentered<arrow.m_isCentered) return m_isCentered ? true : false;
106 return m_width<arrow.m_width && m_viewBox<arrow.m_viewBox && m_path < arrow.m_path;
107 }
109 bool operator<=(Arrow const &arrow) const
110 {
111 return *this<arrow || *this==arrow;
112 }
114 bool operator>(Arrow const &arrow) const
115 {
116 return !(*this<=arrow);
117 }
119 bool operator>=(Arrow const &arrow) const
120 {
121 return !(*this<arrow);
122 }
124 bool isEmpty() const
125 {
126 return m_width<=0 || m_path.empty();
127 }
129 void addTo(librevenge::RVNGPropertyList &propList, std::string const &type) const;
130
134 std::string m_path;
136 float m_width;
139 };
140
142 struct Gradient {
144 struct Stop {
146 explicit Stop(float offset=0.0, MWAWColor const &col=MWAWColor::black(), float opacity=1.0)
147 : m_offset(offset)
148 , m_color(col)
149 , m_opacity(opacity)
150 {
151 }
153 int cmp(Stop const &a) const
154 {
155 if (m_offset < a.m_offset) return -1;
156 if (m_offset > a.m_offset) return 1;
157 if (m_color < a.m_color) return -1;
158 if (m_color > a.m_color) return 1;
159 if (m_opacity < a.m_opacity) return -1;
160 if (m_opacity > a.m_opacity) return 1;
161 return 0;
162 }
164 friend std::ostream &operator<<(std::ostream &o, Stop const &st)
165 {
166 o << "offset=" << st.m_offset << ",";
167 o << "color=" << st.m_color << ",";
168 if (st.m_opacity<1)
169 o << "opacity=" << st.m_opacity*100.f << "%,";
170 return o;
171 }
173 float m_offset;
178 };
183 : m_type(G_None)
184 , m_stopList()
185 , m_angle(0)
186 , m_border(0)
187 , m_percentCenter(0.5f,0.5f)
188 , m_radius(1)
189 {
190 m_stopList.push_back(Stop(0.0, MWAWColor::white()));
191 m_stopList.push_back(Stop(1.0, MWAWColor::black()));
192 }
194 bool hasGradient(bool complex=false) const
195 {
196 return m_type != G_None && static_cast<int>(m_stopList.size()) >= (complex ? 3 : 2);
197 }
199 void addTo(librevenge::RVNGPropertyList &propList) const;
201 bool getAverageColor(MWAWColor &color) const;
203 friend std::ostream &operator<<(std::ostream &o, Gradient const &grad)
204 {
205 switch (grad.m_type) {
207 o << "axial,";
208 break;
210 o << "linear,";
211 break;
213 o << "radial,";
214 break;
216 o << "rectangular,";
217 break;
219 o << "square,";
220 break;
222 o << "ellipsoid,";
223 break;
224 case Gradient::G_None:
225#if !defined(__clang__)
226 default:
227#endif
228 break;
229 }
230 if (grad.m_angle>0 || grad.m_angle<0) o << "angle=" << grad.m_angle << ",";
231 if (grad.m_stopList.size() >= 2) {
232 o << "stops=[";
233 for (auto const &stop : grad.m_stopList)
234 o << "[" << stop << "],";
235 o << "],";
236 }
237 if (grad.m_border>0) o << "border=" << grad.m_border*100 << "%,";
238 if (grad.m_percentCenter != MWAWVec2f(0.5f,0.5f)) o << "center=" << grad.m_percentCenter << ",";
239 if (grad.m_radius<1) o << "radius=" << grad.m_radius << ",";
240 return o;
241 }
242
244 int cmp(Gradient const &a) const
245 {
246 if (m_type < a.m_type) return -1;
247 if (m_type > a.m_type) return 1;
248 if (m_angle < a.m_angle) return -1;
249 if (m_angle > a.m_angle) return 1;
250 if (m_stopList.size() < a.m_stopList.size()) return 1;
251 if (m_stopList.size() > a.m_stopList.size()) return -1;
252 for (auto c :m_stopList) {
253 int diff = c.cmp(c);
254 if (diff) return diff;
255 }
256 if (m_border < a.m_border) return -1;
257 if (m_border > a.m_border) return 1;
259 if (diff) return diff;
260 if (m_radius < a.m_radius) return -1;
261 if (m_radius > a.m_radius) return 1;
262 return 0;
263 }
267 std::vector<Stop> m_stopList;
269 float m_angle;
271 float m_border;
275 float m_radius;
276 };
277
279 struct Hatch {
284 : m_type(H_None)
285 , m_color(MWAWColor::black())
286 , m_distance(1.f/72)
287 , m_rotation(0)
288 {
289 }
291 bool hasHatch() const
292 {
293 return m_type != H_None && m_distance>0;
294 }
296 void addTo(librevenge::RVNGPropertyList &propList) const;
298 friend std::ostream &operator<<(std::ostream &o, Hatch const &hatch)
299 {
300 if (hatch.m_type==H_None || hatch.m_distance<=0)
301 return o;
302 switch (hatch.m_type) {
303 case Hatch::H_None:
304 break;
305 case Hatch::H_Single:
306 o << "single,";
307 break;
308 case Hatch::H_Double:
309 o << "double,";
310 break;
311 case Hatch::H_Triple:
312 o << "triple,";
313 break;
314 default:
315 o << "###type=" << int(hatch.m_type) << ",";
316 break;
317 }
318 if (!hatch.m_color.isBlack())
319 o << hatch.m_color << ",";
320 o << "dist=" << 72*hatch.m_distance << "pt,";
321 if (hatch.m_rotation>0 || hatch.m_rotation<0)
322 o << "rot=" << hatch.m_rotation << "deg,";
323 return o;
324 }
326 int cmp(Hatch const &a) const
327 {
328 if (m_type < a.m_type) return -1;
329 if (m_type > a.m_type) return 1;
330 if (m_color < a.m_color) return -1;
331 if (m_color > a.m_color) return 1;
332 if (m_distance < a.m_distance) return -1;
333 if (m_distance > a.m_distance) return 1;
334 if (m_rotation < a.m_rotation) return -1;
335 if (m_rotation > a.m_rotation) return 1;
336 return 0;
337 }
346 };
351 struct Pattern {
354 : m_dim(0,0)
355 , m_data()
356 , m_picture()
358 {
361 }
363 Pattern(MWAWVec2i dim, MWAWEmbeddedObject const &picture, MWAWColor const &avColor)
364 : m_dim(dim)
365 , m_data()
366 , m_picture(picture)
367 , m_pictureAverageColor(avColor)
368 {
371 }
372 Pattern(Pattern const &)=default;
373 Pattern &operator=(Pattern const &)=default;
376 virtual ~Pattern();
378 bool empty() const
379 {
380 if (m_dim[0]==0 || m_dim[1]==0) return true;
381 if (!m_picture.m_dataList.empty()) return false;
382 if (m_dim[0]!=8 && m_dim[0]!=16 && m_dim[0]!=32) return true;
383 return m_data.size()!=size_t((m_dim[0]/8)*m_dim[1]);
384 }
386 bool getAverageColor(MWAWColor &col) const;
388 bool getUniqueColor(MWAWColor &col) const;
390 bool getBinary(MWAWEmbeddedObject &picture) const;
391
393 int cmp(Pattern const &a) const
394 {
395 int diff = m_dim.cmp(a.m_dim);
396 if (diff) return diff;
397 if (m_data.size() < a.m_data.size()) return -1;
398 if (m_data.size() > a.m_data.size()) return 1;
399 for (size_t h=0; h < m_data.size(); ++h) {
400 if (m_data[h]<a.m_data[h]) return 1;
401 if (m_data[h]>a.m_data[h]) return -1;
402 }
403 for (int i=0; i<2; ++i) {
404 if (m_colors[i] < a.m_colors[i]) return 1;
405 if (m_colors[i] > a.m_colors[i]) return -1;
406 }
409 diff=m_picture.cmp(a.m_picture);
410 if (diff) return diff;
411 return 0;
412 }
414 friend std::ostream &operator<<(std::ostream &o, Pattern const &pat)
415 {
416 o << "dim=" << pat.m_dim << ",";
417 if (!pat.m_picture.isEmpty()) {
418 o << "pict=" << pat.m_picture << ",";
419 o << "col[average]=" << pat.m_pictureAverageColor << ",";
420 }
421 else {
422 if (!pat.m_colors[0].isBlack()) o << "col0=" << pat.m_colors[0] << ",";
423 if (!pat.m_colors[1].isWhite()) o << "col1=" << pat.m_colors[1] << ",";
424 o << "[";
425 for (auto data : pat.m_data)
426 o << std::hex << static_cast<int>(data) << std::dec << ",";
427 o << "],";
428 }
429 return o;
430 }
433
437 std::vector<unsigned char> m_data;
438 protected:
443 };
447 , m_lineWidth(1)
450 , m_lineOpacity(1)
451 , m_lineColor(MWAWColor::black())
452 , m_surfaceColor(MWAWColor::white())
454 , m_shadowColor(MWAWColor::black())
455 , m_shadowOpacity(0)
456 , m_shadowOffset(1,1)
457 , m_pattern()
458 , m_gradient()
459 , m_hatch()
460 , m_backgroundColor(MWAWColor::white())
462 , m_rotate(0)
463 , m_bordersList()
464 , m_frameName("")
465 , m_frameNextName("")
466 , m_fillRuleEvenOdd(false)
467 , m_doNotPrint(false)
469 , m_extra("")
470 {
471 for (auto &fl : m_flip) fl=false;
472 }
478 {
480 res.m_lineWidth=0;
481 return res;
482 }
484 virtual ~MWAWGraphicStyle();
486 bool hasLine() const
487 {
488 return m_lineWidth>0 && m_lineOpacity>0;
489 }
491 void setSurfaceColor(MWAWColor const &col, float opacity = 1)
492 {
493 m_surfaceColor = col;
494 m_surfaceOpacity = opacity;
495 }
497 bool hasSurfaceColor() const
498 {
499 return m_surfaceOpacity > 0;
500 }
502 void setPattern(Pattern const &pat, float opacity = 1)
503 {
504 m_pattern=pat;
505 m_surfaceOpacity = opacity;
506 }
508 bool hasPattern() const
509 {
510 return !m_pattern.empty() && m_surfaceOpacity > 0;
511 }
513 bool hasGradient(bool complex=false) const
514 {
515 return m_gradient.hasGradient(complex);
516 }
518 bool hasHatch() const
519 {
520 return m_hatch.hasHatch();
521 }
523 bool hasSurface() const
524 {
525 return hasSurfaceColor() || hasPattern() || hasGradient() || hasHatch();
526 }
528 void setBackgroundColor(MWAWColor const &col, float opacity = 1)
529 {
530 m_backgroundColor = col;
531 m_backgroundOpacity = opacity;
532 }
535 {
536 return m_backgroundOpacity > 0;
537 }
539 void setShadowColor(MWAWColor const &col, float opacity = 1)
540 {
541 m_shadowColor = col;
542 m_shadowOpacity = opacity;
543 }
545 bool hasShadow() const
546 {
547 return m_shadowOpacity > 0;
548 }
550 bool hasBorders() const
551 {
552 return !m_bordersList.empty();
553 }
555 bool hasSameBorders() const
556 {
557 if (m_bordersList.empty()) return true;
558 if (m_bordersList.size()!=4) return false;
559 for (size_t i=1; i<m_bordersList.size(); ++i) {
560 if (m_bordersList[i]!=m_bordersList[0])
561 return false;
562 }
563 return true;
564 }
566 std::vector<MWAWBorder> const &borders() const
567 {
568 return m_bordersList;
569 }
572 {
573 m_bordersList.resize(0);
574 }
576 void setBorders(int wh, MWAWBorder const &border);
578 friend std::ostream &operator<<(std::ostream &o, MWAWGraphicStyle const &st);
580 void addTo(librevenge::RVNGPropertyList &pList, bool only1d=false) const;
582 void addFrameTo(librevenge::RVNGPropertyList &pList) const;
584 int cmp(MWAWGraphicStyle const &a) const;
585
587 std::vector<float> m_lineDashWidth;
602
609
612
617
618 //
619 // related to the frame
620 //
621
627 float m_rotate;
629 std::vector<MWAWBorder> m_bordersList;
631 std::string m_frameName;
633 std::string m_frameNextName;
634
637
638 //
639 // some transformation: must probably be somewhere else
640 //
641
643 bool m_flip[2];
644
647
650
653
655 std::string m_extra;
656};
657#endif
658// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:48
bool m_doNotPrint
a bool to know if the shape must not be printed
Definition: MWAWGraphicStyle.hxx:649
bool hasHatch() const
returns true if the hatch is defined
Definition: MWAWGraphicStyle.hxx:518
void setShadowColor(MWAWColor const &col, float opacity=1)
set the shadow color
Definition: MWAWGraphicStyle.hxx:539
std::vector< MWAWBorder > m_bordersList
the borders MWAWBorder::Pos (for a frame)
Definition: MWAWGraphicStyle.hxx:629
MWAWVec2f m_shadowOffset
the shadow offset
Definition: MWAWGraphicStyle.hxx:608
VerticalAlignment m_verticalAlignment
related to text area
Definition: MWAWGraphicStyle.hxx:652
Gradient m_gradient
the gradient
Definition: MWAWGraphicStyle.hxx:614
VerticalAlignment
an enum used to define the vertical alignment
Definition: MWAWGraphicStyle.hxx:56
@ V_AlignJustify
Definition: MWAWGraphicStyle.hxx:56
@ V_AlignTop
Definition: MWAWGraphicStyle.hxx:56
@ V_AlignDefault
Definition: MWAWGraphicStyle.hxx:56
@ V_AlignCenter
Definition: MWAWGraphicStyle.hxx:56
@ V_AlignBottom
Definition: MWAWGraphicStyle.hxx:56
friend std::ostream & operator<<(std::ostream &o, MWAWGraphicStyle const &st)
a print operator
Definition: MWAWGraphicStyle.cxx:572
bool m_fillRuleEvenOdd
true if the fill rule is evenod
Definition: MWAWGraphicStyle.hxx:646
float m_rotate
the rotation
Definition: MWAWGraphicStyle.hxx:627
bool hasBackgroundColor() const
returns true if the background is defined
Definition: MWAWGraphicStyle.hxx:534
bool hasSurfaceColor() const
returns true if the surface is defined
Definition: MWAWGraphicStyle.hxx:497
std::string m_frameNextName
the frame next name (if there is a link)
Definition: MWAWGraphicStyle.hxx:633
void addFrameTo(librevenge::RVNGPropertyList &pList) const
add all the frame parameters to propList: the background and the borders
Definition: MWAWGraphicStyle.cxx:451
int cmp(MWAWGraphicStyle const &a) const
compare two styles
Definition: MWAWGraphicStyle.cxx:499
MWAWColor m_surfaceColor
the surface color
Definition: MWAWGraphicStyle.hxx:599
float m_shadowOpacity
true if the shadow has some color
Definition: MWAWGraphicStyle.hxx:606
float m_lineWidth
the linewidth
Definition: MWAWGraphicStyle.hxx:589
bool hasSurface() const
returns true if the interior surface is defined
Definition: MWAWGraphicStyle.hxx:523
MWAWColor m_backgroundColor
the background color
Definition: MWAWGraphicStyle.hxx:623
void setBorders(int wh, MWAWBorder const &border)
sets the cell border: wh=libmwaw::LeftBit|...
Definition: MWAWGraphicStyle.cxx:274
std::string m_frameName
the frame name
Definition: MWAWGraphicStyle.hxx:631
MWAWColor m_shadowColor
the shadow color
Definition: MWAWGraphicStyle.hxx:604
std::string m_extra
extra data
Definition: MWAWGraphicStyle.hxx:655
bool hasShadow() const
returns true if the shadow is defined
Definition: MWAWGraphicStyle.hxx:545
static MWAWGraphicStyle emptyStyle()
returns an empty style.
Definition: MWAWGraphicStyle.hxx:477
MWAWGraphicStyle()
constructor
Definition: MWAWGraphicStyle.hxx:445
float m_lineOpacity
the line opacity: 0=transparent
Definition: MWAWGraphicStyle.hxx:595
bool hasGradient(bool complex=false) const
returns true if the gradient is defined
Definition: MWAWGraphicStyle.hxx:513
void setBackgroundColor(MWAWColor const &col, float opacity=1)
set the background color
Definition: MWAWGraphicStyle.hxx:528
bool hasLine() const
returns true if the border is defined
Definition: MWAWGraphicStyle.hxx:486
float m_surfaceOpacity
true if the surface has some color
Definition: MWAWGraphicStyle.hxx:601
float m_backgroundOpacity
true if the background has some color
Definition: MWAWGraphicStyle.hxx:625
Hatch m_hatch
the hatch
Definition: MWAWGraphicStyle.hxx:616
MWAWGraphicStyle & operator=(MWAWGraphicStyle &&)=default
bool m_flip[2]
two bool to indicated we need to flip the shape or not
Definition: MWAWGraphicStyle.hxx:643
LineCap
an enum used to define the basic line cap
Definition: MWAWGraphicStyle.hxx:51
@ C_Round
Definition: MWAWGraphicStyle.hxx:51
@ C_Butt
Definition: MWAWGraphicStyle.hxx:51
@ C_Square
Definition: MWAWGraphicStyle.hxx:51
std::vector< float > m_lineDashWidth
the dash array: a sequence of (fullsize, emptysize)
Definition: MWAWGraphicStyle.hxx:587
Pattern m_pattern
the pattern if it exists
Definition: MWAWGraphicStyle.hxx:611
MWAWColor m_lineColor
the line color
Definition: MWAWGraphicStyle.hxx:597
bool hasBorders() const
return true if the frame has some border
Definition: MWAWGraphicStyle.hxx:550
void setSurfaceColor(MWAWColor const &col, float opacity=1)
set the surface color
Definition: MWAWGraphicStyle.hxx:491
virtual ~MWAWGraphicStyle()
virtual destructor
Definition: MWAWGraphicStyle.cxx:270
bool hasPattern() const
returns true if the pattern is defined
Definition: MWAWGraphicStyle.hxx:508
std::vector< MWAWBorder > const & borders() const
return the frame border: libmwaw::Left | ...
Definition: MWAWGraphicStyle.hxx:566
void resetBorders()
reset the border
Definition: MWAWGraphicStyle.hxx:571
bool hasSameBorders() const
return true if the frame has some border
Definition: MWAWGraphicStyle.hxx:555
MWAWGraphicStyle(MWAWGraphicStyle const &)=default
Arrow m_arrows[2]
the two arrows corresponding to start and end extremity
Definition: MWAWGraphicStyle.hxx:636
LineJoin
an enum used to define the basic line join
Definition: MWAWGraphicStyle.hxx:53
@ J_Bevel
Definition: MWAWGraphicStyle.hxx:53
@ J_Miter
Definition: MWAWGraphicStyle.hxx:53
@ J_Round
Definition: MWAWGraphicStyle.hxx:53
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:293
MWAWGraphicStyle & operator=(MWAWGraphicStyle const &)=default
LineCap m_lineCap
the line cap
Definition: MWAWGraphicStyle.hxx:591
LineJoin m_lineJoin
the line join
Definition: MWAWGraphicStyle.hxx:593
void setPattern(Pattern const &pat, float opacity=1)
set the pattern
Definition: MWAWGraphicStyle.hxx:502
int cmp(MWAWVec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libmwaw_internal.hxx:777
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:838
MWAWBox2< int > MWAWBox2i
MWAWBox2 of int.
Definition: libmwaw_internal.hxx:1191
a border
Definition: libmwaw_internal.hxx:333
the class to store a color
Definition: libmwaw_internal.hxx:192
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:245
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:289
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:250
bool isBlack() const
return true if the color is black
Definition: libmwaw_internal.hxx:284
small class use to define a embedded object
Definition: libmwaw_internal.hxx:467
int cmp(MWAWEmbeddedObject const &pict) const
a comparison function
Definition: libmwaw_internal.cxx:606
bool isEmpty() const
return true if the picture contains no data
Definition: libmwaw_internal.hxx:486
std::vector< librevenge::RVNGBinaryData > m_dataList
the picture content: one data by representation
Definition: libmwaw_internal.hxx:512
a structure used to define an arrow
Definition: MWAWGraphicStyle.hxx:59
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
std::string m_path
the arrow path
Definition: MWAWGraphicStyle.hxx:134
bool m_isCentered
flag to know if the arrow is centered
Definition: MWAWGraphicStyle.hxx:138
static Arrow plain()
returns a basic plain arrow
Definition: MWAWGraphicStyle.hxx:77
bool operator>(Arrow const &arrow) const
operator>
Definition: MWAWGraphicStyle.hxx:114
float m_width
the arrow width in point
Definition: MWAWGraphicStyle.hxx:136
bool operator!=(Arrow const &arrow) const
operator!=
Definition: MWAWGraphicStyle.hxx:98
bool operator>=(Arrow const &arrow) const
operator>=
Definition: MWAWGraphicStyle.hxx:119
bool operator<=(Arrow const &arrow) const
operator<=
Definition: MWAWGraphicStyle.hxx:109
friend std::ostream & operator<<(std::ostream &o, Arrow const &arrow)
operator<<
Definition: MWAWGraphicStyle.hxx:82
bool isEmpty() const
returns true if there is no arrow
Definition: MWAWGraphicStyle.hxx:124
bool operator<(Arrow const &arrow) const
operator<
Definition: MWAWGraphicStyle.hxx:103
bool operator==(Arrow const &arrow) const
operator==
Definition: MWAWGraphicStyle.hxx:92
Arrow(float w, MWAWBox2i const &box, std::string const &path, bool centered=false)
constructor
Definition: MWAWGraphicStyle.hxx:69
MWAWBox2i m_viewBox
the arrow viewbox
Definition: MWAWGraphicStyle.hxx:132
Arrow()
constructor ( no arrow)
Definition: MWAWGraphicStyle.hxx:61
a structure used to define the gradient limit in MWAWGraphicStyle
Definition: MWAWGraphicStyle.hxx:144
float m_opacity
the opacity
Definition: MWAWGraphicStyle.hxx:177
friend std::ostream & operator<<(std::ostream &o, Stop const &st)
a print operator
Definition: MWAWGraphicStyle.hxx:164
float m_offset
the offset
Definition: MWAWGraphicStyle.hxx:173
MWAWColor m_color
the color
Definition: MWAWGraphicStyle.hxx:175
int cmp(Stop const &a) const
compare two gradient
Definition: MWAWGraphicStyle.hxx:153
Stop(float offset=0.0, MWAWColor const &col=MWAWColor::black(), float opacity=1.0)
constructor
Definition: MWAWGraphicStyle.hxx:146
a basic gradient used in a MWAWGraphicStyle
Definition: MWAWGraphicStyle.hxx:142
float m_radius
the gradient radius
Definition: MWAWGraphicStyle.hxx:275
std::vector< Stop > m_stopList
the list of gradient limits
Definition: MWAWGraphicStyle.hxx:267
Gradient()
constructor
Definition: MWAWGraphicStyle.hxx:182
Type
an enum used to define the gradient type
Definition: MWAWGraphicStyle.hxx:180
@ G_Axial
Definition: MWAWGraphicStyle.hxx:180
@ G_Linear
Definition: MWAWGraphicStyle.hxx:180
@ G_Square
Definition: MWAWGraphicStyle.hxx:180
@ G_Rectangular
Definition: MWAWGraphicStyle.hxx:180
@ G_Radial
Definition: MWAWGraphicStyle.hxx:180
@ G_None
Definition: MWAWGraphicStyle.hxx:180
@ G_Ellipsoid
Definition: MWAWGraphicStyle.hxx:180
void addTo(librevenge::RVNGPropertyList &propList) const
add a gradient to the propList
Definition: MWAWGraphicStyle.cxx:191
bool hasGradient(bool complex=false) const
returns true if the gradient is defined
Definition: MWAWGraphicStyle.hxx:194
float m_angle
the gradient angle
Definition: MWAWGraphicStyle.hxx:269
float m_border
the gradient border opacity
Definition: MWAWGraphicStyle.hxx:271
int cmp(Gradient const &a) const
compare two gradient
Definition: MWAWGraphicStyle.hxx:244
friend std::ostream & operator<<(std::ostream &o, Gradient const &grad)
a print operator
Definition: MWAWGraphicStyle.hxx:203
bool getAverageColor(MWAWColor &color) const
returns the average gradient color if the gradient is defined.
Definition: MWAWGraphicStyle.cxx:168
MWAWVec2f m_percentCenter
the gradient center
Definition: MWAWGraphicStyle.hxx:273
Type m_type
the gradient type
Definition: MWAWGraphicStyle.hxx:265
a basic hatch used in MWAWGraphicStyle
Definition: MWAWGraphicStyle.hxx:279
float m_distance
the hatch distance in inches
Definition: MWAWGraphicStyle.hxx:343
friend std::ostream & operator<<(std::ostream &o, Hatch const &hatch)
a print operator
Definition: MWAWGraphicStyle.hxx:298
Type
the potential type
Definition: MWAWGraphicStyle.hxx:281
@ H_Triple
Definition: MWAWGraphicStyle.hxx:281
@ H_Single
Definition: MWAWGraphicStyle.hxx:281
@ H_None
Definition: MWAWGraphicStyle.hxx:281
@ H_Double
Definition: MWAWGraphicStyle.hxx:281
bool hasHatch() const
returns true if the gradient is defined
Definition: MWAWGraphicStyle.hxx:291
Hatch()
constructor
Definition: MWAWGraphicStyle.hxx:283
MWAWColor m_color
the hatch color
Definition: MWAWGraphicStyle.hxx:341
int cmp(Hatch const &a) const
compare two hatchs
Definition: MWAWGraphicStyle.hxx:326
void addTo(librevenge::RVNGPropertyList &propList) const
add a hatch to the propList
Definition: MWAWGraphicStyle.cxx:251
float m_rotation
the rotation (in degrees)
Definition: MWAWGraphicStyle.hxx:345
Type m_type
the hatch type
Definition: MWAWGraphicStyle.hxx:339
a basic pattern used in a MWAWGraphicStyle:
Definition: MWAWGraphicStyle.hxx:351
MWAWColor m_colors[2]
the two indexed colors
Definition: MWAWGraphicStyle.hxx:435
Pattern()
constructor
Definition: MWAWGraphicStyle.hxx:353
MWAWVec2i m_dim
the dimension width x height
Definition: MWAWGraphicStyle.hxx:432
friend std::ostream & operator<<(std::ostream &o, Pattern const &pat)
a print operator
Definition: MWAWGraphicStyle.hxx:414
bool getAverageColor(MWAWColor &col) const
return the average color
Definition: MWAWGraphicStyle.cxx:101
Pattern(MWAWVec2i dim, MWAWEmbeddedObject const &picture, MWAWColor const &avColor)
constructor from a binary data
Definition: MWAWGraphicStyle.hxx:363
Pattern & operator=(Pattern const &)=default
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:437
Pattern & operator=(Pattern &&)=default
MWAWColor m_pictureAverageColor
the picture average color
Definition: MWAWGraphicStyle.hxx:442
Pattern(Pattern const &)=default
bool getUniqueColor(MWAWColor &col) const
check if the pattern has only one color; if so returns true...
Definition: MWAWGraphicStyle.cxx:86
int cmp(Pattern const &a) const
compare two patterns
Definition: MWAWGraphicStyle.hxx:393
bool getBinary(MWAWEmbeddedObject &picture) const
tries to convert the picture in a binary data ( ppm)
Definition: MWAWGraphicStyle.cxx:128
virtual ~Pattern()
virtual destructor
Definition: MWAWGraphicStyle.cxx:82
MWAWEmbeddedObject m_picture
a picture
Definition: MWAWGraphicStyle.hxx:440
bool empty() const
return true if we does not have a pattern
Definition: MWAWGraphicStyle.hxx:378

Generated on Thu Jan 19 2023 00:00:00 for libmwaw by doxygen 1.9.6