]> git.sesse.net Git - casparcg/blob - accelerator/ogl/image/image_mixer.h
set svn:eol-style native on .h and .cpp files
[casparcg] / accelerator / ogl / image / image_mixer.h
1 /*
2 * Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
3 *
4 * This file is part of CasparCG (www.casparcg.com).
5 *
6 * CasparCG is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * CasparCG is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * Author: Robert Nagy, ronag89@gmail.com
20 */
21
22 #pragma once
23
24 #include <common/forward.h>
25 #include <common/memory.h>
26 #include <common/future_fwd.h>
27
28 #include <core/mixer/image/blend_modes.h>
29 #include <core/mixer/image/image_mixer.h>
30
31 #include <core/frame/frame_visitor.h>
32 #include <core/video_format.h>
33
34 FORWARD2(caspar, core, class frame);
35 FORWARD2(caspar, core, struct pixel_format_desc);
36 FORWARD2(caspar, core, struct video_format_desc);
37 FORWARD2(caspar, core, class mutable_frame);
38 FORWARD2(caspar, core, struct frame_transform);
39
40 namespace caspar { namespace accelerator { namespace ogl {
41         
42 class image_mixer sealed : public core::image_mixer
43 {
44         image_mixer(const image_mixer&);
45         image_mixer& operator=(const image_mixer&);
46 public:
47
48         // Static Members
49         
50         // Constructors
51
52         image_mixer(const spl::shared_ptr<class device>& ogl);
53         ~image_mixer();
54
55         // Methods
56                         
57         boost::unique_future<array<const std::uint8_t>> operator()(const core::video_format_desc& format_desc) override;                
58         core::mutable_frame create_frame(const void* tag, const core::pixel_format_desc& desc) override;
59
60         // core::image_mixer
61         
62         void begin_layer(core::blend_mode blend_mode) override;
63         void end_layer() override;
64
65         void push(const core::frame_transform& frame) override;
66         void visit(const core::const_frame& frame) override;
67         void pop() override;
68                         
69         // Properties
70
71 private:
72         struct impl;
73         spl::unique_ptr<impl> impl_;
74 };
75
76 }}}