discBlur()
Applies a circle-shaped blur to an area of an image.
Declaration
class func discBlur() -> any CIFilter & CIDiscBlurReturn Value
The blurred image.
Discussion
This method applies the disc blur filter to an image. The effect targets the pixels within a circle defined by a radius and calculates the median color value to create to the output image.
The disc blur filter uses the following properties:
radiusA
floatrepresenting the area of effect as an NSNumber.inputImageA CIImage representing the input image to apply the filter to.
The following code creates a filter that adds a strong blur to the input image:
func discBlur(inputImage: CIImage) -> CIImage? {
let discBlurFilter = CIFilter.discBlur()
discBlurFilter.inputImage = inputImage
discBlurFilter.radius = 8
return discBlurFilter.outputImage
}[Image]