BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
List of all members

#include <BALL/VIEW/DATATYPE/colorUnitHue.h>

Public Member Functions

Constructors
 ColorUnitHue ()
 
 ColorUnitHue (const ColorUnitHue &colcor_h_unit)
 
 ColorUnitHue (const char *value)
 
 ColorUnitHue (const String &value)
 
 ColorUnitHue (const short value)
 
 ColorUnitHue (const unsigned short value)
 
 ColorUnitHue (const int value)
 
 ColorUnitHue (const unsigned int value)
 
 ColorUnitHue (const long value)
 
 ColorUnitHue (const unsigned long value)
 
 ColorUnitHue (const float value)
 
 ColorUnitHue (const double value)
 
 ColorUnitHue (const long double value)
 
Destructors
virtual ~ColorUnitHue ()
 
virtual void clear ()
 
Converters
 operator String () const
 
 operator short () const
 
 operator unsigned short () const
 
 operator int () const
 
 operator unsigned int () const
 
 operator long () const
 
 operator unsigned long () const
 
 operator float () const
 
 operator double () const
 
 operator long double () const
 
Assignment methods
void set (const ColorUnitHue &color_unit_hue)
 
const ColorUnitHueoperator= (const ColorUnitHue &color_unit_hue)
 
void swap (ColorUnitHue &color_unit_hue)
 
void set (const char *value)
 
const ColorUnitHueoperator= (const char *value)
 
void get (char *value) const
 
void set (const String &value)
 
const ColorUnitHueoperator= (const String &value)
 
void get (String &value) const
 
void set (const short value)
 
const ColorUnitHueoperator= (const short value)
 
void get (short &value) const
 
void set (const unsigned short value)
 
const ColorUnitHueoperator= (const unsigned short value)
 
void get (unsigned short &value) const
 
void set (const int value)
 
const ColorUnitHueoperator= (const int value)
 
void get (int &value) const
 
void set (const unsigned int value)
 
const ColorUnitHueoperator= (const unsigned int value)
 
void get (unsigned int &value) const
 
void set (const long value)
 
const ColorUnitHueoperator= (const long value)
 
void get (long &value) const
 
void set (const unsigned long value)
 
const ColorUnitHueoperator= (const unsigned long value)
 
void get (unsigned long &value) const
 
void set (const float value)
 
const ColorUnitHueoperator= (const float init)
 
void get (float &value) const
 
void set (const double value)
 
const ColorUnitHueoperator= (const double value)
 
void get (double &value) const
 
void set (const long double value)
 
const ColorUnitHueoperator= (const long double value)
 
void get (long double &value) const
 
Predicates
bool operator== (const ColorUnitHue &color_unit_hue) const
 
bool operator!= (const ColorUnitHue &color_unit_hue) const
 
bool operator< (const ColorUnitHue &color_unit_hue) const
 
bool operator<= (const ColorUnitHue &color_unit_hue) const
 
bool operator> (const ColorUnitHue &color_unit_hue) const
 
bool operator>= (const ColorUnitHue &color_unit_hue) const
 
debuggers and diagnostics
virtual void dump (std::ostream &s=std::cout, Size depth=0) const
 

Friends

Storers
std::istream & operator>> (std::istream &s, ColorUnitHue &color_unit_hue)
 
std::ostream & operator<< (std::ostream &s, const ColorUnitHue &color_unit_hue)
 

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.

Definition at line 36 of file colorUnitHue.h.

Constructor & Destructor Documentation

BALL::VIEW::ColorUnitHue::ColorUnitHue ( )

Default Constructor.

BALL::VIEW::ColorUnitHue::ColorUnitHue ( const ColorUnitHue colcor_h_unit)

Copy constructor.

BALL::VIEW::ColorUnitHue::ColorUnitHue ( const char *  value)

Constructor with Parameter char*.

Parameters
valuethe pointer to a string ( 00 - 168h)
Exceptions
InvalidRangeif string length > 3
NotInHexFormatif string contains characters g-z or G-Z or the hex number exceeds 168h
BALL::VIEW::ColorUnitHue::ColorUnitHue ( const String value)

