Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

VIEW::ColorUnitHue Class Reference
[Format conversion classes used by the color classes]

Value for the hue component of the class ColorHSV. More...

#include <colorUnitHue.h>

List of all members.

Public Member Functions

Constructors
 ColorUnitHue () throw ()
 Default Constructor.
 ColorUnitHue (const ColorUnitHue &colcor_h_unit) throw ()
 Copy constructor.
 ColorUnitHue (const char *value) throw (Exception::InvalidRange, ColorUnit::NotInHexFormat)
 Constructor with Parameter char*.
 ColorUnitHue (const String &value) throw (Exception::InvalidRange, ColorUnit::NotInHexFormat)
 Constructor with Parameter String.
 ColorUnitHue (const short value) throw (Exception::InvalidRange)
 Constructor with Parameter short.
 ColorUnitHue (const unsigned short value) throw (Exception::InvalidRange)
 Constructor with Parameter unsigned short.
 ColorUnitHue (const int value) throw (Exception::InvalidRange)
 Constructor with Parameter int.
 ColorUnitHue (const unsigned int value) throw (Exception::InvalidRange)
 Constructor with Parameter unsigned int.
 ColorUnitHue (const long value) throw (Exception::InvalidRange)
 Constructor with Parameter long.
 ColorUnitHue (const unsigned long value) throw (Exception::InvalidRange)
 Constructor with Parameter unsigned long.
 ColorUnitHue (const float value) throw (Exception::InvalidRange)
 Constructor with Parameter float.
 ColorUnitHue (const double value) throw (Exception::InvalidRange)
 Constructor with Parameter double.
 ColorUnitHue (const long double value) throw (Exception::InvalidRange)
 Constructor with Parameter long double.
Destructors
virtual ~ColorUnitHue () throw ()
 Destructor.
virtual void clear () throw ()
 Explicit default initialization.
Converters
 operator String () const throw ()
 Conversion to string.
 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.
 operator long double () const throw ()
 Conversion to long double.
Assignment methods
void set (const ColorUnitHue &color_unit_hue) throw ()
 Assignment.
const ColorUnitHueoperator= (const ColorUnitHue &color_unit_hue) throw ()
 Assignment operator.
void swap (ColorUnitHue &color_unit_hue) throw ()
 Swapping of colorUnitHues.
void set (const char *value) throw (Exception::InvalidRange, ColorUnit::NotInHexFormat)
 Changes the value to the value represented by a pointer value to a string.
const ColorUnitHueoperator= (const char *value) throw (Exception::InvalidRange, ColorUnit::NotInHexFormat)
 Assignment operator with char*.
void get (char *value) const throw ()
 Inspection of the value.
void set (const String &value) throw (Exception::InvalidRange, ColorUnit::NotInHexFormat)
 Changes the value .
const ColorUnitHueoperator= (const String &value) throw (Exception::InvalidRange, ColorUnit::NotInHexFormat)
 Assignment operator with string.
void get (String &value) const throw ()
 Inspection of the value.
void set (const short value) throw (Exception::InvalidRange)
 Changes the value .
const ColorUnitHueoperator= (const short value) throw (Exception::InvalidRange)
 Assignment operator with short.
void get (short &value) const throw ()
 Inspection of the value.
void set (const unsigned short value) throw (Exception::InvalidRange)
 Changes the value .
const ColorUnitHueoperator= (const unsigned short value) throw (Exception::InvalidRange)
 Assignment operator with unsigned short.
void get (unsigned short &value) const throw ()
 Inspection of the value.
void set (const int value) throw (Exception::InvalidRange)
 Changes the value .
const ColorUnitHueoperator= (const int value) throw (Exception::InvalidRange)
 Assignment operator with int.
void get (int &value) const throw ()
 Inspection of the value.
void set (const unsigned int value) throw (Exception::InvalidRange)
 Changes the value.
const ColorUnitHueoperator= (const unsigned int value) throw (Exception::InvalidRange)
 Assignment operator with unsigned int.
void get (unsigned int &value) const throw ()
 Inspection of the value.
void set (const long value) throw (Exception::InvalidRange)
 Changes the value.
const ColorUnitHueoperator= (const long value) throw (Exception::InvalidRange)
 Assignment operator with long.
void get (long &value) const throw ()
 Inspection of the value.
void set (const unsigned long value) throw (Exception::InvalidRange)
 Changes the value.
const ColorUnitHueoperator= (const unsigned long value) throw (Exception::InvalidRange)
 Assignment operator with unsigned long.
