]> git.sesse.net Git - nageru/blobdiff - theme.lua
Hook up PaddingEffect.
[nageru] / theme.lua
index 82339f8d33db7c03d9fb8c51f1b6060373cef6b9..2238557d808663227505544c628cfc2867a2b285 100644 (file)
--- a/theme.lua
+++ b/theme.lua
@@ -15,7 +15,15 @@ local preview_signal_num = 1;
 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(PaddingEffect.new(), resample_effect);
+padding_effect:set_int("width", 1280);
+padding_effect:set_int("height", 720);
+padding_effect:set_float("left", 30.0);
+padding_effect:set_float("top", 60.0);
+local wb_effect = main_chain:add_effect(WhiteBalanceEffect.new(), 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);
@@ -56,6 +64,13 @@ end
 -- 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.
 --