All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.net.iriscan.sdk.BiometricSdkConfig.kt Maven / Gradle / Ivy

There is a newer version: 0.6.0
Show newest version
package net.iriscan.sdk

import net.iriscan.sdk.core.PlatformContext
import net.iriscan.sdk.face.FaceEncodeProperties
import net.iriscan.sdk.face.FaceExtractProperties
import net.iriscan.sdk.face.FaceMatchProperties
import net.iriscan.sdk.iris.IrisEncodeProperties
import net.iriscan.sdk.iris.IrisExtractProperties
import net.iriscan.sdk.iris.IrisMatchProperties

/**
 * @author Slava Gornostal
 *
 * SDK configuration object
 */
class BiometricSdkConfig(val context: PlatformContext?, val iris: IrisConfig?, val face: FaceConfig?)

data class IrisConfig(
    val extractor: IrisExtractProperties,
    val encoder: IrisEncodeProperties,
    val matcher: IrisMatchProperties,
)

data class FaceConfig(
    val extractor: FaceExtractProperties,
    val encoder: FaceEncodeProperties,
    val matcher: FaceMatchProperties,
)

class BiometricSdkConfigBuilder {
    private var context: PlatformContext? = null
    private var irisConfig: IrisConfig? = null
    private var faceConfig: FaceConfig? = null

    fun withContext(context: PlatformContext): BiometricSdkConfigBuilder {
        this.context = context
        return this
    }

    fun withIris(
        extractor: IrisExtractProperties,
        encoder: IrisEncodeProperties,
        matcher: IrisMatchProperties
    ): BiometricSdkConfigBuilder {
        this.irisConfig = IrisConfig(extractor, encoder, matcher)
        return this
    }

    fun withFace(
        extractor: FaceExtractProperties,
        encoder: FaceEncodeProperties,
        matcher: FaceMatchProperties
    ): BiometricSdkConfigBuilder {
        this.faceConfig = FaceConfig(
            extractor,
            encoder,
            matcher,
        )
        return this
    }

    fun build(): BiometricSdkConfig =
        BiometricSdkConfig(this.context, this.irisConfig, this.faceConfig)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy