Gnash  0.8.10
Public Member Functions
gnash::LineStyle Class Reference

For the outside of outline shapes, or just bare lines. More...

#include <LineStyle.h>

List of all members.

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 rgbaget_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.

Detailed Description

For the outside of outline shapes, or just bare lines.


Constructor & Destructor Documentation

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

Parameters:
widthThickness of line in twips. Zero for hair line
colorLine color
scaleThicknessVertically
scaleThicknessHorizontally
noClose
startCapStyle
endCapStyle
joinStyle
miterLimitFactor

Member Function Documentation

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 
)
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().

void gnash::LineStyle::set_lerp ( const LineStyle ls1,
const LineStyle ls2,
float  ratio 
)

Set this style to the interpolation of the given one.

Parameters:
ls1First LineStyle to interpolate.
ls2Second 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().


The documentation for this class was generated from the following files: