UNPKG

react-native-scanbot-sdk

Version:

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

299 lines (282 loc) 10.2 kB
import { ImageRotation } from '../imageRef/ImageTypes'; import { RefCountedObjectProfile } from '../imageRef/ObjectPoolTypes'; import { ToJsonConfiguration } from '../utils/json/JsonSerializationTypes'; import { DeepPartial, PartiallyConstructible, Rectangle } from '../utils/utils'; /** Image Info. */ export declare class ImageInfo extends PartiallyConstructible { /** Image height in pixels. */ height: number; /** Image width in pixels. */ width: number; /** Byte size of the non-hibernating image. */ maxByteSize: number; /** @param source {@displayType `DeepPartial<ImageInfo>`} */ constructor(source?: DeepPartial<ImageInfo>); serialize(config?: ToJsonConfiguration): DeepPartial<ImageInfo>; } /** Image Ref Path Load Mode. - `EAGER`: Image is immediately loaded into memory. - `LAZY`: Image is loaded into memory the first time it's requested. Specified path must exist at the time of loading. - `LAZY_WITH_COPY`: Image is loaded into memory the first time it's requested. Specified path is copied into internal directory and so isn't required to exist at the time of loading. */ export type PathLoadMode = 'EAGER' | 'LAZY' | 'LAZY_WITH_COPY'; export declare const PathLoadModeValues: PathLoadMode[]; /** Image Ref Buffer Load Mode. - `EAGER`: Image is immediately decoded. - `LAZY`: Image is decoded the first time it's requested. */ export type BufferLoadMode = 'EAGER' | 'LAZY'; export declare const BufferLoadModeValues: BufferLoadMode[]; /** Image Encoding Format. - `JPEG`: JPEG encoding. - `PNG`: PNG encoding. */ export type EncodingFormat = 'JPEG' | 'PNG'; export declare const EncodingFormatValues: EncodingFormat[]; /** Encryption/Decryption mode to be used when an image is loaded/saved. - `REQUIRED`: Encryption/Decryption is used when loading/saving an image. A crypting provider must first be set using `ImageRef.setStorageCryptingProvider`. If no provider is set, the loading/saving operation will fail. - `DISABLED`: Encryption/Decryption is not used when loading/saving an image. - `IF_AVAILABLE`: Encryption/Decryption is used when loading/saving an image if a crypting provider is set using `ImageRef.setStorageCryptingProvider`. */ export type EncryptionMode = 'REQUIRED' | 'DISABLED' | 'IF_AVAILABLE'; export declare const EncryptionModeValues: EncryptionMode[]; /** Basic options for loading image. */ export declare class BasicImageLoadOptions extends PartiallyConstructible { /** Region of interest. */ roi: Rectangle; /** @param source {@displayType `DeepPartial<BasicImageLoadOptions>`} */ constructor(source?: DeepPartial<BasicImageLoadOptions>); } /** Options for loading images that come from sensor. */ export declare class RawImageLoadOptions extends PartiallyConstructible { /** Region of interest. */ roi: Rectangle; /** Rotation that should be applied to the image to recover correct orientation. Default is NONE */ orientation: ImageRotation; /** @param source {@displayType `DeepPartial<RawImageLoadOptions>`} */ constructor(source?: DeepPartial<RawImageLoadOptions>); } /** Options for loading image from path. */ export declare class PathImageLoadOptions extends PartiallyConstructible { /** Region of interest. */ roi: Rectangle; /** Load mode. Default is EAGER */ loadMode: PathLoadMode; /** Encryption mode. Default is IF_AVAILABLE */ encryptionMode: EncryptionMode; /** @param source {@displayType `DeepPartial<PathImageLoadOptions>`} */ constructor(source?: DeepPartial<PathImageLoadOptions>); } /** Options for loading image from buffer. */ export declare class BufferImageLoadOptions extends PartiallyConstructible { /** Region of interest. */ roi: Rectangle; /** Load mode. Default is EAGER */ loadMode: BufferLoadMode; /** @param source {@displayType `DeepPartial<BufferImageLoadOptions>`} */ constructor(source?: DeepPartial<BufferImageLoadOptions>); } /** Options for saving image to a path. */ export declare class SaveImageOptions extends PartiallyConstructible { /** Quality parameter is for jpeg only and is in range 0 to 100. If -1, then settings from hibernation are used. In case when the Image Ref was created with a lazy load mode and originally has the same format as the requested to save, then setting quality to -1 leads to simply copying from source to destination, which is time efficient and prevents quality loss caused by jpeg encoding/decoding. Default is -1 */ quality: number; /** Encryption mode. Default is IF_AVAILABLE */ encryptionMode: EncryptionMode; /** @param source {@displayType `DeepPartial<SaveImageOptions>`} */ constructor(source?: DeepPartial<SaveImageOptions>); } /** Options for encoding image. */ export declare class EncodeImageOptions extends PartiallyConstructible { /** Quality parameter is for jpeg only and is in range 0 to 100. If -1, then settings from hibernation are used. In case when the Image Ref was created with a lazy load mode and originally has the same format as the requested to save, then setting quality to -1 leads to simply copying from source to destination, which is time efficient and prevents quality loss caused by jpeg encoding/decoding. Default is -1 */ quality: number; /** Image format. Default is JPEG */ format: EncodingFormat; /** @param source {@displayType `DeepPartial<EncodeImageOptions>`} */ constructor(source?: DeepPartial<EncodeImageOptions>); } /** The type of source which originated the underlying image. - `API`: ImageRef was created by a call to an SDK feature, such as a scanner, image processor, etc. - `PLATFORM_IMAGE`: ImageRef was created from a platform image, e.g. Bitmap on Android, UIImage on iOS. - `CAMERA`: ImageRef was created from data from the camera. - `FILE`: ImageRef was created from a file. - `BUFFER`: ImageRef was created from an encoded buffer. - `OTHER`: ImageRef was created from another type, e.g. from custom loader. */ export type ImageSourceType = 'API' | 'PLATFORM_IMAGE' | 'CAMERA' | 'FILE' | 'BUFFER' | 'OTHER'; export declare const ImageSourceTypeValues: ImageSourceType[]; /** Description of source from which the ImageRef was created. */ export declare class ImageSource extends PartiallyConstructible { /** Source type from which the ImageRef was created. */ type: ImageSourceType; /** File from which the ImageRef was created. Non-null only if the image ref was created from file. */ filePath: string | null; /** @param source {@displayType `DeepPartial<ImageSource>`} */ constructor(source?: DeepPartial<ImageSource>); serialize(config?: ToJsonConfiguration): DeepPartial<ImageSource>; } /** ImageRef profile part specific to image information. */ export declare class ImageProfile extends PartiallyConstructible { /** Memory consumption of a memory-backed bitmap. Zero, if the image is hibernating. Default is 0 */ bitmapMemoryConsumption: number; /** Memory consumption of the hibernation buffer. Zero, if the image is not hibernating, or is hibernated to a file. Default is 0 */ hibernationMemoryConsumption: number; /** @param source {@displayType `DeepPartial<ImageProfile>`} */ constructor(source?: DeepPartial<ImageProfile>); serialize(config?: ToJsonConfiguration): DeepPartial<ImageProfile>; } /** ImageRef profile which provides detailed information about stored object. */ export declare class ImageRefProfile extends PartiallyConstructible { /** Information about the strong and serialized references to the image. */ refInfo: RefCountedObjectProfile; /** Image-specific information, e.g. memory consumption. */ imageInfo: ImageProfile; /** Description of source from which the ImageRef was created. Non-null only if detailed profiling has been previously enabled by a call to enableDetailedProfiling. */ imageSource: ImageSource | null; /** @param source {@displayType `DeepPartial<ImageRefProfile>`} */ constructor(source?: DeepPartial<ImageRefProfile>); serialize(config?: ToJsonConfiguration): DeepPartial<ImageRefProfile>; } /** Snapshot of all alive ImageRefs. */ export declare class ImageRefPoolSnapshot extends PartiallyConstructible { /** Detailed profiles of all alive ImageRefs. */ imageRefProfiles: ImageRefProfile[]; /** Estimation of total memory consumption of ImageRefs. Default is 0 */ totalMemoryConsumption: number; /** @param source {@displayType `DeepPartial<ImageRefPoolSnapshot>`} */ constructor(source?: DeepPartial<ImageRefPoolSnapshot>); serialize(config?: ToJsonConfiguration): DeepPartial<ImageRefPoolSnapshot>; } /** difference between two snapshots. */ export declare class ImageRefPoolSnapshotsDiff extends PartiallyConstructible { /** Difference between total memory consumption in two snapshots. Default is 0 */ totalMemoryConsumptionDiff: number; /** Unique ids of ImageRefs that are not present in the second snapshot and present in the first snapshot. */ removed: string[]; /** Profiles of ImageRefs that are present in the second snapshot, but not in the first snapshot. */ added: string[]; /** Profiles of ImageRefs that are present in both snapshots but are different. Profile is considered modified if number of references or memory consumption is different. */ modified: string[]; /** @param source {@displayType `DeepPartial<ImageRefPoolSnapshotsDiff>`} */ constructor(source?: DeepPartial<ImageRefPoolSnapshotsDiff>); serialize(config?: ToJsonConfiguration): DeepPartial<ImageRefPoolSnapshotsDiff>; } //# sourceMappingURL=ImageRefTypes.d.ts.map