lenticularHaloGenerator()
Generates a lenticular halo image.
Declaration
class func lenticularHaloGenerator() -> any CIFilter & CILenticularHaloGeneratorReturn 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:
centerA
vectorrepresenting the center of the lens flare as a CIVector.colorA CIColor controlling the proportion of red, green, and blue halos.
haloWidthA
floatrepresenting the halo width as an NSNumber.haloRadiusA
floatrepresenting the halo radius as an NSNumber.haloOverlapA
floatrepresenting the overlap of red, green, and blue halos as an NSNumber. A value of 1 results in a full overlap.striationStrengthA
floatrepresenting the brightness of the rainbow-colored halo area as an NSNumber.striationContrastA
floatrepresenting the contrast of the rainbow-colored halo area as an NSNumber.timeA
floatrepresenting 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
attributedTextImageGenerator()aztecCodeGenerator()barcodeGenerator()blurredRectangleGenerator()checkerboardGenerator()code128BarcodeGenerator()meshGenerator()pdf417BarcodeGenerator()qrCodeGenerator()randomGenerator()roundedRectangleGenerator()roundedRectangleStrokeGenerator()starShineGenerator()stripesGenerator()sunbeamsGenerator()