Contents

kaleidoscope()

Creates a 12-way kaleidoscopic image from an image.

Declaration

class func kaleidoscope() -> any CIFilter & CIKaleidoscope

Return Value

The tiled image.

Discussion

This method applies the kaleidoscope tile filter to an image. The effect produces a complex 12-way symmetrical reflected pattern from the input image.

The kaleidoscope tile filter uses the following properties:

inputImage

An image with the type CIImage.

center

A set of coordinates marking the center of the image as a CGPoint.

angle

A float representing the direction of distortion, in radians as an NSNumber.

count

A float representing the number of reflections in the pattern as an NSNumber.

The following code creates a filter that results in the creation of a kaleidoscope effect from the input image:

func kaleidoscope(inputImage: CIImage) -> CIImage {
    let kaleidoscopeEffect = CIFilter.kaleidoscope()
    kaleidoscopeEffect.inputImage = inputImage
    kaleidoscopeEffect.count = 6
    kaleidoscopeEffect.center = CGPoint(x: 150, y: 150)
    kaleidoscopeEffect.angle = 0
    return kaleidoscopeEffect.outputImage!
}

[Image]

See Also

Filters