#include <colorRGBA.h>
Public Member Functions | |
Constructors | |
ColorRGBA () throw () | |
Default Constructor. | |
ColorRGBA (const ColorRGBA &color) throw () | |
Copy constructor. | |
ColorRGBA (const ColorHSV &color) throw () | |
Constructor with ColorHSV. | |
ColorRGBA (const char *value) throw (Exception::InvalidRange, ColorUnit::NotInHexFormat) | |
Constructor with Parameter char*. | |
ColorRGBA (const String &value) throw (Exception::InvalidRange, ColorUnit::NotInHexFormat) | |
Constructor with Parameter string. | |
ColorRGBA (const ColorUnit &red_value, const ColorUnit &green_value, const ColorUnit &blue_value, const ColorUnit &alpha_value=(float) 1) throw () | |
Detailed component initializing constructor. | |
ColorRGBA (const QColor &color, const ColorUnit &alpha=(float) 1) throw () | |
Assignment from a QT QColor. | |
Destructors | |
virtual | ~ColorRGBA () throw () |
Destructor. | |
void | clear () throw () |
Explicit default initialization. | |
Converters | |
operator String () const throw () | |
Conversion to string. | |
Assignment methods | |
void | set (const ColorRGBA &color) throw () |
Assignment. | |
const ColorRGBA & | operator= (const ColorRGBA &color) throw () |
Assignment operator. | |
void | set (const ColorHSV &color) throw () |
Assignment with ColorHSV. | |
const ColorRGBA & | operator= (const ColorHSV &color) throw () |
Assignment operator with ColorHSV. | |
void | get (ColorHSV &color) const throw () |
Copying to ColorHSV. | |
void | set (const char *value) throw (Exception::InvalidRange, ColorUnit::NotInHexFormat) |
Assignment with char*. | |
const ColorRGBA & | operator= (const char *value) throw (Exception::InvalidRange, ColorUnit::NotInHexFormat) |
Assignment operator with char*. | |
void | get (char *value) const throw () |
Copying to char*. | |
void | set (const String &value) throw (Exception::InvalidRange, ColorUnit::NotInHexFormat) |
Assign the color represented by a String. | |
const ColorRGBA & | operator= (const String &value) throw (Exception::InvalidRange, ColorUnit::NotInHexFormat) |
Assign the color represented by the string value to this colorRGBA. | |
void | get (String &value) const throw () |
Copying to string. | |
void | get (QColor &color) const throw () |
Assign to a QT QColor. | |
bool | set (const QColor &color) throw () |
Assign from a QT QColor. | |
QColor | getQColor () const throw () |
Get a QColor representing this color. | |
void | swap (ColorRGBA &color) throw () |
Swapping of colorRGBAs. | |
Accessors: inspectors and mutators | |
void | setRed (const ColorUnit &red_value) throw () |
Changes the value of the red component. | |
ColorUnit & | getRed () throw () |
Mutable inspection of the red component. | |
const ColorUnit & | getRed () const throw () |
Non-mutable inspection of the red component. | |
void | setGreen (const ColorUnit &green_value) throw () |
Changes the value of the green component. | |
ColorUnit & | getGreen () throw () |
Mutable inspection of the green component. | |
const ColorUnit & | getGreen () const throw () |
Non-mutable inspection of the green component. | |
void | setBlue (const ColorUnit &blue_value) throw () |
Changes the value of the blue component. | |
ColorUnit & | getBlue () throw () |
Mutable inspection of the blue component. | |
const ColorUnit & | getBlue () const throw () |
Non-mutable inspection of the blue component. | |
void | setAlpha (const ColorUnit &alpha_value) throw () |
Changes the value of the alpha component. | |
ColorUnit & | getAlpha () throw () |
Mutable inspection of the alpha component. | |
const ColorUnit & | getAlpha () const throw () |
Non-mutable inspection of the alpha component. | |
void | set (const ColorUnit &red_value, const ColorUnit &green_value, const ColorUnit &blue_value, const ColorUnit &alpha_value=(float) 1) throw () |
Changes the values of the red, green, blue and alpha component. | |
void | get (ColorUnit &red_value, ColorUnit &green_value, ColorUnit &blue_value, ColorUnit &alpha_value) const throw () |
Inspection of the colorRGBA's components. | |
void | get (ColorUnit &red_value, ColorUnit &green_value, ColorUnit &blue_value) const throw () |
Inspection of the colorRGBA's components. | |
ColorRGBA | getInverseColor () const |
Predicates | |
bool | operator== (const ColorRGBA &color) const throw () |
Equality test. | |
bool | operator!= (const ColorRGBA &color) const throw () |
Unequality test. | |
bool | operator< (const ColorRGBA &color) const throw () |
Smaller test. | |
bool | operator<= (const ColorRGBA &color) const throw () |
Smaller or equal test. | |
bool | operator> (const ColorRGBA &color) const throw () |
Greater test. | |
bool | operator>= (const ColorRGBA &color) const throw () |
Greater or equal test. | |
debuggers and diagnostics | |
void | dump (std::ostream &s=std::cout, Size depth=0) const throw () |
Internal value dump. | |
Friends | |
Class friends | |
| |
class | ColorHSV |
Storers | |
std::istream & | operator>> (std::istream &s, ColorRGBA &color) |
Friendly stream input. | |
std::ostream & | operator<< (std::ostream &s, const ColorRGBA &color) |
Friendly stream output. |
An instance of ColorRGBA represents a color consisting of the components red, green, blue and alpha. The components are ColorUnit 's, which allow many types of input parameters. See description of this class for further informations.
|
Default Constructor. Initialized with color black (red=0, green=0, blue=0, alpha=1). |
|
Copy constructor.
|
|
Constructor with ColorHSV.
|
|
Constructor with Parameter char*. Constructs new colorRGBA by initialising its value with the given pointer to a string representing a color value in hex format. The length of the string can either be 6 or 8 characters depending whether the alpha component should be considered. If the string is only 6 characters long the alpha component will be set to 1.0.
|
|
Constructor with Parameter string. Same as constructor with parameter char*.
|
|
Detailed component initializing constructor.
|
|
Destructor.
|
|
Explicit default initialization. Sets the color of this colorRGBA to the default color (black). The value of this colorRGBA is:
|
|
Internal value dump. Dumps the current color of this colorRGBA to the output ostream s with dumping depth depth.
|
|
Inspection of the colorRGBA's components. Accesses only the red, green and blue components of this colorRGBA by using ColorUnit's.
|
|
Inspection of the colorRGBA's components. Accesses all the components of this colorRGBA by using ColorUnit's.
|
|
Copying to string. Calls set. The format of the string is the same as the one given to the constructor.
|
|
Copying to char*. Copies the color to the string represented by a pointer. Calls set. At least 9 bytes must be allocated for the string. The format of the string is the same as the one given to the constructor.
|
|
Copying to ColorHSV.
|
|
Non-mutable inspection of the alpha component. For further information see ColorUnit& getAlpha(). |
|
Mutable inspection of the alpha component.
|
|
Non-mutable inspection of the blue component. |
|
Mutable inspection of the blue component.
|
|
Non-mutable inspection of the green component. For further information see ColorUnit& getGreen(). |
|
Mutable inspection of the green component.
|
|
Non-mutable inspection of the red component.
|
|
Mutable inspection of the red component.
|
|
Conversion to string. This operator casts an instance of colorRGBA to the string type.
|
|
Unequality test.
|
|
Smaller test. Smaller means that all components of this are smaller than all the components of color colorRGBA. |
|
Smaller or equal test. Smaller or equal means that all components of this are smaller or equal than all the components of color colorRGBA. |
|
Assign the color represented by the string value to this colorRGBA. Calls set. The color of this is initialized to the color represented by the string value. See constructor for format description.
|
|
Assignment operator with char*. Calls set. See constructor for format description.
|
|
Assignment operator with ColorHSV. Calls set. |
|
Assignment operator.
|
|
Equality test. Tests if color is equal to this colorRGBA. |
|
Greater test. Greater means that all components of this are greater than all the components of color colorRGBA. |
|
Greater or equal test. Greater or equal means that all components of this are greater or equal than all the components of color colorRGBA. |
|
Changes the values of the red, green, blue and alpha component. Changes the values of of the red, green, blue and alpha component of this colorRGBA to the values represented by the parameters. See ColorUnit for further information concerning type conversions.
|
|
Assign from a QT QColor. Aborts, if the QColor is invalid (see QColor::isValid()) and returns false. The alpha-value of this color is set to max. |
|
Assign the color represented by a String. See constructor for format description.
|
|
Assignment with char*. Assigns the color represented by the string value to this colorRGBA. See constructor for format description.
|
|
Assignment with ColorHSV.
|
|
Assignment.
|
|
Changes the value of the alpha component.
|
|
Changes the value of the blue component.
|
|
Changes the value of the green component.
|
|
Changes the value of the red component.
|
|
Swapping of colorRGBAs.
|
|
Friendly stream output. Writes colorRGBA data to the output stream s and store the color of this. The color will be stored as an vector in integer format. The output will look like '(0-255, 0-255, 0-255, 0-255)'. This method is provided for convienience.
|
|
Friendly stream input. Reads colorRGBA data from the input stream s and restore the color of this. The red, green, blue and alpha component are read as integers from the input stream. THe method expects an vector as written as the one by the output stream operator. This method is provided for convienience.
|