LMBestShotService
final public class LMBestShotService: NSObject, LMBestShotServiceProtocol,
LunaCore.LCBestShotDelegate, LMErrorPresenterDelegate
Service that handles bestshot processing
-
Best shot service delegate
Declaration
Swift
public weak var delegate: LMBestShotServiceDelegate? -
Best shot detector object
Declaration
Swift
public private(set) var detector: LunaCore.LCBestShotDetectorProtocol { get } -
Push frame data to bestshot detector
Declaration
Swift
public func pushFrame(buffer sampleBuffer: CMSampleBuffer)Parameters
sampleBufferbuffer data
-
Push image to bestshot detector
Declaration
Swift
public func pushFrame(image: CGImage)Parameters
imageimage
-
Resume bestshot detection
Declaration
Swift
public func resume() -
Sets detector’s screen (search zone) size
Declaration
Swift
public func screenSize(_ size: CGSize, edges: UIEdgeInsets)Parameters
sizezone size (usually screen)
edgesedge insets
-
Ask detector if any face founded
Declaration
Swift
public func faceFound() -> BoolReturn Value
true - if face was founded, false - otherwhise
-
Launch interactions wizard
Declaration
Swift
public func launchWizard() -
Send a message to engine, that you have show interaction hint to the user
Declaration
Swift
public func interactionHintDidShow() -
Setup interactions list
Declaration
Swift
public func defineStepsList(_ stepsList: [LCStepConfigProtocol])Parameters
stepsListinteractions array
-
Enable video recording
Declaration
Swift
public func enableVideoRecordWatchDog(faceFoundBlock: @escaping FaceFoundedBlock)Parameters
faceFoundBlockblock that is triggered after a face is detected in the frame
-
Called when a face is detected in the shot.
Declaration
Swift
public func detectionRect(_ rect: CGRect, inFrameSize frameSize: CGSize)Parameters
rectFace detection zone
frameSizeFrame 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
public func bestShot(_ bestShot: LunaCore.LCBestShotModel) -> BoolParameters
bestShotThe 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
isMultipartBestShotsis 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
public func multipartBestShots(_ bestShots: [LCBestShotModel]) -> BoolParameters
bestShotsThe 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
public func bestShotError(_ error: Error)Parameters
errorsErrors array, sized from 0 to 3 elements
-
Returns an array of frames with the interaction action performed.
Declaration
Swift
public func interactionsFinish(with interactionFrames: [LCInteractionFrameInfo])Parameters
interactionFramesarray of successful interactions with their descriptions
-
Returns an array of the most frequent errors that occurred in the last second.
Declaration
Swift
public func send(errors: [Error])Parameters
errorsAn array of errors sorted by frequency in descending order
LMBestShotService Class Reference