randomGenerator()
Generates a random filter image.
Declaration
class func randomGenerator() -> any CIFilter & CIRandomGeneratorMentioned in
Return Value
The generated image.
Discussion
This method generates an image with infinite extent. The image pixels values are from one of four independent, uniformly distributed random colors.
The following code creates a filter that generates a random color image:
func random() -> CIImage {
let randomGenerator = CIFilter.randomGenerator()
return randomGenerator.outputImage!
}[Image]
See Also
Filters
attributedTextImageGenerator()aztecCodeGenerator()barcodeGenerator()blurredRectangleGenerator()checkerboardGenerator()code128BarcodeGenerator()lenticularHaloGenerator()meshGenerator()pdf417BarcodeGenerator()qrCodeGenerator()roundedRectangleGenerator()roundedRectangleStrokeGenerator()starShineGenerator()stripesGenerator()sunbeamsGenerator()