parallelogramTile()
Warps the image to create a parallelogram and tiles the result.
Declaration
class func parallelogramTile() -> any CIFilter & CIParallelogramTileReturn Value
The tiled image.
Discussion
This method applies the parallelogram tile filter to an image. The effect warps the input image to create a parallelogram and then tiles the result.
The parallelogram tile filter uses the following properties:
- inputImage
An 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.acuteAngleA
floatrepresenting the primary angle for the repeating parallelogram tile.
The following code creates a filter that results in the image being cropped to a parallelogram and then tiled:
func parallelogram(inputImage: CIImage) -> CIImage {
let parallelogramTile = CIFilter.parallelogramTile()
parallelogramTile.inputImage = inputImage
parallelogramTile.center = CGPoint(x: 150, y: 150)
parallelogramTile.angle = 0
parallelogramTile.acuteAngle = 1.57
parallelogramTile.width = 100
return parallelogramTile.outputImage!
}[Image]