34#include <Pt/Gfx/Api.h>
35#include <Pt/Gfx/Color.h>
36#include <Pt/SmartPtr.h>
145 {
return style() == Solid; }
175 return _penData.get();
183class PT_GFX_API PenData
186 PenData(
const Color& color, std::size_t size,
187 Pen::Style style, Pen::CapStyle cap, Pen::JoinStyle join)
195 PenData(
const Color& color, std::size_t size,
196 Pen::Style style,
const std::vector<Pt::uint8_t>& dashPattern, Pen::CapStyle cap, Pen::JoinStyle join)
200 , _dashPattern(dashPattern)
205 PenData(
const Color& color, std::size_t size,
206 Pen::Style style,
const Pt::uint8_t* dashPatternBeg,
const Pt::uint8_t* dashPatternEnd, Pen::CapStyle cap, Pen::JoinStyle join)
210 , _dashPattern(dashPatternBeg, dashPatternEnd)
215 void setColor(
const Color& color)
218 const Color& color()
const
221 void setSize(std::size_t size)
224 std::size_t size()
const
227 void setStyle(Pen::Style style)
230 _dashPattern.clear();
233 Pen::Style style()
const
236 void setDashPattern(
const std::vector<Pt::uint8_t>& dashPattern)
238 _style = Pen::DashPattern;
239 _dashPattern = dashPattern;
242 const std::vector<Pt::uint8_t>& dashPattern()
const
243 {
return _dashPattern; }
245 void setCapStyle(Pen::CapStyle cap)
248 Pen::CapStyle capStyle()
const
251 void setJoinStyle(Pen::JoinStyle join)
252 { _joinStyle = join; }
254 Pen::JoinStyle joinStyle()
const
255 {
return _joinStyle; }
261 std::vector<Pt::uint8_t> _dashPattern;
262 Pen::CapStyle _capStyle;
263 Pen::JoinStyle _joinStyle;
8-bit ARGB color.
Definition Color.h:65
void setDashPattern(const std::vector< Pt::uint8_t > &dashPattern)
Sets the pen user dash pattern.
void setJoinStyle(JoinStyle join=BevelJoin)
Sets the join style.
Pen()
Constructs a null pen.
Pen(const Color &color, std::size_t width, const std::vector< Pt::uint8_t > &dashPattern, CapStyle cap=FlatCap, JoinStyle join=BevelJoin)
Constructs a pen with a custom dash pattern.
void setSize(std::size_t size)
Sets the size of the pen.
JoinStyle
Identifies how connected line segments are joined.
Definition Pen.h:83
void setColor(const Color &color)
Sets the color of the pen.
bool isSolid() const
Returns true if the pen is solid.
Definition Pen.h:144
CapStyle
Identifies how open line ends are rendered.
Definition Pen.h:74
Pen(const Color &color)
Constructs a pen with the specified color.
JoinStyle joinStyle() const
Returns the join style.
Pen(const Color &color, std::size_t width, Style style=Solid, CapStyle cap=FlatCap, JoinStyle join=BevelJoin)
Constructs a pen with the specified size, color and styles.
CapStyle capStyle() const
Returns the cap style.
const Color & color() const
Returns the color of the pen.
void setStyle(Style style=Solid)
Sets the pen style.
bool isNull() const
Returns true if the pen is null.
Style style() const
Returns the pen style.
const void * instance() const
Returns an implementation-specific pen instance.
Definition Pen.h:173
const std::vector< Pt::uint8_t > & dashPattern() const
Returns the pen user dash pattern.
Style
Identifies how outlines are stroked.
Definition Pen.h:64
std::size_t size() const
Returns the size of the pen.
void setCapStyle(CapStyle cap=FlatCap)
Sets the cap style.
Policy based smart pointer.
Definition SmartPtr.h:462
uint_type uint8_t
Unsigned 8-bit integer type.
Definition Api-Types.h:24
Graphics and imaging services.
Definition Api-Argb32Image.h:12
Core module.
Definition Allocator.h:33