TuttleOFX
1
|
00001 #ifndef _TERRY_COLOR_COLORSPACE_LMS_HPP_ 00002 #define _TERRY_COLOR_COLORSPACE_LMS_HPP_ 00003 00004 #include "xyz.hpp" 00005 00006 namespace terry { 00007 namespace color { 00008 00009 /// \addtogroup ColorNameModel 00010 /// \{ 00011 namespace lms_colorspace 00012 { 00013 /// \brief 00014 struct L_t {}; 00015 /// \brief 00016 struct M_t {}; 00017 /// \brief 00018 struct S_t {}; 00019 } 00020 /// \} 00021 00022 /// \ingroup ColorSpaceModel 00023 typedef boost::mpl::vector3< 00024 lms_colorspace::L_t, 00025 lms_colorspace::M_t, 00026 lms_colorspace::S_t 00027 > lms_colorspace_t; 00028 00029 /// \ingroup LayoutModel 00030 typedef layout<lms_colorspace_t> lms_layout_t; 00031 00032 struct LMSParams : public IColorParams 00033 { 00034 typedef LMSParams This; 00035 virtual bool operator==( const IColorParams& other ) const 00036 { 00037 const This* other_ptr = dynamic_cast<const This*>(&other); 00038 return other_ptr != NULL; 00039 } 00040 }; 00041 /** 00042 * @brief LMS colorspace description 00043 * @todo 00044 */ 00045 struct LMS 00046 { 00047 typedef XYZ reference; 00048 typedef LMSParams params; 00049 00050 typedef lms_colorspace_t colorspace; 00051 typedef lms_layout_t layout; 00052 }; 00053 00054 template<typename SChannelType, typename DChannelType> 00055 void color_transformation_step( const LMSParams& params, const boost::gil::pixel<SChannelType,LMS::layout>& src, boost::gil::pixel<DChannelType,XYZ::layout>& dst ) 00056 { 00057 std::cout << "color_transformation_step LMS to XYZ" << std::endl; 00058 numeric::pixel_zeros( dst ); 00059 } 00060 template<typename SChannelType, typename DChannelType> 00061 void color_transformation_step( const LMSParams& params, const boost::gil::pixel<SChannelType,XYZ::layout>& src, boost::gil::pixel<DChannelType,LMS::layout>& dst ) 00062 { 00063 std::cout << "color_transformation_step XYZ to LMS" << std::endl; 00064 numeric::pixel_zeros( dst ); 00065 } 00066 00067 00068 00069 } 00070 TERRY_DEFINE_GIL_INTERNALS_3(lms) 00071 TERRY_DEFINE_COLORSPACE_STANDARD_TYPEDEFS(lms) 00072 } 00073 00074 #endif 00075