bioformats
5.1.3
|
An RGBA color value. More...
#include <ome/xml/model/primitives/Color.h>
Public Types | |
typedef uint8_t | component_type |
The type of an individual color component (R, G, B, A). | |
typedef uint32_t | composed_type |
The type of all components composed as a single RGBA value (unsigned). | |
typedef int32_t | signed_type |
The type of all components composed as a single RGBA value (signed). | |
Public Member Functions | |
Color () | |
Construct a Color. More... | |
Color (composed_type value) | |
Construct a Color from an unsigned integer value. More... | |
Color (signed_type value) | |
Construct a Color from a signed integer value. More... | |
Color (component_type r, component_type g, component_type b, component_type a=std::numeric_limits< component_type >::max()) | |
Construct a Color from separate red, green, blue and alpha components. More... | |
Color (const std::string &str, bool sign=true) | |
Construct a Color from a string. More... | |
component_type | getRed () const |
Get the red component of this color. More... | |
void | setRed (component_type red) |
Set the red component of this color. More... | |
component_type | getGreen () const |
Get the green component of this color. More... | |
void | setGreen (component_type green) |
Set the green component of this color. More... | |
component_type | getBlue () const |
Get the blue component of this color. More... | |
void | setBlue (component_type blue) |
Set the blue component of this color. More... | |
component_type | getAlpha () const |
Get the alpha component of this color. More... | |
void | setAlpha (component_type alpha) |
Set the alpha component of this color. More... | |
signed_type | getValue () const |
Get the signed integer value of this color. More... | |
void | setValue (composed_type value) |
Set the integer value of this color from an unsigned integer. More... | |
void | setValue (signed_type value) |
Set the integer value of this color from a signed integer. More... | |
operator composed_type () const | |
Cast the color to its value as an unsigned integer. More... | |
operator signed_type () const | |
Cast the color to its value as a signed integer. More... | |
Private Attributes | |
composed_type | value |
The color value. | |
An RGBA color value.
Internally, this is representated as an unsigned integer comprised of the red, green, blue and alpha components. Externally, it may be constructed from a signed or unsigned integer, or all of the separate components. For compatibility reasons, it will default to input and output of a signed integer as its external string representation.
Do not inherit this primitive type; it intentionally does not have a virtual destructor.
|
inline |
Construct a Color.
Defaults to 0x000000FF (black).
|
inline |
Construct a Color from an unsigned integer value.
value | the color value. |
|
inline |
Construct a Color from a signed integer value.
value | the color value. |
|
inline |
Construct a Color from separate red, green, blue and alpha components.
r | the red component. |
g | the green component. |
b | the blue component. |
a | the alpha component. |
ome::xml::model::primitives::Color::Color | ( | const std::string & | str, |
bool | sign = true |
||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set the alpha component of this color.
alpha | the value of the alpha component. |
References value.
|
inline |
Set the blue component of this color.
blue | the value of the blue component. |
References value.
|
inline |
Set the green component of this color.
green | the value of the green component. |
References value.
|
inline |
Set the red component of this color.
red | the value of the red component. |
References value.
|
inline |
Set the integer value of this color from an unsigned integer.
value | the value to set. |
References value.
Referenced by ome::xml::model::primitives::operator>>().
|
inline |
Set the integer value of this color from a signed integer.
value | the value to set. |
References value.