Contents

parallelogramTile()

Warps the image to create a parallelogram and tiles the result.

Declaration

class func parallelogramTile() -> any CIFilter & CIParallelogramTile

Return 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.

center

A set of coordinates marking the center of the image as a CGPoint.

angle

A float representing the direction of distortion, in radians as an NSNumber.

width

A float representing the set width of each tile as an NSNumber.

acuteAngle

A float representing 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]

See Also

Filters