Mercurial > hgrepos > Python2 > PyMuPDF
comparison mupdf-source/thirdparty/zxing-cpp/core/src/Reader.h @ 2:b50eed0cc0ef upstream
ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4.
The directory name has changed: no version number in the expanded directory now.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 15 Sep 2025 11:43:07 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 1:1d09e1dec1d9 | 2:b50eed0cc0ef |
|---|---|
| 1 /* | |
| 2 * Copyright 2016 Nu-book Inc. | |
| 3 * Copyright 2016 ZXing authors | |
| 4 */ | |
| 5 // SPDX-License-Identifier: Apache-2.0 | |
| 6 | |
| 7 #pragma once | |
| 8 | |
| 9 #include "ReaderOptions.h" | |
| 10 #include "Barcode.h" | |
| 11 | |
| 12 namespace ZXing { | |
| 13 | |
| 14 class BinaryBitmap; | |
| 15 class ReaderOptions; | |
| 16 | |
| 17 class Reader | |
| 18 { | |
| 19 protected: | |
| 20 const ReaderOptions& _opts; | |
| 21 | |
| 22 public: | |
| 23 const bool supportsInversion; | |
| 24 | |
| 25 explicit Reader(const ReaderOptions& opts, bool supportsInversion = false) : _opts(opts), supportsInversion(supportsInversion) {} | |
| 26 explicit Reader(ReaderOptions&& opts) = delete; | |
| 27 virtual ~Reader() = default; | |
| 28 | |
| 29 virtual Barcode decode(const BinaryBitmap& image) const = 0; | |
| 30 | |
| 31 // WARNING: this API is experimental and may change/disappear | |
| 32 virtual Barcodes decode(const BinaryBitmap& image, [[maybe_unused]] int maxSymbols) const { | |
| 33 auto res = decode(image); | |
| 34 return res.isValid() || (_opts.returnErrors() && res.format() != BarcodeFormat::None) ? Barcodes{std::move(res)} : Barcodes{}; | |
| 35 } | |
| 36 }; | |
| 37 | |
| 38 } // ZXing |
