X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fproducer%2Fscene%2Fscene_producer.h;h=a7c37710c31e7d7a1674cdfadccf0f4b2e8352a8;hb=62c7da66319a85de98331bcf9dded7490ab62884;hp=34e47ef65d94d5221bd2a305871b63329b356725;hpb=0a0753380eefc7aa64561308ad02564735262ae9;p=casparcg diff --git a/core/producer/scene/scene_producer.h b/core/producer/scene/scene_producer.h index 34e47ef65..a7c37710c 100644 --- a/core/producer/scene/scene_producer.h +++ b/core/producer/scene/scene_producer.h @@ -24,15 +24,12 @@ #include #include "../frame_producer.h" +#include "../../fwd.h" #include "../binding.h" #include "../variable.h" -namespace caspar { namespace core { - -class frame_factory; - -namespace scene { +namespace caspar { namespace core { namespace scene { struct coord { @@ -42,9 +39,16 @@ struct coord struct rect { - coord upper_left; - binding width; - binding height; + coord upper_left; + coord lower_right; +}; + +struct corners +{ + coord upper_left; + coord upper_right; + coord lower_right; + coord lower_left; }; struct adjustments @@ -54,15 +58,33 @@ struct adjustments adjustments(); }; +struct chroma_key +{ + binding enable; + binding target_hue; + binding hue_width; + binding min_saturation; + binding min_brightness; + binding softness; + binding spill; + binding spill_darken; +}; + struct layer { binding name; + scene::coord anchor; scene::coord position; - scene::rect clipping; + scene::rect crop; + scene::corners perspective; + binding rotation; scene::adjustments adjustments; binding> producer; binding hidden; binding is_key; + binding use_mipmap; + binding blend_mode; + scene::chroma_key chroma_key; explicit layer(const std::wstring& name, const spl::shared_ptr& producer); }; @@ -80,19 +102,29 @@ public: } }; +enum class mark_action +{ + start, + stop, + jump_to, + remove +}; + +mark_action get_mark_action(const std::wstring& name); + class scene_producer : public frame_producer_base { public: - scene_producer(int width, int height); + scene_producer(std::wstring producer_name, std::wstring template_name, int width, int height, const video_format_desc& format_desc); ~scene_producer(); - class draw_frame receive_impl() override; + draw_frame receive_impl() override; constraints& pixel_constraints() override; void on_interaction(const interaction_event::ptr& event) override; bool collides(double x, double y) const override; std::wstring print() const override; std::wstring name() const override; - std::future call(const std::vector& params) override; + std::future call(const std::vector& params) override; boost::property_tree::wptree info() const override; monitor::subject& monitor_output(); @@ -100,7 +132,10 @@ public: const spl::shared_ptr& producer, int x, int y, const std::wstring& name); layer& create_layer( const spl::shared_ptr& producer, const std::wstring& name); - binding frame(); + void reverse_layers(); + layer& get_layer(const std::wstring& name); + + binding timeline_frame(); binding speed(); template binding& create_variable( @@ -165,7 +200,7 @@ public: static_cast(duration))); to_affect.set(tweened); - + //CASPAR_LOG(info) << relative_frame << L" " << *start_value << L" " << duration << L" " << tweened; }; @@ -191,6 +226,9 @@ public: store_keyframe(to_affect.identity(), k); } + void add_mark(int64_t at_frame, mark_action action, const std::wstring& label); + void add_task(binding when, std::function task); + core::variable& get_variable(const std::wstring& name) override; const std::vector& get_variables() const override; private: @@ -202,6 +240,4 @@ private: std::unique_ptr impl_; }; -spl::shared_ptr create_dummy_scene_producer(const spl::shared_ptr& frame_factory, const video_format_desc& format_desc, const std::vector& params); - }}}