TuttleOFX  1
rgb.hpp
Go to the documentation of this file.
00001 #ifndef _TERRY_COLOR_COLORSPACE_RGB_HPP_
00002 #define _TERRY_COLOR_COLORSPACE_RGB_HPP_
00003 
00004 #include "xyz.hpp"
00005 
00006 #include <boost/gil/rgba.hpp>
00007 
00008 namespace terry {
00009 namespace color {
00010 
00011 namespace rgb_colorspace
00012 {
00013         using ::boost::gil::red_t;
00014         using ::boost::gil::green_t;
00015         using ::boost::gil::blue_t;
00016 }
00017 typedef ::boost::gil::rgb_t rgb_colorspace_t;
00018 using ::boost::gil::rgb_layout_t;
00019 
00020 struct RGBParams : public IColorParams
00021 {
00022         typedef RGBParams This;
00023         virtual bool operator==( const IColorParams& other ) const
00024         {
00025                 const This* other_ptr = dynamic_cast<const This*>(&other);
00026                 return other_ptr != NULL;
00027         }
00028 };
00029 
00030 /**
00031  * @brief RGB colorspace description
00032  * @todo
00033  */
00034 struct RGB
00035 {
00036         typedef XYZ reference;
00037         typedef RGBParams params;
00038         
00039         typedef rgb_colorspace_t colorspace;
00040         typedef rgb_layout_t layout;
00041 };
00042 
00043 template<typename SChannelType, typename DChannelType>
00044 void color_transformation_step( const RGBParams& params, const boost::gil::pixel<SChannelType,RGB::layout>& src, boost::gil::pixel<DChannelType,XYZ::layout>& dst )
00045 {
00046         std::cout << "color_transformation_step RGB to XYZ" << std::endl;
00047         numeric::pixel_zeros( dst );
00048 }
00049 template<typename SChannelType, typename DChannelType>
00050 void color_transformation_step( const RGBParams& params, const boost::gil::pixel<SChannelType,XYZ::layout>& src, boost::gil::pixel<DChannelType,RGB::layout>& dst )
00051 {
00052         std::cout << "color_transformation_step XYZ to RGB" << std::endl;
00053         numeric::pixel_zeros( dst );
00054 }
00055 
00056 
00057 //BOOST_MPL_ASSERT( ( ::boost::mpl::equal<
00058 //                                      ::boost::mpl::vector<XYZ, RGB>,
00059 //                                      color_dependencies<RGB>::from_root
00060 //                                      > ) );
00061 //
00062 //BOOST_MPL_ASSERT( ( ::boost::mpl::equal<
00063 //                                      ::boost::mpl::vector<RGB, XYZ>,
00064 //                                      color_dependencies<RGB>::to_root
00065 //                                      > ) );
00066 
00067 
00068 }
00069 }
00070 
00071 #endif
00072