Instance Method

setCropRectangle(_:at:)

Sets the crop rectangle value at a time within the time range of the instruction.

Declaration

func setCropRectangle(_ cropRectangle: CGRect, at time: CMTime)

Parameters

cropRectangle

The crop rectangle to be applied at the specified time.

time

A time value within the timeRange of the composition instruction.

Discussion

The origin of the crop rectangle is the top-left corner of the buffer clean aperture rectangle. The crop rectangle is defined in square pixel space, that is, without taking the pixel aspect ratio into account. Crop rectangles extending outside of the clean aperture, are cropped to the clean aperture.

Sets a fixed crop rectangle to apply from time until the next time at which a crop rectangle is set; this is the same as setting a flat ramp for that time range.

Before the first specified time for which a crop rectangle is set, the crop rectangle is held constant to infinite and after the last time for which a crop rectangle is set, the crop rectangle is held constant at that last value.

See Also

Setting Crop Rectangle Values