Contents

fourfoldTranslatedTile()

Creates a tiled image by applying four translation operations.

Declaration

class func fourfoldTranslatedTile() -> any CIFilter & CIFourfoldTranslatedTile

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

inputImage

An image with the type CIImage.

center

A set of coordinates marking the center of the image as a CGPoint. This controls the source of the tile contents.

angle

A float representing the direction of the tiled patten, 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 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]

See Also

Filters