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 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 SCORE_WITH_TIMEOUT options.
*/
let scanTerminationOption: ScanTerminationOptions
/**
* The finger score have to reach a minimum score to be accepted.
* There are default values predefined in the SDK - leave it null to use those values.
* 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 autoScanTerminationThreshold: 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 autoScanTerminationTimeout: Int
/**
* The finger score weights are used for the scan auto termination algorithm.
* The algorithm is based on a threshold. This threshold have to be reached to terminate a scan.
* Due to the fact that the finger score is different for each finger, we've added a score weight.
* This score weight is a factor for relevance of the finger for the scan auto termination.
* The usage of the finger weights for the scan auto termination can be configured using this flag.
* By default, it is on.
*/
let ignoreAutoScanTerminationFingerWeights: Bool
/**
* 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 the
* recordable fingers for further processing.
* The default values can be set by using the `selectedFingers` interface.
*/
let isFingerSelectionOn: Bool
/**
* The visibility of the intro screen view can be configured via this flag.
* By default, it is on.
* The intro screen shows info on how to scan the fingers.
*/
let isIntroScreenOn: Bool
/**
* The visibility of the finalize button can be configured via this flag.
* By default, it is on.
* Using the finalize button you can cancel the scan.
*/
let isFinalizeBtnOn: Bool
/**
* The default configuration for excluded fingers.
* By default no fingers are excluded for the scan flow.
*/
let excludedFingers: Set<BcmFingerHand>
/**
* The scan assistant is a feature that helps the user to scan the fingers correctly.
* Moving camera preview helps the user to place the fingers correctly.
*/
let isScanAssistantEnabled: Bool
/**
* The default configuration for selected fingers in the Finger selection view.
* By default, the Index, Middle, Ring and the Pinky fingers of the Left hand are selected.
* These default values are used for further processing, even when the finger selection is disabled.
*/
let selectedFingers: Set<BcmFingerHand>
/**
* Scan order.
* If the isSingleThumbScanEnabled is true, the LEFT_THUMB and the RIGHT_THUMB are taken into
* account. The THUMBS are ignored.
*/
let scanOrder: [CaptureState]
/**
* 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
/**
Enables presentation attack detection.
If a potential spoof is detected the scan stops with `PAD_DETECTED`.
The internal detection algorithm is not documented.
*/
let isPadCheckEnabled: Bool
/**
* Camera configuration interface; can be overwritten
*/
let cameraConfig: BcmCameraConfig
/**
* Choose between the scan flow of single thumb scan or scan both thumbs together.
*/
let isSingleThumbScanEnabled: Bool
/**
* The visibility of the scan status view can be configured via this flag.
* By default, it is on.
* The scan status view shows information about the current scan progress.
*/
let isScanStatusViewOn: Bool
/**
* The visibility of the scan template view can be configured via this flag.
* By default, it is on.
* The scan status view shows the finger template and shows the user how to place the fingers/hand.
*/
let isScanTemplateViewOn: Bool
/**
* Internal configuration.
* Enable debug mode in Scan view fragment.
*/
let scanViewDebugModeIsOn: Bool
public init(
scanTerminationOption: ScanTerminationOptions = ScanTerminationOptions.SCORE_WITH_TIMEOUT,
autoScanTerminationThreshold: Float? = nil,
autoScanTerminationTimeout: Int = 1,
ignoreAutoScanTerminationFingerWeights: Bool = false,
isFingerSelectionOn: Bool = true,
isIntroScreenOn: Bool = true,
isFinalizeBtnOn: 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)],
scanOrder: [CaptureState] = [CaptureState.LEFT,
CaptureState.LEFT_THUMB,
CaptureState.RIGHT,
CaptureState.RIGHT_THUMB,
CaptureState.THUMBS],
excludedFingers: Set<BcmFingerHand> = [],
isScanAssistantEnabled: Bool = true,
isPadCheckEnabled: Bool = false,
isHapticFeedbackEnabled: Bool = true,
cameraConfig: BcmCameraConfig = BcmCameraConfig(),
isSingleThumbScanEnabled: Bool = false,
isScanStatusViewOn: Bool = true,
isScanTemplateViewOn: Bool = true,
scanViewDebugModeIsOn: Bool = false
) {
self.scanTerminationOption = scanTerminationOption
self.autoScanTerminationThreshold = autoScanTerminationThreshold
self.autoScanTerminationTimeout = autoScanTerminationTimeout
self.ignoreAutoScanTerminationFingerWeights = ignoreAutoScanTerminationFingerWeights
self.isFingerSelectionOn = isFingerSelectionOn
self.isIntroScreenOn = isIntroScreenOn
self.isFinalizeBtnOn = isFinalizeBtnOn
self.selectedFingers = selectedFingers
self.scanOrder = scanOrder
self.excludedFingers = excludedFingers
self.isScanAssistantEnabled = isScanAssistantEnabled
self.isPadCheckEnabled = isPadCheckEnabled
self.isHapticFeedbackEnabled = isHapticFeedbackEnabled
self.cameraConfig = cameraConfig
self.isSingleThumbScanEnabled = isSingleThumbScanEnabled
self.isScanStatusViewOn = isScanStatusViewOn
self.isScanTemplateViewOn = isScanTemplateViewOn
self.scanViewDebugModeIsOn = scanViewDebugModeIsOn
}
}
Examples
Swift:
let bcmScanConfig = BcmScanConfig(
scanTerminationOption: BcmScanConfig.ScanTerminationOptions.SCORE_WITH_TIMEOUT,
autoScanTerminationThreshold: 0.18,
autoScanTerminationTimeout: 1,
isFingerSelectionOn: true
)
let bcmScanConfig = BcmScanConfig(
scanTerminationOption: BcmScanConfig.ScanTerminationOptions.SCORE_WITH_TIMEOUT,
isSingleThumbScanEnabled: 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)
]
)
let bcmScanConfig = BcmScanConfig(
isScanAssistantEnabled: true
)
let bcmScanConfig = BcmScanConfig(
isPadCheckEnabled: true
)
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.