00001 #ifndef __RColorRGBtoLab__ 00002 #define __RColorRGBtoLab__ 00003 00004 00005 00029 #include <stdio.h> 00030 00031 #include "AR3ChannelConverter.hpp" 00032 00033 #include "RLinearRGBtoLMS.hpp" 00034 #include "RLinearLMStoLab.hpp" 00035 00036 class RColorRGBtoLab : public AR3ChannelConverter 00037 { 00038 private: 00039 00040 RLinearRGBtoLMS rgbToLms; 00041 RLinearLMStoLab lmsToLab; 00042 00043 public: 00044 00045 RColorRGBtoLab(){} 00046 virtual ~RColorRGBtoLab(){} 00047 00048 00049 // single shot filtering 00050 virtual Real3CImage* convert(Real3CImage* from, Real3CImage* to=0) 00051 { 00052 Real3CImage* lms= rgbToLms.convert(from, 0); 00053 to= lmsToLab.convert(lms, to); 00054 delete lms; 00055 return to; 00056 } 00057 virtual Real3CImage* revert(Real3CImage* from, Real3CImage* to=0) 00058 { 00059 Real3CImage* lms= lmsToLab.revert(from, 0); 00060 to= rgbToLms.revert(lms, to); 00061 delete lms; 00062 return to; 00063 } 00064 00065 virtual void report(FILE* file){} 00066 }; 00067 00068 00069 #endif