Filter Factory functions

Back to main page

This list of functions and the size of the assembly code is for the Windows 3.00 and 3.0.4 version. There are implementation differences in the versions 3.00a (beta version) and 3.00b (internal build).

Function Synonyms
(UNDOCUMENTED!)
Type ASM Size
(V. 3.0.4)
(V. 3.1.1)
Description

Core functions (internal names)

error   special (For internal use only. Reserved token name. Can usually not be called.) 3 For internal use. Gets called in the case that a syntax error appeared.
prolog 8 For internal use. Gets called at the beginning of the compiled channel asm code.
epilog 6 For internal use. Gets called at the end of the compiled channel asm code.
number 1(+4) For internal use. ASM-Prefix to every number. The number itself is +4 byte ASM size.
negate   unary op, special 4 For internal use only. The real sign is "-a".

Operators and control structures

a?b:c   operator 11-1 If a then b else c
a,b   infix operator 1 Inside a function: Separates two expressions.
Outside a function: "Forget everything" and start over again.
!a   unary operator 9 Logical "not"
a&&b   infix operator 19-5 Logical "and"
a||b   infix operator 19-5 Logical "or"
~a   unary operator 4 Bitwise "not"
a&b   infix operator 5 Bitwise "and"
a|b   infix operator 5 Bitwise "or"
a^b   infix operator 5 Bitwise "xor"
a==b   infix operator 13-3 Values equal
a!=b   infix operator 13-3 Values not equal
a<b   infix operator 13-3 a is smaller than b
a<=b   infix operator 13-3 a is smaller or equal b
a>b   infix operator 13-3 a is greater than b
a>=b   infix operator 13-3 a is greater or equal b
a<<b   infix operator 5 Bitwise shift left
a>>b   infix operator 5 Bitwise shift right
a+b   infix operator 5 Addition
a-b   infix operator 5 Subtraction
a*b   infix operator 6 Multiplication
a/b infix operator 14 Division
a%b   infix operator 14 Modulo

Symbols (constants or calculated)

r r0, r1 pixel-specific constant 3 Value of the red channel.
g g0, g1 pixel-specific constant 4 Value of the green channel.
b b0, b1 pixel-specific constant 4 Value of the blue channel.
a a0, a1 pixel-specific constant 4 Value of the alpha channel.
c c0, c1 pixel-specific constant 10 Value of the current channel, whichever channel the expression is defining
i i0, i1 pixel-specific constant 55-15 Y value of the YUV color space.
u u0, u1 pixel-specific constant 51-8 U value of the YUV color space.
v v0, v1 pixel-specific constant 39+5 V value of the YUV color space.
d d0, d1 pixel-specific constant 117 Direction (angle) of the current pixel from the center of the image, where d is an integer between -512 and 512, inclusive
m m0, m1 pixel-specific constant 77 Distance (magnitude) from the center of the image to the current pixel
R rmax absolute constant 6-1 Max channel value for r; always 255.
G gmax absolute constant 6-1 Max channel value for g; always 255.
B bmax absolute constant 6-1 Max channel value for b; always 255.
A amax absolute constant 6-1 Max channel value for a; always 255.
C cmax absolute constant 6-1 Max channel value for c; always 255.
I imax absolute constant 6-1 Max value for i; always 255.
U umax absolute constant 6-1 Max value for u; always 255.
V vmax absolute constant 6-1 Max value for v; always 255.
D dmax absolute constant 6-1 Range of angles within the image, where dmin is always 0 and D is always 1024
M mmax pixel-specific constant 53 Range of magnitudes with the image, where mmin is always 0 and M is always one half the diagonal size of the image
x   pixel-specific constant 4 x coordinate of the current pixel
y   pixel-specific constant 4 y coordinate of the current pixel
z p pixel-specific constant 4 Channel index for the current expression
X xmax picture-specific constant 4 Range of horizontal coordinates over the width of the image (= Width of the picture = max "x" plus 1)
Y ymax picture-specific constant 4 Range of vertical coordinates over the height of the image (= Height of the picture = max "y" plus 1)
Z zmax, pmax picture-specific constant 4 Range of channel indexes within one pixel (= max "c" plus 1)
xmin   absolute constant 4 Smallest x coodinate; always 0
ymin   absolute constant 4 Smallest y coodinate; always 0
zmin   absolute constant 4 Smallest channel number; always 0.
rmin   absolute constant 3-1 UNDOCUMENTED! Smallest red value; always 0
  gmin absolute constant   UNDOCUMENTED! Smallest green value; always 0
  bmin absolute constant   UNDOCUMENTED! Smallest blue value; always 0
  amin absolute constant   UNDOCUMENTED! Smallest alpha value; always 0
  cmin absolute constant   UNDOCUMENTED! Smallest value of c; always 0.
  imin absolute constant   UNDOCUMENTED! Smalled Y' value in YUV color space; always 0.
  umin absolute constant   UNDOCUMENTED! Smalled U value in YUV color space; always 0.
  vmin absolute constant   UNDOCUMENTED! Smalled V value in YUV color space; always 0.
  dmin absolute constant   UNDOCUMENTED! Smallest possible direction (angle) of the current pixel from the center of the image; always 0.
  mmin absolute constant   UNDOCUMENTED! Smalltest possible distance (magnitude) from the center of the image to the current pixel; always 0.
  pmin absolute constant   UNDOCUMENTED! For compatibility with Adobe Premiere. Always 0.
  t absolute constant   UNDOCUMENTED! Current frame (only for Adobe Premiere); always 0.
  tmin absolute constant   UNDOCUMENTED! Minimum number of frames (only for Adobe Premiere). Always 0.
