Contents

affineClamp()

Performs a transform on the image and extends the image edges to infinity.

Declaration

class func affineClamp() -> any CIFilter & CIAffineClamp

Return Value

The tiled image.

Discussion

This method applies the affine clamp filter to an image. This effect performs similarly to the affine transform filter except that it produces an infinite image. You can use this filter when you need to blur an image but you want to avoid a soft, black fringe along the edges.

The affine clamp filter uses the following properties:

inputImage

An image with the type CIImage.

transform

A CGAffineTransform to constrain to the image.

The following code creates a filter that produces a cropped image with colored edges to fill the rest of the image:

func affineClamp(inputImage: CIImage) -> CIImage {
    let affineClamp = CIFilter.affineClamp()
    affineClamp.inputImage = inputImage
    affineClamp.transform = CGAffineTransform(a: 1.0, b: 0.0, c: 0.0, d: 1.0, tx: 0.0, ty: 0.0)
    return affineClamp.outputImage!
}

[Image]

See Also

Filters