33 #ifndef MWAW_GRAPHIC_STYLE
34 # define MWAW_GRAPHIC_STYLE
39 # include "libwpd/libwpd.h"
75 o <<
"offset=" << st.
m_offset <<
",";
76 o <<
"color=" << st.
m_color <<
",";
78 o <<
"opacity=" << st.
m_opacity*100.f <<
"%,";
118 bool getBinary(WPXBinaryData &data, std::string &type)
const;
123 if (diff)
return diff;
126 for (
size_t h=0; h <
m_data.size(); ++h) {
130 for (
int i=0; i<2; ++i) {
140 const unsigned char *ptr=
m_picture.getDataBuffer();
141 const unsigned char *aPtr=a.
m_picture.getDataBuffer();
142 for (
unsigned long h=0; h <
m_picture.size(); ++h, ++ptr, ++aPtr) {
143 if (*ptr < *aPtr)
return 1;
144 if (*ptr > *aPtr)
return -1;
150 o <<
"dim=" << pat.
m_dim <<
",";
158 for (
size_t h=0; h < pat.
m_data.size(); ++h)
159 o << std::hex << (
int) pat.
m_data[h] << std::dec <<
",";
234 void addTo(WPXPropertyList &pList, WPXPropertyListVector &gradient,
bool only1d=
false)
const;
bool m_flip[2]
two bool to indicated we need to flip the shape or not
Definition: MWAWGraphicStyle.hxx:289
friend std::ostream & operator<<(std::ostream &o, GradientStop const &st)
a print operator
Definition: MWAWGraphicStyle.hxx:74
bool hasSurfaceColor() const
returns true if the surface is defined
Definition: MWAWGraphicStyle.hxx:203
Vec2i m_dim
the dimension width x height
Definition: MWAWGraphicStyle.hxx:165
bool empty() const
return true if we does not have a pattern
Definition: MWAWGraphicStyle.hxx:107
MWAWColor m_surfaceColor
the surface color
Definition: MWAWGraphicStyle.hxx:254
MWAWColor m_shadowColor
the shadow color
Definition: MWAWGraphicStyle.hxx:259
Definition: MWAWGraphicStyle.hxx:53
float m_opacity
the opacity
Definition: MWAWGraphicStyle.hxx:86
float m_shadowOpacity
true if the shadow has some color
Definition: MWAWGraphicStyle.hxx:261
Pattern()
constructor
Definition: MWAWGraphicStyle.hxx:94
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:184
MWAWGraphicStyle()
constructor
Definition: MWAWGraphicStyle.hxx:180
Definition: MWAWGraphicStyle.hxx:55
MWAWColor m_colors[2]
the two indexed colors
Definition: MWAWGraphicStyle.hxx:168
LineCap
an enum used to define the basic line cap
Definition: MWAWGraphicStyle.hxx:51
LineJoin m_lineJoin
the line join
Definition: MWAWGraphicStyle.hxx:246
MWAWColor m_lineColor
the line color
Definition: MWAWGraphicStyle.hxx:250
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:180
float m_gradientRadius
the gradient radius
Definition: MWAWGraphicStyle.hxx:279
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:47
Definition: MWAWGraphicStyle.hxx:51
GradientType
an enum used to define the gradient type
Definition: MWAWGraphicStyle.hxx:55
Definition: MWAWGraphicStyle.hxx:55
bool getUniqueColor(MWAWColor &col) const
check if the pattern has only one color; if so returns true...
Definition: MWAWGraphicStyle.cxx:56
std::string m_pictureMime
the picture type
Definition: MWAWGraphicStyle.hxx:175
friend std::ostream & operator<<(std::ostream &o, MWAWGraphicStyle const &st)
a print operator
Definition: MWAWGraphicStyle.cxx:376
the class to store a color
Definition: libmwaw_internal.hxx:166
bool m_arrows[2]
two bool to indicated if extremity has arrow or not
Definition: MWAWGraphicStyle.hxx:282
Definition: MWAWGraphicStyle.hxx:51
bool hasGradient(bool complex=false) const
returns true if the gradient is defined
Definition: MWAWGraphicStyle.hxx:215
float m_rotate
the rotation
Definition: MWAWGraphicStyle.hxx:287
std::vector< float > m_lineDashWidth
the dash array: a sequence of (fullsize, emptysize)
Definition: MWAWGraphicStyle.hxx:242
a structure used to define the gradient limit
Definition: MWAWGraphicStyle.hxx:58
Definition: MWAWGraphicStyle.hxx:55
std::string m_extra
extra data
Definition: MWAWGraphicStyle.hxx:292
bool hasPattern() const
returns true if the pattern is defined
Definition: MWAWGraphicStyle.hxx:211
void setPattern(Pattern const &pat)
set the pattern
Definition: MWAWGraphicStyle.hxx:207
LineCap m_lineCap
the line cap
Definition: MWAWGraphicStyle.hxx:244
float m_surfaceOpacity
true if the surface has some color
Definition: MWAWGraphicStyle.hxx:256
float m_gradientBorder
the gradient border opacity
Definition: MWAWGraphicStyle.hxx:275
GradientType m_gradientType
the gradient type
Definition: MWAWGraphicStyle.hxx:269
Definition: MWAWGraphicStyle.hxx:53
float m_gradientAngle
the gradient angle
Definition: MWAWGraphicStyle.hxx:273
Pattern m_pattern
the pattern if it exists
Definition: MWAWGraphicStyle.hxx:266
Definition: MWAWGraphicStyle.hxx:53
void setSurfaceColor(MWAWColor const &col, float opacity=1)
set the surface color
Definition: MWAWGraphicStyle.hxx:198
Definition: MWAWGraphicStyle.hxx:51
virtual ~MWAWGraphicStyle()
virtual destructor
Definition: MWAWGraphicStyle.hxx:192
bool m_fillRuleEvenOdd
true if the fill rule is evenod
Definition: MWAWGraphicStyle.hxx:252
bool getAverageColor(MWAWColor &col) const
return the average color
Definition: MWAWGraphicStyle.cxx:71
void addTo(WPXPropertyList &pList, WPXPropertyListVector &gradient, bool only1d=false) const
add to propList
Definition: MWAWGraphicStyle.cxx:139
bool hasSurface() const
returns true if the interior surface is defined
Definition: MWAWGraphicStyle.hxx:219
Definition: MWAWGraphicStyle.hxx:55
Definition: MWAWGraphicStyle.hxx:55
int cmp(GradientStop const &a) const
compare two gradient
Definition: MWAWGraphicStyle.hxx:64
MWAWColor m_color
the color
Definition: MWAWGraphicStyle.hxx:84
bool getBinary(WPXBinaryData &data, std::string &type) const
tries to convert the picture in a binary data ( ppm)
Definition: MWAWGraphicStyle.cxx:98
WPXBinaryData m_picture
a picture
Definition: MWAWGraphicStyle.hxx:173
Definition: MWAWGraphicStyle.hxx:55
bool hasShadow() const
returns true if the shadow is defined
Definition: MWAWGraphicStyle.hxx:228
LineJoin
an enum used to define the basic line join
Definition: MWAWGraphicStyle.hxx:53
void setShadowColor(MWAWColor const &col, float opacity=1)
set the shadow color
Definition: MWAWGraphicStyle.hxx:223
float m_lineOpacity
the line opacity: 0=transparent
Definition: MWAWGraphicStyle.hxx:248
MWAWColor m_pictureAverageColor
the picture average color
Definition: MWAWGraphicStyle.hxx:177
Vec2f m_shadowOffset
the shadow offset
Definition: MWAWGraphicStyle.hxx:263
float m_lineWidth
the linewidth
Definition: MWAWGraphicStyle.hxx:240
friend std::ostream & operator<<(std::ostream &o, Pattern const &pat)
a print operator
Definition: MWAWGraphicStyle.hxx:149
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:200
Vec2f m_gradientPercentCenter
the gradient center
Definition: MWAWGraphicStyle.hxx:277
bool isBlack() const
return true if the color is black
Definition: libmwaw_internal.hxx:196
bool hasLine() const
returns true if the border is defined
Definition: MWAWGraphicStyle.hxx:194
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:170
int cmp(Pattern const &a) const
compare two patterns
Definition: MWAWGraphicStyle.hxx:121
Pattern(Vec2i dim, WPXBinaryData const &picture, std::string const &mime, MWAWColor const &avColor)
constructor from a binary data
Definition: MWAWGraphicStyle.hxx:99
GradientStop(float offset=0.0, MWAWColor const &col=MWAWColor::black(), float opacity=1.0)
constructor
Definition: MWAWGraphicStyle.hxx:60
int cmp(MWAWGraphicStyle const &a) const
compare two styles
Definition: MWAWGraphicStyle.cxx:312
a basic pattern used in a MWAWGraphicStyle:
Definition: MWAWGraphicStyle.hxx:92
float m_offset
the offset
Definition: MWAWGraphicStyle.hxx:82
int cmp(Vec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libmwaw_internal.hxx:532
Definition: MWAWGraphicStyle.hxx:55
std::vector< GradientStop > m_gradientStopList
the list of gradient limits
Definition: MWAWGraphicStyle.hxx:271
virtual ~Pattern()
virtual destructor
Definition: MWAWGraphicStyle.hxx:105