void get (unsigned long &value) const throw ()
 Inspection of the value.
void set (const float value) throw (Exception::InvalidRange)
 Changes the value.
const ColorUnitHueoperator= (const float init) throw (Exception::InvalidRange)
 Assignment operator with float.
void get (float &value) const throw ()
 Inspection of the value.
void set (const double value) throw (Exception::InvalidRange)
 Changes the value.
const ColorUnitHueoperator= (const double value) throw (Exception::InvalidRange)
 Assignment operator with double.
void get (double &value) const throw ()
 Inspection of the value.
void set (const long double value) throw (Exception::InvalidRange)
 Changes the value.
const ColorUnitHueoperator= (const long double value) throw (Exception::InvalidRange)
 Assignment operator with long double.
void get (long double &value) const throw ()
 Inspection of the value.
Predicates
bool operator== (const ColorUnitHue &color_unit_hue) const throw ()
 Equality test.
bool operator!= (const ColorUnitHue &color_unit_hue) const throw ()
 Unequality test.
bool operator< (const ColorUnitHue &color_unit_hue) const throw ()
 Smaller test.
bool operator<= (const ColorUnitHue &color_unit_hue) const throw ()
 Smaller or equal test.
bool operator> (const ColorUnitHue &color_unit_hue) const throw ()
 Greater test.
bool operator>= (const ColorUnitHue &color_unit_hue) const throw ()
 Greater or equal test.
debuggers and diagnostics
virtual void dump (std::ostream &s=std::cout, Size depth=0) const throw ()
 Internal value dump.

Friends

Storers
std::istream & operator>> (std::istream &s, ColorUnitHue &color_unit_hue)
 Friend stream input.
std::ostream & operator<< (std::ostream &s, const ColorUnitHue &color_unit_hue)
 Friend stream output.


Detailed Description

Value for the hue component of the class ColorHSV.

The class handles the many possible variations a hue value can be set (e.g. integer, float, string values can be given as parameter). The integer values are of range 0-360, the float values are of range 0-1.0 and the strings are given in hex format "000"-"168" for the values 0-360. ColorUnitHue provides certain conversion functions as well that will convert its value to the needed type.


Constructor & Destructor Documentation

VIEW::ColorUnitHue::ColorUnitHue  )  throw ()
 

Default Constructor.

VIEW::ColorUnitHue::ColorUnitHue const ColorUnitHue colcor_h_unit  )  throw ()
 

Copy constructor.

VIEW::ColorUnitHue::ColorUnitHue const char *  value  )  throw (Exception::InvalidRange, ColorUnit::NotInHexFormat)
 

Constructor with Parameter char*.

Parameters:
value the pointer to a string ( 00 - 168h)
Exceptions:
InvalidRange if string length > 3
NotInHexFormat if string contains characters g-z or G-Z or the hex number exceeds 168h

VIEW::ColorUnitHue::ColorUnitHue const String value  )  throw (Exception::InvalidRange, ColorUnit::NotInHexFormat)
 

Constructor with Parameter String.

Exceptions:
InvalidRange if string length > 3
NotInHexFormat if string contains characters g-z or G-Z or the hex number exceeds 168h

VIEW::ColorUnitHue::ColorUnitHue const short  value  )  throw (Exception::InvalidRange)
 

Constructor with Parameter short.

Parameters:
value a short value ( 0 - 360)
Exceptions:
InvalidRange if value < 0 || value > 360

VIEW::ColorUnitHue::ColorUnitHue const unsigned short  value  )  throw (Exception::InvalidRange)
 

Constructor with Parameter unsigned short.

Parameters:
value a unsigned short value ( 0 - 360)
Exceptions:
InvalidRange if value > 360

VIEW::ColorUnitHue::ColorUnitHue const int  value  )  throw (Exception::InvalidRange)
 

Constructor with Parameter int.

Parameters:
value an int value ( 0 - 360)
Exceptions:
InvalidRange if value < 0 || value > 360

VIEW::ColorUnitHue::ColorUnitHue const unsigned int  value  )  throw (Exception::InvalidRange)
 

Constructor with Parameter unsigned int.

Parameters:
value an unsigned int value ( 0 - 360)
Exceptions:
InvalidRange if value > 360

VIEW::ColorUnitHue::ColorUnitHue const long  value  )  throw (Exception::InvalidRange)
 

Constructor with Parameter long.

Parameters:
value an long value ( 0 - 360)
Exceptions:
InvalidRange if value < 0 || value > 360

