mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-12 21:21:42 +08:00
#49: Added sample static images
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
<option value="upc">UPC</option>
|
||||
<option value="upc_e">UPC-E</option>
|
||||
<option value="codabar">Codabar</option>
|
||||
<option value="i2of5">I2of5</option>
|
||||
</select>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
@@ -1,14 +1,39 @@
|
||||
$(function() {
|
||||
var App = {
|
||||
init: function() {
|
||||
Quagga.init(this.state, function() {
|
||||
var config = this.config[this.state.decoder.readers[0]] || this.config.default;
|
||||
config = $.extend(true, {}, config, this.state);
|
||||
Quagga.init(config, function() {
|
||||
App.attachListeners();
|
||||
Quagga.start();
|
||||
});
|
||||
},
|
||||
config: {
|
||||
reader: "code_128",
|
||||
length: 10
|
||||
"default": {
|
||||
inputStream: { name: "Test",
|
||||
type: "ImageStream",
|
||||
length: 10,
|
||||
size: 800
|
||||
},
|
||||
locator: {
|
||||
patchSize: "medium",
|
||||
halfSample: true
|
||||
}
|
||||
},
|
||||
"i2of5_reader": {
|
||||
inputStream: {
|
||||
size: 800,
|
||||
type: "ImageStream",
|
||||
length: 5
|
||||
},
|
||||
locator: {
|
||||
patchSize: "small",
|
||||
halfSample: false
|
||||
}
|
||||
}
|
||||
},
|
||||
getState: function(reader) {
|
||||
return this.config[reader] || this.config.default;
|
||||
},
|
||||
attachListeners: function() {
|
||||
var self = this;
|
||||
@@ -58,6 +83,7 @@ $(function() {
|
||||
|
||||
paths.forEach(function(path) {
|
||||
var mappedValue;
|
||||
|
||||
if (typeof self._accessByPath(self.inputMapper, path) === "function") {
|
||||
mappedValue = self._accessByPath(self.inputMapper, path)(value);
|
||||
}
|
||||
@@ -82,10 +108,8 @@ $(function() {
|
||||
}
|
||||
},
|
||||
state: {
|
||||
inputStream: { name: "Test",
|
||||
type: "ImageStream",
|
||||
inputStream: {
|
||||
src: "../test/fixtures/code_128/",
|
||||
length: 10
|
||||
},
|
||||
decoder : {
|
||||
readers : ["code_128_reader"]
|
||||
|
||||
Vendored
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 137 KiB |
Vendored
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 714 KiB After Width: | Height: | Size: 137 KiB |
Vendored
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 633 KiB After Width: | Height: | Size: 714 KiB |
Vendored
BIN
Binary file not shown.
|
After Width: | Height: | Size: 633 KiB |
Reference in New Issue
Block a user