]> git.sesse.net Git - casparcg/blob - accelerator/cpu/image/image_mixer.h
set svn:eol-style native on .h and .cpp files
[casparcg] / accelerator / cpu / image / image_mixer.h
1 #pragma once
2
3 #include <common/forward.h>
4 #include <common/memory.h>
5
6 #include <core/mixer/image/blend_modes.h>
7 #include <core/mixer/image/image_mixer.h>
8
9 #include <core/frame/frame.h>
10 #include <core/frame/frame_visitor.h>
11 #include <core/video_format.h>
12
13 FORWARD1(boost, template<typename> class shared_future);
14 FORWARD1(boost, template<typename> class iterator_range);
15 FORWARD2(caspar, core, class frame);
16 FORWARD2(caspar, core, struct pixel_format_desc);
17 FORWARD2(caspar, core, struct video_format_desc);
18 FORWARD2(caspar, core, class mutable_frame);
19 FORWARD2(caspar, core, struct frame_transform);
20
21 namespace caspar { namespace accelerator { namespace cpu {
22         
23 typedef std::vector<uint8_t, tbb::cache_aligned_allocator<uint8_t>> buffer;
24
25 class image_mixer sealed : public core::image_mixer
26 {
27 public:
28
29         // Static Members
30
31         // Constructors
32
33         image_mixer();
34         ~image_mixer();
35
36         // Methods      
37
38         virtual void begin_layer(core::blend_mode blend_mode);
39         virtual void end_layer();
40
41         virtual void push(const core::frame_transform& frame);
42         virtual void visit(const core::const_frame& frame);
43         virtual void pop();
44                 
45         boost::unique_future<array<const std::uint8_t>> operator()(const core::video_format_desc& format_desc) override;
46                 
47         core::mutable_frame create_frame(const void* tag, const core::pixel_format_desc& desc) override;
48
49         // Properties
50
51 private:
52         struct impl;
53         spl::unique_ptr<impl> impl_;
54 };
55
56 }}}