BcmCameraConfig

The SDK camera configuration interface (BcmCameraConfig) is an optional interface. It allows you to configure camera specific parameters. The interface is for an object to be assigned to BcmScanConfig's camera property.

Interface

Kotlin:

open class BcmCameraConfig(
    private val isLandscape2ndPersonScanEnabled: Boolean = false
) {

    /**
     * Set the preferred frame resolution of the Camera.
     */
    public enum class FrameResolution {
        FULL_HD,
        WQ_HD,
        _4K
    }

    /**
     * Danger, W.R.! Attempting to use a too large frame resolution could exceed the camera
     * bus' bandwidth limitation, result in gorgeous previews but the storage of garbage capture data.
     */
    open fun frameResolution(): FrameResolution = FrameResolution.FULL_HD

    /**
     * This factor is used for the fixed focus distance.
     * By default (0.0), the nearest point will used for the fixed focus distance.
     * This can be changed to a value in the range [0.0, 1.0].
     */
    open fun focusLensPositionFactor(): Float? = null

    /**
     * The camera dpi value is mandatory for the correct image scaling.
     * The dpi value is different for each device and depends on the device camera.
     * There are pre-calculated dpi values for the most used devices in the SDK.
     * The device can be manually calibrated with the calibration API (BcmSdkCalibrationActivity, BcmSdkCalibrationFragment)
     */
    open fun dpi(): Float? = null

    /**
     * Set the camera facing.
     */
    public enum class CameraFacing {
        FRONT,
        BACK
    }

    /**
     * Set the camera facing. use either the front or the back camera of the phone.
     */
    open fun facing(): CameraFacing = CameraFacing.BACK

    /**
     * Set input image rotation. This parameter effects the finger detection.
     * 180.0, indicates the right side and 0 the left side of the phone.
     * Default value is 180.0.
     * Important! This config is ignored for portrait mode.
     */
    open fun imageInputRotation(): Float = if (isLandscape2ndPersonScanEnabled) 0.0f else 180.0f

    /**
     * Set to 1.0 to use the default software zoom. Valid range is in [1.0, 5.0].
     */
    open fun softwareZoomFactor(): Float = 1.0f

    /**
     * Whether to turn on the torch/flash automatically for making finger easily readable.
     */
    open fun isTorchInitiallyOn(): Boolean = true

    /**
     * Internal
     */
    /**
     * Set to false to use continuous auto focus.
     * The configuration cannot be overwritten
     */
    fun focusLensPositionOn(): Boolean = true
}

Example

Kotlin:

class MyBcmCameraConfig() : BcmCameraConfig() {

    override fun softwareZoomFactor(): Float = 1.5f
    ...

}

Java:

public class MyBcmCameraConfig extends BcmCameraConfig {

    public MyBcmCameraConfig() {
        super();
    }

    @Override
    public Float softwareZoomFactor() {
        return 1.5f;
    }

    ...

}

Initialize the camera config in the BcmScanConfig class

Kotlin:

class MyBcmScanConfig() : BcmScanConfig() {

    override fun cameraConfig(): BcmCameraConfig = MyBcmCameraConfig()

}

Java:

public class MyBcmScanConfig extends BcmScanConfig {

    public MyBcmScanConfig() {
        super();
    }

    @Override
    public BcmCameraConfig cameraConfig() {
        return new MyBcmCameraConfig();
    }

}

See Also

results matching ""

    No results matching ""