Go to the documentation of this file.
33 #ifndef MWAW_GRAPHIC_STYLE
34 # define MWAW_GRAPHIC_STYLE
39 # include "librevenge/librevenge.h"
66 Arrow(
float w,
MWAWBox2i const &box, std::string
const &path,
bool centered=
false)
82 o <<
"w=" << arrow.
m_width <<
",";
83 o <<
"viewbox=" << arrow.
m_viewBox <<
",";
84 o <<
"path=" << arrow.
m_path <<
",";
97 return !(*
this==arrow);
108 return *
this<arrow || *
this==arrow;
113 return !(*
this<=arrow);
118 return !(*
this<arrow);
126 void addTo(librevenge::RVNGPropertyList &propList, std::string
const &type)
const;
163 o <<
"offset=" << st.
m_offset <<
",";
164 o <<
"color=" << st.
m_color <<
",";
166 o <<
"opacity=" << st.
m_opacity*100.f <<
"%,";
196 void addTo(librevenge::RVNGPropertyList &propList)
const;
220 #if !defined(__clang__)
229 o <<
"[" << stop <<
"],";
249 if (diff)
return diff;
254 if (diff)
return diff;
322 if (diff)
return diff;
325 for (
size_t h=0; h <
m_data.size(); ++h) {
329 for (
int i=0; i<2; ++i) {
336 if (diff)
return diff;
342 o <<
"dim=" << pat.
m_dim <<
",";
351 for (
auto data : pat.
m_data)
352 o << std::hex << static_cast<int>(data) << std::dec <<
",";
395 for (
auto &fl :
m_flip) fl=
false;
485 std::vector<MWAWBorder>
const &
borders()
const
499 void addTo(librevenge::RVNGPropertyList &pList,
bool only1d=
false)
const;
501 void addFrameTo(librevenge::RVNGPropertyList &pList)
const;
friend std::ostream & operator<<(std::ostream &o, MWAWGraphicStyle const &st)
a print operator
Definition: MWAWGraphicStyle.cxx:497
bool getUniqueColor(MWAWColor &col) const
check if the pattern has only one color; if so returns true...
Definition: MWAWGraphicStyle.cxx:86
@ G_Square
Definition: MWAWGraphicStyle.hxx:177
float m_opacity
the opacity
Definition: MWAWGraphicStyle.hxx:174
std::string m_path
the arrow path
Definition: MWAWGraphicStyle.hxx:131
LineCap m_lineCap
the line cap
Definition: MWAWGraphicStyle.hxx:510
bool isEmpty() const
returns true if there is no arrow
Definition: MWAWGraphicStyle.hxx:121
bool hasBorders() const
return true if the frame has some border
Definition: MWAWGraphicStyle.hxx:469
bool m_doNotPrint
a bool to know if the shape must not be printed
Definition: MWAWGraphicStyle.hxx:566
bool hasSurfaceColor() const
returns true if the surface is defined
Definition: MWAWGraphicStyle.hxx:421
bool empty() const
return true if we does not have a pattern
Definition: MWAWGraphicStyle.hxx:304
MWAWColor m_backgroundColor
the background color
Definition: MWAWGraphicStyle.hxx:540
float m_offset
the offset
Definition: MWAWGraphicStyle.hxx:170
friend std::ostream & operator<<(std::ostream &o, Stop const &st)
a print operator
Definition: MWAWGraphicStyle.hxx:161
MWAWGraphicStyle & operator=(MWAWGraphicStyle &&)=default
int cmp(Pattern const &a) const
compare two patterns
Definition: MWAWGraphicStyle.hxx:319
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
@ J_Bevel
Definition: MWAWGraphicStyle.hxx:53
void setColors(std::vector< MWAWColor > const &cols)
sets the array of indexed colors
Definition: MWAWPictBitmap.hxx:446
Pattern m_pattern
the pattern if it exists
Definition: MWAWGraphicStyle.hxx:530
std::string m_extra
extra data
Definition: MWAWGraphicStyle.hxx:568
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
void addFrameTo(librevenge::RVNGPropertyList &pList) const
add all the frame parameters to propList: the background and the borders
Definition: MWAWGraphicStyle.cxx:380
void setSurfaceColor(MWAWColor const &col, float opacity=1)
set the surface color
Definition: MWAWGraphicStyle.hxx:415
void setShadowColor(MWAWColor const &col, float opacity=1)
set the shadow color
Definition: MWAWGraphicStyle.hxx:458
Type m_type
the gradient type
Definition: MWAWGraphicStyle.hxx:260
Pattern(Pattern const &)=default
@ G_None
Definition: MWAWGraphicStyle.hxx:177
bool m_fillRuleEvenOdd
true if the fill rule is evenod
Definition: MWAWGraphicStyle.hxx:563
static Arrow plain()
returns a basic plain arrow
Definition: MWAWGraphicStyle.hxx:74
bool m_isCentered
flag to know if the arrow is centered
Definition: MWAWGraphicStyle.hxx:135
float m_surfaceOpacity
true if the surface has some color
Definition: MWAWGraphicStyle.hxx:520
std::vector< librevenge::RVNGBinaryData > m_dataList
the picture content: one data by representation
Definition: libmwaw_internal.hxx:512
std::vector< MWAWBorder > m_bordersList
the borders MWAWBorder::Pos (for a frame)
Definition: MWAWGraphicStyle.hxx:546
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:250
LineJoin
an enum used to define the basic line join
Definition: MWAWGraphicStyle.hxx:53
@ BottomBit
Definition: libmwaw_internal.hxx:178
bool operator>=(Arrow const &arrow) const
operator>=
Definition: MWAWGraphicStyle.hxx:116
the class to store a color
Definition: libmwaw_internal.hxx:192
small class use to define a embedded object
Definition: libmwaw_internal.hxx:467
MWAWBox2i m_viewBox
the arrow viewbox
Definition: MWAWGraphicStyle.hxx:129
void setBackgroundColor(MWAWColor const &col, float opacity=1)
set the background color
Definition: MWAWGraphicStyle.hxx:447
bool getAverageColor(MWAWColor &col) const
return the average color
Definition: MWAWGraphicStyle.cxx:101
@ G_Linear
Definition: MWAWGraphicStyle.hxx:177
bool operator<=(Arrow const &arrow) const
operator<=
Definition: MWAWGraphicStyle.hxx:106
std::string str() const
print the color in the form #rrggbb
Definition: libmwaw_internal.cxx:232
@ None
Definition: libmwaw_internal.hxx:335
@ C_Butt
Definition: MWAWGraphicStyle.hxx:51
bool getBinary(MWAWEmbeddedObject &picture) const override
returns the final picture
Definition: MWAWPictBitmap.hxx:225
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:48
bool hasLine() const
returns true if the border is defined
Definition: MWAWGraphicStyle.hxx:410
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:363
virtual ~MWAWGraphicStyle()
virtual destructor
Definition: MWAWGraphicStyle.cxx:228
MWAWColor m_pictureAverageColor
the picture average color
Definition: MWAWGraphicStyle.hxx:368
float m_lineOpacity
the line opacity: 0=transparent
Definition: MWAWGraphicStyle.hxx:514
friend std::ostream & operator<<(std::ostream &o, Pattern const &pat)
a print operator
Definition: MWAWGraphicStyle.hxx:340
Stop(float offset=0.0, MWAWColor const &col=MWAWColor::black(), float opacity=1.0)
constructor
Definition: MWAWGraphicStyle.hxx:143
@ G_Rectangular
Definition: MWAWGraphicStyle.hxx:177
void resetBorders()
reset the border
Definition: MWAWGraphicStyle.hxx:490
@ J_Round
Definition: MWAWGraphicStyle.hxx:53
a basic pattern used in a MWAWGraphicStyle:
Definition: MWAWGraphicStyle.hxx:277
static MWAWColor barycenter(float alpha, MWAWColor const &colA, float beta, MWAWColor const &colB)
return alpha*colA+beta*colB
Definition: libmwaw_internal.cxx:206
bool hasPattern() const
returns true if the pattern is defined
Definition: MWAWGraphicStyle.hxx:432
int cmp(Stop const &a) const
compare two gradient
Definition: MWAWGraphicStyle.hxx:150
int cmp(MWAWEmbeddedObject const &pict) const
a comparison function
Definition: libmwaw_internal.cxx:606
static MWAWGraphicStyle emptyStyle()
returns an empty style.
Definition: MWAWGraphicStyle.hxx:401
MWAWColor m_color
the color
Definition: MWAWGraphicStyle.hxx:172
MWAWColor m_surfaceColor
the surface color
Definition: MWAWGraphicStyle.hxx:518
int cmp(MWAWVec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libmwaw_internal.hxx:777
int cmp(Gradient const &a) const
compare two gradient
Definition: MWAWGraphicStyle.hxx:239
@ Bottom
Definition: libmwaw_internal.hxx:176
bool isEmpty() const
return true if the picture contains no data
Definition: libmwaw_internal.hxx:486
float m_lineWidth
the linewidth
Definition: MWAWGraphicStyle.hxx:508
a structure used to define the gradient limit in MWAWGraphicStyle
Definition: MWAWGraphicStyle.hxx:141
a border
Definition: libmwaw_internal.hxx:333
bool m_flip[2]
two bool to indicated we need to flip the shape or not
Definition: MWAWGraphicStyle.hxx:560
bool isBlack() const
return true if the color is black
Definition: libmwaw_internal.hxx:284
Arrow(float w, MWAWBox2i const &box, std::string const &path, bool centered=false)
constructor
Definition: MWAWGraphicStyle.hxx:66
bool operator<(Arrow const &arrow) const
operator<
Definition: MWAWGraphicStyle.hxx:100
MWAWVec2i m_dim
the dimension width x height
Definition: MWAWGraphicStyle.hxx:358
friend std::ostream & operator<<(std::ostream &o, Gradient const &grad)
a print operator
Definition: MWAWGraphicStyle.hxx:198
float m_border
the gradient border opacity
Definition: MWAWGraphicStyle.hxx:266
void setBorders(int wh, MWAWBorder const &border)
sets the cell border: wh=libmwaw::LeftBit|...
Definition: MWAWGraphicStyle.cxx:232
@ RightBit
Definition: libmwaw_internal.hxx:178
void setRow(int j, U const *val)
sets all cell contents of a row
Definition: MWAWPictBitmap.hxx:430
Arrow m_arrows[2]
the two arrows corresponding to start and end extremity
Definition: MWAWGraphicStyle.hxx:553
void setPattern(Pattern const &pat, float opacity=1)
set the pattern
Definition: MWAWGraphicStyle.hxx:426
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:245
virtual ~Pattern()
virtual destructor
Definition: MWAWGraphicStyle.cxx:82
Pattern(MWAWVec2i dim, MWAWEmbeddedObject const &picture, MWAWColor const &avColor)
constructor from a binary data
Definition: MWAWGraphicStyle.hxx:289
bool hasBackgroundColor() const
returns true if the background is defined
Definition: MWAWGraphicStyle.hxx:453
Pattern & operator=(Pattern const &)=default
@ G_Axial
Definition: MWAWGraphicStyle.hxx:177
MWAWEmbeddedObject m_picture
a picture
Definition: MWAWGraphicStyle.hxx:366
MWAWColor m_colors[2]
the two indexed colors
Definition: MWAWGraphicStyle.hxx:361
float m_width
the arrow width in point
Definition: MWAWGraphicStyle.hxx:133
bool hasSameBorders() const
return true if the frame has some border
Definition: MWAWGraphicStyle.hxx:474
@ Top
Definition: libmwaw_internal.hxx:176
float m_backgroundOpacity
true if the background has some color
Definition: MWAWGraphicStyle.hxx:542
Style m_style
the border style
Definition: libmwaw_internal.hxx:380
MWAWColor m_shadowColor
the shadow color
Definition: MWAWGraphicStyle.hxx:523
MWAWColor m_lineColor
the line color
Definition: MWAWGraphicStyle.hxx:516
void addTo(librevenge::RVNGPropertyList &propList) const
add a gradient to the propList
Definition: MWAWGraphicStyle.cxx:168
bool hasShadow() const
returns true if the shadow is defined
Definition: MWAWGraphicStyle.hxx:464
std::string m_frameName
the frame name
Definition: MWAWGraphicStyle.hxx:548
@ C_Square
Definition: MWAWGraphicStyle.hxx:51
MWAWBox2< int > MWAWBox2i
MWAWBox2 of int.
Definition: libmwaw_internal.hxx:1191
@ LeftBit
Definition: libmwaw_internal.hxx:178
Pattern()
constructor
Definition: MWAWGraphicStyle.hxx:279
int cmp(MWAWGraphicStyle const &a) const
compare two styles
Definition: MWAWGraphicStyle.cxx:428
float m_shadowOpacity
true if the shadow has some color
Definition: MWAWGraphicStyle.hxx:525
std::vector< std::string > m_typeList
the picture type: one type by representation
Definition: libmwaw_internal.hxx:514
@ C_Round
Definition: MWAWGraphicStyle.hxx:51
a basic gradient used in a MWAWGraphicStyle
Definition: MWAWGraphicStyle.hxx:139
a bitmap of int to store indexed bitmap
Definition: MWAWPictBitmap.hxx:357
LineCap
an enum used to define the basic line cap
Definition: MWAWGraphicStyle.hxx:51
MWAWVec2f m_percentCenter
the gradient center
Definition: MWAWGraphicStyle.hxx:268
std::string m_frameNextName
the frame next name (if there is a link)
Definition: MWAWGraphicStyle.hxx:550
Gradient m_gradient
the gradient
Definition: MWAWGraphicStyle.hxx:533
Gradient()
constructor
Definition: MWAWGraphicStyle.hxx:179
@ Right
Definition: libmwaw_internal.hxx:176
@ G_Ellipsoid
Definition: MWAWGraphicStyle.hxx:177
float m_radius
the gradient radius
Definition: MWAWGraphicStyle.hxx:270
bool hasGradient(bool complex=false) const
returns true if the gradient is defined
Definition: MWAWGraphicStyle.hxx:437
@ TopBit
Definition: libmwaw_internal.hxx:178
bool hasGradient(bool complex=false) const
returns true if the gradient is defined
Definition: MWAWGraphicStyle.hxx:191
LineJoin m_lineJoin
the line join
Definition: MWAWGraphicStyle.hxx:512
std::vector< float > m_lineDashWidth
the dash array: a sequence of (fullsize, emptysize)
Definition: MWAWGraphicStyle.hxx:506
bool getBinary(MWAWEmbeddedObject &picture) const
tries to convert the picture in a binary data ( ppm)
Definition: MWAWGraphicStyle.cxx:128
MWAWGraphicStyle()
constructor
Definition: MWAWGraphicStyle.hxx:371
@ Left
Definition: libmwaw_internal.hxx:176
Arrow()
constructor ( no arrow)
Definition: MWAWGraphicStyle.hxx:58
libmwaw API: main libmwaw interface header
MWAWGraphicStyle & operator=(MWAWGraphicStyle const &)=default
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:289
float m_rotate
the rotation
Definition: MWAWGraphicStyle.hxx:544
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:251
std::vector< MWAWBorder > const & borders() const
return the frame border: libmwaw::Left | ...
Definition: MWAWGraphicStyle.hxx:485
float m_angle
the gradient angle
Definition: MWAWGraphicStyle.hxx:264
MWAWGraphicStyle(MWAWGraphicStyle const &)=default
friend std::ostream & operator<<(std::ostream &o, Arrow const &arrow)
operator<<
Definition: MWAWGraphicStyle.hxx:79
@ G_Radial
Definition: MWAWGraphicStyle.hxx:177
bool operator>(Arrow const &arrow) const
operator>
Definition: MWAWGraphicStyle.hxx:111
MWAWVec2f m_shadowOffset
the shadow offset
Definition: MWAWGraphicStyle.hxx:527
bool operator!=(Arrow const &arrow) const
operator!=
Definition: MWAWGraphicStyle.hxx:95
bool hasSurface() const
returns true if the interior surface is defined
Definition: MWAWGraphicStyle.hxx:442
bool operator==(Arrow const &arrow) const
operator==
Definition: MWAWGraphicStyle.hxx:89
Type
an enum used to define the gradient type
Definition: MWAWGraphicStyle.hxx:177
Pattern & operator=(Pattern &&)=default
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:838
std::vector< Stop > m_stopList
the list of gradient limits
Definition: MWAWGraphicStyle.hxx:262
a structure used to define an arrow
Definition: MWAWGraphicStyle.hxx:56
@ J_Miter
Definition: MWAWGraphicStyle.hxx:53
Generated on Fri Sep 18 2020 18:14:52 for libmwaw by
doxygen 1.8.20