fourfoldReflectedTile()
Creates a four-way reflected pattern.
Declaration
class func fourfoldReflectedTile() -> any CIFilter & CIFourfoldReflectedTileReturn Value
The tiled image.
Discussion
This method applies the four-fold reflected tile filter to an image. The effect produces a four-way reflected tile image.
The four-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.acute angleA
floatrepresenting the primary angle for the repeating parallelogram tile as an NSNumber.
The following code creates a filter that results in a four-fold pattern:
func fourFoldReflected(inputImage: CIImage) -> CIImage {
let fourFoldReflectedTile = CIFilter.fourfoldReflectedTile()
fourFoldReflectedTile.inputImage = inputImage
fourFoldReflectedTile.center = CGPoint(x: 150, y: 150)
fourFoldReflectedTile.width = 10
fourFoldReflectedTile.angle = 7
fourFoldReflectedTile.acuteAngle = 1
return fourFoldReflectedTile.outputImage!
}[Image]