Skip to content
Merged

Dev #113

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ yarn.lock
/src
/doc
/Web.config
/samples.url
/samples
/temp
/public
Expand Down
2 changes: 1 addition & 1 deletion Api Reference.url
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[InternetShortcut]
URL=https://www.dynamsoft.com/help/Barcode-Reader-WASM/
URL=https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=9.2.11
177 changes: 98 additions & 79 deletions README.md

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions dist/dbr-9.0.2.browser.worker.js

This file was deleted.

Binary file removed dist/dbr-9.0.2.wasm
Binary file not shown.
11 changes: 11 additions & 0 deletions dist/dbr-9.2.11.browser.worker.js

Large diffs are not rendered by default.

Binary file not shown.
File renamed without changes.
Binary file added dist/dbr-9.2.11.wasm
Binary file not shown.
File renamed without changes.
11 changes: 0 additions & 11 deletions dist/dbr.browser.pure.esm.js

This file was deleted.

11 changes: 0 additions & 11 deletions dist/dbr.browser.pure.js

This file was deleted.

11 changes: 0 additions & 11 deletions dist/dbr.browser.pure.mjs

This file was deleted.

9 changes: 4 additions & 5 deletions dist/dbr.js

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions dist/dbr.mjs

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions dist/dbr.pure.esm.js

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions dist/dbr.pure.js

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions dist/dbr.pure.mjs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/dbr.ui.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<path d="M1024 672q119 0 203.5 84.5t84.5 203.5-84.5 203.5-203.5 84.5-203.5-84.5-84.5-203.5 84.5-203.5 203.5-84.5zm704-416q106 0 181 75t75 181v896q0 106-75 181t-181 75h-1408q-106 0-181-75t-75-181v-896q0-106 75-181t181-75h224l51-136q19-49 69.5-84.5t103.5-35.5h512q53 0 103.5 35.5t69.5 84.5l51 136h224zm-704 1152q185 0 316.5-131.5t131.5-316.5-131.5-316.5-316.5-131.5-316.5 131.5-131.5 316.5 131.5 316.5 316.5 131.5z" />
</svg>
<div class="dce-video-container" style="position:absolute;left:0;top:0;width:100%;height:100%;"></div>
<div class="dce-scanarea" style="position:absolute;left:0;top:0;width:100%;height:100%;">
<div class="dce-scanarea" style="position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;">
<div class="dce-scanlight" style="display:none;position:absolute;width:100%;height:3%;border-radius:50%;box-shadow:0px 0px 2vw 1px #00e5ff;background:#fff;animation:3s infinite dce-scanlight;user-select:none;"></div>
</div>
<div style="position:absolute;left:0;top:0;">
Expand All @@ -23,7 +23,7 @@
</svg>
</button>
<!-- The "Powered by Dynamsoft" logo can be easily removed by eliminating the following line. -->
<div class="dbr-msg-poweredby" style="position:absolute;left:50%;bottom:10%;transform:translateX(-50%);">
<div class="dbr-msg-poweredby" style="position:absolute;left:50%;bottom:10%;transform:translateX(-50%);pointer-events:none;">
<svg viewBox="0 0 94 17" style="height:max(3vmin,17px);fill:#FFFFFF;">
<g>
<path d="M0.9,14V4.3h2.3c0.6,0,1,0.1,1.4,0.3c0.3,0.2,0.6,0.5,0.7,0.9s0.2,0.8,0.2,1.4c0,0.5-0.1,0.9-0.2,1.3
Expand Down
2 changes: 1 addition & 1 deletion dist/dls.license.dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div style="height:32px;background:#000;position:relative;">
<i class="dls-license-icon-error" style="width:20px;height:20px;top:5px;left:16px;position:absolute;display:inline-block;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsSAAALEgHS3X78AAABRUlEQVQ4jZ1UwU3EQAwc0BWQEq4DwhcJKSVQwpZwJVDClZASKCF8eKeE0EEoAA3y3Vgyi/cuhyVrtVnv2BmP944kGtYDGLTuFbIAmAFMWv+aAVZeSC48m60TyVf5VJ2V+n7cdCRnBY8k+ySZe68Y6k5XA+5Jrjq8BJQBz7prGHAOnQ/jbG2R2rBOnOLEt3hgUtkx40jfjkmlZgUqeWz8zlqBFn3LaDGMGUIeLnDkoJfAIAzurvAzi9cP7Z+a+pPdbyDdhP0t768FW4WfCpyS8wLgCOBZe48ZG4m/nMyl0c2as6xR7oYxRlHXUiiNBvQJ4OjijpfNDjdMSdQrPUk8OCjLVqBBjwVjxbuKVB+7Ip+SZpmMXgA8AHgH8PhLSuGlWUODzN7C6xPNJysdhvi7bgZ0ejn+47Hllrk1gpvdZZPp6nYn8QM3jKdoTCb4owAAAABJRU5ErkJggg==');"></i>
<i class="dls-license-icon-warn" style="width:20px;height:20px;top:5px;left:16px;position:absolute;display:inline-block;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsSAAALEgHS3X78AAABKklEQVQ4ja1UAXHDMAz85QogEMqgGYNAGIRAMIRCKISMQSF4CGYIHYMMwe/UvW6e66RZl7/T6WJJL0W29EQSM+gA9NJ7uVwAJABR+hZGWMhA8sJvmI4kj5JY2IYyPv9oSSY5jyS7SjKXTj5UTFsS7klOMtaIuoXzpFjjgPfQ+2E9myqdORY6R6ueGrodgAHAAcDzDNk9TOJ4N90ACABeZ29tHZI4QqPqxn+QOYzj0GxA9AubE9qlfGga4oLfeQWXcXw2IgobFBeuibNHfVqYjNMd++iP2w8GjVFYCFpKRp/r3BCUZS1Rr2XBfEnsiqb6pAySWLksG88Xvd83TdjPUGSbZlIvfD2ds+2TI8mvr1We/67DiK6b4xHxIKvKMlez/kX82dxs3oeExBcP2agdc6IF/QAAAABJRU5ErkJggg==');"></i>
<i class="dls-license-icon-close" style="width:14px;height:14px;position:absolute;top:8px;right:8px;line-height:14px;color:#ccc;font-size:14px;font-style:normal;display:inline-block;cursor:pointer;" onclick="this.parentElement.parentElement.parentElement.parentElement.removeChild(this.parentElement.parentElement.parentElement);">x</i>
<i class="dls-license-icon-close" style="width:40px;height:32px;position:absolute;right:0;top:0;line-height:32px;color:#ccc;font-size:18px;font-style:normal;text-align:center;display:inline-block;cursor:pointer;" onclick="this.parentElement.parentElement.parentElement.parentElement.removeChild(this.parentElement.parentElement.parentElement);">x</i>
</div>
<div class="dls-license-msg-content" style="font-size:17px;line-height:24px;padding:25px 20px 20px 25px;"></div>
</div>
Expand Down
51 changes: 21 additions & 30 deletions dist/types/class/barcodereader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,7 @@ import { ImageSource } from '../interface/imagesource';
import { DSImage } from '../interface/dsimage';
import { ScanSettings } from '../interface/scanSettings';
import { ScannerPlayCallbackInfo } from '../interface/scannerplaycallbackinfo';
/**
* The `BarcodeReader` class is used for image decoding
* Comparing to `BarcodeScanner`, the default decoding settings are more accurate but slower.
* ```js
* let pReader = null;
* (async()=>{
* let reader = await (pReader = pReader || Dynamsoft.DBR.BarcodeReader.createInstance());
* let results = await reader.decode(imageSource);
* for(let result of results){
* console.log(result.barcodeText);
* }
* })();
* ```
*/
import { Warning } from '../interface/warning';
export default class BarcodeReader {
private static _jsVersion;
private static _jsEditVersion;
Expand All @@ -41,7 +28,7 @@ export default class BarcodeReader {
* ```
* For convenience, you can set `license` in `script` tag instead.
* ```html
* <script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.0.2/dist/dbr.js" data-license="PRODUCT-KEYS"></script>
* <script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.11/dist/dbr.js" data-license="PRODUCT-KEYS"></script>
* ```
*/
static set license(license: string);
Expand Down Expand Up @@ -96,7 +83,7 @@ export default class BarcodeReader {
* If the auto-explored engine location is incorrect, you can manually specify the engine location.
* The property needs to be set before [[loadWasm]].
* ```js
* Dynamsoft.DBR.BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.0.2/dist/";
* Dynamsoft.DBR.BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.11/dist/";
* await Dynamsoft.DBR.BarcodeReader.loadWasm();
* ```
*/
Expand All @@ -116,8 +103,6 @@ export default class BarcodeReader {
/** @ignore */
static _isShowRelDecodeTimeInResults: boolean;
/** @ignore */
_canvasMaxWH: number;
/** @ignore */
static _onLog: any;
/** @ignore */
static _bWasmDebug: boolean;
Expand Down Expand Up @@ -162,8 +147,6 @@ export default class BarcodeReader {
/** @ignore */
static isDSImage(value: any): boolean;
/** @ignore */
static isCameraEnhancer(value: any): boolean;
/** @ignore */
static isDCEFrame(value: any): boolean;
/** @ignore */
_instanceID: number;
Expand Down Expand Up @@ -246,7 +229,7 @@ export default class BarcodeReader {
* The url of the default scanner UI.
* Can only be changed before `createInstance`.
* ```js
* Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.0.2/dist/dbr.ui.html";
* Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.11/dist/dbr.ui.html";
* let pScanner = null;
* (async()=>{
* let scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());
Expand All @@ -255,6 +238,8 @@ export default class BarcodeReader {
* ```
*/
static set defaultUIElementURL(value: string);
static onWarning: (warning: Warning) => void;
protected static _fireHTTPSWarnning(): void;
/** @ignore */
intervalTime: number;
/** @ignore */
Expand All @@ -266,7 +251,7 @@ export default class BarcodeReader {
protected array_decodeFrameTimeCost: any[];
/** @ignore */
protected _indexCurrentDecodingFrame: number;
protected resultsOverlay: HTMLCanvasElement;
protected _dbrDrawingLayer: any;
protected _bPauseScan: boolean;
protected _intervalDetectVideoPause: number;
/** @ignore */
Expand Down Expand Up @@ -342,6 +327,7 @@ export default class BarcodeReader {
* @ignore
*/
private set whenToVibrateforSuccessfulRead(value);
protected captureAndDecodeInParallel: boolean;
/**
* Set the style used when filling in located barcode.
* @category UI
Expand All @@ -360,8 +346,9 @@ export default class BarcodeReader {
private _dce;
protected set dce(value: CameraEnhancer);
protected get dce(): CameraEnhancer;
private dceConfig;
private imgSource;
protected _drawingItemNamespace: any;
private _dceControler;
private _imgSource;
private callbackCameraChange?;
private callbackResolutionChange?;
private callbackCameraClose?;
Expand All @@ -370,9 +357,9 @@ export default class BarcodeReader {
/** @ignore */
set maxCvsSideLength(value: number);
get maxCvsSideLength(): number;
private updateDCEConfig;
private releaseDCEConfig;
setImageSource(imgSource: ImageSource | CameraEnhancer): void;
private _registerDCEControler;
private _logoutDCEControler;
setImageSource(imgSource: ImageSource | CameraEnhancer, options?: any): Promise<void>;
/**
* Before most operations, `loadWasm` needs to be excuted firstly.
* Most time, you do not need excute `loadWasm` manually. Because when you excute [[createInstance]], `loadWasm` will be excuted implicitly.
Expand Down Expand Up @@ -588,7 +575,9 @@ export default class BarcodeReader {
private _decode_Url;
private _decode_FilePath;
/** @ignore */
static fixResultLocationWhenFilterRegionInJs(region: any, results: TextResult[], sx: number, sy: number, sWidth: number, sHeight: number, dWidth: number, dHeight: number): void;
static recalculateResultLocation(results: Array<{
localizationResult: any;
}>, sx: number, sy: number, sWidth: number, sHeight: number, dWidth: number, dHeight: number): void;
/** @ignore */
static BarcodeReaderException(ag0: any, ag1: any): BarcodeReaderException;
protected _handleRetJsonString(objRet: any): any;
Expand Down Expand Up @@ -684,7 +673,9 @@ export default class BarcodeReader {
* @ignore
*/
protected _getVideoFrame(): DCEFrame;
protected _drawResults(results: TextResult[]): void;
protected _drawResults(results: Array<{
localizationResult: any;
}>): void;
private _tempSolutionStatus;
/**
* Bind UI, open the camera, start recognizing.
Expand All @@ -707,7 +698,7 @@ export default class BarcodeReader {
* Pause the recognizing process.
* @category Pause and Resume
*/
pauseScanning(): void;
pauseScanning(options?: any): void;
/**
* Resume the recognizing process.
* @category Pause and Resume
Expand Down
24 changes: 18 additions & 6 deletions dist/types/class/barcodescanner.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import BarcodeReader from './barcodereader';
import { RuntimeSettings } from '../interface/runtimesettings';
import { Region } from '../interface/region';
import { DCEFrame } from 'dynamsoft-camera-enhancer';
import { Warning } from '../interface/warning';
/**
* The `BarcodeScanner` class is used for video decoding.
* ```js
Expand All @@ -21,6 +22,10 @@ export default class BarcodeScanner extends BarcodeReader {
* Get the current version.
*/
static get version(): string;
static onWarning: (warning: Warning) => void;
protected static _fireHTTPSWarnning(): void;
onWarning: (warning: Warning) => void;
private _fireResolutionWarning;
/** @ignore */
/**
* Get HTML element containing the `BarcodeScanner` instance.
Expand Down Expand Up @@ -87,6 +92,9 @@ export default class BarcodeScanner extends BarcodeReader {
onFrameRead?: (results: TextResult[]) => void;
get onUnduplicatedRead(): (txt: string, result: TextResult) => void;
set onUnduplicatedRead(value: (txt: string, result: TextResult) => void);
get video(): HTMLVideoElement;
set videoSrc(source: string | MediaStream | MediaSource | Blob);
get videoSrc(): string | MediaStream | MediaSource | Blob;
private _assertOpen;
/**
* Set the style used when filling the mask beyond the region.
Expand Down Expand Up @@ -264,6 +272,10 @@ export default class BarcodeScanner extends BarcodeReader {
*/
set ifShowScanRegionMask(value: boolean);
get ifShowScanRegionMask(): boolean;
set ifSaveLastUsedCamera(value: boolean);
get ifSaveLastUsedCamera(): boolean;
set ifSkipCameraInspection(value: boolean);
get ifSkipCameraInspection(): boolean;
/**
* Stop the video, and release the camera.
* ```js
Expand Down Expand Up @@ -304,7 +316,7 @@ export default class BarcodeScanner extends BarcodeReader {
* ```
* @category Play and Pause
*/
pauseScan(): void;
pauseScan(options?: any): void;
/**
* Resume the decoding process.
* ```js
Expand Down Expand Up @@ -470,7 +482,7 @@ export default class BarcodeScanner extends BarcodeReader {
* @fires [[onPlayed]],[[onUniqueRead]],[[onFrameRead]]
* @category Open and Close
*/
open(): Promise<import("dynamsoft-camera-enhancer/dist/types/interface/playcallbackinfo").PlayCallbackInfo>;
open(): Promise<import("dynamsoft-camera-enhancer").PlayCallbackInfo>;
/**
* Bind UI, open the camera, but not decode.
* ```js
Expand All @@ -482,7 +494,7 @@ export default class BarcodeScanner extends BarcodeReader {
* @fires [[onPlayed]],[[onUniqueRead]],[[onFrameRead]]
* @category Open and Close
*/
openVideo(): Promise<import("dynamsoft-camera-enhancer/dist/types/interface/playcallbackinfo").PlayCallbackInfo>;
openVideo(): Promise<import("dynamsoft-camera-enhancer").PlayCallbackInfo>;
/**
* Stop decoding, release camera, unbind UI.
* ```js
Expand All @@ -499,15 +511,15 @@ export default class BarcodeScanner extends BarcodeReader {
/**
* Bind UI, open the camera, start decoding, and remove the UIElement `display` style if the original style is `display:none;`.
* ```js
* await scanner.setUIElement("https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.0.2/dist/dbr.ui.html");
* await scanner.setUIElement("https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.11/dist/dbr.ui.html");
* scanner.onUniqueRead = (txt, result) => { alert(txt); console.log(result); };
* await scanner.show();
* // await scanner.hide();
* ```
* @fires [[onPlayed]],[[onUniqueRead]],[[onFrameRead]]
* @category Open and Close
*/
show(): Promise<import("dynamsoft-camera-enhancer/dist/types/interface/playcallbackinfo").PlayCallbackInfo>;
show(): Promise<import("dynamsoft-camera-enhancer").PlayCallbackInfo>;
/**
* Bind UI, open the camera, but not decode, and remove the UIElement `display` style if the original style is `display:none;`.
* ```js
Expand All @@ -518,7 +530,7 @@ export default class BarcodeScanner extends BarcodeReader {
* @fires [[onPlayed]],[[onUniqueRead]],[[onFrameRead]]
* @category Open and Close
*/
showVideo(): Promise<import("dynamsoft-camera-enhancer/dist/types/interface/playcallbackinfo").PlayCallbackInfo>;
showVideo(): Promise<import("dynamsoft-camera-enhancer").PlayCallbackInfo>;
/**
* Stop decoding, release camera, unbind UI, and set the Element as `display:none;`.
* ```js
Expand Down
7 changes: 6 additions & 1 deletion dist/types/dbr.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@ import { EnumTextFilterMode } from "./enum/enumtextfiltermode";
import { EnumTextResultOrderMode } from "./enum/enumtextresultordermode";
import { EnumTextureDetectionMode } from "./enum/enumtexturedetectionmode";
import { TextResult } from "./interface/textresult";
export { BarcodeReader, BarcodeScanner, EnumBarcodeColourMode, EnumBarcodeComplementMode, EnumBarcodeFormat, EnumBarcodeFormat_2, EnumBinarizationMode, EnumClarityCalculationMethod, EnumClarityFilterMode, EnumColourClusteringMode, EnumColourConversionMode, EnumConflictMode, EnumDeblurMode, EnumDeformationResistingMode, EnumDPMCodeReadingMode, EnumErrorCode, EnumGrayscaleTransformationMode, EnumImagePixelFormat, EnumImagePreprocessingMode, EnumIMResultDataType, EnumIntermediateResultSavingMode, EnumIntermediateResultType, EnumLocalizationMode, EnumPDFReadingMode, EnumQRCodeErrorCorrectionLevel, EnumRegionPredetectionMode, EnumResultCoordinateType, EnumResultType, EnumScaleUpMode, EnumTerminatePhase, EnumTextFilterMode, EnumTextResultOrderMode, EnumTextureDetectionMode, TextResult, };
import { RuntimeSettings } from "./interface/runtimesettings";
import { ScanSettings } from "./interface/scanSettings";
import { Region } from "./interface/region";
import { ImageSource } from "./interface/imagesource";
import { DSImage } from "./interface/dsimage";
export { BarcodeReader, BarcodeScanner, EnumBarcodeColourMode, EnumBarcodeComplementMode, EnumBarcodeFormat, EnumBarcodeFormat_2, EnumBinarizationMode, EnumClarityCalculationMethod, EnumClarityFilterMode, EnumColourClusteringMode, EnumColourConversionMode, EnumConflictMode, EnumDeblurMode, EnumDeformationResistingMode, EnumDPMCodeReadingMode, EnumErrorCode, EnumGrayscaleTransformationMode, EnumImagePixelFormat, EnumImagePreprocessingMode, EnumIMResultDataType, EnumIntermediateResultSavingMode, EnumIntermediateResultType, EnumLocalizationMode, EnumPDFReadingMode, EnumQRCodeErrorCorrectionLevel, EnumRegionPredetectionMode, EnumResultCoordinateType, EnumResultType, EnumScaleUpMode, EnumTerminatePhase, EnumTextFilterMode, EnumTextResultOrderMode, EnumTextureDetectionMode, TextResult, RuntimeSettings, ScanSettings, Region, ImageSource, DSImage };
//# sourceMappingURL=dbr.d.ts.map
1 change: 1 addition & 0 deletions dist/types/interface/scanSettings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@ export interface ScanSettings {
* @see [[whenToVibrateforSuccessfulRead]]
*/
vibrateDuration?: number;
captureAndDecodeInParallel?: boolean;
}
//# sourceMappingURL=scanSettings.d.ts.map
5 changes: 5 additions & 0 deletions dist/types/interface/warning.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface Warning {
id: number;
message: string;
}
//# sourceMappingURL=warning.d.ts.map
Loading