Gnash 0.8.10dev
|
A basic RGBA type. More...
#include <RGBA.h>
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) |
A basic RGBA type.
This both represents a SWF RGBA record and is a basic Gnash type for color values.
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.
r | Red |
g | Green |
b | Blue |
a | Alpha (transparency) |
bool gnash::rgba::operator!= | ( | const rgba & | o | ) | const [inline] |
References gnash::key::o.
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().
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 gnash::key::a, gnash::key::b, gnash::key::g, and gnash::key::r.
Referenced by gnash::movie_root::reset().
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.
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.
std::string gnash::rgba::toShortString | ( | ) | const |
std::ostream& operator<< | ( | std::ostream & | os, |
const rgba & | r | ||
) | [friend] |
boost::uint8_t gnash::rgba::m_a |
Referenced by gnash::Renderer_cairo::begin_display(), gnash::SWF::TextRecord::displayRecords(), gnash::Renderer_cairo::draw_poly(), gnash::Renderer_cairo::getPixel(), gnash::AddStyles::operator()(), gnash::operator<<(), operator==(), gnash::movie_root::set_background_alpha(), gnash::movie_root::set_background_color(), gnash::Renderer_cairo::set_color(), set_lerp(), toShortString(), and gnash::SWFCxForm::transform().
boost::uint8_t gnash::rgba::m_b |
boost::uint8_t gnash::rgba::m_g |
boost::uint8_t gnash::rgba::m_r |