circleSplashDistortion()
Distorts an image with radiating circles to the periphery of the image.
Declaration
class func circleSplashDistortion() -> any CIFilter & CICircleSplashDistortionReturn 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:
inputImageAn image with the type CIImage.
radiusA
floatrepresenting the amount in pixels the filter uses to create the distortion as an NSNumber.centerA 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]