From: Helge Norberg Date: Mon, 29 Feb 2016 11:59:42 +0000 (+0100) Subject: #414 Added help for color producer. X-Git-Tag: 2.1.0_Beta1~109 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=4a141ed49814d978a6827747d7e69eb01e51f30f;p=casparcg #414 Added help for color producer. --- diff --git a/core/producer/color/color_producer.cpp b/core/producer/color/color_producer.cpp index 888823727..78c89a53c 100644 --- a/core/producer/color/color_producer.cpp +++ b/core/producer/color/color_producer.cpp @@ -30,6 +30,8 @@ #include #include #include +#include +#include #include #include @@ -157,6 +159,44 @@ bool try_get_color(const std::wstring& str, uint32_t& value) return true; } +void describe_color_producer(core::help_sink& sink, const core::help_repository& repo) +{ + sink.short_description(L"Fills a layer with a solid color."); + sink.syntax( + L"{#[argb_hex_value:string]}" + L",{#[rgb_hex_value:string]}" + L",{[named_color:EMPTY,BLACK,WHITE,RED,GREEN,BLUE,ORANGE,YELLOW,BROWN,GRAY,TEAL]}"); + sink.para()->text(L"A producer that fills a layer with a solid color."); + sink.para() + ->text(L"If a ")->code(L"#") + ->text(L" sign followed by an 8 character hexadecimal number is given it is interpreted as an 8-bit per channel ARGB color. ") + ->text(L"If it is instead followed by a 6 character hexadecimal number it is interpreted as an 8-bit per channel RGB value with an opaque alpha channel."); + sink.para()->text(L"There are also a number of predefined named colors, that are specified without a ")->code(L"#")->text(L" sign:"); + sink.definitions() + ->item(L"EMPTY", L"Predefined ARGB value #00000000") + ->item(L"BLACK", L"Predefined ARGB value #FF000000") + ->item(L"WHITE", L"Predefined ARGB value #FFFFFFFF") + ->item(L"RED", L"Predefined ARGB value #FFFF0000") + ->item(L"GREEN", L"Predefined ARGB value #FF00FF00") + ->item(L"BLUE", L"Predefined ARGB value #FF0000FF") + ->item(L"ORANGE", L"Predefined ARGB value #FFFFA500") + ->item(L"YELLOW", L"Predefined ARGB value #FFFFFF00") + ->item(L"BROWN", L"Predefined ARGB value #FFA52A2A") + ->item(L"GRAY", L"Predefined ARGB value #FF808080") + ->item(L"TEAL", L"Predefined ARGB value #FF008080"); + sink.para() + ->strong(L"Note")->text(L" that it is important that all RGB values are multiplied with the alpha ") + ->text(L"at all times, otherwise the compositing in the mixer will be incorrect."); + sink.para()->text(L"Examples:"); + sink.example(L"PLAY 1-10 EMPTY", L"For a completely transparent frame."); + sink.example(L"PLAY 1-10 #00000000", L"For an explicitly defined completely transparent frame."); + sink.example(L"PLAY 1-10 #000000", L"For an explicitly defined completely opaque black frame."); + sink.example(L"PLAY 1-10 RED", L"For a completely red frame."); + sink.example(L"PLAY 1-10 #7F007F00", + L"For a completely green half transparent frame. " + L"Since the RGB part has been premultiplied with the A part this is 100% green."); +} + spl::shared_ptr create_color_producer(const spl::shared_ptr& frame_factory, uint32_t value) { return spl::make_shared(frame_factory, value); diff --git a/core/producer/color/color_producer.h b/core/producer/color/color_producer.h index 40a0972c4..696b274df 100644 --- a/core/producer/color/color_producer.h +++ b/core/producer/color/color_producer.h @@ -33,6 +33,7 @@ namespace caspar { namespace core { bool try_get_color(const std::wstring& str, uint32_t& value); +void describe_color_producer(core::help_sink& sink, const core::help_repository& repo); spl::shared_ptr create_color_producer(const spl::shared_ptr& frame_factory, uint32_t value); spl::shared_ptr create_color_producer(const spl::shared_ptr& frame_factory, const std::vector& params); draw_frame create_color_frame(void* tag, const spl::shared_ptr& frame_factory, uint32_t value); diff --git a/shell/server.cpp b/shell/server.cpp index cfcf4daa1..2c2c5f3d3 100644 --- a/shell/server.cpp +++ b/shell/server.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -167,6 +168,7 @@ struct server::impl : boost::noncopyable initialize_modules(dependencies); core::text::init(dependencies); core::scene::init(dependencies); + help_repo_->register_item({ L"producer" }, L"Color Producer", &core::describe_color_producer); } void start()