View Single Post
Old 20th April 2020, 20:42   #49  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
update:
revamped: Preprocess() is now replaced by RegisterInvokingSequence(), you may invoke a sequence of filters (including the very filter that is being defined, you may invoke this "self" filter via SelfInvoker) any way you like. basically, you get to write something like a vpy script in RegisterInvokingSequence and if this function is absent in your filter, it is assumed that the output is SelfInvoker()

say you defined a 3x3 blurring filter in DrawFrame and you wanna repeat it 10 times:
Code:
auto RegisterInvokingSequence(auto Core, auto&& SelfInvoker, auto Console) {
	for (auto _ : Range{ 10 })
		InputClip = SelfInvoker("clip", InputClip);
	Console.Receive(InputClip);
}
you wanna upsize it by a factor of 2 after blurring.
Code:
auto RegisterInvokingSequence(auto Core, auto&& SelfInvoker, auto Console) {
	for (auto _ : Range{ 10 })
		InputClip = SelfInvoker("clip", InputClip);
	InputClip = Core["fmtc"]["resample"]("clip", InputClip, "width", InputClip.Width * 2, "height", InputClip.Height * 2);
	Console.Receive(InputClip);
}
and you wanna transpose the clip before all this happens
Code:
auto RegisterInvokingSequence(auto Core, auto&& SelfInvoker, auto Console) {
	InputClip = Core["std"]["Transpose"]("clip", InputClip);
	for (auto _ : Range{ 10 })
		InputClip = SelfInvoker("clip", InputClip);
	InputClip = Core["fmtc"]["resample"]("clip", InputClip, "width", InputClip.Width * 2, "height", InputClip.Height * 2);
	Console.Receive(InputClip);
}

Last edited by feisty2; 21st April 2020 at 16:14.
feisty2 is offline   Reply With Quote