Contents

circleSplashDistortion()

Distorts an image with radiating circles to the periphery of the image.

Declaration

class func circleSplashDistortion() -> any CIFilter & CICircleSplashDistortion

Return Value

The distorted image.

Discussion

This method applies the circle splash distortion filter to an image. This effect distorts the pixels starting at the circumference of a circle and emanating outward.

The circle splash distortion filter uses the following properties:

inputImage

An image with the type CIImage.

radius

A float representing the amount in pixels the filter uses to create the distortion as an NSNumber.

center

A CGPoint representing the center of the image.

The following code creates a filter that results in a ripple effect applied to the image:

func circularSplash(inputImage: CIImage) -> CIImage {
    let filter = CIFilter.circleSplashDistortion()
    filter.inputImage = inputImage
    filter.center = CGPoint(x: 50.0, y: 50.0)
    filter.radius = 2.0
    return filter.outputImage!
}

[Image]

See Also

Filters