Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "ngx-opencv", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"peerDependencies": { | ||
@@ -5,0 +5,0 @@ "@angular/common": "^7.0.0", |
# Ngx OpenCv | ||
NgOpenCV is a lightweight angular service for integrating OpenCV.js [WASM](https://webassembly.org/) in Angular 2+ applications. | ||
NgxOpenCV is a lightweight angular service for integrating OpenCV.js [WASM](https://webassembly.org/) in Angular 2+ applications. | ||
OpenCV on WASM offers near-native performance in web-based applications; | ||
@@ -16,11 +16,11 @@ The service loads the library in the angular zone, thus enabling better control over it's state. | ||
copy the opencv.js files to your assets folder (or any other folder). you can build the files yourself ([instructions on the OpenCV site](https://docs.opencv.org/3.4/d4/da1/tutorial_js_setup.html)), or download them from this package's [repository](https://github.com/roiperlman/ngx-document-scanner). | ||
both opencv.js & opencv_js.wasm need to places in the same folder. | ||
both opencv.js & opencv_js.wasm need to placed in the same folder. | ||
import the module to your `app.module`. you'll need to configure the location of the open cv files. | ||
import {OpenCvConfig} from 'ngx-document-scanner'; | ||
import {OpenCVConfig} from 'ngx-document-scanner'; | ||
import {NgxOpencv} from 'ngx-opencv'; | ||
// set the location of the OpenCV files | ||
const OpenCvConfig: OpenCvConfig = { | ||
const openCVConfig: OpenCVConfig = { | ||
openCvDirPath: '/assets/opencv' | ||
@@ -30,3 +30,3 @@ }; | ||
@NgModule({ imports: [ | ||
NgxDocumentScannerModule.forRoot(OpenCvConfig) | ||
NgxDocumentScannerModule.forRoot(openCVConfig) | ||
], | ||
@@ -52,15 +52,15 @@ bootstrap: [AppComponent] | ||
(cvState: OpenCVState) => { | ||
// do something with the state string | ||
this.cvState = cvState.state; | ||
this.ready.emit(cvState.ready); | ||
if (cvState.error) { | ||
// handle errors | ||
} else if (cvState.loading) { | ||
// e.g. show loading indicator | ||
} else if (cvState.ready) { | ||
// do image processing stuff | ||
} | ||
// do something with the state string | ||
this.cvState = cvState.state; | ||
this.ready.emit(cvState.ready); | ||
if (cvState.error) { | ||
// handle errors | ||
} else if (cvState.loading) { | ||
// e.g. show loading indicator | ||
} else if (cvState.ready) { | ||
// do image processing stuff | ||
} | ||
}); | ||
**Note that loading and parsing of the OpenCV library is done synchronously, and might take some time while blocking execution of other processes, depending on client's device.** Therefore I'd recommend binding a loading inicator to the state observable. | ||
**Note that loading and parsing of the OpenCV library is done synchronously, and might take some time while blocking execution of other processes, depending on client's device.** Therefore it's recommended to bind a loading indicator to the state observable. | ||
@@ -67,0 +67,0 @@ The observable emits an `OpenCVState` object when changes occur, with the following properties: |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11134