VIEW::ColorUnitHue::ColorUnitHue const unsigned long  value  )  throw (Exception::InvalidRange)
 

Constructor with Parameter unsigned long.

Parameters:
value an unsigned long value ( 0 - 360)
Exceptions:
InvalidRange if value > 360

VIEW::ColorUnitHue::ColorUnitHue const float  value  )  throw (Exception::InvalidRange)
 

Constructor with Parameter float.

Parameters:
value a float value ( 0 - 1.0)
Exceptions:
InvalidRange if value < 0.0 || value > 1.0

VIEW::ColorUnitHue::ColorUnitHue const double  value  )  throw (Exception::InvalidRange)
 

Constructor with Parameter double.

Parameters:
value a double value ( 0 - 1.0)
Exceptions:
InvalidRange if value < 0.0 || value > 1.0

VIEW::ColorUnitHue::ColorUnitHue const long double  value  )  throw (Exception::InvalidRange)
 

Constructor with Parameter long double.

Parameters:
value a long double value ( 0 - 1.0)
Exceptions:
InvalidRange if value < 0.0 || value > 1.0

virtual VIEW::ColorUnitHue::~ColorUnitHue  )  throw () [virtual]
 

Destructor.


Member Function Documentation

virtual void VIEW::ColorUnitHue::clear  )  throw () [virtual]
 

Explicit default initialization.

Sets the value to the default value (0).

virtual void VIEW::ColorUnitHue::dump std::ostream &  s = std::cout,
Size  depth = 0
const throw () [virtual]
 

Internal value dump.

Dumps the current value to the output ostream s with dumping depth depth.

Parameters:
s output stream where to output the value
depth the dumping depth (depth is irrelevant here)

void VIEW::ColorUnitHue::get long double &  value  )  const throw ()
 

Inspection of the value.

Parameters:
value a long double receiving the value (range: 0-1.0)

void VIEW::ColorUnitHue::get double &  value  )  const throw ()
 

Inspection of the value.

Parameters:
value a double receiving the value (range: 0-1.0)

void VIEW::ColorUnitHue::get float &  value  )  const throw ()
 

Inspection of the value.

Parameters:
value a float receiving the value (range: 0-1.0)
See also:
set

void VIEW::ColorUnitHue::get unsigned long &  value  )  const throw ()
 

Inspection of the value.

Parameters:
value an unsigned long receiving the value (range: 0-360)

void VIEW::ColorUnitHue::get long &  value  )  const throw ()
 

Inspection of the value.

Parameters:
value a long receiving the value (range: 0-360)

void VIEW::ColorUnitHue::get unsigned int &  value  )  const throw ()
 

Inspection of the value.

Parameters:
value an unsigned int receiving the value (range: 0-360)

void VIEW::ColorUnitHue::get int &  value  )  const throw ()
 

Inspection of the value.

Parameters:
value an int receiving the value (range: 0-360)

void VIEW::ColorUnitHue::get unsigned short &  value  )  const throw ()
 

Inspection of the value.

Parameters:
value an unsigned short receiving the value (range: 0-360)

void VIEW::ColorUnitHue::get short &  value  )  const throw ()
 

Inspection of the value.

Parameters:
value a short receiving the value (range: 0-360)

void VIEW::ColorUnitHue::get String value  )  const throw ()
 

Inspection of the value.

Parameters:
value a string receiving the value in hex format ( "00"-"168")
See also:
set

void VIEW::ColorUnitHue::get char *  value  )  const throw ()
 

Inspection of the value.

Accesses the value by using a char pointer. Memory must be allocated for this parameter. The memory must be at least the size of 4 bytes.

Parameters:
value a char* receiving the value in hex format ( "00"-"168")

VIEW::ColorUnitHue::operator double  )  const throw ()
 

Conversion to double.

Returns:
double with a value of range 0 - 1.0

VIEW::ColorUnitHue::operator float  )  const throw ()
 

Conversion to float.

Returns:
float with a value of range 0 - 1.0

VIEW::ColorUnitHue::operator int  )  const throw ()
 

Conversion to int.

Returns:
int with a value of range 0 - 360

VIEW::ColorUnitHue::operator long  )  const throw ()
 

Conversion to long.

Returns:
long with a value of range 0 - 360

VIEW::ColorUnitHue::operator long double  )  const throw ()
 

Conversion to long double.

Returns:
long double with a value of range 0 - 1.0

VIEW::ColorUnitHue::operator short  )  const throw ()
 

