Gnash
0.8.10
|
For the outside of outline shapes, or just bare lines. More...
#include <LineStyle.h>
Public Member Functions | |
LineStyle () | |
Construct a default LineStyle. | |
LineStyle (boost::uint16_t width, const 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. | |
void | read_morph (SWFStream &in, SWF::TagType t, movie_definition &md, const RunResources &r, LineStyle *pOther) |
boost::uint16_t | getThickness () const |
Return thickness of the line, in TWIPS. | |
bool | scaleThicknessVertically () const |
Return true if line thickness should be scaled vertically. | |
bool | scaleThicknessHorizontally () const |
Return true if line thickness should be scaled horizontally. | |
CapStyle | startCapStyle () const |
Return the start cap style. | |
CapStyle | endCapStyle () const |
Return the end cap style. | |
JoinStyle | joinStyle () const |
Return the join style. | |
float | miterLimitFactor () const |
Return the miter limit factor. | |
bool | noClose () const |
bool | doPixelHinting () const |
Return true if pixel hinting should be activated. | |
const rgba & | get_color () const |
Return line color and alpha. | |
void | set_lerp (const LineStyle &ls1, const LineStyle &ls2, float ratio) |
Set this style to the interpolation of the given one. |
For the outside of outline shapes, or just bare lines.
gnash::LineStyle::LineStyle | ( | ) |
Construct a default LineStyle.
gnash::LineStyle::LineStyle | ( | boost::uint16_t | width, |
const 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 |
||
) | [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 |
bool gnash::LineStyle::doPixelHinting | ( | ) | const [inline] |
Return true if pixel hinting should be activated.
CapStyle gnash::LineStyle::endCapStyle | ( | ) | const [inline] |
Return the end cap style.
Referenced by gnash::Renderer_cairo::apply_line_style().
const rgba& gnash::LineStyle::get_color | ( | ) | const [inline] |
Return line color and alpha.
Referenced by set_lerp(), and gnash::Renderer_cairo::apply_line_style().
boost::uint16_t gnash::LineStyle::getThickness | ( | ) | const [inline] |
Return thickness of the line, in TWIPS.
Referenced by gnash::geometry::pointTest(), set_lerp(), and gnash::Renderer_cairo::apply_line_style().
JoinStyle gnash::LineStyle::joinStyle | ( | ) | const [inline] |
Return the join style.
Referenced by gnash::Renderer_cairo::apply_line_style().
float gnash::LineStyle::miterLimitFactor | ( | ) | const [inline] |
Return the miter limit factor.
Referenced by gnash::Renderer_cairo::apply_line_style().
bool gnash::LineStyle::noClose | ( | ) | const [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::SWFStream::ensureBytes(), gnash::SWFStream::read_u16(), gnash::readRGBA(), gnash::key::SWF, gnash::SWF::DEFINESHAPE, gnash::SWF::DEFINESHAPE2, gnash::readRGB(), gnash::SWF::DEFINESHAPE4, gnash::SWF::DEFINESHAPE4_, gnash::SWFStream::read_u8(), gnash::JOIN_MITER, gnash::SWFStream::read_short_ufixed(), and gnash::readFills().
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::SWFStream::ensureBytes(), gnash::SWFStream::read_u16(), gnash::readRGBA(), assert, gnash::SWF::DEFINEMORPHSHAPE2, gnash::SWF::DEFINEMORPHSHAPE2_, gnash::SWFStream::read_u8(), gnash::JOIN_MITER, gnash::SWFStream::read_short_ufixed(), and gnash::readFills().
bool gnash::LineStyle::scaleThicknessHorizontally | ( | ) | const [inline] |
Return true if line thickness should be scaled horizontally.
Referenced by gnash::Renderer_cairo::apply_line_style().
bool gnash::LineStyle::scaleThicknessVertically | ( | ) | const [inline] |
Return true if line thickness should be scaled vertically.
Referenced by gnash::Renderer_cairo::apply_line_style().
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(), getThickness(), gnash::lerp(), get_color(), LOG_ONCE, and _.
CapStyle gnash::LineStyle::startCapStyle | ( | ) | const [inline] |
Return the start cap style.
Referenced by gnash::Renderer_cairo::apply_line_style().