bumpDistortion()
Distorts an image with a concave or convex bump.
Declaration
class func bumpDistortion() -> any CIFilter & CIBumpDistortionReturn Value
The distorted image.
Discussion
This method applies the bump distortion filter to an image. This effect creates a concave or convex bump defined by the scale. A value of 0.0 has no effect, while a positive value creates an outward curvature and a negative value creates an inward curvature.
The bump distortion filter uses the following properties:
inputImageAn image with the type CIImage.
radiusA
floatrepresenting the amount of pixels the filter uses to create the distortion as an NSNumber.centerA CGPoint representing the center of the effect.
scaleA
floatrepresenting the curvature of the bump effect as an NSNumber.
The following code creates a filter that results in a concave bump distorting the image:
func bump(inputImage: CIImage) -> CIImage {
let filter = CIFilter.bumpDistortion()
filter.inputImage = inputImage
filter.center = CGPoint(x: 500, y: 500)
filter.radius = 1200
filter.scale = 2
return filter.outputImage!
}[Image]