Gnash
0.8.11dev
|
For the outside of outline shapes, or just bare lines. More...
#include <LineStyle.h>
Public Member Functions | |
LineStyle () | |
Construct a default LineStyle. More... | |
LineStyle (std::uint16_t width, rgba color, bool scaleThicknessVertically=true, bool scaleThicknessHorizontally=true, bool pixelHinting=false, bool noClose=false, CapStyle startCapStyle=CAP_ROUND, CapStyle endCapStyle=CAP_ROUND, JoinStyle joinStyle=JOIN_ROUND, float miterLimitFactor=1.0f) | |
void | read (SWFStream &in, SWF::TagType t, movie_definition &md, const RunResources &r) |
Read the line style from an SWF stream. More... | |
void | read_morph (SWFStream &in, SWF::TagType t, movie_definition &md, const RunResources &r, LineStyle *pOther) |
std::uint16_t | getThickness () const |
Return thickness of the line, in TWIPS. More... | |
bool | scaleThicknessVertically () const |
Return true if line thickness should be scaled vertically. More... | |
bool | scaleThicknessHorizontally () const |
Return true if line thickness should be scaled horizontally. More... | |
CapStyle | startCapStyle () const |
Return the start cap style. More... | |
CapStyle | endCapStyle () const |
Return the end cap style. More... | |
JoinStyle | joinStyle () const |
Return the join style. More... | |
float | miterLimitFactor () const |
Return the miter limit factor. More... | |
bool | noClose () const |
bool | doPixelHinting () const |
Return true if pixel hinting should be activated. More... | |
const rgba & | get_color () const |
Return line color and alpha. More... | |
void | set_lerp (const LineStyle &ls1, const LineStyle &ls2, float ratio) |
Set this style to the interpolation of the given one. More... | |
For the outside of outline shapes, or just bare lines.
gnash::LineStyle::LineStyle | ( | ) |
Construct a default LineStyle.
|
inline |
Construct a line style with explicit values
width | Thickness of line in twips. Zero for hair line |
color | Line color |
scaleThicknessVertically | |
scaleThicknessHorizontally | |
noClose | |
startCapStyle | |
endCapStyle | |
joinStyle | |
miterLimitFactor |
References gnash::key::r, read(), read_morph(), and gnash::key::t.
|
inline |
Return true if pixel hinting should be activated.
|
inline |
Return the end cap style.
Referenced by gnash::Renderer_cairo::apply_line_style().
|
inline |
Return line color and alpha.
References set_lerp().
Referenced by gnash::Renderer_cairo::apply_line_style(), gnash::renderer::openvg::Renderer_ovg::disable_mask(), and set_lerp().
|
inline |
Return thickness of the line, in TWIPS.
Referenced by gnash::Renderer_cairo::apply_line_style(), gnash::renderer::openvg::Renderer_ovg::disable_mask(), gnash::geometry::pointTest(), and set_lerp().
|
inline |
Return the join style.
Referenced by gnash::Renderer_cairo::apply_line_style(), and gnash::renderer::openvg::Renderer_ovg::disable_mask().
|
inline |
Return the miter limit factor.
Referenced by gnash::Renderer_cairo::apply_line_style(), and gnash::renderer::openvg::Renderer_ovg::disable_mask().
|
inline |
Return true if stroke should not be closed if the stroke's last point matches the first point. Caps should be applied instead of a join
void gnash::LineStyle::read | ( | SWFStream & | in, |
SWF::TagType | t, | ||
movie_definition & | md, | ||
const RunResources & | r | ||
) |
Read the line style from an SWF stream.
Stream is assumed to be positioned at the right place.
Throw a ParserException if there's no enough bytes in the currently opened tag for reading. See stream::ensureBytes()
References gnash::SWF::DEFINESHAPE, gnash::SWF::DEFINESHAPE2, gnash::SWF::DEFINESHAPE4, gnash::SWF::DEFINESHAPE4_, gnash::SWFStream::ensureBytes(), gnash::JOIN_MITER, gnash::SWFStream::read_short_ufixed(), gnash::SWFStream::read_u16(), gnash::SWFStream::read_u8(), gnash::readFills(), gnash::readRGB(), and gnash::readRGBA().
Referenced by LineStyle().
void gnash::LineStyle::read_morph | ( | SWFStream & | in, |
SWF::TagType | t, | ||
movie_definition & | md, | ||
const RunResources & | r, | ||
LineStyle * | pOther | ||
) |
Read two lines styles from the SWF stream at the same time – this is used in morphing.
References gnash::SWF::DEFINEMORPHSHAPE, gnash::SWF::DEFINEMORPHSHAPE2, gnash::SWF::DEFINEMORPHSHAPE2_, gnash::SWFStream::ensureBytes(), gnash::JOIN_MITER, gnash::SWFStream::read_short_ufixed(), gnash::SWFStream::read_u16(), gnash::SWFStream::read_u8(), gnash::readFills(), and gnash::readRGBA().
Referenced by gnash::SWF::DefineMorphShapeTag::display(), and LineStyle().
|
inline |
Return true if line thickness should be scaled horizontally.
Referenced by gnash::Renderer_cairo::apply_line_style(), and gnash::renderer::openvg::Renderer_ovg::disable_mask().
|
inline |
Return true if line thickness should be scaled vertically.
Referenced by gnash::Renderer_cairo::apply_line_style(), and gnash::renderer::openvg::Renderer_ovg::disable_mask().
Set this style to the interpolation of the given one.
ls1 | First LineStyle to interpolate. |
ls2 | Second LineStyle to interpolate. The interpolation factor (0..1). When 0, this will be equal to ls1, when 1 this will be equal to ls2. |
References _, gnash::frnd(), get_color(), getThickness(), gnash::lerp(), gnash::log_error(), and LOG_ONCE.
Referenced by get_color(), and gnash::setLerp().
|
inline |
Return the start cap style.
Referenced by gnash::Renderer_cairo::apply_line_style(), and gnash::renderer::openvg::Renderer_ovg::disable_mask().