X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fmixer%2Fimage%2Fimage_mixer.h;h=266c3d43b8f923fc376561663bc3c203916fc9b4;hb=e427f7e2661d120c1152eaa7868cc18a3b8cdd7e;hp=d09c375316c47642380c9e2f860244d5a030bc5a;hpb=94e1a4ea8fbf536dea2924d4aa3a9d6d50bef77c;p=casparcg diff --git a/core/mixer/image/image_mixer.h b/core/mixer/image/image_mixer.h index d09c37531..266c3d43b 100644 --- a/core/mixer/image/image_mixer.h +++ b/core/mixer/image/image_mixer.h @@ -1,67 +1,63 @@ +/* +* copyright (c) 2010 Sveriges Television AB +* +* This file is part of CasparCG. +* +* CasparCG is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* CasparCG is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. + +* You should have received a copy of the GNU General Public License +* along with CasparCG. If not, see . +* +*/ #pragma once -#include "../gpu/host_buffer.h" +#include "blend_modes.h" -#include "../../video_format.h" +#include + +#include -#include -#include #include -#include -#include +#include namespace caspar { namespace core { +class write_frame; +class host_buffer; +class ogl_device; +struct video_format_desc; struct pixel_format_desc; - -class image_transform -{ -public: - image_transform(); - - void set_opacity(double value); - double get_opacity() const; - - void set_gain(double value); - double get_gain() const; - void set_position(double x, double y); - std::array get_position() const; - - void set_uv(double left, double top, double right, double bottom); - std::array get_uv() const; - - void set_mode(video_mode::type mode); - video_mode::type get_mode() const; - - image_transform& operator*=(const image_transform &other); - const image_transform operator*(const image_transform &other) const; -private: - double opacity_; - double gain_; - std::array pos_; - std::array uv_; - video_mode::type mode_; -}; - -class image_mixer : boost::noncopyable +class image_mixer : public core::frame_visitor, boost::noncopyable { public: - image_mixer(const video_format_desc& format_desc); + image_mixer(ogl_device& ogl, const video_format_desc& format_desc); + + virtual void begin(core::basic_frame& frame); + virtual void visit(core::write_frame& frame); + virtual void end(); - void begin(const image_transform& transform); - void process(const pixel_format_desc& desc, std::vector>& buffers); - void end(); + void begin_layer(blend_mode::type blend_mode); + void end_layer(); - boost::unique_future> begin_pass(); - void end_pass(); + image_mixer& operator=(image_mixer&& other); + + boost::unique_future> render(); - std::vector> create_buffers(const pixel_format_desc& format); + safe_ptr create_frame(const void* tag, const pixel_format_desc& format); private: struct implementation; - std::shared_ptr impl_; + safe_ptr impl_; }; }} \ No newline at end of file