Contents

clamped(to:)

Returns a new image created by cropping to a specified area, then making the pixel colors along the edges of the cropped image extend infinitely in all directions.

Declaration

func clamped(to rect: CGRect) -> CIImage

Parameters

  • rect:

    The rectangle, in image coordinates, to which to crop the image.

Return Value

An image object representing the result of the clamp operation.

Discussion

Calling this method is equivalent to cropping the image (with the cropped(to:) method or the CICrop filter), then using the clampedToExtent() method (or the CIAffineClamp filter), which creates an image of infinite extent by repeating pixel colors from the edges of the cropped image.

See Also

Creating an Image by Modifying an Existing Image