Mercurial > hgrepos > Python2 > PyMuPDF
comparison mupdf-source/thirdparty/zxing-cpp/core/src/ZXingCpp.cpp @ 3:2c135c81b16c
MERGE: upstream PyMuPDF 1.26.4 with MuPDF 1.26.7
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 15 Sep 2025 11:44:09 +0200 |
| parents | b50eed0cc0ef |
| children |
comparison
equal
deleted
inserted
replaced
| 0:6015a75abc2d | 3:2c135c81b16c |
|---|---|
| 1 /* | |
| 2 * Copyright 2024 Axel Waggershauser | |
| 3 */ | |
| 4 // SPDX-License-Identifier: Apache-2.0 | |
| 5 | |
| 6 #include "ZXingCpp.h" | |
| 7 | |
| 8 #if __has_include("Version.h") | |
| 9 #include "Version.h" | |
| 10 #else // this is mainly a workaround for a missing autogenerated Version.h in the XCode/CocoaPods corner | |
| 11 #define ZXING_VERSION_STR "undefined" | |
| 12 #endif | |
| 13 | |
| 14 namespace ZXing { | |
| 15 | |
| 16 const std::string& Version() | |
| 17 { | |
| 18 static std::string res = ZXING_VERSION_STR; | |
| 19 return res; | |
| 20 } | |
| 21 | |
| 22 #ifdef ZXING_EXPERIMENTAL_API | |
| 23 | |
| 24 BarcodeFormats SupportedBarcodeFormats(Operation op) | |
| 25 { | |
| 26 switch (op) { | |
| 27 case Operation::Read: | |
| 28 #ifdef ZXING_READERS | |
| 29 return BarcodeFormat::Any; | |
| 30 #else | |
| 31 return BarcodeFormat::None; | |
| 32 #endif | |
| 33 case Operation::Create: | |
| 34 #if defined(ZXING_WRITERS) && defined(ZXING_EXPERIMENTAL_API) | |
| 35 return BarcodeFormats(BarcodeFormat::Any).setFlag(BarcodeFormat::DXFilmEdge, false); | |
| 36 #else | |
| 37 return BarcodeFormat::None; | |
| 38 #endif | |
| 39 case Operation::CreateAndRead: return SupportedBarcodeFormats(Operation::Create) & SupportedBarcodeFormats(Operation::Read); | |
| 40 case Operation::CreateOrRead: return SupportedBarcodeFormats(Operation::Create) | SupportedBarcodeFormats(Operation::Read); | |
| 41 } | |
| 42 | |
| 43 return {}; // unreachable code | |
| 44 } | |
| 45 | |
| 46 #endif // ZXING_EXPERIMENTAL_API | |
| 47 | |
| 48 } // namespace ZXing |
