react-native-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS
146 lines (127 loc) • 4.88 kB
JavaScript
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from rtu-ui-v2/schemas/document/DocumentScannerCameraConfiguration.yaml
import { PartiallyConstructible } from '../../utils/utils';
/**
Determines the prioritization of still image quality and capturing speed.
- `SPEED`:
Captures a still image at the highest possible speed. The quality of the image may be degraded.
- `BALANCED`:
Balances capturing speed and image quality equally. This is the default value.
- `QUALITY`:
Captures a still image with the best possible quality in terms of noise, frozen motion and detail in low light. The speed of the capturing might be reduced.
*/
export const CapturePhotoQualityPrioritizationValues = ['SPEED', 'BALANCED', 'QUALITY'];
/**
Configuration of the camera behavior.
*/
export class DocumentScannerCameraConfiguration extends PartiallyConstructible {
/**
Determines which camera module to use on start-up.
Default is BACK
*/
cameraModule = 'BACK';
/**
The default zoom factor on start-up.
Default is 1.0
*/
defaultZoomFactor = 1.0;
/**
Determines whether the document should be cropped automatically after a manual snap or not.
Default is true
*/
autoCropOnManualSnap = true;
/**
Determines whether the flashlight is enabled or not on start-up.
Default is false
*/
flashEnabled = false;
/**
Determines whether locking the focus at the minimum possible distance is enabled or not (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 camera preview mode to use.
Default is FILL_IN
*/
cameraPreviewMode = 'FILL_IN';
/**
Determines the prioritization of still image quality and capturing speed.
Default is BALANCED
*/
captureQualityPrioritization = 'BALANCED';
/**
Controls the auto snapping speed. The sensitivity must be between 0.0 and 1.0. A value of 1.0 triggers auto snapping immediately, while a value of 0.0 delays the auto snapping by 3 seconds. The default value is 0.66 (2 seconds).
Default is 0.66
*/
autoSnappingSensitivity = 0.66;
/**
After a page has been snapped, the delay in milliseconds before auto snapping resumes for the next page.
Default is 200
*/
autoSnappingDelay = 200;
/**
Determines if auto snapping is enabled or not.
Default is true
*/
autoSnappingEnabled = true;
/**
When enabled the hardware volume up/down buttons can be used to capture an image if manual snapping is enabled. For iOS version 17.2 or later is required. On iPhones with camera control (iPhone 16 series) this also enables zooming and capturing with the camera control.
Default is true
*/
captureWithHardwareButtonsEnabled = true;
/** @param source {@displayType `DeepPartial<DocumentScannerCameraConfiguration>`} */
constructor(source = {}) {
super();
if (source.cameraModule !== undefined) {
this.cameraModule = source.cameraModule;
}
if (source.defaultZoomFactor !== undefined) {
this.defaultZoomFactor = source.defaultZoomFactor;
}
if (source.autoCropOnManualSnap !== undefined) {
this.autoCropOnManualSnap = source.autoCropOnManualSnap;
}
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.cameraPreviewMode !== undefined) {
this.cameraPreviewMode = source.cameraPreviewMode;
}
if (source.captureQualityPrioritization !== undefined) {
this.captureQualityPrioritization = source.captureQualityPrioritization;
}
if (source.autoSnappingSensitivity !== undefined) {
this.autoSnappingSensitivity = source.autoSnappingSensitivity;
}
if (source.autoSnappingDelay !== undefined) {
this.autoSnappingDelay = source.autoSnappingDelay;
}
if (source.autoSnappingEnabled !== undefined) {
this.autoSnappingEnabled = source.autoSnappingEnabled;
}
if (source.captureWithHardwareButtonsEnabled !== undefined) {
this.captureWithHardwareButtonsEnabled = source.captureWithHardwareButtonsEnabled;
}
}
}
//# sourceMappingURL=DocumentScannerCameraConfiguration.js.map