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 : Serializable {
    /**
     * 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 has to reach a minimum score to be accepted (autoScanTerminationThreshold).
     * When all selected fingers reaches the configured threshold (autoScanTerminationThreshold)
     * a timer gets started and terminates the scan after the timeout is reached.
     * This timeout is in seconds.
     * This property is used if the "scanTerminationOption" is set to "SCORE_WITH_TIMEOUT"
     */
    open fun autoScanTerminationTimeout(): Int = 1

    /**
     * The finger score weights are used for the scan auto termination algorithm.
     * The algorithm is based on a threshold. This threshold has 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 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 = false

    /**
     * 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 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.
     */
    open fun isScanAssistantEnabled(): Boolean = true

    /**
     * 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

    /**
     * Enable presentation attack detection.
     * If a potential spoof is detected the scan aborts with `PAD_DETECTED`.
     * The internal detection algorithm is not documented.
     */
    open fun isPadCheckEnabled(): Boolean = false

    /**
     * Flag to enable or disable second person scan mode for the landscape mode.
     * In Portrait mode only first user mode is useful.
     * When enabled, the scan interface adapts for a more ergonomic experience during a scan performed by another person,
     * particularly useful in scenarios where the user cannot or should not scan themselves, such as accessibility use cases
     * or situations where professional assistance is required. This setting alters the camera and interface orientation
     * to facilitate a smoother and more efficient scanning process in such contexts.
     * By default, this feature is disabled, assuming a self-scan scenario.
     */
    open fun isLandscape2ndPersonScanEnabled(): Boolean = false

    /**
     * Camera configuration interface; can be overwritten.
     */
    open fun cameraConfig(): BcmCameraConfig = BcmCameraConfig(
        isLandscape2ndPersonScanEnabled()
    )

    /**
     * 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.
     */
    open fun isScanStatusViewOn(): Boolean = true

    /**
     * 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.
     */
    open fun isScanTemplateViewOn(): Boolean = true

    /**
     * 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
    override fun isPadCheckEnabled(): Boolean = true
    ...

}

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;
    }

    @Override
    public Boolean isPadCheckEnabled() {
        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.

See Also

results matching ""

    No results matching ""