BrowserMultiFormatReader.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. "use strict";
  2. var __extends = (this && this.__extends) || (function () {
  3. var extendStatics = function (d, b) {
  4. extendStatics = Object.setPrototypeOf ||
  5. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  6. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  7. return extendStatics(d, b);
  8. };
  9. return function (d, b) {
  10. extendStatics(d, b);
  11. function __() { this.constructor = d; }
  12. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  13. };
  14. })();
  15. Object.defineProperty(exports, "__esModule", { value: true });
  16. exports.BrowserMultiFormatReader = void 0;
  17. var BrowserCodeReader_1 = require("./BrowserCodeReader");
  18. var MultiFormatReader_1 = require("../core/MultiFormatReader");
  19. var BrowserMultiFormatReader = /** @class */ (function (_super) {
  20. __extends(BrowserMultiFormatReader, _super);
  21. function BrowserMultiFormatReader(hints, timeBetweenScansMillis) {
  22. if (hints === void 0) { hints = null; }
  23. if (timeBetweenScansMillis === void 0) { timeBetweenScansMillis = 500; }
  24. var _this = this;
  25. var reader = new MultiFormatReader_1.default();
  26. reader.setHints(hints);
  27. _this = _super.call(this, reader, timeBetweenScansMillis) || this;
  28. return _this;
  29. }
  30. /**
  31. * Overwrite decodeBitmap to call decodeWithState, which will pay
  32. * attention to the hints set in the constructor function
  33. */
  34. BrowserMultiFormatReader.prototype.decodeBitmap = function (binaryBitmap) {
  35. return this.reader.decodeWithState(binaryBitmap);
  36. };
  37. return BrowserMultiFormatReader;
  38. }(BrowserCodeReader_1.BrowserCodeReader));
  39. exports.BrowserMultiFormatReader = BrowserMultiFormatReader;