Contents

bumpDistortion()

Distorts an image with a concave or convex bump.

Declaration

class func bumpDistortion() -> any CIFilter & CIBumpDistortion

Return 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:

inputImage

An image with the type CIImage.

radius

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

center

A CGPoint representing the center of the effect.

scale

A float representing 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]

See Also

Filters