Binarizer.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. "use strict";
  2. /*
  3. * Copyright 2009 ZXing authors
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. Object.defineProperty(exports, "__esModule", { value: true });
  18. /**
  19. * This class hierarchy provides a set of methods to convert luminance data to 1 bit data.
  20. * It allows the algorithm to vary polymorphically, for example allowing a very expensive
  21. * thresholding technique for servers and a fast one for mobile. It also permits the implementation
  22. * to vary, e.g. a JNI version for Android and a Java fallback version for other platforms.
  23. *
  24. * @author dswitkin@google.com (Daniel Switkin)
  25. */
  26. var Binarizer = /** @class */ (function () {
  27. function Binarizer(source) {
  28. this.source = source;
  29. }
  30. Binarizer.prototype.getLuminanceSource = function () {
  31. return this.source;
  32. };
  33. Binarizer.prototype.getWidth = function () {
  34. return this.source.getWidth();
  35. };
  36. Binarizer.prototype.getHeight = function () {
  37. return this.source.getHeight();
  38. };
  39. return Binarizer;
  40. }());
  41. exports.default = Binarizer;