| 3414 | } |
| 3415 | |
| 3416 | function splash(img, dx, dy, radius) { |
| 3417 | /* Returns the image with a light-tunnel distortion applied to it. |
| 3418 | * - dx: horizontal offset (in pixels) of the effect. |
| 3419 | * - dy: vertical offset (in pixels) of the effect. |
| 3420 | * - radius: the radius of the unaffected area in pixels. |
| 3421 | */ |
| 3422 | var m = radius || 0; |
| 3423 | return polar(img, dx, dy, function(d, a) { |
| 3424 | return [(d > m)? m : d, a]; |
| 3425 | }); |
| 3426 | } |
| 3427 | |
| 3428 | function twirl(img, dx, dy, radius, angle) { |
| 3429 | /* Returns the image with a twirl distortion applied to it. |