1 #ifndef color_YPbPr_convert_yuv
2 #define color_YPbPr_convert_yuv
3 
4 #include "../category.hpp"
5 
6 #include "../../_internal/convert.hpp"
7 
8 
9 
10 #include "../../yuv/yuv.hpp"
11 #include "../../rgb/rgb.hpp"
12 
13 namespace color
14  {
15   namespace _internal
16    {
17 
18     template
19      <
20        typename YPbPr_tag_name, ::color::constant::YPbPr::reference_enum YPbPr_reference_number
21       ,typename yuv_tag_name,   ::color::constant::yuv::reference_enum     yuv_reference_number
22      >
23      struct convert
24       <
25         ::color::category::YPbPr<  YPbPr_tag_name, YPbPr_reference_number >
26        ,::color::category::yuv<      yuv_tag_name,   yuv_reference_number >
27       >
28       {
29        public:
30          typedef ::color::category::YPbPr< YPbPr_tag_name, YPbPr_reference_number >    YPbPr_category_type, category_left_type;
31          typedef ::color::category::yuv< yuv_tag_name,       yuv_reference_number >    yuv_category_type, category_right_type;
32 
33          typedef typename ::color::trait::scalar<category_left_type>::instance_type  scalar_type;
34 
35          typedef ::color::model< category_left_type >    left_model_type;
36          typedef ::color::model< category_right_type >  right_model_type;
37 
38          typedef ::color::rgb< scalar_type >  rgb_model_type;
39 
40          typedef ::color::trait::container<category_left_type>     container_left_trait_type;
41          typedef ::color::trait::container<category_right_type>    container_right_trait_type;
42 
43          typedef typename container_left_trait_type::input_type         container_left_input_type;
44          typedef typename container_right_trait_type::model_type  container_right_const_input_type;
45 
processcolor::_internal::convert46          static void process
47           (
48             container_left_input_type         left
49            ,container_right_const_input_type  right
50           )
51           {
52            left = left_model_type( rgb_model_type( right_model_type( right ) ) ).container();
53           }
54         };
55 
56    }
57  }
58 
59 #endif
60