Conversion to short.

Returns:
short with a value of range 0 - 360

VIEW::ColorUnitHue::operator String  )  const throw ()
 

Conversion to string.

Returns:
string with hex format "00"-"168"

VIEW::ColorUnitHue::operator unsigned int  )  const throw ()
 

Conversion to unsigned int.

Returns:
unsigned int with a value of range 0 - 360

VIEW::ColorUnitHue::operator unsigned long  )  const throw ()
 

Conversion to unsigned long.

Returns:
unsigned long with a value of range 0 - 360

VIEW::ColorUnitHue::operator unsigned short  )  const throw ()
 

Conversion to unsigned short.

Returns:
unsigned short with a value of range 0 - 360

bool VIEW::ColorUnitHue::operator!= const ColorUnitHue color_unit_hue  )  const throw ()
 

Unequality test.

bool VIEW::ColorUnitHue::operator< const ColorUnitHue color_unit_hue  )  const throw ()
 

Smaller test.

bool VIEW::ColorUnitHue::operator<= const ColorUnitHue color_unit_hue  )  const throw ()
 

Smaller or equal test.

const ColorUnitHue& VIEW::ColorUnitHue::operator= const long double  value  )  throw (Exception::InvalidRange)
 

Assignment operator with long double.

Calls set.

Parameters:
value a long double containing a value of range 0-1.0
Exceptions:
InvalidRange if value < 0.0 || value > 1.0

const ColorUnitHue& VIEW::ColorUnitHue::operator= const double  value  )  throw (Exception::InvalidRange)
 

Assignment operator with double.

Calls set.

Parameters:
value a double containing a value of range 0-1.0
Exceptions:
InvalidRange if value < 0.0 || value > 1.0

const ColorUnitHue& VIEW::ColorUnitHue::operator= const float  init  )  throw (Exception::InvalidRange)
 

Assignment operator with float.

Calls set.

Parameters:
init a float containing a value of range 0-1.0
Exceptions:
InvalidRange if value < 0.0 || value > 1.0

const ColorUnitHue& VIEW::ColorUnitHue::operator= const unsigned long  value  )  throw (Exception::InvalidRange)
 

Assignment operator with unsigned long.

Calls set.

Parameters:
value an unsigned long containing a value of range 0-360
Exceptions:
InvalidRange if value > 360

const ColorUnitHue& VIEW::ColorUnitHue::operator= const long  value  )  throw (Exception::InvalidRange)
 

Assignment operator with long.

Calls set.

Parameters:
value a long containing a value of range 0-360
Exceptions:
InvalidRange if value < 0 || value > 360

const ColorUnitHue& VIEW::ColorUnitHue::operator= const unsigned int  value  )  throw (Exception::InvalidRange)
 

Assignment operator with unsigned int.

Calls set.

Parameters:
value an unsigned int containing a value of range 0-360
Exceptions:
InvalidRange if value > 360

const ColorUnitHue& VIEW::ColorUnitHue::operator= const int  value  )  throw (Exception::InvalidRange)
 

Assignment operator with int.

Calls set.

Parameters:
value an int containing a value of range 0-360
Exceptions:
InvalidRange if value < 0 || value > 360

const ColorUnitHue& VIEW::ColorUnitHue::operator= const unsigned short  value  )  throw (Exception::InvalidRange)
 

Assignment operator with unsigned short.

Calls set.

Parameters:
value an unsigned short containing a value of range 0-360
Exceptions:
InvalidRange if value > 360

const ColorUnitHue& VIEW::ColorUnitHue::operator= const short  value  )  throw (Exception::InvalidRange)
 

Assignment operator with short.

Calls set.

Parameters:
value a short containing a value of range 0-360
Exceptions:
InvalidRange if value < 0 || value > 360

const ColorUnitHue& VIEW::ColorUnitHue::operator= const String value  )  throw (Exception::InvalidRange, ColorUnit::NotInHexFormat)
 

Assignment operator with string.

Calls set.

Parameters:
value a string containing a value in hex format ( "00"-"168")
Exceptions:
InvalidRange if string length > 3
NotInHexFormat if string contains characters g-z or G-Z or the hex number exceeds 168h

const ColorUnitHue& VIEW::ColorUnitHue::operator= const char *  value  )  throw (Exception::InvalidRange, ColorUnit::NotInHexFormat)
 

Assignment operator with char*.

Calls set.

