Contents

videoZoomFactor

A value that controls the cropping and enlargement of images captured by the device.

Declaration

var videoZoomFactor: CGFloat { get set }

Mentioned in

Discussion

This value is a multiplier. For example, a value of 2.0 doubles the size of an image’s subject (and halves the field of view). Allowed values range from 1.0 (full field of view) to the value of the active format’s videoMaxZoomFactor property. Setting the value of this property jumps immediately to the new zoom factor. For a smooth transition, use the ramp(toVideoZoomFactor:withRate:) method.

The device achieves a zoom effect by cropping around the center of the image captured by the sensor. At low zoom factors, the cropped images is equal to or larger than the output size. At higher zoom factors, the device must scale the cropped image up to the output size, resulting in a loss of image quality. The active format’s videoZoomFactorUpscaleThreshold property indicates the factors at which upscaling occurs.

Before changing the value of this property, you must call lockForConfiguration() to acquire exclusive access to the device’s configuration properties. Otherwise, setting the value of this property raises an exception. When you finish configuring the device, call unlockForConfiguration() to release the lock and allow other devices to configure the settings.

See Also

Adjusting zoom