#include <BColor.h>

An RGB color can be represented as an ARGB color with the opacity (A) set to 255.
Public Member Functions | |
| BColor (UInt32 rgb) | |
| Constructs a BColor from an integer containing an RGB value. | |
| BColor (UInt32 red, UInt32 green, UInt32 blue, UInt32 opacity=255) | |
| Constructs a BColor with the specified components. | |
| BColor (const BColor &c) | |
| Copy constructor. | |
| BColor () | |
| Default constructor. | |
| virtual size_t | ComputeSize (void) const |
| Computes the size of the BByteArray required to store this object. | |
| void | FromARGB (UInt32 argb) |
| Sets the value of this BColor according to an unsigned integer containing ARGB bytes. | |
| virtual void | FromByteArray (const BByteArray &bytes, size_t &startPos) |
| Initializes an instance of this object from a BByteArray. | |
| void | FromRGB (UInt32 rgb, UInt32 opacity=0xFF) |
| Sets the value of this BColor according to an unsigned integer containing RGB bytes. | |
| UInt32 | GetBlue (void) const |
| Gets the blue component. | |
| UInt32 | GetGreen (void) const |
| Gets the green component. | |
| UInt32 | GetOpacity (void) const |
| Gets the opacity component. | |
| UInt32 | GetRed (void) const |
| Gets the red component. | |
| bool | IsTransparent (void) const |
| Indicats whether or not this BColor is transparent. | |
| bool | operator!= (const BColor &rhs) const |
| Inequality operator. | |
| BColor & | operator= (const BColor &rhs) |
| Assignment operator. | |
| bool | operator== (const BColor &rhs) const |
| Equality operator. | |
| void | SetBlue (UInt32 blue) |
| Sets the blue component. | |
| void | SetGreen (UInt32 green) |
| Sets the green component. | |
| void | SetOpacity (UInt32 op) |
| Sets the opacity component. | |
| void | SetRed (UInt32 red) |
| Sets the red component. | |
| UInt32 | ToARGB () const |
| Converts this BColor to an unsigned integer containing ARGB bytes. | |
| virtual BByteArray | ToByteArray (void) const |
| Stores this object in a BByteArray. | |
| UInt32 | ToRGB (void) const |
| Converts this BColor to an unsigned integer containing RGB bytes. | |
| virtual | ~BColor () |
| Destructor. | |
Static Public Member Functions | |
| static size_t | SizeOf (void) |
| Returns the size of a BColor in bytes. | |
Static Public Attributes | |
| static BColor | Black |
| Defines a BColor that is black. | |
| static BColor | Transparent |
| Defines a BColor that is completely transparent. | |
| static BColor | White |
| Defines a BColor that is white. | |
Constructs a BColor with the specified components.
All arguments to this method must be between 0 and 255. The opacity parameter is optional, and it will be set to 255 (opaque) if it is ommitted.
| red | The red component. | |
| green | The green component. | |
| blue | The blue component. | |
| opacity | The opacity component. |
| virtual ~BColor | ( | ) | [inline, virtual] |
Destructor.
| virtual size_t ComputeSize | ( | void | ) | const [inline, virtual] |
Computes the size of the BByteArray required to store this object.
Implements BByteStreamable.
| void FromARGB | ( | UInt32 | argb | ) |
Sets the value of this BColor according to an unsigned integer containing ARGB bytes.
| argb | The ARGB value. |
| virtual void FromByteArray | ( | const BByteArray & | bytes, | |
| size_t & | startPos | |||
| ) | [virtual] |
Initializes an instance of this object from a BByteArray.
| bytes | The BByteArray containing the byte representation for this object. | |
| startPos | The position in the BByteArray where the byte representation begins. This value will be updated to point to the byte past the end of this object in the byte array. |
Implements BByteStreamable.
| UInt32 GetBlue | ( | void | ) | const [inline] |
Gets the blue component.
| UInt32 GetGreen | ( | void | ) | const [inline] |
Gets the green component.
| UInt32 GetOpacity | ( | void | ) | const [inline] |
Gets the opacity component.
| UInt32 GetRed | ( | void | ) | const [inline] |
Gets the red component.
| bool IsTransparent | ( | void | ) | const [inline] |
| bool operator!= | ( | const BColor & | rhs | ) | const |
| bool operator== | ( | const BColor & | rhs | ) | const |
| void SetBlue | ( | UInt32 | blue | ) | [inline] |
Sets the blue component.
| blue | The blue component value. It is assumed that this value will be between 0 (no blue) and 255 (lots of blue). |
| void SetGreen | ( | UInt32 | green | ) | [inline] |
Sets the green component.
| green | The green component value. It is assumed that this value will be between 0 (no green) and 255 (lots of green). |
| void SetOpacity | ( | UInt32 | op | ) | [inline] |
Sets the opacity component.
| op | The opacity component value. It is assumed that this value will be between 0 (transparent) and 255 (opaque). |
| void SetRed | ( | UInt32 | red | ) | [inline] |
Sets the red component.
| red | The red component value. It is assumed that this value will be between 0 (no red) and 255 (lots of red). |
| static size_t SizeOf | ( | void | ) | [inline, static] |
| UInt32 ToARGB | ( | ) | const |
| virtual BByteArray ToByteArray | ( | void | ) | const [virtual] |
Stores this object in a BByteArray.
Implements BByteStreamable.
| UInt32 ToRGB | ( | void | ) | const |
BColor Transparent [static] |
Defines a BColor that is completely transparent.