Skip to content
Merged
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
11 changes: 6 additions & 5 deletions _includes/sidelist-programming/programming-js.html
Original file line number Diff line number Diff line change
Expand Up @@ -932,11 +932,12 @@
<ul>
<li lang="android"><a href="{{ site.code_types }}" class="otherLinkColour">Supported Code Types</a>
<ul>
<li lang="android"><a href="{{ site.code_types }}mrtd.html" class="otherLinkColour">Machine Readable Travel Documents</a></li>
<li lang="android"><a href="{{ site.code_types }}aamva-dl-id.html" class="otherLinkColour">North America DL/ID</a></li>
<li lang="android"><a href="{{ site.code_types }}za-dl.html" class="otherLinkColour">South Africa Driver License</a></li>
<li lang="android"><a href="{{ site.code_types }}aadhaar.html" class="otherLinkColour">Aadhaar</a></li>
<li lang="android"><a href="{{ site.code_types }}vin.html" class="otherLinkColour">Vehicle Identification Number</a></li>
<li><a href="{{ site.code_types }}mrtd.html" class="otherLinkColour">Machine Readable Travel Documents</a></li>
<li><a href="{{ site.code_types }}aamva-dl-id.html" class="otherLinkColour">North America DL/ID</a></li>
<li><a href="{{ site.code_types }}za-dl.html" class="otherLinkColour">South Africa Driver License</a></li>
<li><a href="{{ site.code_types }}aadhaar.html" class="otherLinkColour">Aadhaar</a></li>
<li><a href="{{ site.code_types }}vin.html" class="otherLinkColour">Vehicle Identification Number</a></li>
<li><a href="{{ site.code_types }}gs1-ai.html" class="otherLinkColour">GS1 Application Identifiers (AI)</a></li>
</ul>
</li>
<li>
Expand Down
5 changes: 4 additions & 1 deletion _includes/sidelist-programming/sidelist-parameters.html
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,9 @@
<li><a href="{{ site.dcvb_parameters }}barcode-format-specification/enable-addon-code.html" class="otherLinkColour">EnableAddOnCode</a></li>
<li><a href="{{ site.dcvb_parameters }}barcode-format-specification/enable-data-matrix-ecc000-140.html" class="otherLinkColour">EnableDataMatrixECC000-140</a></li>
<li><a href="{{ site.dcvb_parameters }}barcode-format-specification/enable-qr-code-model-1.html" class="otherLinkColour">EnableQRCodeModel1</a></li>
<li><a href="{{ site.dcvb_parameters }}barcode-format-specification/expected-barcodes-count.html" class="otherLinkColour">ExpectedBarcodesCount</a></li>
<li><a href="{{ site.dcvb_parameters }}barcode-format-specification/find-uneven-module-barcode.html" class="otherLinkColour">FindUnevenModuleBarcode</a></li>
<li><a href="{{ site.dcvb_parameters }}barcode-format-specification/has-vertical-quietzone.html" class="otherLinkColour">HasVerticalQuietZone</a></li>
<li><a href="{{ site.dcvb_parameters }}barcode-format-specification/head-module-ratio.html" class="otherLinkColour">HeadModuleRatio</a></li>
<li><a href="{{ site.dcvb_parameters }}barcode-format-specification/include-implied-ai01.html" class="otherLinkColour">IncludeImpliedAI01</a></li>
<li><a href="{{ site.dcvb_parameters }}barcode-format-specification/include-trailing-check-digit.html" class="otherLinkColour">IncludeTrailingCheckDigit</a></li>
Expand Down Expand Up @@ -497,7 +499,8 @@
</li>
<li><a href="{{ site.dcvb_parameter_file }}auxiliary/global-parameter.html" class="otherLinkColour">Global Parameter</a>
<ul>
<li><a href="{{ site.dcvb_parameters }}global-parameter/max-total-image-dimension.html" class="otherLinkColour">MaxTotalImageDimension</a></li>
<li><a href="{{ site.dcvb_parameters_file }}auxiliary/global-parameter.html#maxtotalimagedimension" class="otherLinkColour">MaxTotalImageDimension</a></li>
<li><a href="{{ site.dcvb_parameters_file }}auxiliary/global-parameter.html#intraopnumthreads" class="otherLinkColour">IntraOpNumThreads</a></li>
</ul>
</li>
<li><a href="{{ site.dcvb_parameter_file }}semantic-processing/index.html" class="otherLinkColour">SemanticProcessing Object</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ breadcrumbText: CVR JavaScript CaptureVisionRouter
| Name | Description |
| -------------------------------------------- | ------------------------------------------------------------------------ |
| [maxImageSideLength](#maximagesidelength) | Limits the maximum pixel value of the longest side of an image during the processing workflow. |
| [appendModelBuffer()](#appendmodelbuffer) | Loads a specific data file containing recognition information. |
| [appendDLModelBuffer()](#appenddlmodelbuffer) | Loads a specific data file containing recognition information. |
| [onDataLoadProgressChanged](#ondataloadprogresschanged) | An event that fires during the loading of a recognition data file (.data). |
| [onCaptureError](#oncaptureerror) | An event that fires when an error occurs from the start of capturing process. |
| `static`[setGlobalIntraOpNumThreads](#setglobalintraopnumthreads) | Sets the global number of threads used internally for model execution. |
| `static`[clearDLModelBuffers](#cleardlmodelbuffers) | Clears all deep learning models from buffer to free up memory. |

## maxImageSideLength

Expand All @@ -28,14 +30,14 @@ The `maxImageSideLength` property limits the maximum pixel value of the longest
maxImageSideLength: number;
```

## appendModelBuffer
## appendDLModelBuffer

Loads a specific data file containing recognition information. This file typically comprises a Convolutional Neural Networks (CNN) model.

**Syntax**

```typescript
static appendModelBuffer(dataName: string, dataPath?: string) : Promise<void>;
static appendDLModelBuffer(dataName: string, dataPath?: string) : Promise<void>;
```

**Parameter**
Expand All @@ -51,7 +53,7 @@ None.
**Code snippet**

```javascript
CaptureVisionRouter.appendModelBuffer("sample-model.data")
CaptureVisionRouter.appendDLModelBuffer("sample-model.data")
.then(() => {
console.log("Model appended successfully.");
})
Expand All @@ -60,6 +62,10 @@ CaptureVisionRouter.appendModelBuffer("sample-model.data")
});
```

**Remarks**

This method was renamed from `appendModelBuffer()` in Dynamsoft Barcode Reader Bundle version 11.2.2000 and Dynamsoft Capture Vision Bundle version 3.2.1000.

## onDataLoadProgressChanged

An event that fires during the loading of a recognition data file (.data).
Expand Down Expand Up @@ -122,4 +128,48 @@ CaptureVisionRouter.onCaptureError = function(error) {
// You can also show an alert or update the UI
alert("An error occurred during capture: " + error.message);
};
```
```

## setGlobalIntraOpNumThreads

Sets the global number of threads used internally for model execution.

**Syntax**

```typescript
static setGlobalIntraOpNumThreads(intraOpNumThreads?: number): Promise<void>;
```

**Parameter**

`intraOpNumThreads`(optional) : Number of threads used internally for model execution.

**Code snippet**

```javascript
await CaptureVisionRouter.setGlobalIntraOpNumThreads(4);
```

**Remarks**

Introduced in Dynamsoft Barcode Reader Bundle version 11.2.2000 and Dynamsoft Capture Vision Bundle version 3.2.1000.

## clearDLModelBuffers

Clears all deep learning models from buffer to free up memory.

**Syntax**

```typescript
static clearDLModelBuffers(): Promise<void>;
```

**Code snippet**

```javascript
await CaptureVisionRouter.clearDLModelBuffers();
```

**Remarks**

Introduced in Dynamsoft Barcode Reader Bundle version 11.2.2000 and Dynamsoft Capture Vision Bundle version 3.2.1000.
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ breadcrumbText: CVR JavaScript CaptureVisionRouter

# CaptureVisionRouter Settings

| Name | Description |
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [initSettings()](#initsettings) | Configures runtime settings using a provided JSON string, an object, or a URL pointing to an object, which contains settings for one or more `CaptureVisionTemplates`. |
| [outputSettings()](#outputsettings) | Outputs a `CaptureVisionTemplate` specified by its name. |
| [outputSettingsToFile](#outputsettingstofile) | Generates a Blob object or initiates a JSON file download containing the settings for the specified `CaptureVisionTemplate`. |
| [getSimplifiedSettings()](#getsimplifiedsettings) | Retrieves a JSON object that contains simplified settings for the specified `CaptureVisionTemplate`. |
| [getTemplateNames()](#gettemplatenames) | Retrieves the names of all the currently available templates. |
| [updateSettings()](#updatesettings) | Updates the specified `CaptureVisionTemplate` with an updated `SimplifiedCaptureVisionSettings` object. |
| [resetSettings()](#resetsettings) | Restores all runtime settings to their original default values. |
| Name | Description |
| ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [initSettings()](#initsettings) | Configures runtime settings using a provided JSON string, an object, or a URL pointing to an object, which contains settings for one or more `CaptureVisionTemplates`. |
| [outputSettings()](#outputsettings) | Outputs a `CaptureVisionTemplate` specified by its name. |
| [outputSettingsToFile](#outputsettingstofile) | Generates a Blob object or initiates a JSON file download containing the settings for the specified `CaptureVisionTemplate`. |
| [getSimplifiedSettings()](#getsimplifiedsettings) | Retrieves a JSON object that contains simplified settings for the specified `CaptureVisionTemplate`. |
| [getTemplateNames()](#gettemplatenames) | Retrieves the names of all the currently available templates. |
| [updateSettings()](#updatesettings) | Updates the specified `CaptureVisionTemplate` with an updated `SimplifiedCaptureVisionSettings` object. |
| [resetSettings()](#resetsettings) | Restores all runtime settings to their original default values. |
| [switchCapturingTemplate()](#switchcapturingtemplate) | Switches the currently active capturing template during the image processing workflow. |


## initSettings
Expand Down Expand Up @@ -235,3 +236,34 @@ A promise that resolves when the operation has completed. It provides an object
let router = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
await router.resetSettings();
```

## switchCapturingTemplate

Switches the currently active capturing template during the image processing workflow. This allows dynamic reconfiguration of the capture process without restarting or reinitializing the system, enabling different settings or rules to be applied on the fly.

**Syntax**

```typescript
switchCapturingTemplate(templateName: string): Promise<void>;
```

**Parameters**

`templateName`: The name of the new capturing template to apply.

**Return Value**

A promise that resolves when the operation has completed.

**Code snippet**

```javascript
let router = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
await router.startCapturing("ReadSingleBarcode");
// Switching to ReadRateFirst template
await router.switchCapturingTemplate("ReadBarcodes_ReadRateFirst");
```

**Remarks**

Introduced in Dynamsoft Barcode Reader Bundle version 11.2.2000 and Dynamsoft Capture Vision Bundle version 3.2.1000.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,48 @@ The `OriginalImageResultItem` interface extends the [CapturedResultItem](./captu
```typescript
interface OriginalImageResultItem extends CapturedResultItem {
readonly imageData: DSImageData;
toCanvas: () => HTMLCanvasElement;
toImage: (MIMEType: "image/png" | "image/jpeg") => HTMLImageElement;
toBlob: (MIMEType: "image/png" | "image/jpeg") => Promise<Blob>;
}
```

## imageData

The image data associated with this result item.

## toCanvas

Converts the image data into an HTMLCanvasElement for display or further manipulation in web applications.

**See Also**

[HTMLCanvasElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement)

**Remarks**

Introduced in Dynamsoft Barcode Reader Bundle version 11.2.2000 and Dynamsoft Capture Vision Bundle version 3.2.1000.

## toImage

Converts the image data into an HTMLImageElement of a specified MIME type ('image/png' or 'image/jpeg').

**See Also**

[HTMLImageElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement)

**Remarks**

Introduced in Dynamsoft Barcode Reader Bundle version 11.2.2000 and Dynamsoft Capture Vision Bundle version 3.2.1000.

## toBlob

Converts the image data into a Blob object of a specified MIME type ('image/png' or 'image/jpeg').

**See Also**

[Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob)

**Remarks**

Introduced in Dynamsoft Barcode Reader Bundle version 11.2.2000 and Dynamsoft Capture Vision Bundle version 3.2.1000.
54 changes: 47 additions & 7 deletions programming/javascript/api-reference/core/core-module-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ noTitleIndex: true

The CoreModule class defines common functionality in the Core module.

| Name | Description |
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `static` [detectEnvironment()](#detectenvironment) | Detects and returns information about the current runtime environment. |
| `static` [engineResourcePaths](#engineresourcepaths) | Configures the paths where the .wasm files and other necessary resources for modules are located. |
| `static` [getVersion()](#getversion) | Returns the version of the Core module. |
| `static` [isModuleLoaded()](#ismoduleloaded) | Returns whether the WebAssembly (.wasm) file for the specified module is successfully loaded. |
| `static` [loadWasm()](#loadwasm) | Initiates the loading process for the .wasm file(s) corresponding to the specified module(s). |
| Name | Description |
| ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `static` [detectEnvironment()](#detectenvironment) | Detects and returns information about the current runtime environment. |
| `static` [engineResourcePaths](#engineresourcepaths) | Configures the paths where the .wasm files and other necessary resources for modules are located. |
| `static` [getVersion()](#getversion) | Returns the version of the Core module. |
| `static` [isModuleLoaded()](#ismoduleloaded) | Returns whether the WebAssembly (.wasm) file for the specified module is successfully loaded. |
| `static` [loadWasm()](#loadwasm) | Initiates the loading process for the .wasm file(s) corresponding to the specified module(s). |
| `static` [onWasmLoadProgressChanged()](#onwasmloadprogresschanged) | An event that fires during the loading of a WebAssembly module (.wasm). |

<!--
| `static` [onLog](#onlog) | Event triggered whenever a log message is ready to be dispatched. |
Expand Down Expand Up @@ -199,6 +200,45 @@ A promise that resolves when the resources have been successfully released. It d
await Dynamsoft.Core.CoreModule.loadWasm();
```

## onWasmLoadProgressChanged

An event that fires during the loading of a WebAssembly module (.wasm).

**Syntax**

```typescript
static onWasmLoadProgressChanged (filePath: string, tag: "starting"| "in progress" | "completed", progress: { loaded: number, total: number }) : void;
```

**Parameter**

`filePath` : The path of the wasm file.

`tag`(Optional) : Indicates the ongoing status of the file download ("starting", "in progress", "completed").

`progress` : An object indicating the progress of the download, with `loaded` and `total` bytes.

**Return value**

None.

**Code snippet**

```javascript
Dynamsoft.Core.Coremodule.onWasmLoadProgressChanged = function(filePath, tag, progress) {
console.log(`Status: ${tag} - File: ${filePath}`);
if (tag === "in progress") {
let percent = ((progress.loaded / progress.total) * 100).toFixed(1);
console.log(`Progress: ${percent}%`);
} else if (tag === "completed") {
console.log("wasm loading completed!");
}
};
```

**Remarks**

Introduced in Dynamsoft Barcode Reader Bundle version 11.2.2000 and Dynamsoft Capture Vision Bundle version 3.2.1000.
<!--
## onLog

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ codeAutoHeight: true
enum EnumImagePixelFormat {
/** 0:Black, 1:White. */
IPF_BINARY = 0,
/** 0:White, 1:Black. */
/** 0: black, 255: white. foreground (bars) are white, background (spaces) are black. */
IPF_BINARYINVERTED = 1,
/** 8bit gray. */
IPF_GRAYSCALED = 2,
Expand All @@ -46,7 +46,7 @@ enum EnumImagePixelFormat {
IPF_ABGR_16161616 = 11,
/** 24bit with BGR channel order stored in memory from high to low address. */
IPF_BGR_888 = 12,
/** 0:Black, 255:White. */
/** 0: black, 255: white. foreground (bars) are black, background (spaces) are white. */
IPF_BINARY_8 = 13,
/**NV12 */
IPF_NV12 = 14
Expand Down
Loading