UNPKG

react-native-scanbot-sdk

Version:

Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS

134 lines (118 loc) 3.78 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CameraModuleValues = exports.CameraConfiguration = void 0; var _utils = require("../../utils/utils"); /// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten. /// Generated from rtu-ui-v2/schemas/common/CameraConfiguration.yaml /** Determines which camera module to use on start-up. - `FRONT`: Use the front camera. - `BACK`: Use the default back camera. - `BACK_WIDEST`: Use the back camera with the widest available angle. iOS only. */ const CameraModuleValues = exports.CameraModuleValues = ['FRONT', 'BACK', 'BACK_WIDEST']; /** Configuration of the camera settings to be used while scanning. */ class CameraConfiguration extends _utils.PartiallyConstructible { /** Determines which camera module to use on start-up. Default is BACK */ cameraModule = 'BACK'; /** The zoom steps available to the user. */ zoomSteps = [1.0, 2.0, 5.0]; /** The default zoom factor on start-up. Default is 1.0 */ defaultZoomFactor = 1.0; /** Determines whether the flash is enabled on start-up. Default is false */ flashEnabled = false; /** Determines whether to lock the focus at the minimum possible distance (device-specific). Default is false */ minFocusDistanceLock = false; /** Determines whether touch-to-focus is enabled or not. Android only. Default is false */ touchToFocusEnabled = false; /** Determines whether pinch-to-zoom is enabled or not. Default is true */ pinchToZoomEnabled = true; /** Determines which mode to use when orientation should be locked to landscape or portrait. Default is NONE */ orientationLockMode = 'NONE'; /** Determines which camera preview mode to use. Default is FILL_IN */ cameraPreviewMode = 'FILL_IN'; /** When enabled it allows zooming using camera control button (iPhone 16 series). iOS only. Default is true */ 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 */ fpsLimit = 20; /** @param source {@displayType `DeepPartial<CameraConfiguration>`} */ constructor(source = {}) { super(); 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; } } } exports.CameraConfiguration = CameraConfiguration; //# sourceMappingURL=CameraConfiguration.js.map