Constructor with Parameter String.

Exceptions
InvalidRangeif string length > 3
NotInHexFormatif string contains characters g-z or G-Z or the hex number exceeds 168h
BALL::VIEW::ColorUnitHue::ColorUnitHue ( const short  value)

Constructor with Parameter short.

Parameters
valuea short value ( 0 - 360)
Exceptions
InvalidRangeif value < 0 || value > 360
BALL::VIEW::ColorUnitHue::ColorUnitHue ( const unsigned short  value)

Constructor with Parameter unsigned short.

Parameters
valuea unsigned short value ( 0 - 360)
Exceptions
InvalidRangeif value > 360
BALL::VIEW::ColorUnitHue::ColorUnitHue ( const int  value)

Constructor with Parameter int.

Parameters
valuean int value ( 0 - 360)
Exceptions
InvalidRangeif value < 0 || value > 360
BALL::VIEW::ColorUnitHue::ColorUnitHue ( const unsigned int  value)

Constructor with Parameter unsigned int.

Parameters
valuean unsigned int value ( 0 - 360)
Exceptions
InvalidRangeif value > 360
BALL::VIEW::ColorUnitHue::ColorUnitHue ( const long  value)

Constructor with Parameter long.

Parameters
valuean long value ( 0 - 360)
Exceptions
InvalidRangeif value < 0 || value > 360
BALL::VIEW::ColorUnitHue::ColorUnitHue ( const unsigned long  value)

Constructor with Parameter unsigned long.

Parameters
valuean unsigned long value ( 0 - 360)
Exceptions
InvalidRangeif value > 360
BALL::VIEW::ColorUnitHue::ColorUnitHue ( const float  value)

Constructor with Parameter float.

Parameters
valuea float value ( 0 - 1.0)
Exceptions
InvalidRangeif value < 0.0 || value > 1.0
BALL::VIEW::ColorUnitHue::ColorUnitHue ( const double  value)

Constructor with Parameter double.

Parameters
valuea double value ( 0 - 1.0)
Exceptions
InvalidRangeif value < 0.0 || value > 1.0
BALL::VIEW::ColorUnitHue::ColorUnitHue ( const long double  value)

Constructor with Parameter long double.

Parameters
valuea long double value ( 0 - 1.0)
Exceptions
InvalidRangeif value < 0.0 || value > 1.0
virtual BALL::VIEW::ColorUnitHue::~ColorUnitHue ( )
virtual

Destructor.

Member Function Documentation

virtual void BALL::VIEW::ColorUnitHue::clear ( )
virtual

Explicit default initialization. Sets the value to the default value (0).

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

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

Parameters
soutput stream where to output the value
depththe dumping depth (depth is irrelevant here)
void BALL::VIEW::ColorUnitHue::get ( char *  value) const

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
valuea char* receiving the value in hex format ( "00"-"168")
void BALL::VIEW::ColorUnitHue::get ( String value) const

Inspection of the value.

Parameters
valuea string receiving the value in hex format ( "00"-"168")
See also
set
void BALL::VIEW::ColorUnitHue::get ( short &  value) const

Inspection of the value.

Parameters
valuea short receiving the value (range: 0-360)
void BALL::VIEW::ColorUnitHue::get ( unsigned short &  value) const

Inspection of the value.

Parameters
valuean unsigned short receiving the value (range: 0-360)
void BALL::VIEW::ColorUnitHue::get ( int &  value) const

Inspection of the value.

Parameters
valuean int receiving the value (range: 0-360)
void BALL::VIEW::ColorUnitHue::get ( unsigned int &  value) const

Inspection of the value.

Parameters
valuean unsigned int receiving the value (range: 0-360)
void BALL::VIEW::ColorUnitHue::get ( long &  value) const

Inspection of the value.

Parameters
valuea long receiving the value (range: 0-360)
void BALL::VIEW::ColorUnitHue::get ( unsigned long &  value) const

Inspection of the value.

