#include <libsswf.h>
Public Member Functions | |
unsigned char | Alpha (void) const |
Returns the alpha (or transparency) component. | |
unsigned char | Blue (void) const |
Returns the blue component. | |
Color (void) | |
Construct a color object. | |
unsigned char | Green (void) const |
Returns the green component. | |
bool | IsInvisible (void) const |
Checks whether this color is invisible. | |
bool | IsSolid (void) const |
Checks whether this color represents a solid color. | |
bool | operator!= (const Color &color) const |
operator != compares two colors for inequality | |
bool | operator== (const Color &color) const |
operator == compares two colors for equality | |
unsigned char | Red (void) const |
Returns the red component. | |
void | Reset (void) |
Reset the color to its default values. | |
void | Save (Data &data, bool save_alpha=true) |
Save the color to a Data buffer. | |
void | Set (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha=255) |
Set the color to the specified values. | |
Private Attributes | |
unsigned char | f_alpha |
unsigned char | f_blue |
unsigned char | f_green |
unsigned char | f_red |
When only an RGB color is necessary, you should pass a Color object with the alpha component set to 255 (solid).
SWF Alexis' Reference—swf_xrgb
sswf::Color::Color | ( | void | ) | [inline] |
The Color() constructor initialize the color with a call to Reset().
This is supposed to have the effect of setting the color to solid white.
sswf::Color::Alpha | ( | void | ) | const [inline] |
sswf::Color::Blue | ( | void | ) | const [inline] |
sswf::Color::Green | ( | void | ) | const [inline] |
sswf::Color::IsInvisible | ( | void | ) | const [inline] |
sswf::Color::IsSolid | ( | void | ) | const [inline] |
bool Color::operator!= | ( | const Color & | color | ) | const |
The != operator compares two colors together and returns true when any of the components, including the alpha channel, does not match exactly.
[in] | color | The other color to compare 'this' with |
bool Color::operator== | ( | const Color & | color | ) | const |
The == operator compares two colors together and returns true when all the components, including the alpha channel, match exactly.
[in] | color | The other color to compare 'this' with |
sswf::Color::Red | ( | void | ) | const [inline] |
void Color::Reset | ( | void | ) |
The Reset() function sets the color to solid white which is the default animation background color.
void Color::Save | ( | Data & | data, | |
bool | save_alpha = true | |||
) |
The Save() function saves the color to a Data buffer.
The 'save_alpha' flag can be used to determine whether the alpha should also be saved.
This function saves the color as RGB or RGBA. To save the color as XRGB or ARGB you need to write your own code.
[in] | data | The output buffer where the result is saved. |
[in] | save_alpha | A flag used to specify whether the alpha is saved too |
void Color::Set | ( | unsigned char | red, | |
unsigned char | green, | |||
unsigned char | blue, | |||
unsigned char | alpha = 255 | |||
) |
The Set() function sets the color to the specified red, green, blue and alpha values.
0 represent none and 255 represents full color.
For the alpha, 0 represent 100% transparent and 255 represents 100% solid. Notice that by default the alpha will be set to 255 which means a solid color.
[in] | red | The value for the red component |
[in] | green | The value for the green component |
[in] | blue | The value for the blue component |
[in] | alpha | The value for the alpha component |
unsigned char sswf::Color::f_alpha [private] |
unsigned char sswf::Color::f_blue [private] |
unsigned char sswf::Color::f_green [private] |
unsigned char sswf::Color::f_red [private] |