#include <colorUnit.h>
Public Member Functions | |
Constructors | |
ColorUnit () throw () | |
Default Constructor. | |
ColorUnit (const ColorUnit &color_unit) throw () | |
Copy constructor. | |
ColorUnit (const char *value) throw (Exception::InvalidRange, NotInHexFormat) | |
Constructor with Parameter char*, representing a value in hex format (00 - FF, or 00 - ff). | |
ColorUnit (const String &value) throw (Exception::InvalidRange, NotInHexFormat) | |
Constructor with Parameter String. | |
ColorUnit (const unsigned char value) throw () | |
Constructor with Parameter unsigned char. | |
ColorUnit (const short value) throw (Exception::InvalidRange) | |
Constructor with Parameter short. | |
ColorUnit (const unsigned short value) throw (Exception::InvalidRange) | |
Constructor with Parameter unsigned short. | |
ColorUnit (const int value) throw (Exception::InvalidRange) | |
Constructor with Parameter int. | |
ColorUnit (const unsigned int value) throw (Exception::InvalidRange) | |
Constructor with Parameter unsigned int. | |
ColorUnit (const long value) throw (Exception::InvalidRange) | |
Constructor with Parameter long. | |
ColorUnit (const unsigned long value) throw (Exception::InvalidRange) | |
Constructor with Parameter unsigned long. | |
ColorUnit (const float value) throw (Exception::InvalidRange) | |
Constructor with Parameter float. | |
ColorUnit (const double value) throw (Exception::InvalidRange) | |
Constructor with Parameter double. | |
Destructors | |
virtual | ~ColorUnit () throw () |
Destructor. | |
void | clear () throw () |
Explicit default initialization. | |
Converters | |
operator String () const throw () | |
Conversion to string. | |
operator char () const throw () | |
Conversion to char. | |
operator unsigned char () const throw () | |
Conversion to unsigned char. | |
operator short () const throw () | |
Conversion to short. | |
operator unsigned short () const throw () | |
Conversion to unsigned short. | |
operator int () const throw () | |
Conversion to int. | |
operator unsigned int () const throw () | |
Conversion to unsigned int. | |
operator long () const throw () | |
Conversion to long. | |
operator unsigned long () const throw () | |
Conversion to unsigned long. | |
operator float () const throw () | |
Conversion to float. | |
operator double () const throw () | |
Conversion to double. | |
Assignment methods | |
void | set (const ColorUnit &color_unit) throw () |
Assignment. | |
const ColorUnit & | operator= (const ColorUnit &color_unit) throw () |
Assignment operator. | |
void | swap (ColorUnit &color_unit) throw () |
Swapping of colorUnits. | |
Accessors: inspectors and mutators | |
void | set (const char *value) throw (Exception::InvalidRange, NotInHexFormat) |
Changes the value of the colorUnit. | |
const ColorUnit & | operator= (const char *value) throw (Exception::InvalidRange, NotInHexFormat) |
Assignment operator with char*. | |
void | get (char *value) const throw () |
Inspection of the colorUnit's value. | |
void | set (const String &value) throw (Exception::InvalidRange, NotInHexFormat) |
Changes the value of the colorUnit. | |
const ColorUnit & | operator= (const String &value) throw (Exception::InvalidRange, NotInHexFormat) |
Assignment operator with string. | |
void | get (String &value) const throw () |
Inspection of the colorUnit's value. | |
void | set (const unsigned char value) throw () |
Changes the value of the colorUnit. | |
const ColorUnit & | operator= (const unsigned char value) throw () |
Assignment operator with unsigned char. | |
void | get (unsigned char &value) const throw () |
Inspection of the colorUnit's value. | |
void | set (const short value) throw (Exception::InvalidRange) |
Changes the value of the colorUnit. | |
const ColorUnit & | operator= (const short value) throw (Exception::InvalidRange) |
Assignment operator with short. | |
void | get (short &value) const throw () |
Inspection of the colorUnit's value. | |
void | set (const unsigned short value) throw (Exception::InvalidRange) |
Changes the value of the colorUnit. | |
const ColorUnit & | operator= (const unsigned short value) throw (Exception::InvalidRange) |
Assignment operator with unsigned short. | |
void | get (unsigned short &value) const throw () |
Inspection of the colorUnit's value. | |
void | set (const int value) throw (Exception::InvalidRange) |
Changes the value of the colorUnit. | |
const ColorUnit & | operator= (const int value) throw (Exception::InvalidRange) |
Assignment operator with int. | |
void | get (int &value) const throw () |
Inspection of the colorUnit's value. | |
void | set (const unsigned int value) throw (Exception::InvalidRange) |
Changes the value of the colorUnit. | |
const ColorUnit & | operator= (const unsigned int value) throw (Exception::InvalidRange) |
Assignment operator with unsigned int. | |
void | get (unsigned int &value) const throw () |
Inspection of the colorUnit's value. | |
void | set (const long value) throw (Exception::InvalidRange) |
Changes the value of the colorUnit. | |
const ColorUnit & | operator= (const long value) throw (Exception::InvalidRange) |
Assignment operator with long. | |
void | get (long &value) const throw () |
Inspection of the colorUnit's value. | |
void | set (const unsigned long value) throw (Exception::InvalidRange) |
Changes the value of the colorUnit. | |
const ColorUnit & | operator= (const unsigned long value) throw (Exception::InvalidRange) |
Assignment operator with unsigned long. | |
void | get (unsigned long &value) const throw () |
Inspection of the colorUnit's value. | |
void | set (const float value) throw (Exception::InvalidRange) |
Changes the value of the colorUnit. | |
const ColorUnit & | operator= (const float value) throw (Exception::InvalidRange) |
Assignment operator with float. | |
void | get (float &value) const throw () |
Inspection of the colorUnit's value. | |
void | set (const double value) throw (Exception::InvalidRange) |
Changes the value of the colorUnit. | |
const ColorUnit & | operator= (const double value) throw (Exception::InvalidRange) |
Assignment operator with double. | |
void | get (double &value) const throw () |
Inspection of the colorUnit's value. | |
Predicates | |
bool | operator== (const ColorUnit &color_unit) const throw () |
Equality test. | |
bool | operator!= (const ColorUnit &color_unit) const throw () |
Unequality test. | |
bool | operator< (const ColorUnit &color_unit) const throw () |
Smaller test. | |
bool | operator<= (const ColorUnit &color_unit) const throw () |
Smaller or equal test. | |
bool | operator> (const ColorUnit &color_unit) const throw () |
Greater test. | |
bool | operator>= (const ColorUnit &color_unit) 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 | |
Storers | |
std::istream & | operator>> (std::istream &s, ColorUnit &color_unit) |
Friendly stream input. | |
std::ostream & | operator<< (std::ostream &s, const ColorUnit &color_unit) |
Friendly stream output. |
An instance of ColorUnit can represent a value for the red, green, blue and alpha component of the class ColorRGBA. Furthermore this class is used for the value and saturation component of the class ColorHSV. The class handles the many possible variations a color value can be set (e.g. integer, float, string values can be given as parameter). The integer values are of range 0-255, the float values are of range 0-1.0 and the strings given are in hex format "00"-"FF". ColorUnit provides certain conversion functions as well, that will convert its value to the needed type. This class is used by the class ColorRGBA and ColorHSV.
|
Default Constructor. Its value will be set to zero (0). |
|
Copy constructor.
|
|
Constructor with Parameter char*, representing a value in hex format (00 - FF, or 00 - ff).
|
|
Constructor with Parameter String.
|
|
Constructor with Parameter unsigned char.
|
|
Constructor with Parameter short.
|
|
Constructor with Parameter unsigned short.
|
|
Constructor with Parameter int.
|
|
Constructor with Parameter unsigned int.
|
|
Constructor with Parameter long.
|
|
Constructor with Parameter unsigned long.
|
|
Constructor with Parameter float.
|
|
Constructor with Parameter double.
|
|
Destructor.
|
|
Explicit default initialization. Sets the value of this colorUnit to the default value. The value of this colorUnit is:
|
|
Internal value dump.
Dumps the current value of this colorUnit to the output ostream s with dumping depth depth. The value will be outputed as an integer of range
|
|
Inspection of the colorUnit's value.
|
|
Inspection of the colorUnit's value.
|
|
Inspection of the colorUnit's value.
|
|
Inspection of the colorUnit's value.
|
|
Inspection of the colorUnit's value.
|
|
Inspection of the colorUnit's value.
|
|
Inspection of the colorUnit's value.
|
|
Inspection of the colorUnit's value.
|
|
Inspection of the colorUnit's value.
|
|
Inspection of the colorUnit's value.
|
|
Inspection of the colorUnit's value. Memory must be allocated for this parameter. The memory must be at least the size of 3 bytes.
|
|
Conversion to char.
|
|
Conversion to double.
|
|
Conversion to float.
|
|
Conversion to int.
|
|
Conversion to long.
|
|
Conversion to short.
|
|
Conversion to string.
|
|
Conversion to unsigned char.
|
|
Conversion to unsigned int.
|
|
Conversion to unsigned long.
|
|
Conversion to unsigned short.
|
|
Unequality test. Unequality means that the internals value (floats) of the colorUnit's are unequal. |
|
Smaller test. Smaller means that the internal value (float) this is smaller than the internal value (float) of color_unit colorUnit. |
|
Smaller or equal test. Smaller or equal means that the internal value (float) this is smaller or equal than the internal value (float) of color_unit colorUnit. |
|
Assignment operator with double. Calls set.
|
|
Assignment operator with float. Calls set.
|
|
Assignment operator with unsigned long. Calls set.
|
|
Assignment operator with long. Calls set.
|
|
Assignment operator with unsigned int. Calls set.
|
|
Assignment operator with int. Calls set.
|
|
Assignment operator with unsigned short. Calls set.
|
|
Assignment operator with short. Calls set.
|
|
Assignment operator with unsigned char. Calls set.
|
|
Assignment operator with string. Calls set.
|
|
Assignment operator with char*. Calls set.
|
|
Assignment operator.
|
|
Equality test. Equality means that the internals value (floats) of the colorUnit's are equal. |
|
Greater test. Greater means that the internal value (float) this is greater than the internal value (float) of color_unit colorUnit. |
|
Greater or equal test. Greater or equal means that the internal value (float) this is greater or equal than the internal value (float) of color_unit colorUnit. |
|
Changes the value of the colorUnit.
|
|
Changes the value of the colorUnit.
|
|
Changes the value of the colorUnit.
|
|
Changes the value of the colorUnit.
|
|
Changes the value of the colorUnit.
|
|
Changes the value of the colorUnit.
|
|
Changes the value of the colorUnit.
|
|
Changes the value of the colorUnit.
|
|
Changes the value of the colorUnit.
|
|
Changes the value of the colorUnit. Changes the value of this colorUnit to the value represented by a string value.
|
|
Changes the value of the colorUnit.
|
|
Assignment.
|
|
Swapping of colorUnits.
|
|
Friendly stream output.
Writes colorUnit data to the output stream s and store the value of this. The value will be stored in integer format of range
|
|
Friendly stream input.
Reads colorUnit data from the input stream s and restore the value of this. The value will be needed in integer format of range
|