Home
RecentChanges

Search:

» AviSynth is a powerful video FrameServer for Win32.

AviSynth Links:
»Download
»Learn to script
»FAQ
»Manual
»Discussion fora
»Project page
»External filters
»FeedBack

» You can add pages to this website immediately. No login required.
Edit this document

» AboutAviSynth

 

Avisynth 
Logo

FunctionArguments

( Diese Seite in flag-germany.gif deutsch )

Functions in AviSynth may have several arguments.

Some of these arguments can be mandatory (they have to be assigned), others can be optional (they can be omitted). The optional parameters shall get a default value if they are not assigned during the function call.

In the definition of a user defined function, mandatory parameters are declared as a pair of data type and argument name; for optional parameters, the argument name is surrounded by double quotes.

In user defined functions, like in most of the kernel functions, all mandatory arguments have to be declared as the first arguments from the left. Optional parameters may then follow to the right of the mandatory arguments.

Note: In functions, which use a variable of the data type clip, omitting this argument is allowed by the implicit assignment of the clip last as the previous processing step. In this context, it looks like an exception.

Mandatory arguments are identified by their position on call -- they are always "positional arguments". They have to be assigned in the order which was declared in the function definition. Using their name in assignments is not valid on call.

Optional arguments can follow the mandatory arguments completely or at least in a row from the left in defined order. In this case, they are identified by their position as well. But if they are not assigned all together, then they have to be identified by their name from the position where their order differs from the one in the definition -- they become "named arguments".


Example:

Subtitle (clip clip, string text, int "x", int "y", int "first_frame", int "last_frame", string "font", int "size", int "text_color", int "halo_color", int "align" int "spc")

  • The first clip is optional due to the implicit binding to the last clip.
  • The string argument ''text' ist mandatory, thus has to be assigned without its name.
  • All the following arguments are optional - they are assigned either completely or at least from the left in the defined order, or some of them by their name in any order.

Subtitle([last,] "Test", 200, 100, size=18, font="Arial")


ConvertToRGB (clip [, string "matrix"], bool "interlaced")

Optional positional argument in the middle: This kind of declaration cannot be used in user defined functions!

SourceForge Logo

 


Edit this document | View document history
Document last modified Thu, 26 Aug 2004 07:37:35