Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::HSVColor< T > Class Template Reference

#include <Color.h>

Inheritance diagram for prapi::HSVColor< T >:

prapi::Color< T, 3 > List of all members.

Detailed Description

template<class T = int>
class prapi::HSVColor< T >

A class for the HSV (hue, saturation, value) color space.

The H channel varies in the range [0,360). S channel is in the range [0,1] for data types float and double. For int, the range is [0,255]. The value of V can be just about anything.


Public Methods

 HSVColor (T clr=0)
 Create a new HSV color with all channels set to clr.

 HSVColor (T r, T g, T b)
 Create a new HSV color with color channels set as indicated.

template<class U>  HSVColor (const Color< U, 3 > &other)
 Copy any three-component color.

 HSVColor (const Color< T, 3 > &other)
 Copy any three-component color with the same content type.

 HSVColor (const RGBColor< T > &other)
 Convert an RGB color to HSV.

getHue () const
 Get the value of the 'hue' channel.

getSaturation () const
 Get the value of the 'saturation' channel.

getValue () const
 Get the value of the 'value' channel.

void setHue (T value)
 Set hue.

void setSaturation (T value)
 Set saturation.

void setValue (T value)
 Set value.

 operator int () const
 Get the intensity (V) channel as an integer.

 operator float () const
 Get the intensity (V) channel as a float.

 operator double () const
 Get the intensity (V) channel as a double.

 operator RGBColor () const
 Convert this color to the RGB color space.

template<class U> HSVColor & operator= (const Color< U, 3 > &other)
 Copy any three-component color.

HSVColor & operator= (const Color< T, 3 > &other)
 Copy a three-component color of the same content type.


Friends

class RGBColor< T >


Constructor & Destructor Documentation

template<class T = int>
prapi::HSVColor< T >::HSVColor const RGBColor< T > &    other [inline]
 

Convert an RGB color to HSV.

See also:
operator RGBColor<T>


Member Function Documentation

template<class T = int>
prapi::HSVColor< T >::operator RGBColor   const [inline]
 

Convert this color to the RGB color space.

For integer-valued HSV colors, the saturation channel must be in the range [0,255]. Preferably, the value channel should also be in this range. The hue channel must be in [0,360) independent of the content type. For floating point content types, saturation must and value should be in the range [0,1].


The documentation for this class was generated from the following file:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.