sixfoldRotatedTile()
Creates a tiled image by rotating in increments of 60 degrees.
Declaration
class func sixfoldRotatedTile() -> any CIFilter & CISixfoldRotatedTileReturn Value
The tiled image.
Discussion
This method applies the six-fold reflected tile filter to an image. The effect produces a tiled image by rotating the image in increments 60 degrees.
The six-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 flowers in the input image becoming rotated by 60 degrees and tiled to create the output:
func sixFoldRotated(inputImage: CIImage) -> CIImage {
let sixFoldRotatedTile = CIFilter.sixfoldRotatedTile()
sixFoldRotatedTile.inputImage = inputImage
sixFoldRotatedTile.center = CGPoint(x: 150, y: 150)
sixFoldRotatedTile.angle = 0
sixFoldRotatedTile.width = 100
return sixFoldRotatedTile.outputImage!
}[Image]