eightfoldReflectedTile()
Creates an eight-way reflected pattern.
Declaration
class func eightfoldReflectedTile() -> any CIFilter & CIEightfoldReflectedTileReturn Value
The tiled image.
Discussion
This method applies the eight-fold reflected tile filter to an image. The effect creates an eight-way symmetry from the input image and tiles it to create the output image.
The eight-fold reflected tile filter uses the following properties:
inputImageAn image with the type CIImage.
centerA set of coordinates marking the center of the image as a CGPoint.
angleA
floatrepresenting the direction of distortion, in radians as an NSNumber.widthA
floatrepresenting the set width of each tile as an NSNumber.
The following code creates a filter that results in small symmetrical repeated tiles:
func eightFoldReflected(inputImage: CIImage) -> CIImage {
let eightFoldReflectedTile = CIFilter.eightfoldReflectedTile()
eightFoldReflectedTile.inputImage = inputImage
eightFoldReflectedTile.center = CGPoint(x: inputImage.extent.midX, y: inputImage.extent.midY)
eightFoldReflectedTile.width = 400
eightFoldReflectedTile.angle = 1
return eightFoldReflectedTile.outputImage!
}[Image]