Gnash  0.8.11dev
Public Member Functions | List of all members
gnash::LineStyle Class Reference

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

Detailed Description

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

Constructor & Destructor Documentation

§ LineStyle() [1/2]

gnash::LineStyle::LineStyle ( )

Construct a default LineStyle.

§ LineStyle() [2/2]

gnash::LineStyle::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 
)
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

References gnash::key::r, read(), read_morph(), and gnash::key::t.

Member Function Documentation

§ doPixelHinting()

bool gnash::LineStyle::doPixelHinting ( ) const
inline

Return true if pixel hinting should be activated.

§ endCapStyle()

CapStyle gnash::LineStyle::endCapStyle ( ) const
inline

Return the end cap style.

Referenced by gnash::Renderer_cairo::apply_line_style().

§ get_color()

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

§ getThickness()

std::uint16_t gnash::LineStyle::getThickness ( ) const
inline

§ joinStyle()

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

§ miterLimitFactor()

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

§ noClose()

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

§ read()

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

§ read_morph()

void gnash::LineStyle::read_morph ( SWFStream in,
SWF::TagType  t,
movie_definition md,
const RunResources r,
LineStyle pOther 
)

§ scaleThicknessHorizontally()

bool gnash::LineStyle::scaleThicknessHorizontally ( ) const
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().

§ scaleThicknessVertically()

bool gnash::LineStyle::scaleThicknessVertically ( ) const
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_lerp()

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(), get_color(), getThickness(), gnash::lerp(), gnash::log_error(), and LOG_ONCE.

Referenced by get_color(), and gnash::setLerp().

§ startCapStyle()

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

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