2011

Table Of Contents
Variable Declarations
The naming of variables uses the same rules as C. A variable name must begin
with an alphabetical character, followed by none or more alphanumeric
characters or underscore character. It must not contain any white spaces.
All variables are initialized by Composite upon declaration, depending on
type:
Float variables are initialized to 0.
Color / vec4 variables are initialized to (0, 0, 0, 1).
Image variables are initialized to an uninitialized image. An uninitialized
image will return (0, 0, 0, 1) on sample(), has a pixel aspect ratio of 0, and
has a size of (0, 0).
Numeric Constants
Built-in Variables
PXL has built-in variables to ease script writing. These variables are x, y,
and t. The first two are the floating-point normalized image reference frame
(x, y) coordinates of the pixel being computedsee
Calculating Image Size in
Composite
on page 191. t is the floating-point current time, in seconds. All
built-in variables are declared constant by the system, so they cannot be
assigned to. PXL exposes the IRF coordinates of each pixel in its x and y built-in
variables. This means that in PXL horizontally adjacent pixels will have a
value of the x built-in variable that differs by 0.9 for an NTSC image. Thus,
an NTSC image (with 720x486 pixels) is actually 648x486 IRF units (720 * 0.9
= 648), which represents a 4:3 image aspect ratio (648/486 = 4/3), as expected.
Built-in Functions
PXL provides a number of built-in functions. Functions can return any of the
PXL fundamental types, or can return void. Built-in function argument
460 | Chapter 18 Pixel Expressions