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 GradientStop {
60 GradientStop(float offset=0.0, MWAWColor const &col=MWAWColor::black(), float opacity=1.0) :
61 m_offset(offset), m_color(col), m_opacity(opacity)
62 {
63 }
65 int cmp(GradientStop const &a) const
66 {
67 if (m_offset < a.m_offset) return -1;
68 if (m_offset > a.m_offset) return 1;
69 if (m_color < a.m_color) return -1;
70 if (m_color > a.m_color) return 1;
71 if (m_opacity < a.m_opacity) return -1;
72 if (m_opacity > a.m_opacity) return 1;
73 return 0;
74 }
76 friend std::ostream &operator<<(std::ostream &o, GradientStop const &st)
77 {
78 o << "offset=" << st.m_offset << ",";
79 o << "color=" << st.m_color << ",";
80 if (st.m_opacity<1.0)
81 o << "opacity=" << st.m_opacity*100.f << "%,";
82 return o;
83 }
85 float m_offset;
87 MWAWColor m_color;
89 float m_opacity;
90 };
95 struct Pattern {
97 Pattern() : m_dim(0,0), m_data(), m_picture(), m_pictureMime(""), m_pictureAverageColor(MWAWColor::white())
98 {
99 m_colors[0]=MWAWColor::black();
100 m_colors[1]=MWAWColor::white();
101 }
103 Pattern(Vec2i dim, librevenge::RVNGBinaryData const &picture, std::string const &mime, MWAWColor const &avColor) :
104 m_dim(dim), m_data(), m_picture(picture), m_pictureMime(mime), m_pictureAverageColor(avColor)
105 {
106 m_colors[0]=MWAWColor::black();
107 m_colors[1]=MWAWColor::white();
108 }
110 virtual ~Pattern() {}
112 bool empty() const
113 {
114 if (m_dim[0]==0 || m_dim[1]==0) return true;
115 if (m_picture.size()) return false;
116 if (m_dim[0]!=8 && m_dim[0]!=16 && m_dim[0]!=32) return true;
117 return m_data.size()!=size_t((m_dim[0]/8)*m_dim[1]);
118 }
120 bool getAverageColor(MWAWColor &col) const;
122 bool getUniqueColor(MWAWColor &col) const;
124 bool getBinary(librevenge::RVNGBinaryData &data, std::string &type) const;
125
127 int cmp(Pattern const &a) const
128 {
129 int diff = m_dim.cmp(a.m_dim);
130 if (diff) return diff;
131 if (m_data.size() < a.m_data.size()) return -1;
132 if (m_data.size() > a.m_data.size()) return 1;
133 for (size_t h=0; h < m_data.size(); ++h) {
134 if (m_data[h]<a.m_data[h]) return 1;
135 if (m_data[h]>a.m_data[h]) return -1;
136 }
137 for (int i=0; i<2; ++i) {
138 if (m_colors[i] < a.m_colors[i]) return 1;
139 if (m_colors[i] > a.m_colors[i]) return -1;
140 }
141 if (m_pictureAverageColor < a.m_pictureAverageColor) return 1;
142 if (m_pictureAverageColor > a.m_pictureAverageColor) return -1;
143 if (m_pictureMime < a.m_pictureMime) return 1;
144 if (m_pictureMime > a.m_pictureMime) return -1;
145 if (m_picture.size() < a.m_picture.size()) return 1;
146 if (m_picture.size() > a.m_picture.size()) return -1;
147 const unsigned char *ptr=m_picture.getDataBuffer();
148 const unsigned char *aPtr=a.m_picture.getDataBuffer();
149 if (!ptr || !aPtr) return 0; // must only appear if the two buffers are empty
150 for (unsigned long h=0; h < m_picture.size(); ++h, ++ptr, ++aPtr) {
151 if (*ptr < *aPtr) return 1;
152 if (*ptr > *aPtr) return -1;
153 }
154 return 0;
155 }
157 friend std::ostream &operator<<(std::ostream &o, Pattern const &pat)
158 {
159 o << "dim=" << pat.m_dim << ",";
160 if (pat.m_picture.size()) {
161 o << "type=" << pat.m_pictureMime << ",";
162 o << "col[average]=" << pat.m_pictureAverageColor << ",";
163 }
164 else {
165 if (!pat.m_colors[0].isBlack()) o << "col0=" << pat.m_colors[0] << ",";
166 if (!pat.m_colors[1].isWhite()) o << "col1=" << pat.m_colors[1] << ",";
167 o << "[";
168 for (size_t h=0; h < pat.m_data.size(); ++h)
169 o << std::hex << (int) pat.m_data[h] << std::dec << ",";
170 o << "],";
171 }
172 return o;
173 }
175 Vec2i m_dim;
176
178 MWAWColor m_colors[2];
180 std::vector<unsigned char> m_data;
181 protected:
183 librevenge::RVNGBinaryData m_picture;
185 std::string m_pictureMime;
187 MWAWColor m_pictureAverageColor;
188 };
190 MWAWGraphicStyle() : m_lineWidth(1), m_lineDashWidth(), m_lineCap(C_Butt), m_lineJoin(J_Miter), m_lineOpacity(1), m_lineColor(MWAWColor::black()),
191 m_fillRuleEvenOdd(false), m_surfaceColor(MWAWColor::white()), m_surfaceOpacity(0),
192 m_shadowColor(MWAWColor::black()), m_shadowOpacity(0), m_shadowOffset(1,1),
193 m_pattern(),
194 m_gradientType(G_None), m_gradientStopList(), m_gradientAngle(0), m_gradientBorder(0), m_gradientPercentCenter(0.5f,0.5f), m_gradientRadius(1),
195 m_backgroundColor(MWAWColor::white()), m_backgroundOpacity(-1), m_bordersList(), m_frameName(""), m_frameNextName(""),
196 m_rotate(0), m_extra("")
197 {
198 m_arrows[0]=m_arrows[1]=false;
199 m_flip[0]=m_flip[1]=false;
200 m_gradientStopList.push_back(GradientStop(0.0, MWAWColor::white()));
201 m_gradientStopList.push_back(GradientStop(1.0, MWAWColor::black()));
202 }
204 static MWAWGraphicStyle emptyStyle()
205 {
206 MWAWGraphicStyle res;
207 res.m_lineWidth=0;
208 return res;
209 }
211 virtual ~MWAWGraphicStyle() { }
213 bool hasLine() const
214 {
215 return m_lineWidth>0 && m_lineOpacity>0;
216 }
218 void setSurfaceColor(MWAWColor const &col, float opacity = 1)
219 {
220 m_surfaceColor = col;
221 m_surfaceOpacity = opacity;
222 }
224 bool hasSurfaceColor() const
225 {
226 return m_surfaceOpacity > 0;
227 }
229 void setPattern(Pattern const &pat)
230 {
231 m_pattern=pat;
232 }
234 bool hasPattern() const
235 {
236 return !m_pattern.empty();
237 }
239 bool hasGradient(bool complex=false) const
240 {
241 return m_gradientType != G_None && (int) m_gradientStopList.size() >= (complex ? 3 : 2);
242 }
244 bool hasSurface() const
245 {
246 return hasSurfaceColor() || hasPattern() || hasGradient();
247 }
249 void setBackgroundColor(MWAWColor const &col, float opacity = 1)
250 {
251 m_backgroundColor = col;
252 m_backgroundOpacity = opacity;
253 }
255 bool hasBackgroundColor() const
256 {
257 return m_backgroundOpacity > 0;
258 }
260 void setShadowColor(MWAWColor const &col, float opacity = 1)
261 {
262 m_shadowColor = col;
263 m_shadowOpacity = opacity;
264 }
266 bool hasShadow() const
267 {
268 return m_shadowOpacity > 0;
269 }
271 bool hasBorders() const
272 {
273 return !m_bordersList.empty();
274 }
276 bool hasSameBorders() const
277 {
278 if (m_bordersList.empty()) return true;
279 if (m_bordersList.size()!=4) return false;
280 for (size_t i=1; i<m_bordersList.size(); ++i) {
281 if (m_bordersList[i]!=m_bordersList[0])
282 return false;
283 }
284 return true;
285 }
287 std::vector<MWAWBorder> const &borders() const
288 {
289 return m_bordersList;
290 }
292 void resetBorders()
293 {
294 m_bordersList.resize(0);
295 }
297 void setBorders(int wh, MWAWBorder const &border);
299 friend std::ostream &operator<<(std::ostream &o, MWAWGraphicStyle const &st);
301 void addTo(librevenge::RVNGPropertyList &pList, bool only1d=false) const;
303 void addFrameTo(librevenge::RVNGPropertyList &pList) const;
305 int cmp(MWAWGraphicStyle const &a) const;
306
308 float m_lineWidth;
310 std::vector<float> m_lineDashWidth;
312 LineCap m_lineCap;
314 LineJoin m_lineJoin;
316 float m_lineOpacity;
318 MWAWColor m_lineColor;
320 bool m_fillRuleEvenOdd;
322 MWAWColor m_surfaceColor;
324 float m_surfaceOpacity;
325
327 MWAWColor m_shadowColor;
329 float m_shadowOpacity;
331 Vec2f m_shadowOffset;
332
334 Pattern m_pattern;
335
337 GradientType m_gradientType;
339 std::vector<GradientStop> m_gradientStopList;
341 float m_gradientAngle;
343 float m_gradientBorder;
345 Vec2f m_gradientPercentCenter;
347 float m_gradientRadius;
348
350 bool m_arrows[2];
351
352 //
353 // related to the frame
354 //
355
357 MWAWColor m_backgroundColor;
359 float m_backgroundOpacity;
361 std::vector<MWAWBorder> m_bordersList;
363 std::string m_frameName;
365 std::string m_frameNextName;
366
367 //
368 // some transformation: must probably be somewhere else
369 //
370
372 float m_rotate;
374 bool m_flip[2];
375
377 std::string m_extra;
378 };
379 #endif
380 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWGraphicStyle::m_flip
bool m_flip[2]
two bool to indicated we need to flip the shape or not
Definition: MWAWGraphicStyle.hxx:374
MWAWGraphicStyle::GradientStop::operator<<
friend std::ostream & operator<<(std::ostream &o, GradientStop const &st)
a print operator
Definition: MWAWGraphicStyle.hxx:76
MWAWGraphicStyle::hasSurfaceColor
bool hasSurfaceColor() const
returns true if the surface is defined
Definition: MWAWGraphicStyle.hxx:224
MWAWGraphicStyle::Pattern::m_dim
Vec2i m_dim
the dimension width x height
Definition: MWAWGraphicStyle.hxx:175
MWAWGraphicStyle::Pattern::empty
bool empty() const
return true if we does not have a pattern
Definition: MWAWGraphicStyle.hxx:112
MWAWGraphicStyle::m_surfaceColor
MWAWColor m_surfaceColor
the surface color
Definition: MWAWGraphicStyle.hxx:322
MWAWGraphicStyle::m_frameNextName
std::string m_frameNextName
the frame next name (if there is a link)
Definition: MWAWGraphicStyle.hxx:365
MWAWGraphicStyle::m_shadowColor
MWAWColor m_shadowColor
the shadow color
Definition: MWAWGraphicStyle.hxx:327
MWAWGraphicStyle::J_Round
Definition: MWAWGraphicStyle.hxx:53
MWAWGraphicStyle::GradientStop::m_opacity
float m_opacity
the opacity
Definition: MWAWGraphicStyle.hxx:89
MWAWGraphicStyle::m_backgroundOpacity
float m_backgroundOpacity
true if the background has some color
Definition: MWAWGraphicStyle.hxx:359
MWAWGraphicStyle::m_frameName
std::string m_frameName
the frame name
Definition: MWAWGraphicStyle.hxx:363
libmwaw_internal.hxx
MWAWGraphicStyle::m_shadowOpacity
float m_shadowOpacity
true if the shadow has some color
Definition: MWAWGraphicStyle.hxx:329
MWAWGraphicStyle::Pattern::Pattern
Pattern()
constructor
Definition: MWAWGraphicStyle.hxx:97
MWAWColor::white
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:216
MWAWGraphicStyle::MWAWGraphicStyle
MWAWGraphicStyle()
constructor
Definition: MWAWGraphicStyle.hxx:190
MWAWGraphicStyle::G_None
Definition: MWAWGraphicStyle.hxx:55
MWAWGraphicStyle::Pattern::m_colors
MWAWColor m_colors[2]
the two indexed colors
Definition: MWAWGraphicStyle.hxx:178
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:314
MWAWGraphicStyle::m_lineColor
MWAWColor m_lineColor
the line color
Definition: MWAWGraphicStyle.hxx:318
MWAWGraphicStyle::Pattern::Pattern
Pattern(Vec2i dim, librevenge::RVNGBinaryData const &picture, std::string const &mime, MWAWColor const &avColor)
constructor from a binary data
Definition: MWAWGraphicStyle.hxx:103
MWAWColor::black
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:211
MWAWGraphicStyle::m_gradientRadius
float m_gradientRadius
the gradient radius
Definition: MWAWGraphicStyle.hxx:347
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::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:56
MWAWGraphicStyle::Pattern::m_pictureMime
std::string m_pictureMime
the picture type
Definition: MWAWGraphicStyle.hxx:185
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:158
MWAWGraphicStyle::hasSameBorders
bool hasSameBorders() const
return true if the frame has some border
Definition: MWAWGraphicStyle.hxx:276
MWAWGraphicStyle::addFrameTo
void addFrameTo(librevenge::RVNGPropertyList &pList) const
add all the frame parameters to propList: the background and the borders
Definition: MWAWGraphicStyle.cxx:337
MWAWGraphicStyle::operator<<
friend std::ostream & operator<<(std::ostream &o, MWAWGraphicStyle const &st)
a print operator
Definition: MWAWGraphicStyle.cxx:467
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:167
MWAWGraphicStyle::m_arrows
bool m_arrows[2]
two bool to indicated if extremity has arrow or not
Definition: MWAWGraphicStyle.hxx:350
MWAWGraphicStyle::C_Butt
Definition: MWAWGraphicStyle.hxx:51
MWAWGraphicStyle::hasGradient
bool hasGradient(bool complex=false) const
returns true if the gradient is defined
Definition: MWAWGraphicStyle.hxx:239
MWAWGraphicStyle::m_rotate
float m_rotate
the rotation
Definition: MWAWGraphicStyle.hxx:372
MWAWGraphicStyle::m_lineDashWidth
std::vector< float > m_lineDashWidth
the dash array: a sequence of (fullsize, emptysize)
Definition: MWAWGraphicStyle.hxx:310
MWAWGraphicStyle::GradientStop
a structure used to define the gradient limit
Definition: MWAWGraphicStyle.hxx:58
MWAWBorder
a border
Definition: libmwaw_internal.hxx:299
MWAWGraphicStyle::G_Axial
Definition: MWAWGraphicStyle.hxx:55
MWAWGraphicStyle::m_extra
std::string m_extra
extra data
Definition: MWAWGraphicStyle.hxx:377
MWAWGraphicStyle::hasPattern
bool hasPattern() const
returns true if the pattern is defined
Definition: MWAWGraphicStyle.hxx:234
MWAWGraphicStyle::setPattern
void setPattern(Pattern const &pat)
set the pattern
Definition: MWAWGraphicStyle.hxx:229
MWAWGraphicStyle::m_lineCap
LineCap m_lineCap
the line cap
Definition: MWAWGraphicStyle.hxx:312
MWAWGraphicStyle::m_surfaceOpacity
float m_surfaceOpacity
true if the surface has some color
Definition: MWAWGraphicStyle.hxx:324
MWAWGraphicStyle::m_gradientBorder
float m_gradientBorder
the gradient border opacity
Definition: MWAWGraphicStyle.hxx:343
MWAWGraphicStyle::m_gradientType
GradientType m_gradientType
the gradient type
Definition: MWAWGraphicStyle.hxx:337
MWAWGraphicStyle::m_backgroundColor
MWAWColor m_backgroundColor
the background color
Definition: MWAWGraphicStyle.hxx:357
MWAWGraphicStyle::J_Miter
Definition: MWAWGraphicStyle.hxx:53
MWAWGraphicStyle::m_gradientAngle
float m_gradientAngle
the gradient angle
Definition: MWAWGraphicStyle.hxx:341
MWAWGraphicStyle::hasBackgroundColor
bool hasBackgroundColor() const
returns true if the background is defined
Definition: MWAWGraphicStyle.hxx:255
MWAWGraphicStyle::m_pattern
Pattern m_pattern
the pattern if it exists
Definition: MWAWGraphicStyle.hxx:334
MWAWGraphicStyle::hasBorders
bool hasBorders() const
return true if the frame has some border
Definition: MWAWGraphicStyle.hxx:271
MWAWGraphicStyle::J_Bevel
Definition: MWAWGraphicStyle.hxx:53
MWAWGraphicStyle::setSurfaceColor
void setSurfaceColor(MWAWColor const &col, float opacity=1)
set the surface color
Definition: MWAWGraphicStyle.hxx:218
MWAWGraphicStyle::C_Square
Definition: MWAWGraphicStyle.hxx:51
MWAWGraphicStyle::~MWAWGraphicStyle
virtual ~MWAWGraphicStyle()
virtual destructor
Definition: MWAWGraphicStyle.hxx:211
MWAWGraphicStyle::Pattern::m_picture
librevenge::RVNGBinaryData m_picture
a picture
Definition: MWAWGraphicStyle.hxx:183
MWAWGraphicStyle::m_fillRuleEvenOdd
bool m_fillRuleEvenOdd
true if the fill rule is evenod
Definition: MWAWGraphicStyle.hxx:320
MWAWGraphicStyle::Pattern::getAverageColor
bool getAverageColor(MWAWColor &col) const
return the average color
Definition: MWAWGraphicStyle.cxx:71
MWAWGraphicStyle::hasSurface
bool hasSurface() const
returns true if the interior surface is defined
Definition: MWAWGraphicStyle.hxx:244
MWAWGraphicStyle::G_Square
Definition: MWAWGraphicStyle.hxx:55
MWAWGraphicStyle::borders
std::vector< MWAWBorder > const & borders() const
return the frame border: libmwaw::Left | ...
Definition: MWAWGraphicStyle.hxx:287
MWAWGraphicStyle::G_Linear
Definition: MWAWGraphicStyle.hxx:55
MWAWGraphicStyle::GradientStop::cmp
int cmp(GradientStop const &a) const
compare two gradient
Definition: MWAWGraphicStyle.hxx:65
MWAWGraphicStyle::GradientStop::m_color
MWAWColor m_color
the color
Definition: MWAWGraphicStyle.hxx:87
MWAWGraphicStyle::G_Rectangular
Definition: MWAWGraphicStyle.hxx:55
MWAWGraphicStyle::hasShadow
bool hasShadow() const
returns true if the shadow is defined
Definition: MWAWGraphicStyle.hxx:266
MWAWGraphicStyle::m_bordersList
std::vector< MWAWBorder > m_bordersList
the borders MWAWBorder::Pos (for a frame)
Definition: MWAWGraphicStyle.hxx:361
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:260
MWAWGraphicStyle::m_lineOpacity
float m_lineOpacity
the line opacity: 0=transparent
Definition: MWAWGraphicStyle.hxx:316
MWAWGraphicStyle::Pattern::m_pictureAverageColor
MWAWColor m_pictureAverageColor
the picture average color
Definition: MWAWGraphicStyle.hxx:187
MWAWGraphicStyle::setBackgroundColor
void setBackgroundColor(MWAWColor const &col, float opacity=1)
set the background color
Definition: MWAWGraphicStyle.hxx:249
MWAWGraphicStyle::m_shadowOffset
Vec2f m_shadowOffset
the shadow offset
Definition: MWAWGraphicStyle.hxx:331
MWAWGraphicStyle::m_lineWidth
float m_lineWidth
the linewidth
Definition: MWAWGraphicStyle.hxx:308
MWAWGraphicStyle::Pattern::operator<<
friend std::ostream & operator<<(std::ostream &o, Pattern const &pat)
a print operator
Definition: MWAWGraphicStyle.hxx:157
MWAWColor::isWhite
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:255
MWAWGraphicStyle::m_gradientPercentCenter
Vec2f m_gradientPercentCenter
the gradient center
Definition: MWAWGraphicStyle.hxx:345
MWAWColor::isBlack
bool isBlack() const
return true if the color is black
Definition: libmwaw_internal.hxx:250
MWAWGraphicStyle::hasLine
bool hasLine() const
returns true if the border is defined
Definition: MWAWGraphicStyle.hxx:213
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:180
Vec2< int >
MWAWGraphicStyle::Pattern::cmp
int cmp(Pattern const &a) const
compare two patterns
Definition: MWAWGraphicStyle.hxx:127
MWAWGraphicStyle::GradientStop::GradientStop
GradientStop(float offset=0.0, MWAWColor const &col=MWAWColor::black(), float opacity=1.0)
constructor
Definition: MWAWGraphicStyle.hxx:60
MWAWGraphicStyle::cmp
int cmp(MWAWGraphicStyle const &a) const
compare two styles
Definition: MWAWGraphicStyle.cxx:383
MWAWGraphicStyle::Pattern
a basic pattern used in a MWAWGraphicStyle:
Definition: MWAWGraphicStyle.hxx:95
MWAWGraphicStyle::GradientStop::m_offset
float m_offset
the offset
Definition: MWAWGraphicStyle.hxx:85
MWAWGraphicStyle::setBorders
void setBorders(int wh, MWAWBorder const &border)
sets the cell border: wh=libmwaw::LeftBit|...
Definition: MWAWGraphicStyle.cxx:139
Vec2::cmp
int cmp(Vec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libmwaw_internal.hxx:646
MWAWGraphicStyle::G_Radial
Definition: MWAWGraphicStyle.hxx:55
MWAWGraphicStyle::m_gradientStopList
std::vector< GradientStop > m_gradientStopList
the list of gradient limits
Definition: MWAWGraphicStyle.hxx:339
MWAWGraphicStyle::emptyStyle
static MWAWGraphicStyle emptyStyle()
returns an empty style.
Definition: MWAWGraphicStyle.hxx:204
MWAWGraphicStyle::resetBorders
void resetBorders()
reset the border
Definition: MWAWGraphicStyle.hxx:292
MWAWGraphicStyle::Pattern::~Pattern
virtual ~Pattern()
virtual destructor
Definition: MWAWGraphicStyle.hxx:110
MWAWGraphicStyle::Pattern::getBinary
bool getBinary(librevenge::RVNGBinaryData &data, std::string &type) const
tries to convert the picture in a binary data ( ppm)
Definition: MWAWGraphicStyle.cxx:98