Parameters
valuean unsigned long receiving the value (range: 0-360)
void BALL::VIEW::ColorUnitHue::get ( float value) const

Inspection of the value.

Parameters
valuea float receiving the value (range: 0-1.0)
See also
set
void BALL::VIEW::ColorUnitHue::get ( double value) const

Inspection of the value.

Parameters
valuea double receiving the value (range: 0-1.0)
void BALL::VIEW::ColorUnitHue::get ( long double value) const

Inspection of the value.

Parameters
valuea long double receiving the value (range: 0-1.0)
BALL::VIEW::ColorUnitHue::operator double ( ) const

Conversion to double.

Returns
double with a value of range 0 - 1.0
BALL::VIEW::ColorUnitHue::operator float ( ) const

Conversion to float.

Returns
float with a value of range 0 - 1.0
BALL::VIEW::ColorUnitHue::operator int ( ) const

Conversion to int.

Returns
int with a value of range 0 - 360
BALL::VIEW::ColorUnitHue::operator long ( ) const

Conversion to long.

Returns
long with a value of range 0 - 360
BALL::VIEW::ColorUnitHue::operator long double ( ) const

Conversion to long double.

Returns
long double with a value of range 0 - 1.0
BALL::VIEW::ColorUnitHue::operator short ( ) const

Conversion to short.

Returns
short with a value of range 0 - 360
BALL::VIEW::ColorUnitHue::operator String ( ) const

Conversion to string.

Returns
string with hex format "00"-"168"
BALL::VIEW::ColorUnitHue::operator unsigned int ( ) const

Conversion to unsigned int.

Returns
unsigned int with a value of range 0 - 360
BALL::VIEW::ColorUnitHue::operator unsigned long ( ) const

Conversion to unsigned long.

Returns
unsigned long with a value of range 0 - 360
BALL::VIEW::ColorUnitHue::operator unsigned short ( ) const

Conversion to unsigned short.

Returns
unsigned short with a value of range 0 - 360
bool BALL::VIEW::ColorUnitHue::operator!= ( const ColorUnitHue color_unit_hue) const

Unequality test.

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

Smaller test.

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

Smaller or equal test.

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

Assignment operator.

const ColorUnitHue& BALL::VIEW::ColorUnitHue::operator= ( const char *  value)

Assignment operator with char*. Calls set.

Parameters
valuethe pointer to a string containing a value in hex format ( "00"-"168")
Exceptions
InvalidRangeif string length > 3
NotInHexFormatif string contains characters g-z or G-Z or the hex number exceeds 168h
const ColorUnitHue& BALL::VIEW::ColorUnitHue::operator= ( const String value)

Assignment operator with string. Calls set.

Parameters
valuea string containing a value in hex format ( "00"-"168")
Exceptions
InvalidRangeif string length > 3
NotInHexFormatif string contains characters g-z or G-Z or the hex number exceeds 168h
const ColorUnitHue& BALL::VIEW::ColorUnitHue::operator= ( const short  value)

Assignment operator with short. Calls set.

Parameters
valuea short containing a value of range 0-360
Exceptions
InvalidRangeif value < 0 || value > 360
const ColorUnitHue& BALL::VIEW::ColorUnitHue::operator= ( const unsigned short  value)

Assignment operator with unsigned short. Calls set.

Parameters
valuean unsigned short containing a value of range 0-360
Exceptions
InvalidRangeif value > 360
const ColorUnitHue& BALL::VIEW::ColorUnitHue::operator= ( const int  value)

Assignment operator with int. Calls set.

Parameters
valuean int containing a value of range 0-360
Exceptions
InvalidRangeif value < 0 || value > 360
const ColorUnitHue& BALL::VIEW::ColorUnitHue::operator= ( const unsigned int  value)

Assignment operator with unsigned int. Calls set.

Parameters
valuean unsigned int containing a value of range 0-360
Exceptions
InvalidRangeif value > 360
const ColorUnitHue& BALL::VIEW::ColorUnitHue::operator= ( const long  value)

