BrowserMultiFormatReader.js 1.6 KB

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