PassiveFaceCaptureSessionController
class PassiveFaceCaptureSessionController : ObservableObject
This controller handles the business logic for the passive face capture session. It handles the processing of the frames captured by the camera and updates the UI accordingly.
-
This variable holds an instance of the PassiveFaceCaptureModel.
Declaration
Swift
var model: PassiveFaceCaptureModel
-
This variable holds an instance of the FaceScannerController.
Declaration
Swift
var faceScanController: FaceScannerController
-
The passive face capture session.
Declaration
Swift
var session: PassiveFaceCaptureSession?
-
Callback for handling session errors.
Declaration
Swift
var onSessionError: ((_ model: PassiveFaceCaptureModel) -> Void)?
-
Callback for updating instructions. Usually subscribed by the view.
Declaration
Swift
var onInstructionUpdate: ((_ model: PassiveFaceCaptureModel) -> Void)?
-
Callback for handling session completion. Usually subscribed by the view.
Declaration
Swift
var onSessionCompleted: ((_ model: PassiveFaceCaptureModel) -> Void)?
-
Lock object for thread safety.
Declaration
Swift
let lock: Lock
-
This function initializes the model and sets the frame captured callback.
Declaration
Swift
init()
-
Initializes the controller by setting the model.
Declaration
Swift
required init?(coder: NSCoder)
-
Resets the controller by clearing the session and initializing a new model.
Declaration
Swift
func reset()
-
Prepares the controller by initializing the model and the passive face capture session.
Declaration
Swift
func prepare()
-
Processes the frame captured by the camera and updates the model accordingly. It handles the interaction with the SenseCrypt SDK and updates the UI based on the processing result.
Declaration
Swift
func frameCaptured(image: CMSampleBuffer)
Parameters
image
The frame captured by the camera
-
This function returns the instruction label based on the current head pose.
Declaration
Swift
func getCurrentHeadPoseLabel(headpose: HeadPose?) -> String?
Parameters
headpose
The current head pose.
Return Value
The instruction label.
-
This function updates the model based on the processing result.
Declaration
Swift
func updateModel(processResult: PassiveFaceCaptureProcessingResult?)
Parameters
processResult
The processing result.