Gnash  0.8.10
Public Member Functions | Public Attributes | Friends
gnash::rgba Class Reference

A basic RGBA type. More...

#include <RGBA.h>

List of all members.

Public Member Functions

 rgba ()
 Construct default RGBA value.
 rgba (boost::uint8_t r, boost::uint8_t g, boost::uint8_t b, boost::uint8_t a)
 Construct an RGBA with the provided values.
void parseRGB (boost::uint32_t rgbCol)
 Parse a 32-bit unsigned integer as three packed R,G,B bytes.
boost::uint32_t toRGB () const
 Return a 32-bit unsigned integer as four packed R,G,B bytes.
boost::uint32_t toRGBA () const
 Return a 32-bit unsigned integer as four packed A,R,G,B bytes.
bool operator== (const rgba &o) const
bool operator!= (const rgba &o) const

Public Attributes

boost::uint8_t m_r
boost::uint8_t m_g
boost::uint8_t m_b
boost::uint8_t m_a

Friends

std::ostream & operator<< (std::ostream &os, const rgba &r)

Detailed Description

A basic RGBA type.

This both represents a SWF RGBA record and is a basic Gnash type for color values.


Constructor & Destructor Documentation

gnash::rgba::rgba ( ) [inline]

Construct default RGBA value.

Default value is 0xffffffff (solid white).

gnash::rgba::rgba ( boost::uint8_t  r,
boost::uint8_t  g,
boost::uint8_t  b,
boost::uint8_t  a 
) [inline]

Construct an RGBA with the provided values.

Parameters:
rRed
gGreen
bBlue
aAlpha (transparency)

Member Function Documentation

bool gnash::rgba::operator!= ( const rgba o) const [inline]

References gnash::key::o.

bool gnash::rgba::operator== ( const rgba o) const [inline]

References m_r, m_g, m_b, and m_a.

void gnash::rgba::parseRGB ( boost::uint32_t  rgbCol) [inline]

Parse a 32-bit unsigned integer as three packed R,G,B bytes.

Alpha will be untouched. Blue is the least significant byte.

This function is meant to be used to parse ActionScript colors in numeric format.

Referenced by gnash::colorFromHexString(), and gnash::StaticText::setSelectionColor().

boost::uint32_t gnash::rgba::toRGB ( ) const [inline]

Return a 32-bit unsigned integer as four packed R,G,B bytes.

Blue is the least significant byte. The most significant (alpha) byte is unused.

This function is meant to be used to output ActionScript colors in numeric format.

boost::uint32_t gnash::rgba::toRGBA ( ) const [inline]

Return a 32-bit unsigned integer as four packed A,R,G,B bytes.

Blue is the least significant byte.

This function is meant to be used to output ActionScript colors in numeric format.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const rgba r 
) [friend]

Member Data Documentation

boost::uint8_t gnash::rgba::m_a
boost::uint8_t gnash::rgba::m_b
boost::uint8_t gnash::rgba::m_g
boost::uint8_t gnash::rgba::m_r

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