IBcmCameraConfig
The SDK camera configuration interface (IBcmCameraConfig) is an optional interface.
It allows you to configure camera specific parameters.
The interface is for an object to be assigned to IBcmScanConfig's camera property.
Interface
Kotlin:
open class IBcmCameraConfig {
/**
* 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 = 0.0f
/**
* Set the preferred frame resolution of the Camera.
*/
public enum class CameraResolution {
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(): CameraResolution = CameraResolution.FULL_HD
/**
* 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 cameraFacing(): 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
*/
open fun imageInputRotation(): Float = 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 BcmCamera() : IBcmCameraConfig() {
override fun softwareZoomFactor(): Double = 1.5
...
}
Java:
public class BcmCamera extends IBcmCameraConfig {
public BcmCamera() {
super();
}
@Override
public Double softwareZoomFactor() {
return 1.5;
}
...
}
Initialize the camera config in the IBcmScanConfig class
Kotlin:
class BcmScanConfig() : IBcmScanConfig() {
override fun camera(): IBcmCameraConfig = BcmCamera()
}
Java:
public class BcmScanConfig extends IBcmScanConfig {
public BcmScanConfig() {
super();
}
@Override
public IBcmCameraConfig cameraConfig() {
return new BcmCamera();
}
}