Assignment operator with long. Calls set.

Parameters
valuea long containing a value of range 0-360
Exceptions
InvalidRangeif value < 0 || value > 360
const ColorUnitHue& BALL::VIEW::ColorUnitHue::operator= ( const unsigned long  value)

Assignment operator with unsigned long. Calls set.

Parameters
valuean unsigned long containing a value of range 0-360
Exceptions
InvalidRangeif value > 360
const ColorUnitHue& BALL::VIEW::ColorUnitHue::operator= ( const float  init)

Assignment operator with float. Calls set.

Parameters
inita float containing a value of range 0-1.0
Exceptions
InvalidRangeif value < 0.0 || value > 1.0
const ColorUnitHue& BALL::VIEW::ColorUnitHue::operator= ( const double  value)

Assignment operator with double. Calls set.

Parameters
valuea double containing a value of range 0-1.0
Exceptions
InvalidRangeif value < 0.0 || value > 1.0
const ColorUnitHue& BALL::VIEW::ColorUnitHue::operator= ( const long double  value)

Assignment operator with long double. Calls set.

Parameters
valuea long double containing a value of range 0-1.0
Exceptions
InvalidRangeif value < 0.0 || value > 1.0
bool BALL::VIEW::ColorUnitHue::operator== ( const ColorUnitHue color_unit_hue) const

Equality test.

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

Greater test.

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

Greater or equal test.

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

Assignment.

void BALL::VIEW::ColorUnitHue::set ( const char *  value)

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

Parameters
valuethe new value (a string in the format "00"-"168")
Exceptions
InvalidRangeif string length > 3
NotInHexFormatif string contains characters g-z or G-Z or the hex number exceeds 168h
void BALL::VIEW::ColorUnitHue::set ( const String value)

Changes the value .

Parameters
valuea string (in the hex format "00"-"168")
Exceptions
InvalidRangeif string length > 3
NotInHexFormatif string contains characters g-z or G-Z or the hex number exceeds 168h
void BALL::VIEW::ColorUnitHue::set ( const short  value)

Changes the value .

Parameters
valuea short of range 0-360
Exceptions
InvalidRangeif value < 0 || value > 360
void BALL::VIEW::ColorUnitHue::set ( const unsigned short  value)

Changes the value .

Parameters
valuean unsigned short of range 0-360
Exceptions
InvalidRangeif value > 360
void BALL::VIEW::ColorUnitHue::set ( const int  value)

Changes the value .

Parameters
valuean int of range 0-360
Exceptions
InvalidRangeif value < 0 || value > 360
void BALL::VIEW::ColorUnitHue::set ( const unsigned int  value)

Changes the value.

Parameters
valuean unsigned int of range 0-360
Exceptions
InvalidRangeif value > 360
void BALL::VIEW::ColorUnitHue::set ( const long  value)

Changes the value.

Parameters
valuea long of range 0-360
Exceptions
InvalidRangeif value < 0 || value > 360
void BALL::VIEW::ColorUnitHue::set ( const unsigned long  value)

Changes the value.

Parameters
valuean unsigned long of range 0-360
Exceptions
InvalidRangeif value > 360
void BALL::VIEW::ColorUnitHue::set ( const float  value)

Changes the value.

Parameters
valuea float of range 0-1.0
Exceptions
InvalidRangeif value < 0.0 || value > 1.0
void BALL::VIEW::ColorUnitHue::set ( const double  value)

Changes the value.

Parameters
valuea double of range 0-1.0
Exceptions
InvalidRangeif value < 0.0 || value > 1.0
void BALL::VIEW::ColorUnitHue::set ( const long double  value)

Changes the value.

Parameters
valuea long double of range 0-1.0
Exceptions
InvalidRangeif value < 0.0 || value > 1.0
void BALL::VIEW::ColorUnitHue::swap ( ColorUnitHue color_unit_hue)

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
soutput stream to where the value will be stored
color_unit_huethe 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
sinput stream from where to restore the value
color_unit_huethe colorUnitHue to which the value will be restored