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 all selected fingers scan score reach to "fingerScoreThreshold",
* the scan terminates with timeout (fingerScoreTimeout)
*
* 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 SCORE_WITH_TIMEOUT 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]
*
* Default value is 0.15
*
* This property is used if the "scanTerminationOption"
* is set to "SCORE_WITH_TIMEOUT"
*/
let autoScanTerminationFingerScoreThreshold: Float
/**
* The finger score have to reach a minimum score to be accepted.
* This timeout is in seconds.
*
* Default value is 1 second
*
* This property is used if the "scanTerminationOption"
* is set to "SCORE_WITH_TIMEOUT"
*/
let autoScanTerminationFingerScoreTimeout: Int
/**
* The visibility of the finger selection view
* can be configured via this flag.
* By default, it is on.
* The finger selection view is responsible to select or exclude the
* recordable fingers for further processing.
* The default values can be set by using the `selectedFingers()` interface.
*/
let isFingerSelectionOn: Bool
/**
* The default configuration for excluded fingers.
* By default no fingers are excluded for the scan flow.
*/
let excludedFingers: Set<BcmFingerHand>
/**
* The default configuration for selected fingers
* in the Finger selection view.
* By default, Index, Middle, Ring, and Pinky fingers
* are selected for left hand.
* These default values are used for further processing,
* even when the finger selection is disabled.
*/
let selectedFingers: Set<BcmFingerHand>
/**
* 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 = .SCORE_WITH_TIMEOUT,
autoScanTerminationFingerScoreThreshold: Float = 0.15,
autoScanTerminationFingerScoreTimeout: Int = 1,
isFingerSelectionOn: Bool = true,
selectedFingers: Set<BcmFingerHand> =
[BcmFingerHand(hand: Hand.LEFT, finger: Finger.INDEX),
BcmFingerHand(hand: Hand.LEFT, finger: Finger.MIDDLE),
BcmFingerHand(hand: Hand.LEFT, finger: Finger.RING),
BcmFingerHand(hand: Hand.LEFT, finger: Finger.PINKY)],
excludedFingers: Set<BcmFingerHand> = [],
isHapticFeedbackEnabled: Bool = true,
cameraConfig: BcmCameraConfig = BcmCameraConfig()
) {
self.scanTerminationOption = scanTerminationOption
self.autoScanTerminationFingerScoreThreshold = autoScanTerminationFingerScoreThreshold
self.autoScanTerminationFingerScoreTimeout = autoScanTerminationFingerScoreTimeout
self.isFingerSelectionOn = isFingerSelectionOn
self.selectedFingers = selectedFingers
self.excludedFingers = excludedFingers
self.isHapticFeedbackEnabled = isHapticFeedbackEnabled
self.cameraConfig = cameraConfig
}
}
Examples
Swift:
let bcmScanConfig = BcmScanConfig(
scanTerminationOption: BcmScanConfig.ScanTerminationOptions.SCORE_WITH_TIMEOUT
autoScanTerminationFingerScoreThreshold: 0.18
autoScanTerminationTimeout: 5,
isFingerSelectionOn: true
)
let bcmScanConfig = BcmScanConfig(
scanTerminationOption: BcmScanConfig.ScanTerminationOptions.DISABLE
isHapticFeedbackEnabled: false
)
let bcmScanConfig = BcmScanConfig(
isFingerSelectionOn: false,
selectedFingers: [
BcmFingerHand(hand: Hand.LEFT, finger: Finger.INDEX),
BcmFingerHand(hand: Hand.RIGHT, finger: Finger.MIDDLE)
]
)
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.