Parameters:
value the pointer to a string containing a value in hex format ( "00"-"168")
Exceptions:
InvalidRange if string length > 3
NotInHexFormat if string contains characters g-z or G-Z or the hex number exceeds 168h

const ColorUnitHue& VIEW::ColorUnitHue::operator= const ColorUnitHue color_unit_hue  )  throw ()
 

Assignment operator.

bool VIEW::ColorUnitHue::operator== const ColorUnitHue color_unit_hue  )  const throw ()
 

Equality test.

bool VIEW::ColorUnitHue::operator> const ColorUnitHue color_unit_hue  )  const throw ()
 

Greater test.

bool VIEW::ColorUnitHue::operator>= const ColorUnitHue color_unit_hue  )  const throw ()
 

Greater or equal test.

void VIEW::ColorUnitHue::set const long double  value  )  throw (Exception::InvalidRange)
 

Changes the value.

Parameters:
value a long double of range 0-1.0
Exceptions:
InvalidRange if value < 0.0 || value > 1.0

void VIEW::ColorUnitHue::set const double  value  )  throw (Exception::InvalidRange)
 

Changes the value.

Parameters:
value a double of range 0-1.0
Exceptions:
InvalidRange if value < 0.0 || value > 1.0

void VIEW::ColorUnitHue::set const float  value  )  throw (Exception::InvalidRange)
 

Changes the value.

Parameters:
value a float of range 0-1.0
Exceptions:
InvalidRange if value < 0.0 || value > 1.0

void VIEW::ColorUnitHue::set const unsigned long  value  )  throw (Exception::InvalidRange)
 

Changes the value.

Parameters:
value an unsigned long of range 0-360
Exceptions:
InvalidRange if value > 360

void VIEW::ColorUnitHue::set const long  value  )  throw (Exception::InvalidRange)
 

Changes the value.

Parameters:
value a long of range 0-360
Exceptions:
InvalidRange if value < 0 || value > 360

void VIEW::ColorUnitHue::set const unsigned int  value  )  throw (Exception::InvalidRange)
 

Changes the value.

Parameters:
value an unsigned int of range 0-360
Exceptions:
InvalidRange if value > 360

void VIEW::ColorUnitHue::set const int  value  )  throw (Exception::InvalidRange)
 

Changes the value .

Parameters:
value an int of range 0-360
Exceptions:
InvalidRange if value < 0 || value > 360

void VIEW::ColorUnitHue::set const unsigned short  value  )  throw (Exception::InvalidRange)
 

Changes the value .

Parameters:
value an unsigned short of range 0-360
Exceptions:
InvalidRange if value > 360

void VIEW::ColorUnitHue::set const short  value  )  throw (Exception::InvalidRange)
 

Changes the value .

Parameters:
value a short of range 0-360
Exceptions:
InvalidRange if value < 0 || value > 360

void VIEW::ColorUnitHue::set const String value  )  throw (Exception::InvalidRange, ColorUnit::NotInHexFormat)
 

Changes the value .

Parameters:
value a string (in the hex format "00"-"168")
Exceptions:
InvalidRange if string length > 3
NotInHexFormat if string contains characters g-z or G-Z or the hex number exceeds 168h

void VIEW::ColorUnitHue::set const char *  value  )  throw (Exception::InvalidRange, ColorUnit::NotInHexFormat)
 

Changes the value to the value represented by a pointer value to a string.

Parameters:
value the new value (a string in the format "00"-"168")
Exceptions:
InvalidRange if string length > 3
NotInHexFormat if string contains characters g-z or G-Z or the hex number exceeds 168h

void VIEW::ColorUnitHue::set const ColorUnitHue color_unit_hue  )  throw ()
 

Assignment.

void VIEW::ColorUnitHue::swap ColorUnitHue color_unit_hue  )  throw ()
 

Swapping of colorUnitHues.


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  s,
const ColorUnitHue color_unit_hue
[friend]
 

Friend stream output.

Writes colorUnitHue data to the output stream s and store the value of this. The value will be stored in integer format of range 0-360. This method is provided for convienience.

Parameters:
s output stream to where the value will be stored
color_unit_hue the colorUnitHue from which the value will be stored

std::istream& operator>> std::istream &  s,
ColorUnitHue color_unit_hue
[friend]
 

Friend stream input.

Reads colorUnitHue data from the input stream s and restore the value of this. The value will be needed in integer format of range 0-360. This method is provided for convienience.

Parameters:
s input stream from where to restore the value
color_unit_hue the colorUnitHue to which the value will be restored