Contents

randomGenerator()

Generates a random filter image.

Declaration

class func randomGenerator() -> any CIFilter & CIRandomGenerator

Mentioned 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