LMBestShotServiceDelegate

public protocol LMBestShotServiceDelegate : AnyObject

Protocol LMBestShotServiceDelegate provides methods for capturing bestshot.

  • Called when a face is detected in the shot.

    Declaration

    Swift

    func detectionRect(_ rect: CGRect, inFrameSize frameSize: CGSize)

    Parameters

    rect

    Face detection zone

    frameSize

    Frame size

  • Called when the best shot is found. @note If false is returned, a process of the best shot detection will continue, otherwise the process will be paused. Recall a resume method to continue the process after a pause.

    Declaration

    Swift

    func bestShot(_ bestShot: LunaCore.LCBestShotModel) -> Bool

    Parameters

    bestShot

    The best shot of the face.

    Return Value

    Return true, if the new best shots are no longer needed.

  • Called when the best shot is collected. @note This method is called only if isMultipartBestShots is set to true. If false is returned, a process of the best shot detection will continue, otherwise the process will be paused. Recall a resume method to continue the process after a pause.

    Declaration

    Swift

    func multipartBestShots(_ bestShots: [LunaCore.LCBestShotModel]) -> Bool

    Parameters

    bestShots

    The best shots of the face.

    Return Value

    Return true, if the new best shots are no longer needed.

  • Returns errors array received upon last second. User defines array size.

    Declaration

    Swift

    func bestShotErrors(_ errors: [Error])

    Parameters

    errors

    Errors array, sized from 0 to 3 elements

  • interactionsFinish(with:) Default implementation

    Returns an array of frames with the interaction action performed.

    Default Implementation

    Notify that interactions finished

    Declaration

    Swift

    func interactionsFinish(with interactionFrames: [LCInteractionFrameInfo])

    Parameters

    interactionFrames

    frames of passed interactions

  • Triggered when interaction changed it’s state

    Declaration

    Swift

    func interactionsStateUpdate(interactionsType: LunaCore.LCInteractionsType, stateUpdate: LunaCore.LCStepState)

    Parameters

    interactionsType

    type of interaction

    stateUpdate

    state of interaction