The expression in the editor will be ran on all pixels.

You can use plain math syntax, sin, cos, the ternary operator (?:).

The result can be a 3 component array that will be interpreted as rgb values:

[0.3, cos(x * 10), 0.0]

The result can also be a single value that will be interpreted as grayscale.

cos(3 * sqrt(x^2 + y ^2))

Have a look at the math js syntax here: http://mathjs.org/docs/expressions/syntax.html