1 #ifndef color_YPbPr_convert_lab
2 #define color_YPbPr_convert_lab
3 
4 #include "../../_internal/convert.hpp"
5 
6 #include "../category.hpp"
7 
8 
9 #include "../../lab/lab.hpp"
10 #include "../../xyz/xyz.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  lab_tag_name,   ::color::constant::lab::reference_enum     lab_reference_number
22      >
23      struct convert
24       <
25         ::color::category::YPbPr< YPbPr_tag_name, YPbPr_reference_number >
26        ,::color::category::lab< lab_tag_name, lab_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::lab< lab_tag_name, lab_reference_number >    lab_category_type, category_right_type;
32 
33          typedef typename ::color::trait::scalar<category_left_type>::instance_type scalar_type;
34 
35          typedef ::color::model< YPbPr_category_type > YPbPr_model_type;
36          typedef ::color::model< lab_category_type >  lab_model_type;
37 
38          typedef ::color::rgb< scalar_type >  rgb_model_type;
39          typedef ::color::xyz< scalar_type >  xyz_model_type;
40 
41          typedef ::color::trait::container<category_left_type>     container_left_trait_type;
42          typedef ::color::trait::container<category_right_type>    container_right_trait_type;
43 
44          typedef typename container_left_trait_type::input_type         container_left_input_type;
45          typedef typename container_right_trait_type::model_type  container_right_const_input_type;
46 
processcolor::_internal::convert47          static void process
48           (
49             container_left_input_type         left
50            ,container_right_const_input_type  right
51           )
52           {
53            left = YPbPr_model_type( rgb_model_type( xyz_model_type( lab_model_type( right ) ) ) ).container();
54           }
55       };
56 
57    }
58  }
59 
60 #endif
61