]> git.sesse.net Git - casparcg/blob - core/producer/transition/transition_producer.h
c4e47affcae039e0b938be57a8c58348403fccf8
[casparcg] / core / producer / transition / transition_producer.h
1 /*\r
2 * Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
3 *\r
4 * This file is part of CasparCG (www.casparcg.com).\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 * Author: Robert Nagy, ronag89@gmail.com\r
20 */\r
21 \r
22 #pragma once\r
23 \r
24 #include "../../video_format.h"\r
25 \r
26 #include <common/enum_class.h>\r
27 #include <common/memory.h>\r
28 #include <common/tweener.h>\r
29 \r
30 #include <string>\r
31 \r
32 namespace caspar { namespace core {\r
33         \r
34 struct transition_type_def\r
35 {\r
36         enum type\r
37         {\r
38                 cut,    \r
39                 mix,    \r
40                 push,    \r
41                 slide,  \r
42                 wipe,\r
43                 count\r
44         };\r
45 };\r
46 typedef enum_class<transition_type_def> transition_type;\r
47         \r
48 struct transition_direction_def\r
49 {\r
50         enum type\r
51         {\r
52                 from_left,\r
53                 from_right,\r
54                 count\r
55         };\r
56 };\r
57 typedef enum_class<transition_direction_def> transition_direction;\r
58 \r
59 struct transition_info\r
60 {\r
61         transition_info() \r
62                 : type(transition_type::cut)\r
63                 , duration(0)\r
64                 , direction(transition_direction::from_left)\r
65                 , tweener(L"linear"){}\r
66                 \r
67         int                                             duration;\r
68         transition_direction    direction;\r
69         transition_type                 type;\r
70         tweener                                 tweener;\r
71 };\r
72 \r
73 spl::shared_ptr<class frame_producer> create_transition_producer(const field_mode& mode, const spl::shared_ptr<class frame_producer>& destination, const transition_info& info);\r
74 \r
75 }}