]> git.sesse.net Git - casparcg/blob - core/mixer/image/image_mixer.h
2.0.0.2: -mixer: Moved device -> host read mapping to consumer_device thus reducing...
[casparcg] / core / mixer / image / image_mixer.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 "../write_frame.h"\r
23 \r
24 #include <common/memory/safe_ptr.h>\r
25 \r
26 #include <core/video_format.h>\r
27 #include <core/producer/frame/frame_visitor.h>\r
28 #include <core/producer/frame/pixel_format.h>\r
29 \r
30 #include "../gpu/host_buffer.h"\r
31 \r
32 #include <boost/noncopyable.hpp>\r
33 #include <boost/thread/future.hpp>\r
34 \r
35 #include <vector>\r
36 \r
37 namespace caspar { namespace core {\r
38         \r
39 class image_mixer : public core::frame_visitor, boost::noncopyable\r
40 {\r
41 public:\r
42         image_mixer(const core::video_format_desc& format_desc);\r
43         \r
44         virtual void begin(const core::basic_frame& frame);\r
45         virtual void visit(core::write_frame& frame);\r
46         virtual void end();\r
47 \r
48         void begin_layer();\r
49         void end_layer();\r
50         \r
51         boost::unique_future<safe_ptr<host_buffer>> render();\r
52 \r
53         safe_ptr<write_frame> create_frame(void* tag, const core::pixel_format_desc& format);\r
54 \r
55 private:\r
56         struct implementation;\r
57         safe_ptr<implementation> impl_;\r
58 };\r
59 \r
60 }}