mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-13 05:31:37 +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);
|
return fromConfig(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultScanner = createScanner();
|
|
||||||
|
|
||||||
function setConfig(configuration = {}, key, config = {}) {
|
function setConfig(configuration = {}, key, config = {}) {
|
||||||
var mergedConfig = merge({}, configuration, {[key]: config});
|
var mergedConfig = merge({}, configuration, {[key]: config});
|
||||||
return createApi(mergedConfig);
|
return createApi(mergedConfig);
|
||||||
@@ -90,6 +94,7 @@ function createApi(configuration = Config) {
|
|||||||
return fromSource(configuration, src, inputConfig);
|
return fromSource(configuration, src, inputConfig);
|
||||||
},
|
},
|
||||||
fromConfig(conf) {
|
fromConfig(conf) {
|
||||||
|
// check if source is given an return scanner
|
||||||
return createApi(merge({}, configuration, conf));
|
return createApi(merge({}, configuration, conf));
|
||||||
},
|
},
|
||||||
decoder(conf) {
|
decoder(conf) {
|
||||||
@@ -104,12 +109,6 @@ function createApi(configuration = Config) {
|
|||||||
config(conf) {
|
config(conf) {
|
||||||
return createApi(merge({}, configuration, conf));
|
return createApi(merge({}, configuration, conf));
|
||||||
},
|
},
|
||||||
registerResultCollector(resultCollector) {
|
|
||||||
defaultScanner.registerResultCollector(resultCollector);
|
|
||||||
},
|
|
||||||
getCanvas() {
|
|
||||||
return defaultScanner.canvas;
|
|
||||||
},
|
|
||||||
ImageWrapper,
|
ImageWrapper,
|
||||||
ImageDebug,
|
ImageDebug,
|
||||||
ResultCollector,
|
ResultCollector,
|
||||||
|
|||||||
Reference in New Issue
Block a user