VisionManagerDelegate
public protocol VisionManagerDelegate : AnyObject
Interface that user’s custom object should conform to in order to receive events from VisionManager
.
Some methods will not be called until Camera.isCalibrated
value becomes true
due to highly imprecise results.
Delegate methods are called one by one followed by visionManagerDidCompleteUpdate
call, which denotes the end of the iteration.
Note
All delegate methods are called on a background thread.-
visionManager(_:didUpdateAuthorizationStatus:)
Default implementationTells the delegate that authorization status was updated.
VisionManager
may not emit events unless it has successfully authorized.Default Implementation
Declaration
Swift
func visionManager(_ visionManager: VisionManagerProtocol, didUpdateAuthorizationStatus authorizationStatus: AuthorizationStatus)
-
visionManager(_:didUpdateFrameSegmentation:)
Default implementationTells the delegate that segmentation mask was updated.
Default Implementation
Declaration
Swift
func visionManager(_ visionManager: VisionManagerProtocol, didUpdateFrameSegmentation frameSegmentation: FrameSegmentation)
-
visionManager(_:didUpdateFrameDetections:)
Default implementationTells the delegate that detections were updated.
Default Implementation
Declaration
Swift
func visionManager(_ visionManager: VisionManagerProtocol, didUpdateFrameDetections frameDetections: FrameDetections)
-
visionManager(_:didUpdateFrameSignClassifications:)
Default implementationTells the delegate that classified signs were updated.
Default Implementation
Declaration
Swift
func visionManager(_ visionManager: VisionManagerProtocol, didUpdateFrameSignClassifications frameSignClassifications: FrameSignClassifications)
-
visionManager(_:didUpdateRoadDescription:)
Default implementationTells the delegate that road description was updated. Road description parameters reach maximum accuracy when
Camera
is calibrated and may not be produced until then.Default Implementation
Declaration
Swift
func visionManager(_ visionManager: VisionManagerProtocol, didUpdateRoadDescription roadDescription: RoadDescription)
-
visionManager(_:didUpdateWorldDescription:)
Default implementationTells the delegate that world description was updated. World description parameters reach maximum accuracy when
Camera
is calibrated and may not be produced until then.Default Implementation
Declaration
Swift
func visionManager(_ visionManager: VisionManagerProtocol, didUpdateWorldDescription worldDescription: WorldDescription)
-
visionManager(_:didUpdateVehicleState:)
Default implementationTells the delegate that vehicle state was updated.
Default Implementation
Declaration
Swift
func visionManager(_ visionManager: VisionManagerProtocol, didUpdateVehicleState vehicleState: VehicleState)
-
visionManager(_:didUpdateCountry:)
Default implementationTells the delegate that country which is used in the VisionSDK changed.
Default Implementation
Declaration
Swift
func visionManager(_ visionManager: VisionManagerProtocol, didUpdateCountry country: Country)
-
visionManager(_:didUpdateCamera:)
Default implementationTells the delegate that camera state was updated. Use this method to obtain current values of calibration progress, frame size, and other camera parameters from
Camera
instance.Default Implementation
Declaration
Swift
func visionManager(_ visionManager: VisionManagerProtocol, didUpdateCamera camera: Camera)
-
visionManagerDidCompleteUpdate(_:)
Default implementationThis method is called after the whole update iteration is completed. This means that all the data that came from delegate methods is in sync. This method is an appropriate place to work with different values emitted from
VisionManager
.Note
Performance of this function is critical sinceVisionManager
blocks until the method execution is finished.Default Implementation
Declaration
Swift
func visionManagerDidCompleteUpdate(_ visionManager: VisionManagerProtocol)