comparison mupdf-source/thirdparty/zxing-cpp/core/src/ZXingCpp.cpp @ 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 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