mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-12 21:21:42 +08:00
Fixed access to canvas
This commit is contained in:
+8
-9
@@ -68,7 +68,13 @@ function fromConfig(config) {
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
registerResultCollector(resultCollector) {
|
||||
scanner.registerResultCollector(resultCollector);
|
||||
},
|
||||
getCanvas() {
|
||||
return scanner.canvas;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -77,8 +83,6 @@ function fromSource(config, source, inputConfig = {}) {
|
||||
return fromConfig(config);
|
||||
}
|
||||
|
||||
const defaultScanner = createScanner();
|
||||
|
||||
function setConfig(configuration = {}, key, config = {}) {
|
||||
var mergedConfig = merge({}, configuration, {[key]: config});
|
||||
return createApi(mergedConfig);
|
||||
@@ -90,6 +94,7 @@ function createApi(configuration = Config) {
|
||||
return fromSource(configuration, src, inputConfig);
|
||||
},
|
||||
fromConfig(conf) {
|
||||
// check if source is given an return scanner
|
||||
return createApi(merge({}, configuration, conf));
|
||||
},
|
||||
decoder(conf) {
|
||||
@@ -104,12 +109,6 @@ function createApi(configuration = Config) {
|
||||
config(conf) {
|
||||
return createApi(merge({}, configuration, conf));
|
||||
},
|
||||
registerResultCollector(resultCollector) {
|
||||
defaultScanner.registerResultCollector(resultCollector);
|
||||
},
|
||||
getCanvas() {
|
||||
return defaultScanner.canvas;
|
||||
},
|
||||
ImageWrapper,
|
||||
ImageDebug,
|
||||
ResultCollector,
|
||||
|
||||
Reference in New Issue
Block a user