UNPKG

dynamsoft-capture-vision-for-node

Version:

Dynamsoft Capture Vision (DCV) is a comprehensive SDK that integrates various functional products. It encompasses image capture, content understanding, result parsing, and interactive workflow. Essentially, DCV processes images to extract specific informa

719 lines (712 loc) 33.5 kB
import { Worker } from 'node:worker_threads'; /** * `ErrorCode` enumerates the specific error codes that the SDK may return, providing a systematic way to identify and handle errors encountered during its operation. */ declare enum EnumErrorCode { /** Operation completed successfully. */ EC_OK = 0, /** An unspecified error occurred. */ EC_UNKNOWN = -10000, /** The system does not have enough memory to perform the requested operation. */ EC_NO_MEMORY = -10001, /** A null pointer was encountered where a valid pointer was required. */ EC_NULL_POINTER = -10002, /** The provided license is not valid. */ EC_LICENSE_INVALID = -10003, /** The provided license has expired. */ EC_LICENSE_EXPIRED = -10004, /** The specified file could not be found. */ EC_FILE_NOT_FOUND = -10005, /** The file type is not supported for processing. */ EC_FILE_TYPE_NOT_SUPPORTED = -10006, /** The image's bits per pixel (BPP) is not supported. */ EC_BPP_NOT_SUPPORTED = -10007, /** The specified index is out of the valid range. */ EC_INDEX_INVALID = -10008, /** The specified custom region value is invalid or out of range. */ EC_CUSTOM_REGION_INVALID = -10010, /** Failed to read the image due to an error in accessing or interpreting the image data. */ EC_IMAGE_READ_FAILED = -10012, /** Failed to read a TIFF image, possibly due to corruption or unsupported format. */ EC_TIFF_READ_FAILED = -10013, /** The provided DIB (Device-Independent Bitmaps) buffer is invalid or corrupted. */ EC_DIB_BUFFER_INVALID = -10018, /** Failed to read a PDF image, possibly due to corruption or unsupported format. */ EC_PDF_READ_FAILED = -10021, /** Required PDF processing DLL is missing. */ EC_PDF_DLL_MISSING = -10022, /** The specified page number is invalid or out of bounds for the document. */ EC_PAGE_NUMBER_INVALID = -10023, /** The specified custom size is invalid or not supported. */ EC_CUSTOM_SIZE_INVALID = -10024, /** The operation timed out. */ EC_TIMEOUT = -10026, /** Failed to parse JSON input. */ EC_JSON_PARSE_FAILED = -10030, /** The JSON type is invalid for the expected context. */ EC_JSON_TYPE_INVALID = -10031, /** The JSON key is invalid or unrecognized in the current context. */ EC_JSON_KEY_INVALID = -10032, /** The JSON value is invalid for the specified key. */ EC_JSON_VALUE_INVALID = -10033, /** The required "Name" key is missing in the JSON data. */ EC_JSON_NAME_KEY_MISSING = -10034, /** The value of the "Name" key is duplicated and conflicts with existing data. */ EC_JSON_NAME_VALUE_DUPLICATED = -10035, /** The template name is invalid or does not match any known template. */ EC_TEMPLATE_NAME_INVALID = -10036, /** The reference made by the "Name" key is invalid or points to nonexistent data. */ EC_JSON_NAME_REFERENCE_INVALID = -10037, /** The parameter value provided is invalid or out of the expected range. */ EC_PARAMETER_VALUE_INVALID = -10038, /** The domain of the current site does not match the domain bound to the current product key. */ EC_DOMAIN_NOT_MATCH = -10039, /** The reserved information does not match the reserved info bound to the current product key. */ EC_RESERVED_INFO_NOT_MATCH = -10040, /** The license key does not match the license content. */ EC_LICENSE_KEY_NOT_MATCH = -10043, /** Failed to request the license content from the server. */ EC_REQUEST_FAILED = -10044, /** Failed to initialize the license. */ EC_LICENSE_INIT_FAILED = -10045, /** Error setting the mode's argument, indicating invalid or incompatible arguments. */ EC_SET_MODE_ARGUMENT_ERROR = -10051, /** The license content is invalid or corrupted. */ EC_LICENSE_CONTENT_INVALID = -10052, /** The license key is invalid or does not match any known valid keys. */ EC_LICENSE_KEY_INVALID = -10053, /** The license key has reached its maximum allowed usage and has no remaining quota. */ EC_LICENSE_DEVICE_RUNS_OUT = -10054, /** Failed to retrieve the mode's argument, possibly due to invalid state or configuration. */ EC_GET_MODE_ARGUMENT_ERROR = -10055, /** The Intermediate Result Types (IRT) license is invalid or not present. */ EC_IRT_LICENSE_INVALID = -10056, /** Failed to save the file, possibly due to permissions, space, or an invalid path. */ EC_FILE_SAVE_FAILED = -10058, /** The specified stage type is invalid or not supported in the current context. */ EC_STAGE_TYPE_INVALID = -10059, /** The specified image orientation is invalid or not supported. */ EC_IMAGE_ORIENTATION_INVALID = -10060, /** Failed to convert complex template to simplified settings, indicating a configuration or compatibility issue. */ EC_CONVERT_COMPLEX_TEMPLATE_ERROR = -10061, /** Rejecting function call while capturing is in progress, to prevent conflicts or data corruption. */ EC_CALL_REJECTED_WHEN_CAPTURING = -10062, /** The specified image source was not found, indicating a missing or inaccessible input source. */ EC_NO_IMAGE_SOURCE = -10063, /** Failed to read the directory, possibly due to permissions, non-existence, or other access issues. */ EC_READ_DIRECTORY_FAILED = -10064, /** A required module (e.g., DynamsoftBarcodeReader, DynamsoftLabelRecognizer) was not found. */ EC_MODULE_NOT_FOUND = -10065, /** The operation does not support multi-page files; use FileFetcher for processing such files. */ EC_MULTI_PAGES_NOT_SUPPORTED = -10066, /** Indicates an attempt to write to a file that already exists, with overwriting explicitly disabled. This error suggests the need for either enabling overwriting or ensuring unique file names to avoid conflicts. */ EC_FILE_ALREADY_EXISTS = -10067, /** The specified file path does not exist and could not be created. This error could be due to insufficient permissions, a read-only filesystem, or other environmental constraints preventing file creation. */ EC_CREATE_FILE_FAILED = -10068, /** The input ImageData object contains invalid parameters. This could be due to incorrect data types, out-of-range values, or improperly formatted data being passed to a function expecting ImageData. */ EC_IMGAE_DATA_INVALID = -10069, /** The size of the input image does not meet the requirements. */ EC_IMAGE_SIZE_NOT_MATCH = -10070, /** The pixel format of the input image does not meet the requirements. */ EC_IMAGE_PIXEL_FORMAT_NOT_MATCH = -10071, /** The section level result is irreplaceable. */ EC_SECTION_LEVEL_RESULT_IRREPLACEABLE = -10072, /** Incorrect axis definition. */ EC_AXIS_DEFINITION_INCORRECT = -10073, /**The result is not replaceable due to type mismatch*/ EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE = -10074, /**Failed to load the PDF library.*/ EC_PDF_LIBRARY_LOAD_FAILED = -10075, /** Indicates no license is available or the license is not set. */ EC_NO_LICENSE = -20000, /** The provided Handshake Code is invalid or does not match expected format. */ EC_HANDSHAKE_CODE_INVALID = -20001, /** Encountered failures while attempting to read or write to the license buffer. */ EC_LICENSE_BUFFER_FAILED = -20002, /** Synchronization with the license server failed, possibly due to network issues or server unavailability. */ EC_LICENSE_SYNC_FAILED = -20003, /** The device attempting to use the license does not match the device specified in the license buffer. */ EC_DEVICE_NOT_MATCH = -20004, /** Binding the device to the license failed, indicating possible issues with the license or device identifier. */ EC_BIND_DEVICE_FAILED = -20005, /** The number of instances using the license exceeds the limit allowed by the license terms. */ EC_INSTANCE_COUNT_OVER_LIMIT = -20008, /** InitLicenseFromDLS must be called before any SDK objects are created to ensure proper license initialization. */ EC_LICENSE_INIT_SEQUENCE_FAILED = -20009, /** Indicates the license in use is a trial version with limited functionality or usage time. */ EC_TRIAL_LICENSE = -20010, /** The system failed to reach the License Server, likely due to network connectivity issues. */ EC_FAILED_TO_REACH_DLS = -20200, /** Online license validation failed due to network issues. Using cached license information for validation.*/ EC_LICENSE_CACHE_USED = -20012, /** The specified barcode format is invalid or unsupported. */ EC_BARCODE_FORMAT_INVALID = -30009, /** The license for decoding QR Codes is invalid or not present. */ EC_QR_LICENSE_INVALID = -30016, /** The license for decoding 1D barcodes is invalid or not present. */ EC_1D_LICENSE_INVALID = -30017, /** The license for decoding PDF417 barcodes is invalid or not present. */ EC_PDF417_LICENSE_INVALID = -30019, /** The license for decoding DataMatrix barcodes is invalid or not present. */ EC_DATAMATRIX_LICENSE_INVALID = -30020, /** The specified custom module size for barcode generation is invalid or outside acceptable limits. */ EC_CUSTOM_MODULESIZE_INVALID = -30025, /** The license for decoding Aztec barcodes is invalid or not present. */ EC_AZTEC_LICENSE_INVALID = -30041, /** The license for decoding Patchcode barcodes is invalid or not present. */ EC_PATCHCODE_LICENSE_INVALID = -30046, /** The license for decoding postal code formats is invalid or not present. */ EC_POSTALCODE_LICENSE_INVALID = -30047, /** The license for Direct Part Marking (DPM) decoding is invalid or not present. */ EC_DPM_LICENSE_INVALID = -30048, /** A frame decoding thread is already running, indicating a concurrent operation conflict. */ EC_FRAME_DECODING_THREAD_EXISTS = -30049, /** Stopping the frame decoding thread failed, indicating potential issues with thread management. */ EC_STOP_DECODING_THREAD_FAILED = -30050, /** The license for decoding MaxiCode barcodes is invalid or not present. */ EC_MAXICODE_LICENSE_INVALID = -30057, /** The license for decoding GS1 DataBar barcodes is invalid or not present. */ EC_GS1_DATABAR_LICENSE_INVALID = -30058, /** The license for decoding GS1 Composite codes is invalid or not present. */ EC_GS1_COMPOSITE_LICENSE_INVALID = -30059, /** The license for decoding DotCode barcodes is invalid or not present. */ EC_DOTCODE_LICENSE_INVALID = -30061, /** The license for decoding Pharmacode barcodes is invalid or not present. */ EC_PHARMACODE_LICENSE_INVALID = -30062, /** Indicates that the required character model file was not found, possibly due to incorrect paths or missing files. */ EC_CHARACTER_MODEL_FILE_NOT_FOUND = -40100, /**There is a conflict in the layout of TextLineGroup. */ EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT = -40101, /**There is a conflict in the regex of TextLineGroup. */ EC_TEXT_LINE_GROUP_REGEX_CONFLICT = -40102, /** The specified quadrilateral is invalid, potentially due to incorrect points or an unprocessable shape. */ EC_QUADRILATERAL_INVALID = -50057, /** The license for generating or processing panoramas is invalid or missing. */ EC_PANORAMA_LICENSE_INVALID = -70060, /** The specified resource path does not exist, indicating a missing directory or incorrect path specification. */ EC_RESOURCE_PATH_NOT_EXIST = -90001, /** Failed to load the specified resource, which might be due to missing files, access rights, or other issues preventing loading. */ EC_RESOURCE_LOAD_FAILED = -90002, /** The code specification required for processing was not found, indicating a missing or incorrect specification. */ EC_CODE_SPECIFICATION_NOT_FOUND = -90003, /** The full code string provided is empty, indicating no data was provided for processing. */ EC_FULL_CODE_EMPTY = -90004, /** Preprocessing the full code string failed, possibly due to invalid format, corruption, or unsupported features. */ EC_FULL_CODE_PREPROCESS_FAILED = -90005, /** The license required for parsing South Africa Driver License data is invalid or not present. */ EC_ZA_DL_LICENSE_INVALID = -90006, /** The license required for parsing North America DL/ID (AAMVA) data is invalid or not present. */ EC_AAMVA_DL_ID_LICENSE_INVALID = -90007, /** The license required for parsing Aadhaar data is invalid or not present. */ EC_AADHAAR_LICENSE_INVALID = -90008, /** The license required for parsing Machine Readable Travel Documents (MRTD) is invalid or not present. */ EC_MRTD_LICENSE_INVALID = -90009, /** The license required for parsing Vehicle Identification Number (VIN) data is invalid or not present. */ EC_VIN_LICENSE_INVALID = -90010, /** The license required for parsing customized code types is invalid or not present. */ EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID = -90011, /**The license is initialized successfully but detected invalid content in your key.*/ EC_LICENSE_WARNING = -10076, /** [Barcode Reader] No license found.*/ EC_BARCODE_READER_LICENSE_NOT_FOUND = -30063, /**[Label Recognizer] No license found.*/ EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND = -40103, /**[Document Normalizer] No license found.*/ EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND = -50058, /**[Code Parser] No license found.*/ EC_CODE_PARSER_LICENSE_NOT_FOUND = -90012 } declare enum EnumImagePixelFormat { IPF_BINARY = 0, IPF_BINARYINVERTED = 1, IPF_GRAYSCALED = 2, IPF_NV21 = 3, IPF_RGB_565 = 4, IPF_RGB_555 = 5, IPF_RGB_888 = 6, IPF_ARGB_8888 = 7, IPF_RGB_161616 = 8, IPF_ARGB_16161616 = 9, IPF_ABGR_8888 = 10, IPF_ABGR_16161616 = 11, IPF_BGR_888 = 12, IPF_BINARY_8 = 13, IPF_NV12 = 14, IPF_BINARY_8_INVERTED = 15 } declare enum EnumCapturedResultItemType { CRIT_ORIGINAL_IMAGE = 1, CRIT_BARCODE = 2, CRIT_TEXT_LINE = 4, CRIT_DETECTED_QUAD = 8, CRIT_DESKEWED_IMAGE = 16, CRIT_PARSED_RESULT = 32, CRIT_ENHANCED_IMAGE = 64 } declare enum EnumPresetTemplate { /**compatible with "default": DBR + DLR + DDN-Normalize*/ PT_DEFAULT = "Default", /**compatible with "read-barcodes"*/ PT_READ_BARCODES = "ReadBarcodes_Default", /**compatible with "recognize-textlines"*/ PT_RECOGNIZE_TEXT_LINES = "RecognizeTextLines_Default", /**compatible with "detect-document-boundaries"*/ PT_DETECT_DOCUMENT_BOUNDARIES = "DetectDocumentBoundaries_Default", /**compatible with "detect-and-normalize-document"*/ PT_DETECT_AND_NORMALIZE_DOCUMENT = "DetectAndNormalizeDocument_Default", /**compatible with "normalize-document"*/ PT_NORMALIZE_DOCUMENT = "NormalizeDocument_Default", /** * @brief Represents a barcode reading mode where speed is prioritized. * * In this mode, the barcode reader will optimize for faster barcode detection * and decoding, sacrificing some level of accuracy and read rate. It is suitable * for situations where a quick response time is more important than perfect * barcode recognition. */ PT_READ_BARCODES_SPEED_FIRST = "ReadBarcodes_SpeedFirst", /** * @brief Represents a barcode reading mode where barcode read rate is prioritized. * * In this mode, the barcode reader will optimize for higher barcode read rates, * even if it may sometimes result in reduced accuracy and speed. It is suitable for * scenarios where maximizing the number of successfully read barcodes is critical. */ PT_READ_BARCODES_READ_RATE_FIRST = "ReadBarcodes_ReadRateFirst", /** * @brief Represents a barcode reading mode for single barcode code detection. * * In this mode, the barcode reader will focus on detecting and decoding a single * barcode code, ignoring any additional codes in the same image. It is efficient * when the target image has only one barcode. */ PT_READ_SINGLE_BARCODE = "ReadSingleBarcode", /** * @brief Represents a text recognition mode focused on recognizing numbers. */ PT_RECOGNIZE_NUMBERS = "RecognizeNumbers", /** * @brief Represents a text recognition mode focused on recognizing alphabetic characters (letters). * */ PT_RECOGNIZE_LETTERS = "RecognizeLetters", /** * @brief Represents a text recognition mode that combines numbers and alphabetic characters (letters) recognition. */ PT_RECOGNIZE_NUMBERS_AND_LETTERS = "RecognizeNumbersAndLetters", /** * @brief Represents a text recognition mode that combines numbers and uppercase letters recognition. */ PT_RECOGNIZE_NUMBERS_AND_UPPERCASE_LETTERS = "RecognizeNumbersAndUppercaseLetters", /** * @brief Represents a text recognition mode focused on recognizing uppercase letters. */ PT_RECOGNIZE_UPPERCASE_LETTERS = "RecognizeUppercaseLetters" } interface Point { x: number; y: number; } interface Quadrilateral { area: number; points: [Point, Point, Point, Point]; } interface DCVNativeImageData { bytes: { toUint8Array: () => Uint8Array; }; width: number; height: number; stride: number; format: EnumImagePixelFormat; /** EXIF orientation; 1 means no rotate. */ orientation: number; } interface CapturedResultItem { type: EnumCapturedResultItemType; targetROIDefName: string; taskName: string; referenceItem?: CapturedResultItem; } interface OriginalImageResultItem extends CapturedResultItem { type: EnumCapturedResultItemType.CRIT_ORIGINAL_IMAGE; imageData: DCVNativeImageData; } interface BarcodeResultItem extends CapturedResultItem { type: EnumCapturedResultItemType.CRIT_BARCODE; format: { $bigint: string; }; formatString: string; text: string; location: Quadrilateral; confidence: number; angle: number; moduleSize: number; details: object; isDPM: boolean; isMirrored: boolean; bytes: number[]; } interface CharacterResult { characterH: string; characterM: string; characterL: string; characterHConfidence: number; characterMConfidence: number; characterLConfidence: number; location: Quadrilateral; } interface TextLineResultItem extends CapturedResultItem { type: EnumCapturedResultItemType.CRIT_TEXT_LINE; text: string; /** The recognized raw text, excluding any concatenation separators. */ rawText: string; location: Quadrilateral; confidence: number; /** The name of the text line specification that generated this item. */ specificationName: string; characterResults: CharacterResult[]; } interface DetectedQuadResultItem extends CapturedResultItem { type: EnumCapturedResultItemType.CRIT_DETECTED_QUAD; location: Quadrilateral; confidenceAsDocumentBoundary: number; } interface DeskewedImageResultItem extends CapturedResultItem { type: EnumCapturedResultItemType.CRIT_DESKEWED_IMAGE; imageData: DCVNativeImageData; sourceDeskewQuad: Quadrilateral; originalToLocalMatrix: [number, number, number, number, number, number, number, number, number]; } interface ParsedResultItem extends CapturedResultItem { type: EnumCapturedResultItemType.CRIT_PARSED_RESULT; codeType: string; parsed: object; rawCodes: string; } interface EnhancedImageResultItem extends CapturedResultItem { type: EnumCapturedResultItemType.CRIT_ENHANCED_IMAGE; imageData: DCVNativeImageData; originalToLocalMatrix: [number, number, number, number, number, number, number, number, number]; } interface CapturedResult { originalImageTag?: { pageNumber: number; totalPages: number; }; errorCode: number; errorString: string; /** A float[9] which represents the rotation transform matrix. */ rotationTransformMatrix: [number, number, number, number, number, number, number, number, number]; items: CapturedResultItem[]; originalImageItems: OriginalImageResultItem[]; barcodeResultItems: BarcodeResultItem[]; textLineResultItems: TextLineResultItem[]; detectedQuadResultItems: DetectedQuadResultItem[]; deskewedImageResultItems: DeskewedImageResultItem[]; parsedResultItems: ParsedResultItem[]; enhancedImageResultItems: EnhancedImageResultItem[]; } declare const EnumBarcodeFormat: { /**No barcode format in BarcodeFormat*/ BF_NULL: bigint; /**All supported formats in BarcodeFormat*/ BF_ALL: bigint; /**Use the default barcode format settings*/ BF_DEFAULT: bigint; /**Combined value of BF_CODABAR, BF_CODE_128, BF_CODE_39, BF_CODE_39_Extended, BF_CODE_93, BF_EAN_13, BF_EAN_8, INDUSTRIAL_25, BF_ITF, BF_UPC_A, BF_UPC_E, BF_MSI_CODE; */ BF_ONED: bigint; /**Combined value of BF_GS1_DATABAR_OMNIDIRECTIONAL, BF_GS1_DATABAR_TRUNCATED, BF_GS1_DATABAR_STACKED, BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL, BF_GS1_DATABAR_EXPANDED, BF_GS1_DATABAR_EXPANDED_STACKED, BF_GS1_DATABAR_LIMITED*/ BF_GS1_DATABAR: bigint; /**Code 39 */ BF_CODE_39: bigint; /**Code 128 */ BF_CODE_128: bigint; /**Code 93 */ BF_CODE_93: bigint; /**Codabar */ BF_CODABAR: bigint; /**Interleaved 2 of 5 */ BF_ITF: bigint; /**EAN-13 */ BF_EAN_13: bigint; /**EAN-8 */ BF_EAN_8: bigint; /**UPC-A */ BF_UPC_A: bigint; /**UPC-E */ BF_UPC_E: bigint; /**Industrial 2 of 5 */ BF_INDUSTRIAL_25: bigint; /**CODE39 Extended */ BF_CODE_39_EXTENDED: bigint; /**GS1 Databar Omnidirectional*/ BF_GS1_DATABAR_OMNIDIRECTIONAL: bigint; /**GS1 Databar Truncated*/ BF_GS1_DATABAR_TRUNCATED: bigint; /**GS1 Databar Stacked*/ BF_GS1_DATABAR_STACKED: bigint; /**GS1 Databar Stacked Omnidirectional*/ BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL: bigint; /**GS1 Databar Expanded*/ BF_GS1_DATABAR_EXPANDED: bigint; /**GS1 Databar Expaned Stacked*/ BF_GS1_DATABAR_EXPANDED_STACKED: bigint; /**GS1 Databar Limited*/ BF_GS1_DATABAR_LIMITED: bigint; /**Patch code. */ BF_PATCHCODE: bigint; /**PDF417 */ BF_CODE_32: bigint; /**PDF417 */ BF_PDF417: bigint; /**QRCode */ BF_QR_CODE: bigint; /**DataMatrix */ BF_DATAMATRIX: bigint; /**AZTEC */ BF_AZTEC: bigint; /**MAXICODE */ BF_MAXICODE: bigint; /**Micro QR Code*/ BF_MICRO_QR: bigint; /**Micro PDF417*/ BF_MICRO_PDF417: bigint; /**GS1 Composite Code*/ BF_GS1_COMPOSITE: bigint; /**MSI Code*/ BF_MSI_CODE: bigint; BF_CODE_11: bigint; BF_TWO_DIGIT_ADD_ON: bigint; BF_FIVE_DIGIT_ADD_ON: bigint; BF_MATRIX_25: bigint; /**Combined value of BF2_USPSINTELLIGENTMAIL, BF2_POSTNET, BF2_PLANET, BF2_AUSTRALIANPOST, BF2_RM4SCC.*/ BF_POSTALCODE: bigint; /**Nonstandard barcode */ BF_NONSTANDARD_BARCODE: bigint; /**USPS Intelligent Mail.*/ BF_USPSINTELLIGENTMAIL: bigint; /**Postnet.*/ BF_POSTNET: bigint; /**Planet.*/ BF_PLANET: bigint; /**Australian Post.*/ BF_AUSTRALIANPOST: bigint; /**Royal Mail 4-State Customer Barcode.*/ BF_RM4SCC: bigint; /**KIX.*/ BF_KIX: bigint; /**DotCode.*/ BF_DOTCODE: bigint; /**_PHARMACODE_ONE_TRACK.*/ BF_PHARMACODE_ONE_TRACK: bigint; /**PHARMACODE_TWO_TRACK.*/ BF_PHARMACODE_TWO_TRACK: bigint; /**PHARMACODE.*/ BF_PHARMACODE: bigint; }; type EnumBarcodeFormat = bigint; /** Label: DBRJS10.0.10-Check * @enum EnumDeblurMode * * Describes the deblur mode. */ declare enum EnumDeblurMode { /**Performs deblur process using the direct binarization algorithm.*/ DM_DIRECT_BINARIZATION = 1, /**Performs deblur process using the threshold binarization algorithm.*/ DM_THRESHOLD_BINARIZATION = 2, /**Performs deblur process using the gray equalization algorithm.*/ DM_GRAY_EQUALIZATION = 4, /**Performs deblur process using the smoothing algorithm.*/ DM_SMOOTHING = 8, /**Performs deblur process using the morphing algorithm.*/ DM_MORPHING = 16, /**Performs deblur process using the deep analysis algorithm.*/ DM_DEEP_ANALYSIS = 32, /**Performs deblur process using the sharpening algorithm.*/ DM_SHARPENING = 64, /**Performs deblur process based on the binary image from the localization process.*/ DM_BASED_ON_LOC_BIN = 128, /**Performs deblur process using the sharpening and smoothing algorithm.*/ DM_SHARPENING_SMOOTHING = 256, /**Reserved setting for deblur mode.*/ DM_REV = -2147483648, /**Skips the deblur process.*/ DM_SKIP = 0 } /** Label: DBRJS10.0.10-Check * @enum EnumLocalizationMode * * Describes the localization mode. */ declare enum EnumLocalizationMode { /**Not supported yet. */ LM_AUTO = 1, /**Localizes barcodes by searching for connected blocks. This algorithm usually gives best result and it is recommended to set ConnectedBlocks to the highest priority. */ LM_CONNECTED_BLOCKS = 2, /**Localizes barcodes by groups of contiguous black-white regions. This is optimized for QRCode and DataMatrix. */ LM_STATISTICS = 4, /**Localizes barcodes by searching for groups of lines. This is optimized for 1D and PDF417 barcodes. */ LM_LINES = 8, /**Localizes barcodes quickly. This mode is recommended in interactive scenario. Check @ref LM for available argument settings.*/ LM_SCAN_DIRECTLY = 16, /**Localizes barcodes by groups of marks.This is optimized for DPM codes. */ LM_STATISTICS_MARKS = 32, /**Localizes barcodes by groups of connected blocks and lines.This is optimized for postal codes. */ LM_STATISTICS_POSTAL_CODE = 64, /**Localizes barcodes from the centre of the image. Check @ref LM for available argument settings. */ LM_CENTRE = 128, /**Localizes 1D barcodes fast. Check @ref LM for available argument settings. */ LM_ONED_FAST_SCAN = 256, LM_REV = -2147483648, /**Skips localization. */ LM_SKIP = 0 } type intptr = any; type PlainObject = object; interface DCVError extends Error { dcvErrorCode: number; } interface DCVImageData { bytes: Uint8Array; width: number; height: number; stride: number; format: EnumImagePixelFormat; /** EXIF orientation; 1 or undefined means no rotate. */ orientation?: number; } type DCVWorker = Worker & { cvr: CaptureVisionRouter; }; declare const LicenseManager: { /** Accept license start with `t`, `f`, `DLS2` or `DLC2`. */ initLicense: (license: string) => void; setDeviceFriendlyName: (name: string) => void; setLicenseCachePath: (directoryPath: string) => void; getDeviceUUID: () => any; _clearDeviceUUID: () => void; _clearLicenseCache: () => void; }; declare class CaptureVisionRouter { static get version(): string; /** Queue length waiting for capturing. */ static get waitQueueLength(): number; static get maxWorkerCount(): number; static set maxWorkerCount(value: number); /** Terminate idle workers. This way you can exit your process if there is no other code running. */ static terminateIdleWorkers(): Promise<void>; static _instance: CaptureVisionRouter; static _presetTemplate: string; _instanceID: intptr; _template: string; _updVer: number; _nextUpdVer(): void; constructor(); initSettings(filePath: string): void; initSettings(template: string): void; initSettings(template: PlainObject): void; _initSettings(template: string): void; outputSettings(templateName?: EnumPresetTemplate | string): any; resetSettings(): void; _capture(inputData: any, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; _multi?: boolean; }): CapturedResult | CapturedResult[]; _captureAsync(inputData: any, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; worker?: DCVWorker; dataTransferType?: "move" | "copy"; _multi?: boolean; }): Promise<CapturedResult | CapturedResult[]>; capture(imageData: DCVImageData, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; }): CapturedResult; capture(fileBytes: Uint8Array, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; }): CapturedResult; capture(filePath: string, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; }): CapturedResult; captureMultiPages(fileBytes: Uint8Array, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; }): CapturedResult[]; captureMultiPages(filePath: string, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; }): CapturedResult[]; captureAsync(imageData: DCVImageData, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; dataTransferType?: "move" | "copy"; }): Promise<CapturedResult>; captureAsync(fileBytes: Uint8Array, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; dataTransferType?: "move" | "copy"; }): Promise<CapturedResult>; captureAsync(filePath: string, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; }): Promise<CapturedResult>; captureMultiPagesAsync(fileBytes: Uint8Array, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; dataTransferType?: "move" | "copy"; }): Promise<CapturedResult[]>; captureMultiPagesAsync(filePath: string, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; }): Promise<CapturedResult[]>; addIntermediateResultReceiver(dylibName: string, cFuncCreateIrr: string, args: string, cFuncDeleteIrr: string): intptr; removeIntermediateResultReceiver(irr: intptr): void; static initSettings(filePath: string): void; static initSettings(template: string): void; static initSettings(template: PlainObject): void; static _initSettings(template: string): void; static outputSettings(templateName?: EnumPresetTemplate | string): any; static resetSettings(): void; static capture(imageData: DCVImageData, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; }): CapturedResult; static capture(fileBytes: Uint8Array, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; }): CapturedResult; static capture(filePath: string, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; }): CapturedResult; static captureMultiPages(fileBytes: Uint8Array, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; }): CapturedResult[]; static captureMultiPages(filePath: string, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; }): CapturedResult[]; static _captureAsync(inputData: any, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; dataTransferType?: "move" | "copy"; _multi?: boolean; }): Promise<CapturedResult | CapturedResult[]>; static captureAsync(imageData: DCVImageData, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; dataTransferType?: "move" | "copy"; }): Promise<CapturedResult>; static captureAsync(fileBytes: Uint8Array, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; dataTransferType?: "move" | "copy"; }): Promise<CapturedResult>; static captureAsync(filePath: string, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; }): Promise<CapturedResult>; static captureMultiPagesAsync(fileBytes: Uint8Array, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; dataTransferType?: "move" | "copy"; }): Promise<CapturedResult[]>; static captureMultiPagesAsync(filePath: string, config: EnumPresetTemplate | string | { templateName: EnumPresetTemplate | string; }): Promise<CapturedResult[]>; static addIntermediateResultReceiver(dylibName: string, cFuncCreateIrr: string, args: string, cFuncDeleteIrr: string): intptr; static removeIntermediateResultReceiver(irr: intptr): void; } declare const ImageIO: { saveToFile: (imageData: DCVImageData | DCVNativeImageData, filePath: string, overwrite?: boolean) => void; }; declare const ImageDrawer: { drawOnImage: (imageData: DCVImageData | DCVNativeImageData, quads: Quadrilateral[], color?: number, thickness?: number) => DCVImageData; }; export { BarcodeResultItem, CaptureVisionRouter, CapturedResult, CapturedResultItem, CharacterResult, DCVError, DCVImageData, DCVNativeImageData, DeskewedImageResultItem, DetectedQuadResultItem, EnhancedImageResultItem, EnumBarcodeFormat, EnumCapturedResultItemType, EnumDeblurMode, EnumErrorCode, EnumImagePixelFormat, EnumLocalizationMode, EnumPresetTemplate, ImageDrawer, ImageIO, LicenseManager, OriginalImageResultItem, ParsedResultItem, Point, Quadrilateral, TextLineResultItem, intptr };