mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-12 21:21:42 +08:00
Improved docs
Added docs for locate Added docs for inputStream Removed unused code Added docs for decoder Improved docs
This commit is contained in:
@@ -17,14 +17,9 @@ export default {
|
||||
},
|
||||
singleChannel: false // true: only the red color-channel is read
|
||||
},
|
||||
tracking: false,
|
||||
debug: false,
|
||||
controls: false,
|
||||
locate: true,
|
||||
numOfWorkers: 4,
|
||||
visual: {
|
||||
show: true
|
||||
},
|
||||
decoder: {
|
||||
drawBoundingBox: false,
|
||||
showFrequency: false,
|
||||
|
||||
@@ -39,28 +39,6 @@ function initializeData(imageWrapper) {
|
||||
_decoder = BarcodeDecoder.create(_config.decoder, _inputImageWrapper);
|
||||
}
|
||||
|
||||
function initConfig() {
|
||||
if (typeof document !== "undefined") {
|
||||
var vis = [{
|
||||
node: document.querySelector("div[data-controls]"),
|
||||
prop: _config.controls
|
||||
}, {
|
||||
node: _canvasContainer.dom.overlay,
|
||||
prop: _config.visual.show
|
||||
}];
|
||||
|
||||
for (var i = 0; i < vis.length; i++) {
|
||||
if (vis[i].node) {
|
||||
if (vis[i].prop === true) {
|
||||
vis[i].node.style.display = "block";
|
||||
} else {
|
||||
vis[i].node.style.display = "none";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function initInputStream(cb) {
|
||||
var video;
|
||||
if (_config.inputStream.type === "VideoStream") {
|
||||
@@ -97,7 +75,6 @@ function canRecord(cb) {
|
||||
BarcodeLocator.checkImageConstraints(_inputStream, _config.locator);
|
||||
initCanvas();
|
||||
_framegrabber = FrameGrabber.create(_inputStream, _canvasContainer.dom.image);
|
||||
initConfig();
|
||||
|
||||
if (_config.numOfWorkers > 0) {
|
||||
initWorkers(function() {
|
||||
|
||||
Reference in New Issue
Block a user