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.
void set (boost::uint8_t r, boost::uint8_t g, boost::uint8_t b, boost::uint8_t a)
 Set r, g, b, a values.
void set_lerp (const rgba &a, const rgba &b, float f)
 Used for morphing.
std::string toShortString () const
 Neater string output (example: "0,0,0,255").
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:
r Red
g Green
b Blue
a Alpha (transparency)

Member Function Documentation

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

References m_a, m_b, m_g, and m_r.

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.

References m_b, m_g, and m_r.

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

Set r, g, b, a values.

References m_a, m_b, m_g, and m_r.

void gnash::rgba::set_lerp ( const rgba a,
const rgba b,
float  f 
)

Used for morphing.

References gnash::frnd(), m_a, m_b, m_g, and m_r.

Referenced by gnash::LineStyle::set_lerp().

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.

References m_b, m_g, and m_r.

Referenced by toRGBA().

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.

References m_a, and toRGB().

std::string gnash::rgba::toShortString (  )  const

Neater string output (example: "0,0,0,255").

References m_a, m_b, m_g, and m_r.

Referenced by gnash::MovieTester::checkPixel().


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 files: