/** * @file ColorSpace.h * @brief color space conversion routines * @author Michael Koch * @date 07/28/2008 */ #ifndef COLORSPACEINCLUDE #define COLORSPACEINCLUDE #include #include "core/image/MultiChannelImageT.h" namespace OBJREC { /** @brief color space conversion routines */ class ColorSpace { protected: public: enum { COLORSPACE_RGB = 0, COLORSPACE_HSL, COLORSPACE_LAB, COLORSPACE_LMS, COLORSPACE_OPP, NUM_COLORSPACES }; //bad position choose better one static void ColorImagetoMultiChannelImage(const NICE::ColorImage &imgrgb,NICE::MultiChannelImageT &genimg); #if 0 //entfernt, da Probleme mit Wertebereich, bitte GenericImage und generisches convert benutzen /** convert RGB to hsl*/ static NICE::ColorImage rgbtohsl(const NICE::ColorImage &imgrgb); /** convert hsl to RGB*/ static NICE::ColorImage hsltorgb(const NICE::ColorImage &imghsl); /** convert RGB to LAB*/ static NICE::ColorImage rgbtolab(const NICE::ColorImage &imgrgb); /** convert LAB to RGB*/ static NICE::ColorImage labtorgb(const NICE::ColorImage &imglab); /** convert RGB to LMS*/ static NICE::ColorImage rgbtolms(const NICE::ColorImage &imgrgb);*/ #endif template static void convert ( NICE::MultiChannelImageT & dst, const NICE::MultiChannelImageT & src, int dstColorSpace = COLORSPACE_HSL, int srcColorSpace = COLORSPACE_RGB, double dstM = 255.0, double srcM = 255.0); }; } // namespace #include "ColorSpace.tcc" #endif