BcmScanConfig
The SDK scan configuration interface (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
Kotlin:
open class BcmScanConfig {
/**
* Configurable scan termination options.
*/
enum class ScanTerminationOptions {
/**
* The scan is not terminated by the SDK -
* an own termination logic can be implemented
*/
DISABLE,
/**
* A default button would be visible in the scan screen,
* when clicking the button - the scan terminates.
*/
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"
*/
SCORE_WITH_TIMEOUT,
}
/**
* The Scan termination option controls, how a scan is terminating.
* By default, it set to MANUAL. Possible configuration
* - MANUAL
* - DISABLE
* - SCORE_WITH_TIMEOUT
* Please find the description above
*/
open fun scanTerminationOption(): ScanTerminationOptions = ScanTerminationOptions.MANUAL
/**
* 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"
*/
open fun autoScanTerminationThreshold(): Float? = null
/**
* 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.
*/
open fun ignoreAutoScanTerminationFingerWeights(): Boolean = false
/**
* 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"
*/
open fun autoScanTerminationTimeout(): Int = 1
/**
* 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 `defaultFingerSelection()` interface.
*/
open fun isFingerSelectionOn(): Boolean = true
/**
* 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.
*/
open fun isIntroScreenOn(): Boolean = true
/**
* 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.
*/
open fun isFinalizeBtnOn(): Boolean = true
/**
* The default configuration for excluded fingers.
* By default no fingers are excluded for the scan flow.
*/
open fun excludedFingers(): Set<BcmFingerHand> = emptySet()
/**
* 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.
*/
open fun selectedFingers(): Set<BcmFingerHand> = Finger.values()
.filter { it != Finger.THUMB }
.map { BcmFingerHand(Hand.LEFT, it) }.toSet()
/**
* Scan order.
* If the isSingleThumbScanEnabled is true, the LEFT_THUMB and the RIGHT_THUMB are taken into
* account. The THUMBS are ignored.
*/
open fun scanOrder(): List<CaptureStates> = listOf(
CaptureStates.LEFT,
CaptureStates.LEFT_THUMB,
CaptureStates.RIGHT,
CaptureStates.RIGHT_THUMB,
CaptureStates.THUMBS)
/**
* Choose between the scan flow of single thumb scan or scan both thumbs together.
*/
open fun isSingleThumbScanEnabled(): Boolean = false
/**
* The phone vibrates when there is an improvement of a finger image.
* This can be disabled. By default this the vibration is on.
*/
open fun isHapticFeedbackEnabled(): Boolean = true
/**
* Camera configuration interface; can be overwritten.
*/
open fun cameraConfig(): BcmCameraConfig = BcmCameraConfig()
/**
* Internal configuration.
* Enable debug mode in Scan view fragment.
*/
open fun scanViewDebugModeIsOn(): Boolean = false
}
Example
Kotlin:
class BcmScanConfig() : BcmScanConfig() {
override fun cameraConfig(): BcmCameraConfig = BcmCameraConfig()
override fun isFingerSelectionOn(): Boolean = false
override fun isSingleThumbScanEnabled(): Boolean = false
...
}
Java:
public class BcmScanConfig extends BcmScanConfig {
public BcmScanConfig() {
super();
}
@Override
public BcmCameraConfig cameraConfig() {
return BcmCameraConfig();
}
@Nullable
@Override
public Boolean isFingerSelectionOn() {
return false;
}
@Override
public Boolean isSingleThumbScanEnabled() {
return true;
}
...
}
Usage
You can either inherit from the SDK Scan Activity (BcmScanActivity) and
set the scanConfig or set the scanConfig at the Fragment
level (BcmScanFragment).
Set the scanConfig at the Scan Activity level (BcmScanActivity)
Kotlin:
class YourBcmScanActivity : BcmScanActivity() {
/**
* Set config take place here
*/
init {
scanConfig = BcmScanConfig()
}
}
Java:
public class YourBcmScanActivity extends BcmScanActivity {
// Instance initialization block
/**
* Set config take place here
*/ {
setScanConfig(new BcmScanConfig(this));
}
}
Set the scanConfig at the Scan Fragment level (BcmScanFragment)
Kotlin:
val scanFragment: ScanFragment = BcmScanFragment(
BcmGlobalConfig(),
BcmScanConfig(),
this)
Java:
BcmScanFragment scanFragment=new BcmScanFragment(
new BcmGlobalConfig(),
new BcmScanConfig(),
this);
Additive
Using the IBcmFlowDelegate.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.