Commit 9fa126d1 authored by Kenneth Vanhoey's avatar Kenneth Vanhoey

new functionality to colourConverter

parent ce7ab27c
......@@ -71,6 +71,16 @@ public: // methods
*/
~ColourConverter() {} ;
/**
* getR
* @return original value (in its original space)
*/
VEC3 getOriginal() ;
/**
* getR
* @return enc value of provided colour
*/
VEC3 getColour(enum ColourEncoding enc) ;
/**
* getR
* @return RGB value of provided colour
......
......@@ -65,6 +65,36 @@ ColourConverter<REAL>::ColourConverter(VEC3 col, enum ColourEncoding enc) :
}
}
template<typename REAL>
Geom::Vector<3,REAL> ColourConverter<REAL>::getColour(enum ColourEncoding enc) {
switch (enc) {
case (C_RGB) :
return getRGB() ;
break ;
case (C_XYZ) :
return getXYZ() ;
break ;
case (C_Luv) :
return getLuv() ;
break ;
case (C_Lab) :
return getLab() ;
break ;
default :
assert(!"Should never arrive here : ColourConverter::getColour default case") ;
return getOriginal() ;
}
}
template<typename REAL>
Geom::Vector<3,REAL> ColourConverter<REAL>::getOriginal() {
return getColour(this->originalEnc) ;
}
template<typename REAL>
Geom::Vector<3,REAL> ColourConverter<REAL>::getRGB() {
if (RGB == NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment