Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
24th May 2020, 22:26 | #1 | Link |
Registered User
Join Date: Jan 2015
Posts: 1,048
|
confirmation of how to set defaults in user-defined functions
(Stainless's inbox is full so I have to post this openly)
So let's say I wanted to create a function, "KTFM", which is basically TFM, but with my preferred cthresh, mthresh, MI, blockx, and micmatching values. Let's also say that I wanted KTFM to allow the user to override my preferred settings for the first four of these, but always match from the non-dominant field, and lock the user out of micmatching and all other TFM parameters. If I understand correctly, it would look something like this? Code:
function ktfm(clip c, int "peanut", int "butter", int "jelly", int "time") { c underpants = (GetParity) ? 0 : 1 peanut = Default(peanut,1) butter = Default(butter,20) jelly = Default(jelly,4) time = Default(time,2) tfm(field=underpants, cthresh=peanut, MI=butter, blockx=jelly, mthresh=time, micmatching=0)
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers. |
24th May 2020, 23:07 | #2 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Looks about right, although you missed off at least the last brace, end of function.
Best place to start is the wiki:- http://avisynth.nl/index.php/Main_Page Read ALL entries after "Your first script", we all have had to do it. (Also, every now and then not a bad idea to go back and re-read the lot again, see if anything has been added).
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
25th May 2020, 00:16 | #4 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
I meant all headings under that, but,
See MediaFire under this post, DATA folder, AvisynthEngHelp+SDK26_FINAL-2015-05-31.zip. Is compressed help file (CHM), also has a table with entries for all the component HTML parts that make up the CHM. So you can visit each page, and know for sure that you've read the lot (instead of going around and around following links). Here part of the table: Above for v2.60 std, but that is enough to get you going.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
Thread Tools | Search this Thread |
Display Modes | |
|
|