Public Member Functions

gnash::LineStyle Class Reference

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

#include <LineStyle.h>

Collaboration diagram for gnash::LineStyle:
Collaboration graph
[legend]

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:
width Thickness of line in twips. Zero for hair line
color Line 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.

const rgba& gnash::LineStyle::get_color (  )  const [inline]

Return line color and alpha.

Referenced by set_lerp().

boost::uint16_t gnash::LineStyle::getThickness (  )  const [inline]

Return thickness of the line, in TWIPS.

Referenced by set_lerp().

JoinStyle gnash::LineStyle::joinStyle (  )  const [inline]

Return the join style.

float gnash::LineStyle::miterLimitFactor (  )  const [inline]

Return the miter limit factor.

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

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.

bool gnash::LineStyle::scaleThicknessVertically (  )  const [inline]

Return true if line thickness should be scaled vertically.

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

Set this style to the interpolation of the given one.

Parameters:
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(), LOG_ONCE, and gnash::rgba::set_lerp().

Referenced by gnash::setLerp().

CapStyle gnash::LineStyle::startCapStyle (  )  const [inline]

Return the start cap style.


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