Name
BarrelDistortBrush -- apply barrel distortion to brush (V5.0)
Synopsis
BarrelDistortBrush(id, ...)
BarrelDistortBrush(id, A, B, C, D[, X, Y])
BarrelDistortBrush(id, Ax, Bx, Cx, Dx, Ay, By, Cy, Dy[, X, Y])
Function
This command can be used to apply barrel distortion to the brush specified in id. You can use this function in two different ways: The first way requires you to pass at least three coefficients (A, B, C) that define the barrel distortion. Optionally, you can specify a fourth coefficient (D) and a center point for the radial distortion (X and Y). The center point has to passed in pixels whereas the coefficients must be specified as floating point values. If all coefficients add up to 1.0, there will be no change in the picture.

The second way of using this function is to provide separate coefficients for the x and y axis. In that case, you have to pass 8 coefficients (4 for every axis). As in the first variant, you can optionally specify a center point.

Finally, the optional argument smooth can be used to enable antialiased pixel interpolation which leads to a smoother appearance but takes longer to calculate.

Inputs
id
brush that shall be distorted
...
coefficients for the barrel distortion (see above)
X
optional: x coordinate of center point (defaults to half of brush width)
Y
optional: y coordinate of center point (defaults to half of brush height)
smooth
optional: whether or not anti-aliased distortion shall be used (defaults to False)

Show TOC