IBcmScanConfig

The SDK scan configuration interface (IBcmScanConfig) 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 IBcmScanConfig {

    /**
     * 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 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"
         */
        SCORE_WITH_TIMEOUT,
    }

    /**
     * Scan termination option - how a scan terminates - default is a the BUTTON options.
     */
    open fun scanTerminationOption(): ScanTerminationOptions = ScanTerminationOptions.MANUAL

    /**
     * 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"
     */
    open fun fingerScoreThreshold(): Float = 0.09f

    /**
     * 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 fingerScoreTimeout(): Int = 1

    /**
     * Finger selection view is visible or not. By default it is on.
     * In this view the recordable fingers for further processing can be selected.
     */
    open fun isFingerSelectionOn(): Boolean = true

    /**
     * Default configuration for selected fingers 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.
     */
    open fun defaultFingerSelection(): Set<BcmFingerHandDTO> = Finger.values()
        .filter { it != Finger.THUMB }
        .filter { it != Finger.PINKY }
        .map { BcmFingerHandDTO(Hand.LEFT, it) }.toSet()

    /**
     * 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(): IBcmCameraConfig = IBcmCameraConfig()

}

Example

Kotlin:

class BcmScanConfig() : IBcmScanConfig() {

    override fun cameraConfig(): IBcmCameraConfig = IBcmCameraConfig()
    override fun isFingerSelectionOn(): Boolean = false
    ...

}

Java:

public class BcmScanConfig extends IBcmScanConfig {

    public BcmScanConfig() {
        super();
    }

    @Override
    public IBcmCameraConfig cameraConfig() {
        return IBcmCameraConfig();
    }

    @Nullable
    @Override
    public  Boolean isFingerSelectionOn() {
        return false;
    }

    ...

}

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 BcmScanActivityOverride : BcmScanActivity() {

    /**
     * Set config take place here
     */
    init {
        scanConfig = BcmScanConfig()
    }

}

Java:

public class BcmScanActivityOverride 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 ""