Author
Travis Kirton


Twirl

This example shows how you can apply a twirl filter to an image.

let filter = Twirl()
//change filter settings
img.apply(filter)

Example

let image = Image("chop")!
image.constrainsProportions = true
image.width = canvas.width
image.center = canvas.center
canvas.add(image)

var filter = Twirl()
filter.center = Point(0.5, 0.5)
filter.angle = 2*M_PI
filter.radius = 200
image.apply(filter)