starShineGenerator()
Generates a star-shine image.
Declaration
class func starShineGenerator() -> any CIFilter & CIStarShineGeneratorReturn Value
The generated image.
Discussion
This method generates a star-shine image. The effect is similar to a supernova effect. You can use this filter to simulate a lens flare.
The star-shine generator filter uses the following properties:
centerA
vectorrepresenting the center of the flare as a CGPoint.colorA color representing the color of the flare as a cgColor.
radiusA
floatrepresenting the radius of the flare as an NSNumber.crossScaleA
floatrepresenting the cross flare size relative to the round central flare as an NSNumber.crossAngleA
floatrepresenting the angle of the flare as an NSNumber.crossOpacityA
floatrepresenting the thickness of the cross opacity as an NSNumber.crossWidthA
floatrepresenting the cross width as an NSNumber.epsilonA
floatrepresenting the epsilon as an NSNumber.
The following code generates a star-shaped silhouette with a black background.
func starShine() -> CIImage {
let starShineGenerator = CIFilter.starShineGenerator()
starShineGenerator.center = CGPoint(x: 150, y: 150)
starShineGenerator.color = .green
starShineGenerator.radius = 50
starShineGenerator.crossScale = 15
starShineGenerator.crossAngle = 0.60
starShineGenerator.crossOpacity = -2
starShineGenerator.crossWidth = 2.5
starShineGenerator.epsilon = -2.0
return starShineGenerator.outputImage!
}[Image]
See Also
Filters
attributedTextImageGenerator()aztecCodeGenerator()barcodeGenerator()blurredRectangleGenerator()checkerboardGenerator()code128BarcodeGenerator()lenticularHaloGenerator()meshGenerator()pdf417BarcodeGenerator()qrCodeGenerator()randomGenerator()roundedRectangleGenerator()roundedRectangleStrokeGenerator()stripesGenerator()sunbeamsGenerator()