capacitor-plugin-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK for Capacitor
113 lines (103 loc) • 3.97 kB
JavaScript
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from rtu-ui-v2/schemas/common/CameraConfiguration.yaml
import { PartiallyConstructible } from '../../utils/utils';
export const CameraModuleValues = ['FRONT', 'BACK', 'BACK_WIDEST'];
/**
Configuration of the camera settings to be used while scanning.
*/
export class CameraConfiguration extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<CameraConfiguration>`} */
constructor(source = {}) {
super();
/**
Determines which camera module to use on start-up.
Default is BACK
*/
this.cameraModule = 'BACK';
/**
The zoom steps available to the user.
*/
this.zoomSteps = [1.0, 2.0, 5.0];
/**
The default zoom factor on start-up.
Default is 1.0
*/
this.defaultZoomFactor = 1.0;
/**
Determines whether the flash is enabled on start-up.
Default is false
*/
this.flashEnabled = false;
/**
Determines whether to lock the focus at the minimum possible distance (device-specific).
Default is false
*/
this.minFocusDistanceLock = false;
/**
Determines whether touch-to-focus is enabled or not. Android only.
Default is false
*/
this.touchToFocusEnabled = false;
/**
Determines whether pinch-to-zoom is enabled or not.
Default is true
*/
this.pinchToZoomEnabled = true;
/**
Determines which mode to use when orientation should be locked to landscape or portrait.
Default is NONE
*/
this.orientationLockMode = 'NONE';
/**
Determines which camera preview mode to use.
Default is FILL_IN
*/
this.cameraPreviewMode = 'FILL_IN';
/**
When enabled it allows zooming using camera control button (iPhone 16 series). iOS only.
Default is true
*/
this.hardwareButtonsEnabled = true;
/**
The rate of detections/recognitions per second in normal performance mode. If the number is equal or greater than the video frame rate, no frames will be skipped.
Default is 20
*/
this.fpsLimit = 20;
if (source.cameraModule !== undefined) {
this.cameraModule = source.cameraModule;
}
if (source.zoomSteps !== undefined) {
this.zoomSteps = source.zoomSteps.map((it) => {
return it;
});
}
if (source.defaultZoomFactor !== undefined) {
this.defaultZoomFactor = source.defaultZoomFactor;
}
if (source.flashEnabled !== undefined) {
this.flashEnabled = source.flashEnabled;
}
if (source.minFocusDistanceLock !== undefined) {
this.minFocusDistanceLock = source.minFocusDistanceLock;
}
if (source.touchToFocusEnabled !== undefined) {
this.touchToFocusEnabled = source.touchToFocusEnabled;
}
if (source.pinchToZoomEnabled !== undefined) {
this.pinchToZoomEnabled = source.pinchToZoomEnabled;
}
if (source.orientationLockMode !== undefined) {
this.orientationLockMode = source.orientationLockMode;
}
if (source.cameraPreviewMode !== undefined) {
this.cameraPreviewMode = source.cameraPreviewMode;
}
if (source.hardwareButtonsEnabled !== undefined) {
this.hardwareButtonsEnabled = source.hardwareButtonsEnabled;
}
if (source.fpsLimit !== undefined) {
this.fpsLimit = source.fpsLimit;
}
}
}
//# sourceMappingURL=CameraConfiguration.js.map