BcmScanConfig
The SDK scan configuration struct (BcmScanConfig) is an optional interface.
The interface is used for configuring underlying Biocapture SDK components, which are related to the scan.
You can consume this class by subclassing it, which enables lazy value computation.
Interface
Swift:
public struct BcmScanConfig {
/**
* Configurable scan termination options.
*/
public enum ScanTerminationOptions {
/**
* The scan is not terminated by the SDK -
* an own termination logic can be implemented
*/
case DISABLE
/**
* A default button would be visible in the scan screen,
* when clicking the button - the scan terminates.
*/
case MANUAL
/**
* When the finger threshold is reached by > 50% of the selected fingers, a countdown timer starts.
* The scan terminates, when the countdown timer expires.
*
* The score threshold can be configured with "fingerScoreThreshold"
* The timeout can be configured with "fingerScoreTimeout"
*/
case SCORE_WITH_TIMEOUT
}
/**
* Scan termination option - how a scan terminates - default is a the BUTTON options.
*/
let scanTerminationOption: ScanTerminationOptions
/**
* The finger score have to reach a minimum score to be accepted.
* The score represents a sharpness value between (0.0, 1.0]
* This property is used if the "scanTerminationOption" is set to "SCORE_WITH_TIMEOUT"
*/
let fingerScoreThreshold: Float
/**
* The finger score have to reach a minimum score to be accepted.
* This timeout is in seconds.
* This property is used if the "scanTerminationOption" is set to "SCORE_WITH_TIMEOUT"
*/
let fingerScoreTimeout: Int
/**
* Finger selection view is visible or not. By default it is on.
* In this view the recordable fingers for further processing can be selected.
*/
let isFingerSelectionOn: Bool
/**
* Default configuration for selecte finger in the Finger selection view.
* By default the Index, Middle and the Ring finger are selected for both hands.
* These default values are also used, if the finger selection is disabled.
*/
let defaultFingerSelection: Set<BcmFingerHandDTO>
/**
* The phone vibrates when there is an improvement of a finger image.
* This can be disabled. By default this the vibration is on.
*/
let isHapticFeedbackEnabled: Bool
/**
* Camera configuration interface; can be overwritten
*/
let cameraConfig: BcmCameraConfig
public init(
scanTerminationOption: ScanTerminationOptions = ScanTerminationOptions.SCORE_WITH_TIMEOUT,
fingerScoreThreshold: Float = 0.09,
fingerScoreTimeout: Int = 1,
isFingerSelectionOn: Bool = true,
defaultFingerSelection: Set<BcmFingerHandDTO> = [BcmFingerHandDTO(hand: Hand.LEFT, finger: Finger.INDEX),
BcmFingerHandDTO(hand: Hand.LEFT, finger: Finger.MIDDLE),
BcmFingerHandDTO(hand: Hand.LEFT, finger: Finger.RING)],
isHapticFeedbackEnabled: Bool = true,
cameraConfig: BcmCameraConfig = BcmCameraConfig()
) {
self.scanTerminationOption = scanTerminationOption
self.fingerScoreThreshold = fingerScoreThreshold
self.fingerScoreTimeout = fingerScoreTimeout
self.isFingerSelectionOn = isFingerSelectionOn
self.defaultFingerSelection = defaultFingerSelection
self.isHapticFeedbackEnabled = isHapticFeedbackEnabled
self.cameraConfig = cameraConfig
}
}
Example
Swift:
let bcmScanConfig = BcmScanConfig(
scanTerminationOption: BcmScanConfig.ScanTerminationOptions.SCORE_WITH_TIMEOUT)
Usage
You can set the scanConfigin the constructor of the Scan Controller (BcmScanController).
Swift:
let bcmScanController = BcmScanController(
scanConfig: bcmScanConfig)
Additive
Using the PBcmFlowDelegate.fingerImagesCachedLiveScore() it is possible to implement your own scan termination logic.
Please refer to Custom Scan Termination for an example implementation. In this case, you have to set the scanTerminationOption to ScanTerminationOptions.DISABLE.