CameraZoom

@objc(GSCameraZoom)
public protocol CameraZoom

A camera zoom.

Zoom level can be changed either by giving a desired level (set(level:)) or by giving a desired zoom change velocity (set(velocity:)).

  • Max zoom speed setting.

    Declaration

    Swift

    var maxSpeed: DoubleSetting { get }
  • Whether zoom level changes using zoom velocity will stop at the maxLossyLevel or at the maxLossLessLevel to avoid image quality degradation. If quality degradation is not allowed, it will stop at maxLossLessZoomLevel.

    Declaration

    Swift

    var velocityQualityDegradationAllowance: BoolSetting { get }
  • Whether zoom is currently available.

    Note

    this might change according to the drone actions. For example, zoom might be temporarily unavailable if the drone is doing an animation.

    Declaration

    Swift

    var isAvailable: Bool { get }
  • Current zoom level, in focal length factor.

    1 means no zoom.

    Note

    Zoom level can be changed either by specifying a new factor with set(level:) or by specifying a zoom change velocity with set(velocity:).

    Declaration

    Swift

    var currentLevel: Double { get }
  • Maximum zoom level available on the device

    Note

    from maxLossLessLevel to this value, image quality is altered.

    Declaration

    Swift

    var maxLossyLevel: Double { get }
  • Maximum zoom level to keep image quality at its best.

    Note

    If zoom level is greater than this value, image quality will be altered.

    Declaration

    Swift

    var maxLossLessLevel: Double { get }
  • Controls the zoom.

    Unit of the target depends on the value of the mode parameter:

    • .level: target is in zoom level.1 means no zoom. This value will be clamped to the maxLossyLevel if it is greater than this value.
    • .velocity: value is in signed ratio (from -1 to 1) of maxSpeed setting value. Negative value will produce a zoom out, positive value will zoom in.

      • mode: the mode that should be used to control the zoom.
      • target: Either level or velocity zoom target.

    Declaration

    Swift

    func control(mode: CameraZoomControlMode, target: Double)

    Parameters

    mode

    the mode that should be used to control the zoom.

    target

    Either level or velocity zoom target.

  • Resets zoom to default level immediately.

    Bypasses any maximum zoom speed restriction and resets zoom level as fast as possible.

    Declaration

    Swift

    func resetLevel()