fourfoldTranslatedTile()
Creates a tiled image by applying four translation operations.
Declaration
class func fourfoldTranslatedTile() -> any CIFilter & CIFourfoldTranslatedTileReturn Value
The tiled image.
Discussion
This method applies the four-fold translated tile filter to an image. The effect produces a four-way tiled image by applying four translation operations. Translation operations map the position of each element in the photo to a new position in the output image.
The four-fold translated 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. This controls the source of the tile contents.
angleA
floatrepresenting the direction of the tiled patten, in radians as an NSNumber.widthA
floatrepresenting the set width of each tile as an NSNumber.acuteAngleA
floatrepresenting the primary angle for the repeating translated tile as an NSNumber.
The following code creates a filter that performs a four-fold translated tile operation on the image:
func fourFoldTranslated(inputImage: CIImage) -> CIImage {
let fourFoldTranslatedTile = CIFilter.fourfoldTranslatedTile()
fourFoldTranslatedTile.inputImage = inputImage
fourFoldTranslatedTile.center = CGPoint(x: inputImage.extent.midX, y: inputImage.extent.midY)
fourFoldTranslatedTile.angle = 1
fourFoldTranslatedTile.width = 400
fourFoldTranslatedTile.acuteAngle = 1
return fourFoldTranslatedTile.outputImage!.cropped(to: inputImage.extent)
}[Image]