Contents

heightFieldFromMask()

Creates a realistic shaded height-field image.

Declaration

class func heightFieldFromMask() -> any CIFilter & CIHeightFieldFromMask

Return Value

The modified image.

Discussion

This method applies the height-field from the mask filter to an image. The effect targets the white in the input image and creates realistic shading.

The height field from mask filter uses the following properties:

inputImage

An image with the type CIImage.

radius

A float representing the area of effect as an NSNumber.

The following code creates a filter that results in the text having a shading effect:

func heightFieldFromMask(inputImage: CIImage) -> CIImage {
    let heightFieldFromMaskFilter = CIFilter.heightFieldFromMask()
    heightFieldFromMaskFilter.inputImage = inputImage
    heightFieldFromMaskFilter.radius = 3
    return heightFieldFromMaskFilter.outputImage!
}

[Image]

See Also

Filters