blurredRectangleGenerator()
Generates a blurred rectangle.
Declaration
class func blurredRectangleGenerator() -> any CIFilter & CIBlurredRectangleGeneratorReturn Value
A CIImage containing a blurred rectangle.
Discussion
Creates a CIImage containing a blurred rectangle. The resulting image size is the extent of the rectangle plus any additional space required for the blur effect.
The blurred rectangle filter uses the following properties:
extentA CGRect that defines the extent of the effect.
colorA CIColor specifying the color of the rectangle.
sigmaA
floatspecifying the sigma for the Gaussian blur.
The following code creates a filter that generates a blurred red rectangle with a width of 200 x 100 pixels.
func blurredRectangle() -> CIImage {
let filter = CIFilter.blurredRectangleGenerator()
filter.extent = CGRect(x: 0, y: 0, width: 200, height: 100)
filter.color = CIColor.red
filter.sigma = 10.0
return filter.outputImage!
}[Image]
See Also
Filters
attributedTextImageGenerator()aztecCodeGenerator()barcodeGenerator()checkerboardGenerator()code128BarcodeGenerator()lenticularHaloGenerator()meshGenerator()pdf417BarcodeGenerator()qrCodeGenerator()randomGenerator()roundedRectangleGenerator()roundedRectangleStrokeGenerator()starShineGenerator()stripesGenerator()sunbeamsGenerator()