Begins a smooth transition from the current zoom factor to another.
SDKs
- iOS 7.0+
- Mac Catalyst 13.0+
Framework
- AVFoundation
Declaration
Parameters
factor
The new magnification factor.
rate
The rate at which to transition to the new magnification factor, specified in powers of two per second.
Discussion
Allowed values for factor
range from 1
(full field of view) to the video
specified by the active capture format.
During a ramp, the zoom factor changes at an exponential rate, but this yields a visually linear transition. The rate
parameter controls the speed of this transition independent of direction; for example, a value of 1
causes zoom factor to double every second if zooming in (that is, if the specified factor
is greater than the current video
) or halve every second if zooming out.
Before calling this method, you must call lock
to acquire exclusive access to the device’s configuration properties. If you do not, calling this method raises an exception. When you finish configuring the device, call unlock
to release the lock and allow other devices to configure the settings.