]> git.sesse.net Git - casparcg/blob - core/producer/transition/transition_producer.h
2.0. video_format: Renamed video_mode to field_mode. image_mixer: Refactored field...
[casparcg] / core / producer / transition / transition_producer.h
1 /*\r
2 * copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
3 *\r
4 *  This file is part of CasparCG.\r
5 *\r
6 *    CasparCG is free software: you can redistribute it and/or modify\r
7 *    it under the terms of the GNU General Public License as published by\r
8 *    the Free Software Foundation, either version 3 of the License, or\r
9 *    (at your option) any later version.\r
10 *\r
11 *    CasparCG is distributed in the hope that it will be useful,\r
12 *    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14 *    GNU General Public License for more details.\r
15 \r
16 *    You should have received a copy of the GNU General Public License\r
17 *    along with CasparCG.  If not, see <http://www.gnu.org/licenses/>.\r
18 *\r
19 */\r
20 #pragma once\r
21 \r
22 #include "../frame_producer.h"\r
23 #include "../../video_format.h"\r
24 \r
25 #include <common/utility/tweener.h>\r
26 \r
27 #include <string>\r
28 #include <memory>\r
29 \r
30 namespace caspar { namespace core {\r
31 \r
32 struct transition\r
33 {\r
34         enum type\r
35         {\r
36 \r
37                 cut = 1,\r
38                 mix,\r
39                 push,\r
40                 slide,\r
41                 wipe\r
42         };\r
43 };\r
44 \r
45 struct transition_direction\r
46 {\r
47         enum type\r
48         {\r
49                 from_left = 1,\r
50                 from_right\r
51         };\r
52 };\r
53 \r
54 struct transition_info\r
55 {\r
56         transition_info() \r
57                 : type(transition::cut)\r
58                 , duration(0)\r
59                 , direction(transition_direction::from_left)\r
60                 , tweener(get_tweener(L"linear")){}\r
61                 \r
62         size_t                                          duration;\r
63         transition_direction::type      direction;\r
64         transition::type                        type;\r
65         tweener_t                                       tweener;\r
66 };\r
67 \r
68 safe_ptr<frame_producer> create_transition_producer(const field_mode::type& mode, const safe_ptr<frame_producer>& destination, const transition_info& info);\r
69 \r
70 }}