TuttleOFX  1
cmyk.hpp
Go to the documentation of this file.
00001 #ifndef _TERRY_COLOR_COLORSPACE_CMYK_HPP_
00002 #define _TERRY_COLOR_COLORSPACE_CMYK_HPP_
00003 
00004 #include "rgb.hpp"
00005 
00006 namespace terry {
00007 namespace color {
00008 
00009 /// \addtogroup ColorNameModel
00010 /// \{
00011 namespace cmyk_colorspace
00012 {
00013 /// \brief cyan
00014 struct cyan_t {};    
00015 /// \brief magenta
00016 struct magenta_t {};
00017 /// \brief yellow
00018 struct yellow_t {}; 
00019 /// \brief key -> black
00020 struct key_t {}; 
00021 }
00022 /// \}
00023 
00024 /// \ingroup ColorSpaceModel
00025 typedef boost::mpl::vector4<
00026                 cmyk_colorspace::cyan_t,
00027                 cmyk_colorspace::magenta_t,
00028                 cmyk_colorspace::yellow_t,
00029                 cmyk_colorspace::key_t
00030         > cmyk_colorspace_t;
00031 
00032 /// \ingroup LayoutModel
00033 typedef layout<cmyk_colorspace_t> cmyk_layout_t;
00034 
00035 struct CMYKParams : public IColorParams
00036 {
00037         typedef CMYKParams This;
00038         virtual bool operator==( const IColorParams& other ) const
00039         {
00040                 const This* other_ptr = dynamic_cast<const This*>(&other);
00041                 return other_ptr != NULL;
00042         }
00043 };
00044 
00045 /**
00046  * @brief CMYK colorspace description
00047  * @todo
00048  */
00049 struct CMYK
00050 {
00051         typedef RGB reference;
00052         typedef CMYKParams params;
00053         
00054         typedef cmyk_colorspace_t colorspace;
00055         typedef cmyk_layout_t layout;
00056 };
00057 
00058 template<typename SChannelType, typename DChannelType>
00059 void color_transformation_step( const CMYKParams& params, const boost::gil::pixel<SChannelType,CMYK::layout>& src, boost::gil::pixel<DChannelType,RGB::layout>& dst )
00060 {
00061         std::cout << "color_transformation_step CMYK to RGB" << std::endl;
00062         numeric::pixel_zeros( dst );
00063 }
00064 template<typename SChannelType, typename DChannelType>
00065 void color_transformation_step( const CMYKParams& params, const boost::gil::pixel<SChannelType,RGB::layout>& src, boost::gil::pixel<DChannelType,CMYK::layout>& dst )
00066 {
00067         std::cout << "color_transformation_step RGB to CMYK" << std::endl;
00068         numeric::pixel_zeros( dst );
00069 }
00070 
00071 
00072 }
00073 TERRY_DEFINE_GIL_INTERNALS_4(cmyk)
00074 TERRY_DEFINE_COLORSPACE_STANDARD_TYPEDEFS(cmyk)
00075 }
00076 
00077 #endif
00078