<AFS_program>

Parses a binary Adobe FilterFactory Save (AFS) program.

The AFS format is the *.afs text file format used by the Adobe Filter Factory to save and load the design parameters for a Filter Factory filter.

The AFS format includes a "magic" header line, 8 integer values giving the initial values of the 8 sliders, and the four Filter Factory formulas for the R, G, B, and A channels, respectively. The AFS format does not include fields for the slider labels, the Category, Title, Copyright, Author, and Filename fields, any indication as to which sliders (if any) are actually used, nor whether slider controls are grouped into map controls.

Syntax

<AFS_program> :
%RGB-1.0
<preset> //slider 0
<preset> //slider 1
<preset> //slider 2
<preset> //slider 3
<preset> //slider 4
<preset> //slider 5
<preset> //slider 6
<preset> //slider 7
<C_language_expression> <p> //channel R
<C_language_expression> <p> //channel G
<C_language_expression> <p> //channel B
<C_language_expression> [<p>] //channel A
<end_of_program>
<preset> :
(<decimal_constant>)?
<p> :
<lf><lf> | <lf><cr>

Examples

The following is an example of an AFS program file (MyFilter.afs):

    %RGB-1.0
    0 1 2 3 4 5 6 7
    (r-g)/2

    (g+b)/2

    (b/2) + ctl(0)

    255

The following is an example of a more elaborate AFS program, namely, the AFH Beveler 2.0b:

%RGB-1.0
28
201
0
76
82
149
0
8
((x<val(7,0,M))&&(y>=x)&&(y<Y-x))?scl(c,0,255,ctl(0),ctl(1)*2)+
ctl(4)-128:((y<val(7,0,M))&&(x>y)&&(x<X-y))?scl(c,0,255,ctl(0),
ctl(1)*2)-ctl(4)+128:((X-x<=val(7,0,M))&&(Y-y>=X-x)&&(y>x-X))?s
cl(c,0,255,ctl(2),ctl(3)*2)+ctl(5)-128:((Y-y<=val(7,0,M))&&(X-x
>Y-y)&&(x>y-Y))?scl(c,0,255,ctl(2),ctl(3)*2)-ctl(5)+128:c

((x<val(7,0,M))&&(y>=x)&&(y<Y-x))?scl(c,0,255,ctl(0),ctl(1)*2)+
ctl(4)-128:((y<val(7,0,M))&&(x>y)&&(x<X-y))?scl(c,0,255,ctl(0),
ctl(1)*2)-ctl(4)+128:((X-x<=val(7,0,M))&&(Y-y>=X-x)&&(y>x-X))?s
cl(c,0,255,ctl(2),ctl(3)*2)+ctl(5)-128:((Y-y<=val(7,0,M))&&(X-x
>Y-y)&&(x>y-Y))?scl(c,0,255,ctl(2),ctl(3)*2)-ctl(5)+128:c

((x<val(7,0,M))&&(y>=x)&&(y<Y-x))?scl(c,0,255,ctl(0),ctl(1)*2)+
ctl(4)-128:((y<val(7,0,M))&&(x>y)&&(x<X-y))?scl(c,0,255,ctl(0),
ctl(1)*2)-ctl(4)+128:((X-x<=val(7,0,M))&&(Y-y>=X-x)&&(y>x-X))?s
cl(c,0,255,ctl(2),ctl(3)*2)+ctl(5)-128:((Y-y<=val(7,0,M))&&(X-x
>Y-y)&&(x>y-Y))?scl(c,0,255,ctl(2),ctl(3)*2)-ctl(5)+128:c

a

Also see

Command Reference, Syntax, <FM_program>