Contents

lenticularHaloGenerator()

Generates a lenticular halo image.

Declaration

class func lenticularHaloGenerator() -> any CIFilter & CILenticularHaloGenerator

Return Value

The generated image.

Discussion

This method generates a lenticular halo image. You commonly combine this effect with an image to simulate a halo generated by the spread of light on a lens.

The lenticular halo generator filter uses the following properties:

center

A vector representing the center of the lens flare as a CIVector.

color

A CIColor controlling the proportion of red, green, and blue halos.

haloWidth

A float representing the halo width as an NSNumber.

haloRadius

A float representing the halo radius as an NSNumber.

haloOverlap

A float representing the overlap of red, green, and blue halos as an NSNumber. A value of 1 results in a full overlap.

striationStrength

A float representing the brightness of the rainbow-colored halo area as an NSNumber.

striationContrast

A float representing the contrast of the rainbow-colored halo area as an NSNumber.

time

A float representing the addition of brightness to the halo as an NSNumber.

The following code creates a filter that generates a lenticular halo image:

func lenticularHalo() -> CIImage {
    let lenticularHaloGenerator = CIFilter.lenticularHaloGenerator()
    lenticularHaloGenerator.center = CGPoint(x: 200, y: 200)
    lenticularHaloGenerator.color = CIColor(red: 1.2, green: 2.7, blue: 2.5)
    lenticularHaloGenerator.haloWidth = 87
    lenticularHaloGenerator.haloRadius = 70
    lenticularHaloGenerator.haloOverlap = 0.77
    lenticularHaloGenerator.striationStrength = 0.50
    lenticularHaloGenerator.striationContrast = 1.00
    lenticularHaloGenerator.time = 0.00
    return lenticularHaloGenerator.outputImage!
}

[Image]

See Also

Filters