tmax total, T absolute constant 6-4 UNDOCUMENTED! Total number of frames (used only in Adobe Premiere). In some documentations, "T" seems to be an alias too, but not in this FF; always returns 1. Alias "T" was added with in the Inofficial patch.

Functions

min(a,b)   function 9 Lesser of a and b
max(a,b)   function 9 Greater of a and b
abs(a)   function 7 Absolute value of a.
add(a,b,c)   function 12 Sum of a and b, or c, whichever is lesser
sub(a,b,c)   function 12 Difference of a and b, or c, whichever is greater
dif(a,b)   function 10 Absolute value of the difference of a and b
mix(a,b,n,d)   function 32-3 Mixture of a and b by fraction n/d. The definition is: a*n/d+b*(d-n)/d
scl(a,il,ih,ol,oh)   function 39 Scale a from input range (il to ih) to output range (ol to oh)
sqr(x) sqrt function 31 Square root of x
Synonym sqrt(x) only available in Premiere FilterFactory/TransitionFactory. It was added in Inofficial patch.
rnd(a,b)   function 82 Random number between a and b, inclusive
Note: Modifies internal state
rst(x)   function 10-1 UNDOCUMENTED! Sets a seed for rnd(). Parameter i has the range of 0..32767 .
Note: Modifies internal state
ctl(i)   function 17-2 Value of slider i, where i is an integer between 0 and 7, inclusive.
val(i,a,b)   function 34-1 Value of slider i, mapped onto the range a to b
map(i,n)   function 48-2 Item n from mapping table i, where i is an integer between 0 and 3, inclusive, and n is and integer between 0 and 255, inclusive
src(x,y,z) src0, src1 function 94 Channel z for the pixel at coordinates x,y
cnv(...) cnv0, cnv1 function 187+160 "Convolve". Applies a convolution matrix and divides with d.
Attention: Crashes in 3.0.4 because of bad programming (use src workaround or the inofficial patch).
rad(d,m,z) rad0, rad1 function 158 Channel z in the source image, which is m units away, at an angle of d, from the center of the image
c2d(x,y)   function 97 Angle displacement of the pixel at coordinates x,y
c2m(x,y)   function 57 Magnitude displacement of the pixel at coordinates x,y
r2x(d,m)   function 31 x displacement of the pixel m units away, at an angle of d, from an arbitrary center
r2y(d,m)   function 37 y displacement of the pixel m units away, at an angle of d, from an arbitrary center
sin(x)   function 32 Sine function of x, where x is an integer between 0 and 1024, inclusive, and the value returned is an integer between -512 and 512, inclusive (Windows) or -1024 and 1024, inclusive (Mac OS)
cos(x)   function 27 Cosine function of x, where x is an integer between 0 and 1024, inclusive, and the value returned is an integer between -512 and 512, inclusive (Windows) or -1024 and 1024, inclusive (Mac OS)
tan(x)   function 60 Unbounded Tangent function of x, where x is an integer between -256 and 256, inclusive
get(i)   function 20-4 Returns the current cell value at i
put(v,i)   function 21-4 Puts the new value v into cell i
Note: Modifies internal state
pow(b,e)   function 54 Calculates the base to the exponent power, that is, be.
This function was added with Inofficial patch.
debug   unknown ? Special function in Premiere (causes crash).
dbg(i)   unknown 1 The function dbg(i) only exists in Filter Foundry on Macintosh and WILL crash the WHOLE SYSTEM, seriously!