local main_chain = EffectChain.new(16, 9);
local input0 = main_chain:add_live_input();
input0:connect_signal(0);
-local wb_effect = main_chain:add_effect(WhiteBalanceEffect.new(), input0);
+local resample_effect = main_chain:add_effect(ResampleEffect.new(), input0);
+resample_effect:set_int("width", 320);
+resample_effect:set_int("height", 180);
+local padding_effect = main_chain:add_effect(IntegralPaddingEffect.new(), resample_effect);
+padding_effect:set_int("width", 1280);
+padding_effect:set_int("height", 720);
+padding_effect:set_int("left", 30);
+padding_effect:set_int("top", 60);
+local input1 = main_chain:add_live_input();
+input1:connect_signal(1);
+local wb_effect = main_chain:add_effect(WhiteBalanceEffect.new(), input1);
+local overlay_effect = main_chain:add_effect(OverlayEffect.new(), wb_effect, padding_effect);
main_chain:finalize(true);
--- local input1 = main_chain.add_input(Inputs.create(1));
--- local resample_effect = main_chain.add_effect(ResampleEffect.new(), input0);
--- local padding_effect = main_chain.add_effect(IntegralPaddingEffect.new());
-- A chain to show a single input on screen.
local simple_chain = EffectChain.new(16, 9);
-- Returns the number of outputs in addition to the live (0) and preview (1).
-- Called only once, at the start of the program.
function num_channels()
- return 0;
+ return 2;
end
-- Called every frame.
-- current time in seconds. width and height are the dimensions of
-- the output, although you can ignore them if you don't need them
-- (they're useful if you want to e.g. know what to resample by).
+--
+-- You should return two objects; the chain itself, and then a
+-- function (taking no parameters) that is run just before rendering.
+-- The function needs to call connect_signal on any inputs, so that
+-- it gets updated video data for the given frame. (You are allowed
+-- to switch which input your input is getting from between frames,
+-- but not calling connect_signal results in undefined behavior.)
-- If you want to change any parameters in the chain, this is also
-- the right place.
--
if num == 0 then -- Live.
prepare = function()
input0:connect_signal(live_signal_num);
+ input1:connect_signal(1);
wb_effect:set_float("output_color_temperature", 3500.0 + t * 100.0);
end
return main_chain, prepare;