sunbeamsGenerator()
Generates an image resembling the sun.
Declaration
class func sunbeamsGenerator() -> any CIFilter & CISunbeamsGeneratorReturn Value
The generated image.
Discussion
This method generates a sunbeam as an image. The effect generates a center-textured sun with striations. You can combine with other filters to create more sophisticated images.
The sunbeams generator filter uses the following properties:
centerA vector representing the center of the image as a CIVector.
colorA CIColor representing the color of the sun.
sunRadiusA
floatrepresenting the radius of the center sun as an NSNumber.maxStriationRadiusA
floatrepresenting the striation radius as an NSNumber.striationStrengthA
floatrepresenting the striation strength as an NSNumber.striationContrastA
floatrepresenting the striation contrast as an NSNumber.timeA
floatrepresenting the time as an NSNumber.
The following code creates a filter that generates an image that resembles a yellow sun with sunbeams:
func sunBeam () -> CIImage {
let sunBeamGenerator = CIFilter.sunbeamsGenerator()
sunBeamGenerator.center = CGPoint(x: 150, y: 150)
sunBeamGenerator.color = CIColor(red: 0.96, green: 1, blue: 1, alpha: 1)
sunBeamGenerator.sunRadius = 40
sunBeamGenerator.maxStriationRadius = 2.58
sunBeamGenerator.striationStrength = 0.50
sunBeamGenerator.striationContrast = 1.38
sunBeamGenerator.time = 0
return sunBeamGenerator.outputImage!
}[Image]
See Also
Filters
attributedTextImageGenerator()aztecCodeGenerator()barcodeGenerator()blurredRectangleGenerator()checkerboardGenerator()code128BarcodeGenerator()lenticularHaloGenerator()meshGenerator()pdf417BarcodeGenerator()qrCodeGenerator()randomGenerator()roundedRectangleGenerator()roundedRectangleStrokeGenerator()starShineGenerator()stripesGenerator()