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] |
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] |
void gnash::rgba::set_lerp |
( |
const rgba & |
a, |
|
|
const rgba & |
b, |
|
|
float |
f | |
|
) |
| | |
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 |
Friends And Related Function Documentation
std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const rgba & |
r | |
|
) |
| | [friend] |
Member Data Documentation
The documentation for this class was generated from the following files: