User Manual

Table Of Contents
These two expressions are evaluated at the beginning of each frame. S1 divides 1.0
by the current width of the frame, and S2 divides 1.0 by the height. This provides a
floating-point value between 0.0 and 1.0 that represents the distance from the
current pixel to the next pixel along each axis.
Now enter the following expression into the first text control of the Channel tab (r).
(getr1w(x-s1, y-s2) + getr1w(x, y-s2) + getr1w(x+s1, y-s2) + getr1w(x+s1,
y) + getr1w(x-s1, y) + r1 +getr1w(x-s1, y+s2) + getr1w(x, y+s2) +
getr1w(x+s1, y+s2)) / 9
This expression adds together the nine pixels above the current pixel by calling the
getr1w() function nine times and providing it with values relative to the current position.
Note that we referred to the pixels by using x+s1, y+s2, rather than using x+1, y+1.
Fusion refers to pixels as floating-point values between 0.0 and 1.0, which is why we
created the expressions we used in the Setup tab. If we had used x+1, y+1 instead, the
expression would have sampled the same pixel over and over again. (The function we
used wraps the pixel position around the image if the offset values are out of range.)
That took care of the red channel; now use the following expressions for the green,
blue, and Alpha channels.
(getg1w(x-s1, y-s2) + getg1w(x, y-s2) + getg1w(x+s1, y-s2) + getg1w(x+s1,
y) + getg1w(x-s1, y) + g1 +getg1w(x-s1, y+s2) + getg1w(x, y+s2) +
getg1w(x+s1, y+s2)) / 9
(getb1w(x-s1, y-s2) + getb1w(x, y-s2) + getb1w(x+s1, y-s2) + getb1w(x+s1,
y) + getb1w(x-s1, y) + b1 +getb1w(x-s1, y+s2) + getb1w(x, y+s2) +
getb1w(x+s1, y+s2)) / 9
(geta1w(x-s1, y-s2) + geta1w(x, y-s2) + geta1w(x+s1, y-s2) + geta1w(x+s1,
y) + geta1w(x-s1, y) + a1 + geta1w(x-s1, y+s2) + geta1w(x, y+s2) +
geta1w(x+s1, y+s2)) / 9
It’s time to view the results. Add a Background node set to a solid color and change the
color to a pure red. Add a hard-edged Rectangular effects mask and connect it to the
expression just created.
For comparison, add a Custom Filter node and duplicate the settings from the image
above. Connect a pipe to this node from the background to the node and view the
results. Alternate between viewing the Custom Tool node and the Custom Filter while
zoomed in close to the top corners of the effects mask.
Of course, the Custom Filter node renders a lot faster than the Custom Tool node we
created, but the flexibility of the Custom Tool node is its primary advantage. For
example, you could use an image connected to input 2 to control the median applied to
input one by changing all instances of getr1w, getg1w, and getb1w in the expression to
getr2w, getg2w, and getb2w, but leaving the r1, g1, and b1s as they are.
This is just one example; the possibilities of the Custom Tool node are limitless.
Common Controls
Settings Tab
The Settings tab in the Inspector is also duplicated in other miscellaneous nodes. These
common controls are described in detail at the end of this chapter in “The Common
Controls” section.
Chapter – 100 Miscellaneous Nodes 2218