]> git.sesse.net Git - casparcg/blob - core/mixer/image/image_mixer.h
2.0.0.2: More missing files.
[casparcg] / core / mixer / image / image_mixer.h
1 #pragma once\r
2 \r
3 #include "../gpu/host_buffer.h"\r
4 \r
5 #include "../../video_format.h"\r
6 \r
7 #include <boost/tuple/tuple.hpp>\r
8 #include <boost/thread/future.hpp>\r
9 #include <boost/noncopyable.hpp>\r
10 \r
11 #include <memory>\r
12 #include <array>\r
13 \r
14 namespace caspar { namespace core {\r
15 \r
16 struct pixel_format_desc;\r
17         \r
18 struct image_transform \r
19 {\r
20         image_transform() : alpha(1.0), pos(boost::make_tuple(0.0, 0.0)), gain(1.0), uv(boost::make_tuple(0.0, 0.0, 0.0, 0.0)), mode(video_mode::invalid){}\r
21         double alpha;\r
22         double gain;\r
23         boost::tuple<double, double> pos;\r
24         boost::tuple<double, double, double, double> uv;\r
25         video_mode::type mode; \r
26 \r
27         image_transform& operator*=(const image_transform &other);\r
28         const image_transform operator*(const image_transform &other) const;\r
29 };\r
30 \r
31 class image_mixer : boost::noncopyable\r
32 {\r
33 public:\r
34         image_mixer(const video_format_desc& format_desc);\r
35 \r
36         void begin(const image_transform& transform);\r
37         void process(const pixel_format_desc& desc, std::vector<safe_ptr<host_buffer>>& buffers);\r
38         void end();\r
39 \r
40         boost::unique_future<safe_ptr<const host_buffer>> begin_pass();\r
41         void end_pass();\r
42 \r
43         std::vector<safe_ptr<host_buffer>> create_buffers(const pixel_format_desc& format);\r
44 \r
45 private:\r
46         struct implementation;\r
47         std::shared_ptr<implementation> impl_;\r
48 };\r
49 \r
50 }}