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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 24th May 2020, 22:26   #1  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
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.
Katie Boundary is offline   Reply With Quote
Old 24th May 2020, 23:07   #2  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
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 ???
StainlessS is offline   Reply With Quote
Old 24th May 2020, 23:59   #3  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,048
"After" is meaningless when the pages aren't in any kind of order or organizational structure.
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.
Katie Boundary is offline   Reply With Quote
Old 25th May 2020, 00:16   #4  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
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 ???
StainlessS is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 17:24.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.