12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- /**
- * @file ColorSpace.h
- * @brief color space conversion routines
- * @author Michael Koch
- * @date 07/28/2008
- */
- #ifndef COLORSPACEINCLUDE
- #define COLORSPACEINCLUDE
- #include <vislearning/nice.h>
- #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<double> &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<class SrcPixelType,class DstPixelType>
- static void convert ( NICE::MultiChannelImageT<DstPixelType> & dst,
- const NICE::MultiChannelImageT<SrcPixelType> & src,
- int dstColorSpace = COLORSPACE_HSL,
- int srcColorSpace = COLORSPACE_RGB,
- double dstM = 255.0,
- double srcM = 255.0);
- };
- } // namespace
- #include "ColorSpace.tcc"
- #endif
|