Go to the documentation of this file.
23 #ifndef WPS_GRAPHIC_STYLE
24 # define WPS_GRAPHIC_STYLE
29 # include "librevenge/librevenge.h"
71 o <<
"offset=" << st.
m_offset <<
",";
72 o <<
"color=" << st.
m_color <<
",";
74 o <<
"opacity=" << st.
m_opacity*100.f <<
"%,";
102 Pattern(
Vec2i dim, librevenge::RVNGBinaryData
const &picture, std::string
const &mime,
WPSColor const &avColor)
129 bool getBinary(librevenge::RVNGBinaryData &data, std::string &type)
const;
135 if (diff)
return diff;
138 for (
size_t h=0; h <
m_data.size(); ++h)
143 for (
int i=0; i<2; ++i)
154 const unsigned char *ptr=
m_picture.getDataBuffer();
155 const unsigned char *aPtr=a.
m_picture.getDataBuffer();
156 if (!ptr || !aPtr)
return 0;
157 for (
unsigned long h=0; h <
m_picture.size(); ++h, ++ptr, ++aPtr)
159 if (*ptr < *aPtr)
return 1;
160 if (*ptr > *aPtr)
return -1;
167 o <<
"dim=" << pat.
m_dim <<
",";
178 for (
auto const &data : pat.
m_data)
179 o << std::hex << int(data) << std::dec <<
",";
338 void addTo(librevenge::RVNGPropertyList &pList,
bool only1d=
false)
const;
340 void addFrameTo(librevenge::RVNGPropertyList &pList)
const;
librevenge::RVNGString m_frameNextName
the frame next name (if there is a link)
Definition: WPSGraphicStyle.h:402
static WPSColor white()
return the white color
Definition: libwps_internal.h:311
librevenge::RVNGBinaryData m_picture
a picture
Definition: WPSGraphicStyle.h:195
WPSColor m_pictureAverageColor
the picture average color
Definition: WPSGraphicStyle.h:199
bool hasPattern() const
returns true if the pattern is defined
Definition: WPSGraphicStyle.h:270
std::string m_extra
extra data
Definition: WPSGraphicStyle.h:414
float m_surfaceOpacity
true if the surface has some color
Definition: WPSGraphicStyle.h:361
bool m_fillRuleEvenOdd
true if the fill rule is evenod
Definition: WPSGraphicStyle.h:357
@ Top
Definition: libwps_internal.h:400
WPSColor m_surfaceColor
the surface color
Definition: WPSGraphicStyle.h:359
@ G_Linear
Definition: WPSGraphicStyle.h:45
LineJoin m_lineJoin
the line join
Definition: WPSGraphicStyle.h:351
float m_gradientAngle
the gradient angle
Definition: WPSGraphicStyle.h:378
LineCap m_lineCap
the line cap
Definition: WPSGraphicStyle.h:349
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: WPSGraphicStyle.h:192
void setShadowColor(WPSColor const &col, float opacity=1)
set the shadow color
Definition: WPSGraphicStyle.h:296
friend std::ostream & operator<<(std::ostream &o, WPSGraphicStyle const &st)
a print operator
Definition: WPSGraphicStyle.cpp:509
virtual ~Pattern()
virtual destructor
Definition: WPSGraphicStyle.cpp:41
void resetBorders()
reset the border
Definition: WPSGraphicStyle.h:329
Vec2f m_gradientPercentCenter
the gradient center
Definition: WPSGraphicStyle.h:382
bool m_flip[2]
two bool to indicated we need to flip the shape or not
Definition: WPSGraphicStyle.h:411
const std::vector< WPSBorder > & borders() const
return the frame border: libwps::Left | ...
Definition: WPSGraphicStyle.h:324
@ BottomBit
Definition: libwps_internal.h:401
WPSColor m_backgroundColor
the background color
Definition: WPSGraphicStyle.h:394
int cmp(Vec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libwps_internal.h:647
@ Right
Definition: libwps_internal.h:400
@ J_Round
Definition: WPSGraphicStyle.h:43
@ G_Radial
Definition: WPSGraphicStyle.h:45
@ G_Ellipsoid
Definition: WPSGraphicStyle.h:45
bool hasShadow() const
returns true if the shadow is defined
Definition: WPSGraphicStyle.h:302
bool isWhite() const
return true if the color is white
Definition: libwps_internal.h:350
Vec2f m_shadowOffset
the shadow offset
Definition: WPSGraphicStyle.h:368
bool hasBorders() const
return true if the frame has some border
Definition: WPSGraphicStyle.h:307
static WPSColor barycenter(float alpha, WPSColor const &colA, float beta, WPSColor const &colB)
return alpha*colA+beta*colB
Definition: libwps_internal.cpp:386
void setBackgroundColor(WPSColor const &col, float opacity=1)
set the background color
Definition: WPSGraphicStyle.h:285
std::vector< float > m_lineDashWidth
the dash array: a sequence of (fullsize, emptysize)
Definition: WPSGraphicStyle.h:347
bool getBinary(librevenge::RVNGBinaryData &data, std::string &type) const
tries to convert the picture in a binary data ( ppm)
Definition: WPSGraphicStyle.cpp:92
GradientType m_gradientType
the gradient type
Definition: WPSGraphicStyle.h:374
bool hasLine() const
returns true if the border is defined
Definition: WPSGraphicStyle.h:249
Vec2i m_dim
the dimension width x height
Definition: WPSGraphicStyle.h:187
friend std::ostream & operator<<(std::ostream &o, GradientStop const &st)
a print operator
Definition: WPSGraphicStyle.h:69
bool hasSurface() const
returns true if the interior surface is defined
Definition: WPSGraphicStyle.h:280
float m_lineOpacity
the line opacity: 0=transparent
Definition: WPSGraphicStyle.h:353
float m_gradientRadius
the gradient radius
Definition: WPSGraphicStyle.h:384
Pattern(Vec2i dim, librevenge::RVNGBinaryData const &picture, std::string const &mime, WPSColor const &avColor)
constructor from a binary data
Definition: WPSGraphicStyle.h:102
WPSColor m_colors[2]
the two indexed colors
Definition: WPSGraphicStyle.h:190
Pattern()
constructor
Definition: WPSGraphicStyle.h:91
@ Left
Definition: libwps_internal.h:400
bool getAverageColor(WPSColor &col) const
return the average color
Definition: WPSGraphicStyle.cpp:61
@ TopBit
Definition: libwps_internal.h:401
#define WPS_DEBUG_MSG(M)
Definition: libwps_internal.h:134
static WPSGraphicStyle emptyStyle()
returns an empty style.
Definition: WPSGraphicStyle.h:240
@ J_Bevel
Definition: WPSGraphicStyle.h:43
std::vector< WPSBorder > m_bordersList
the borders WPSBorder::Pos (for a frame)
Definition: WPSGraphicStyle.h:398
@ C_Butt
Definition: WPSGraphicStyle.h:41
std::string m_pictureMime
the picture type
Definition: WPSGraphicStyle.h:197
GradientStop(float offset=0.0, WPSColor const &col=WPSColor::black(), float opacity=1.0)
constructor
Definition: WPSGraphicStyle.h:51
void addFrameTo(librevenge::RVNGPropertyList &pList) const
add all the frame parameters to propList: the background and the borders
Definition: WPSGraphicStyle.cpp:369
WPSColor m_shadowColor
the shadow color
Definition: WPSGraphicStyle.h:364
@ G_Axial
Definition: WPSGraphicStyle.h:45
@ C_Round
Definition: WPSGraphicStyle.h:41
@ Bottom
Definition: libwps_internal.h:400
@ RightBit
Definition: libwps_internal.h:401
LineJoin
an enum used to define the basic line join
Definition: WPSGraphicStyle.h:43
a structure used to define a picture style
Definition: WPSGraphicStyle.h:37
@ G_None
Definition: WPSGraphicStyle.h:45
int cmp(Pattern const &a) const
compare two patterns
Definition: WPSGraphicStyle.h:132
GradientType
an enum used to define the gradient type
Definition: WPSGraphicStyle.h:45
int cmp(WPSGraphicStyle const &a) const
compare two styles
Definition: WPSGraphicStyle.cpp:421
Style m_style
the border style
Definition: libwps_internal.h:446
bool hasSameBorders() const
return true if the frame has some border
Definition: WPSGraphicStyle.h:312
bool hasBackgroundColor() const
returns true if the background is defined
Definition: WPSGraphicStyle.h:291
float m_shadowOpacity
true if the shadow has some color
Definition: WPSGraphicStyle.h:366
std::vector< GradientStop > m_gradientStopList
the list of gradient limits
Definition: WPSGraphicStyle.h:376
LineCap
an enum used to define the basic line cap
Definition: WPSGraphicStyle.h:41
a border list
Definition: libwps_internal.h:394
a structure used to define the gradient limit
Definition: WPSGraphicStyle.h:48
float m_rotate
the rotation
Definition: WPSGraphicStyle.h:409
void setSurfaceColor(WPSColor const &col, float opacity=1)
set the surface color
Definition: WPSGraphicStyle.h:254
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: WPSGraphicStyle.cpp:165
bool hasSurfaceColor() const
returns true if the surface is defined
Definition: WPSGraphicStyle.h:260
WPSColor m_lineColor
the line color
Definition: WPSGraphicStyle.h:355
WPSColor m_color
the color
Definition: WPSGraphicStyle.h:80
bool hasGradient(bool complex=false) const
returns true if the gradient is defined
Definition: WPSGraphicStyle.h:275
float m_offset
the offset
Definition: WPSGraphicStyle.h:78
float m_backgroundOpacity
true if the background has some color
Definition: WPSGraphicStyle.h:396
void setBorders(int wh, WPSBorder const &border)
sets the cell border: wh=libwps::LeftBit|...
Definition: WPSGraphicStyle.cpp:144
float m_gradientBorder
the gradient border opacity
Definition: WPSGraphicStyle.h:380
bool empty() const
return true if we does not have a pattern
Definition: WPSGraphicStyle.h:117
@ LeftBit
Definition: libwps_internal.h:401
@ None
Definition: libwps_internal.h:397
@ G_Square
Definition: WPSGraphicStyle.h:45
friend std::ostream & operator<<(std::ostream &o, Pattern const &pat)
a print operator
Definition: WPSGraphicStyle.h:165
a basic pattern used in a WPSGraphicStyle:
Definition: WPSGraphicStyle.h:88
virtual ~WPSGraphicStyle()
virtual destructor
Definition: WPSGraphicStyle.cpp:140
std::string str() const
print the color in the form #rrggbb
Definition: libwps_internal.cpp:413
the class to store a color
Definition: libwps_internal.h:280
Pattern & operator=(Pattern const &)=default
operator=
WPSGraphicStyle()
constructor
Definition: WPSGraphicStyle.h:202
librevenge::RVNGString m_frameName
the frame name
Definition: WPSGraphicStyle.h:400
@ G_Rectangular
Definition: WPSGraphicStyle.h:45
int cmp(GradientStop const &a) const
compare two gradient
Definition: WPSGraphicStyle.h:58
float m_lineWidth
the linewidth
Definition: WPSGraphicStyle.h:345
WPSGraphicStyle & operator=(WPSGraphicStyle &&)=default
float m_opacity
the opacity
Definition: WPSGraphicStyle.h:82
bool getUniqueColor(WPSColor &col) const
check if the pattern has only one color; if so returns true...
Definition: WPSGraphicStyle.cpp:45
void setPattern(Pattern const &pat)
set the pattern
Definition: WPSGraphicStyle.h:265
Pattern m_pattern
the pattern if it exists
Definition: WPSGraphicStyle.h:371
static WPSColor black()
return the back color
Definition: libwps_internal.h:306
@ J_Miter
Definition: WPSGraphicStyle.h:43
bool isBlack() const
return true if the color is black
Definition: libwps_internal.h:345
bool m_arrows[2]
two bool to indicated if extremity has arrow or not
Definition: WPSGraphicStyle.h:387
@ C_Square
Definition: WPSGraphicStyle.h:41
Generated on Sat Apr 4 2020 08:40:32 for libwps by
doxygen 1.8.17