fourfoldRotatedTile()
Creates a tiled image by rotating a tile in increments of 90 degrees.
Declaration
class func fourfoldRotatedTile() -> any CIFilter & CIFourfoldRotatedTileReturn Value
The tiled image.
Discussion
This method applies the four-fold rotated tile filter to an image. The effect produces a tiled image by rotating a tile from the iput image in increments of 90 degrees.
The four-fold rotated 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 the flowers in the input image becoming rotated by 90 degrees and tiled:
func fourFoldRotated(inputImage: CIImage) -> CIImage {
let fourFoldRotatedTile = CIFilter.fourfoldRotatedTile()
fourFoldRotatedTile.inputImage = inputImage
fourFoldRotatedTile.center = CGPoint(x: 150, y: 150)
fourFoldRotatedTile.angle = 10
fourFoldRotatedTile.width = 10
return fourFoldRotatedTile.outputImage!
}[Image]