zxing-cpp 3.2.0rc1__cp315-cp315t-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ Version: 1.13.2
2
+ Arguments: ['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-dkda84ra\\cp315t-win_amd64\\build\\venv\\Scripts\\delvewheel', 'repair', '-w', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-dkda84ra\\cp315t-win_amd64\\repaired_wheel', '-v', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-dkda84ra\\cp315t-win_amd64\\built_wheel\\zxing_cpp-3.2.0rc1-cp315-cp315t-win_amd64.whl']
@@ -0,0 +1,84 @@
1
+ Metadata-Version: 2.4
2
+ Name: zxing-cpp
3
+ Version: 3.2.0rc1
4
+ Summary: Python bindings for the zxing-cpp barcode library
5
+ Keywords: barcode
6
+ Author-Email: zxing-cpp community <zxingcpp@gmail.com>
7
+ License-Expression: Apache-2.0
8
+ Classifier: Development Status :: 5 - Production/Stable
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Topic :: Multimedia :: Graphics
13
+ Project-URL: Homepage, https://github.com/zxing-cpp/zxing-cpp
14
+ Project-URL: Repository, https://github.com/zxing-cpp/zxing-cpp.git
15
+ Project-URL: Issues, https://github.com/zxing-cpp/zxing-cpp/issues
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+
19
+ # Python bindings for zxing-cpp
20
+
21
+ [![PyPI](https://img.shields.io/pypi/v/zxing-cpp.svg)](https://pypi.org/project/zxing-cpp/)
22
+
23
+ The package uses [scikit-build-core](https://scikit-build-core.readthedocs.io/) as its build backend and [nanobind](https://nanobind.readthedocs.io/) for the Python bindings.
24
+
25
+ ## Installation
26
+
27
+ ```bash
28
+ pip install zxing-cpp
29
+ ```
30
+
31
+ To build from a checked out / extracted soruce tree, a suitable [build environment](https://github.com/zxing-cpp/zxing-cpp#build-instructions) including a C++20 compiler is required:
32
+
33
+ ```bash
34
+ pip install .
35
+ ```
36
+
37
+
38
+ ## Usage
39
+
40
+ ### Reading barcodes
41
+
42
+ ```python
43
+ import cv2, zxingcpp
44
+
45
+ img = cv2.imread('test.png')
46
+ barcodes = zxingcpp.read_barcodes(img)
47
+ for barcode in barcodes:
48
+ print('Found barcode:'
49
+ f'\n Text: "{barcode.text}"'
50
+ f'\n Format: {barcode.format}'
51
+ f'\n Content: {barcode.content_type}'
52
+ f'\n Position: {barcode.position}')
53
+ if len(barcodes) == 0:
54
+ print("Could not find any barcode.")
55
+ ```
56
+
57
+ The `read_barcodes` function can accept images in various formats, including OpenCV, Pillow, and Qt images,
58
+ as well as NumPy arrays with dtype `uint8`. Grayscale arrays can have shape `(height, width)` or
59
+ `(height, width, 1)`. Three-channel arrays are interpreted as BGR, matching OpenCV's default `imread` output.
60
+ To explicitly specify the image buffer memory layout including the number of channels, the shape and the stride
61
+ of any given memory view / array, you can use the `ImageView` class:
62
+
63
+ ```python
64
+ view = zxingcpp.ImageView(memoryview(img), width, height, zxingcpp.ImageFormat.RGBA, row_stride, pix_stride)
65
+ barcodes = zxingcpp.read_barcodes(view)
66
+ ```
67
+
68
+ ### Writing barcodes
69
+
70
+ ```python
71
+ import zxingcpp
72
+ from PIL import Image
73
+
74
+ barcode = zxingcpp.create_barcode('This is a test', zxingcpp.BarcodeFormat.QRCode, ec_level = "50%")
75
+
76
+ img = barcode.to_image(scale = 5)
77
+ Image.fromarray(img).save("test.png")
78
+
79
+ svg = barcode.to_svg(add_quiet_zones = False)
80
+ with open("test.svg", "w") as svg_file:
81
+ svg_file.write(svg)
82
+ ```
83
+
84
+ To get a full list of available parameters for `read_barcodes` and `create_barcode` as well as the properties of the Barcode objects, have a look at the `nanobind` module definition in [this C++ source file](https://github.com/zxing-cpp/zxing-cpp/blob/master/wrappers/python/zxing.cpp).
@@ -0,0 +1,10 @@
1
+ zxingcpp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ zxingcpp/zxingcpp.cp315t-win_amd64.pyd,sha256=0ZDhQio4ZMkzsuSXYhDisJui8zIDYetKlmJPAoXPdks,1883648
3
+ zxingcpp/zxingcpp.pyi,sha256=Gmz_M7esS6d0G2oRST-WNkSBGCIri6KTtwUCBx1qOcU,21011
4
+ zxingcpp/__init__.py,sha256=E3_qeQFuBNZ5kmgd_5FmvTbdFOys7bxG_iNMfwZXVdA,521
5
+ zxing_cpp-3.2.0rc1.dist-info/DELVEWHEEL,sha256=tpJncVxT0EU8jaqsVirq4i8MexwjKFdJZC6vKqW0_V0,415
6
+ zxing_cpp-3.2.0rc1.dist-info/METADATA,sha256=2FGqRLfuKkr-PVTVUX699bNn6rpdyn0vKMsiBFwUeC4,2987
7
+ zxing_cpp-3.2.0rc1.dist-info/RECORD,,
8
+ zxing_cpp-3.2.0rc1.dist-info/WHEEL,sha256=apHcMXqKLwQkY16c8SuSFqHbhY_7ZOR4ctaqH7Vv24c,106
9
+ zxing_cpp-3.2.0rc1.dist-info/licenses/LICENSE,sha256=LlTNhKZFvqJZQ8dd2K5nyykeZqR6EVeDM8m0s7a4bIU,11560
10
+ zxing_cpp.libs/msvcp140-a4c2229bdc2a2a630acdc095b4d86008.dll,sha256=pMIim9wqKmMKzcCVtNhgCOXD47x3cxdDVPPaT1vrnN4,575056
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: scikit-build-core 1.1.2
3
+ Root-Is-Purelib: false
4
+ Tag: cp315-cp315t-win_amd64
5
+
@@ -0,0 +1,202 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright {yyyy} {name of copyright owner}
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
202
+
zxingcpp/__init__.py ADDED
@@ -0,0 +1,16 @@
1
+ # Re-export the native module for 'import zxingcpp' compatibility.
2
+ # Named init.py instead of __init__.py to avoid import conflicts when running from this directory.
3
+
4
+
5
+ # start delvewheel patch
6
+ def _delvewheel_patch_1_13_2():
7
+ import os
8
+ if os.path.isdir(libs_dir := os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'zxing_cpp.libs'))):
9
+ os.add_dll_directory(libs_dir)
10
+
11
+
12
+ _delvewheel_patch_1_13_2()
13
+ del _delvewheel_patch_1_13_2
14
+ # end delvewheel patch
15
+
16
+ from .zxingcpp import *
zxingcpp/py.typed ADDED
File without changes
Binary file
zxingcpp/zxingcpp.pyi ADDED
@@ -0,0 +1,742 @@
1
+ """python bindings for zxing-cpp"""
2
+
3
+ from collections.abc import Iterator, Sequence
4
+ import enum
5
+ from typing import Annotated, TypeAlias, overload
6
+
7
+ from numpy.typing import NDArray
8
+
9
+
10
+ class BarcodeFormats:
11
+ @overload
12
+ def __init__(self, arg: BarcodeFormat, /) -> None: ...
13
+
14
+ @overload
15
+ def __init__(self, arg: Sequence[BarcodeFormat], /) -> None: ...
16
+
17
+ def __repr__(self) -> str: ...
18
+
19
+ def __eq__(self, arg: BarcodeFormats, /) -> bool: ...
20
+
21
+ def __or__(self, arg: BarcodeFormat, /) -> BarcodeFormats: ...
22
+
23
+ def __len__(self) -> int: ...
24
+
25
+ def __iter__(self) -> Iterator[BarcodeFormat]: ...
26
+
27
+ def __getitem__(self, arg: int, /) -> BarcodeFormat: ...
28
+
29
+ class BarcodeFormat(enum.IntEnum):
30
+ """Enumeration of zxing supported barcode formats"""
31
+
32
+ def __str__(self) -> str: ...
33
+
34
+ NONE = 0
35
+
36
+ All = 10794
37
+
38
+ AllReadable = 29226
39
+
40
+ AllCreatable = 30506
41
+
42
+ AllLinear = 27690
43
+
44
+ AllMatrix = 27946
45
+
46
+ AllGS1 = 18218
47
+
48
+ AllRetail = 21034
49
+
50
+ AllIndustrial = 18730
51
+
52
+ Codabar = 8262
53
+
54
+ Code39 = 8257
55
+
56
+ Code39Std = 29505
57
+
58
+ Code39Ext = 25921
59
+
60
+ Code32 = 12865
61
+
62
+ PZN = 28737
63
+
64
+ Code93 = 8263
65
+
66
+ Code128 = 8259
67
+
68
+ ITF = 8265
69
+
70
+ ITF14 = 13385
71
+
72
+ DataBar = 8293
73
+
74
+ DataBarOmni = 28517
75
+
76
+ DataBarStk = 29541
77
+
78
+ DataBarStkOmni = 20325
79
+
80
+ DataBarLtd = 27749
81
+
82
+ DataBarExp = 25957
83
+
84
+ DataBarExpStk = 17765
85
+
86
+ EANUPC = 8261
87
+
88
+ EAN13 = 12613
89
+
90
+ EAN8 = 14405
91
+
92
+ EAN5 = 13637
93
+
94
+ EAN2 = 12869
95
+
96
+ ISBN = 26949
97
+
98
+ UPCA = 24901
99
+
100
+ UPCE = 25925
101
+
102
+ Telepen = 8258
103
+
104
+ TelepenAlpha = 12354
105
+
106
+ TelepenNumeric = 12610
107
+
108
+ OtherBarcode = 8280
109
+
110
+ DXFilmEdge = 30808
111
+
112
+ PDF417 = 8268
113
+
114
+ CompactPDF417 = 25420
115
+
116
+ MicroPDF417 = 27980
117
+
118
+ Aztec = 8314
119
+
120
+ AztecCode = 25466
121
+
122
+ AztecRune = 29306
123
+
124
+ QRCode = 8273
125
+
126
+ QRCodeModel1 = 12625
127
+
128
+ QRCodeModel2 = 12881
129
+
130
+ MicroQRCode = 27985
131
+
132
+ RMQRCode = 29265
133
+
134
+ DataMatrix = 8292
135
+
136
+ MaxiCode = 8277
137
+
138
+ DataBarExpanded = 25957
139
+
140
+ DataBarLimited = 27749
141
+
142
+ LinearCodes = 27690
143
+
144
+ MatrixCodes = 27946
145
+
146
+ def __or__(self, arg: BarcodeFormat, /) -> BarcodeFormats: ...
147
+
148
+ @property
149
+ def symbology(self) -> BarcodeFormat: ...
150
+
151
+ NONE: ErrorType = ErrorType.NONE
152
+
153
+ All: BarcodeFormat = BarcodeFormat.All
154
+
155
+ AllReadable: BarcodeFormat = BarcodeFormat.AllReadable
156
+
157
+ AllCreatable: BarcodeFormat = BarcodeFormat.AllCreatable
158
+
159
+ AllLinear: BarcodeFormat = BarcodeFormat.AllLinear
160
+
161
+ AllMatrix: BarcodeFormat = BarcodeFormat.AllMatrix
162
+
163
+ AllGS1: BarcodeFormat = BarcodeFormat.AllGS1
164
+
165
+ AllRetail: BarcodeFormat = BarcodeFormat.AllRetail
166
+
167
+ AllIndustrial: BarcodeFormat = BarcodeFormat.AllIndustrial
168
+
169
+ Codabar: BarcodeFormat = BarcodeFormat.Codabar
170
+
171
+ Code39: BarcodeFormat = BarcodeFormat.Code39
172
+
173
+ Code39Std: BarcodeFormat = BarcodeFormat.Code39Std
174
+
175
+ Code39Ext: BarcodeFormat = BarcodeFormat.Code39Ext
176
+
177
+ Code32: BarcodeFormat = BarcodeFormat.Code32
178
+
179
+ PZN: BarcodeFormat = BarcodeFormat.PZN
180
+
181
+ Code93: BarcodeFormat = BarcodeFormat.Code93
182
+
183
+ Code128: BarcodeFormat = BarcodeFormat.Code128
184
+
185
+ ITF: BarcodeFormat = BarcodeFormat.ITF
186
+
187
+ ITF14: BarcodeFormat = BarcodeFormat.ITF14
188
+
189
+ DataBar: BarcodeFormat = BarcodeFormat.DataBar
190
+
191
+ DataBarOmni: BarcodeFormat = BarcodeFormat.DataBarOmni
192
+
193
+ DataBarStk: BarcodeFormat = BarcodeFormat.DataBarStk
194
+
195
+ DataBarStkOmni: BarcodeFormat = BarcodeFormat.DataBarStkOmni
196
+
197
+ DataBarLtd: BarcodeFormat = BarcodeFormat.DataBarLtd
198
+
199
+ DataBarExp: BarcodeFormat = BarcodeFormat.DataBarExp
200
+
201
+ DataBarExpStk: BarcodeFormat = BarcodeFormat.DataBarExpStk
202
+
203
+ EANUPC: BarcodeFormat = BarcodeFormat.EANUPC
204
+
205
+ EAN13: BarcodeFormat = BarcodeFormat.EAN13
206
+
207
+ EAN8: BarcodeFormat = BarcodeFormat.EAN8
208
+
209
+ EAN5: BarcodeFormat = BarcodeFormat.EAN5
210
+
211
+ EAN2: BarcodeFormat = BarcodeFormat.EAN2
212
+
213
+ ISBN: BarcodeFormat = BarcodeFormat.ISBN
214
+
215
+ UPCA: BarcodeFormat = BarcodeFormat.UPCA
216
+
217
+ UPCE: BarcodeFormat = BarcodeFormat.UPCE
218
+
219
+ Telepen: BarcodeFormat = BarcodeFormat.Telepen
220
+
221
+ TelepenAlpha: BarcodeFormat = BarcodeFormat.TelepenAlpha
222
+
223
+ TelepenNumeric: BarcodeFormat = BarcodeFormat.TelepenNumeric
224
+
225
+ OtherBarcode: BarcodeFormat = BarcodeFormat.OtherBarcode
226
+
227
+ DXFilmEdge: BarcodeFormat = BarcodeFormat.DXFilmEdge
228
+
229
+ PDF417: BarcodeFormat = BarcodeFormat.PDF417
230
+
231
+ CompactPDF417: BarcodeFormat = BarcodeFormat.CompactPDF417
232
+
233
+ MicroPDF417: BarcodeFormat = BarcodeFormat.MicroPDF417
234
+
235
+ Aztec: BarcodeFormat = BarcodeFormat.Aztec
236
+
237
+ AztecCode: BarcodeFormat = BarcodeFormat.AztecCode
238
+
239
+ AztecRune: BarcodeFormat = BarcodeFormat.AztecRune
240
+
241
+ QRCode: BarcodeFormat = BarcodeFormat.QRCode
242
+
243
+ QRCodeModel1: BarcodeFormat = BarcodeFormat.QRCodeModel1
244
+
245
+ QRCodeModel2: BarcodeFormat = BarcodeFormat.QRCodeModel2
246
+
247
+ MicroQRCode: BarcodeFormat = BarcodeFormat.MicroQRCode
248
+
249
+ RMQRCode: BarcodeFormat = BarcodeFormat.RMQRCode
250
+
251
+ DataMatrix: BarcodeFormat = BarcodeFormat.DataMatrix
252
+
253
+ MaxiCode: BarcodeFormat = BarcodeFormat.MaxiCode
254
+
255
+ class Binarizer(enum.Enum):
256
+ """Enumeration of binarizers used before decoding images"""
257
+
258
+ BoolCast = 3
259
+
260
+ FixedThreshold = 2
261
+
262
+ GlobalHistogram = 1
263
+
264
+ LocalAverage = 0
265
+
266
+ BoolCast: Binarizer = Binarizer.BoolCast
267
+
268
+ FixedThreshold: Binarizer = Binarizer.FixedThreshold
269
+
270
+ GlobalHistogram: Binarizer = Binarizer.GlobalHistogram
271
+
272
+ LocalAverage: Binarizer = Binarizer.LocalAverage
273
+
274
+ class EanAddOnSymbol(enum.Enum):
275
+ """Enumeration of options for EAN-2/5 add-on symbols check"""
276
+
277
+ Ignore = 0
278
+ """Ignore any Add-On symbol during read/scan"""
279
+
280
+ Read = 1
281
+ """Read EAN-2/EAN-5 Add-On symbol if found"""
282
+
283
+ Require = 2
284
+ """Require EAN-2/EAN-5 Add-On symbol to be present"""
285
+
286
+ Ignore: EanAddOnSymbol = EanAddOnSymbol.Ignore
287
+
288
+ Read: EanAddOnSymbol = EanAddOnSymbol.Read
289
+
290
+ Require: EanAddOnSymbol = EanAddOnSymbol.Require
291
+
292
+ class ContentType(enum.Enum):
293
+ """Enumeration of content types"""
294
+
295
+ Text = 0
296
+
297
+ Binary = 1
298
+
299
+ Mixed = 2
300
+
301
+ GS1 = 3
302
+
303
+ ISO15434 = 4
304
+
305
+ UnknownECI = 5
306
+
307
+ Text: ContentType = ContentType.Text
308
+
309
+ Binary: ContentType = ContentType.Binary
310
+
311
+ Mixed: ContentType = ContentType.Mixed
312
+
313
+ GS1: ContentType = ContentType.GS1
314
+
315
+ ISO15434: ContentType = ContentType.ISO15434
316
+
317
+ UnknownECI: ContentType = ContentType.UnknownECI
318
+
319
+ class TextMode(enum.Enum):
320
+ Plain = 0
321
+ """
322
+ bytes() transcoded to unicode based on ECI info or guessed charset (the default mode prior to 2.0)
323
+ """
324
+
325
+ ECI = 1
326
+ """
327
+ standard content following the ECI protocol with every character set ECI segment transcoded to unicode
328
+ """
329
+
330
+ HRI = 2
331
+ """Human Readable Interpretation (dependent on the ContentType)"""
332
+
333
+ Escaped = 3
334
+ """
335
+ Use the EscapeNonGraphical() function (e.g. ASCII 29 will be transcoded to '<GS>'
336
+ """
337
+
338
+ Hex = 4
339
+ """bytes() transcoded to ASCII string of HEX values"""
340
+
341
+ HexECI = 5
342
+ """bytesECI() transcoded to ASCII string of HEX values"""
343
+
344
+ Plain: TextMode = TextMode.Plain
345
+
346
+ ECI: TextMode = TextMode.ECI
347
+
348
+ HRI: TextMode = TextMode.HRI
349
+
350
+ Escaped: TextMode = TextMode.Escaped
351
+
352
+ Hex: TextMode = TextMode.Hex
353
+
354
+ HexECI: TextMode = TextMode.HexECI
355
+
356
+ class ImageFormat(enum.Enum):
357
+ """Enumeration of image formats supported by read_barcodes"""
358
+
359
+ Lum = 16777216
360
+
361
+ LumA = 33554432
362
+
363
+ RGB = 50331906
364
+
365
+ BGR = 50462976
366
+
367
+ RGBA = 67109122
368
+
369
+ ARGB = 67174915
370
+
371
+ BGRA = 67240192
372
+
373
+ ABGR = 67305985
374
+
375
+ Lum: ImageFormat = ImageFormat.Lum
376
+
377
+ LumA: ImageFormat = ImageFormat.LumA
378
+
379
+ RGB: ImageFormat = ImageFormat.RGB
380
+
381
+ BGR: ImageFormat = ImageFormat.BGR
382
+
383
+ RGBA: ImageFormat = ImageFormat.RGBA
384
+
385
+ ARGB: ImageFormat = ImageFormat.ARGB
386
+
387
+ BGRA: ImageFormat = ImageFormat.BGRA
388
+
389
+ ABGR: ImageFormat = ImageFormat.ABGR
390
+
391
+ class Point:
392
+ """Represents the coordinates of a point in an image"""
393
+
394
+ @property
395
+ def x(self) -> int:
396
+ """
397
+ :return: horizontal coordinate of the point
398
+ :rtype: int
399
+ """
400
+
401
+ @property
402
+ def y(self) -> int:
403
+ """
404
+ :return: vertical coordinate of the point
405
+ :rtype: int
406
+ """
407
+
408
+ class Position:
409
+ """The position of a decoded symbol"""
410
+
411
+ @property
412
+ def top_left(self) -> Point:
413
+ """
414
+ :return: coordinate of the symbol's top-left corner
415
+ :rtype: zxingcpp.Point
416
+ """
417
+
418
+ @property
419
+ def top_right(self) -> Point:
420
+ """
421
+ :return: coordinate of the symbol's top-right corner
422
+ :rtype: zxingcpp.Point
423
+ """
424
+
425
+ @property
426
+ def bottom_left(self) -> Point:
427
+ """
428
+ :return: coordinate of the symbol's bottom-left corner
429
+ :rtype: zxingcpp.Point
430
+ """
431
+
432
+ @property
433
+ def bottom_right(self) -> Point:
434
+ """
435
+ :return: coordinate of the symbol's bottom-right corner
436
+ :rtype: zxingcpp.Point
437
+ """
438
+
439
+ def __str__(self) -> str: ...
440
+
441
+ class ErrorType(enum.Enum):
442
+ NONE = 0
443
+ """No error"""
444
+
445
+ Format = 1
446
+ """Data format error"""
447
+
448
+ Checksum = 2
449
+ """Checksum error"""
450
+
451
+ Unsupported = 3
452
+ """Unsupported content error"""
453
+
454
+ Format: ErrorType = ErrorType.Format
455
+
456
+ Checksum: ErrorType = ErrorType.Checksum
457
+
458
+ Unsupported: ErrorType = ErrorType.Unsupported
459
+
460
+ class Error:
461
+ """Barcode reading error"""
462
+
463
+ @property
464
+ def type(self) -> ErrorType:
465
+ """
466
+ :return: Error type
467
+ :rtype: zxingcpp.ErrorType
468
+ """
469
+
470
+ @property
471
+ def message(self) -> str:
472
+ """
473
+ :return: Error message
474
+ :rtype: str
475
+ """
476
+
477
+ def __str__(self) -> str: ...
478
+
479
+ class Barcode:
480
+ """The Barcode class"""
481
+
482
+ @property
483
+ def valid(self) -> bool:
484
+ """
485
+ :return: whether or not barcode is valid (i.e. a symbol was found and decoded)
486
+ :rtype: bool
487
+ """
488
+
489
+ @property
490
+ def text(self) -> str:
491
+ """
492
+ :return: text of the decoded symbol (see also TextMode parameter)
493
+ :rtype: str
494
+ """
495
+
496
+ @property
497
+ def bytes(self) -> bytes:
498
+ """
499
+ :return: uninterpreted bytes of the decoded symbol
500
+ :rtype: bytes
501
+ """
502
+
503
+ @property
504
+ def format(self) -> BarcodeFormat:
505
+ """
506
+ :return: decoded symbol format
507
+ :rtype: zxingcpp.BarcodeFormat
508
+ """
509
+
510
+ @property
511
+ def symbology(self) -> BarcodeFormat:
512
+ """
513
+ :return: decoded symbol symbology
514
+ :rtype: zxingcpp.BarcodeFormat
515
+ """
516
+
517
+ @property
518
+ def symbology_identifier(self) -> str:
519
+ """
520
+ :return: decoded symbology idendifier
521
+ :rtype: str
522
+ """
523
+
524
+ @property
525
+ def ec_level(self) -> str:
526
+ """
527
+ :return: error correction level of the symbol (empty string if not applicable)
528
+ :rtype: str
529
+ """
530
+
531
+ @property
532
+ def content_type(self) -> ContentType:
533
+ """
534
+ :return: content type of symbol
535
+ :rtype: zxingcpp.ContentType
536
+ """
537
+
538
+ @property
539
+ def position(self) -> Position:
540
+ """
541
+ :return: position of the decoded symbol
542
+ :rtype: zxingcpp.Position
543
+ """
544
+
545
+ @property
546
+ def rotation(self) -> int:
547
+ """
548
+ :return: rotation (in degree) of the decoded symbol
549
+ :rtype: int
550
+ """
551
+
552
+ @property
553
+ def orientation(self) -> int:
554
+ """
555
+ :return: rotation (in degree) of the decoded symbol
556
+ :rtype: int
557
+ """
558
+
559
+ @property
560
+ def error(self) -> Error | None:
561
+ """
562
+ :return: Error code or None
563
+ :rtype: zxingcpp.Error
564
+ """
565
+
566
+ @property
567
+ def extra(self) -> object:
568
+ """
569
+ :return: Symbology specific extra information as a Python dictionary (might be empty)
570
+ :rtype: dict
571
+ """
572
+
573
+ def to_image(self, scale: int = 1, add_hrt: bool = False, add_quiet_zones: bool = True) -> Image: ...
574
+
575
+ def to_svg(self, scale: int = 1, add_hrt: bool = False, add_quiet_zones: bool = True) -> str: ...
576
+
577
+ Result: TypeAlias = Barcode
578
+
579
+ def barcode_format_from_str(str: str) -> BarcodeFormat:
580
+ """
581
+ Convert string to BarcodeFormat
582
+
583
+ :type str: str
584
+ :param str: string representing barcode format
585
+ :return: corresponding barcode format
586
+ :rtype: zxingcpp.BarcodeFormat
587
+ """
588
+
589
+ def barcode_formats_from_str(str: str) -> BarcodeFormats:
590
+ """
591
+ Convert string to BarcodeFormats
592
+
593
+ :type str: str
594
+ :param str: string representing a list of barcodes formats
595
+ :return: corresponding barcode formats
596
+ :rtype: zxingcpp.BarcodeFormats
597
+ """
598
+
599
+ def barcode_formats_list(filter: BarcodeFormats = ...) -> BarcodeFormats:
600
+ """
601
+ Returns a list of available/supported barcode formats, optionally filtered by the provided format(s).
602
+
603
+ :type filter: zxingcpp.BarcodeFormats
604
+ :param filter: the BarcodeFormat(s) to filter by
605
+ :return: list of available/supported barcode formats (optionally filtered)
606
+ :rtype: list[zxingcpp.BarcodeFormat]
607
+ """
608
+
609
+ def read_barcode(image: object, formats: BarcodeFormats = ..., try_rotate: bool = True, try_downscale: bool = True, try_invert: bool = True, text_mode: TextMode = TextMode.HRI, binarizer: Binarizer = Binarizer.LocalAverage, is_pure: bool = False, ean_add_on_symbol: EanAddOnSymbol = EanAddOnSymbol.Ignore, return_errors: bool = False) -> Barcode | None:
610
+ """
611
+ Read (decode) a barcode from a numpy BGR or grayscale image array or from a PIL image.
612
+
613
+ :type image: buffer|numpy.ndarray|PIL.Image.Image
614
+ :param image: The image object to decode. The image can be either:
615
+ - a buffer with the correct shape, use .cast on memory view to convert
616
+ - a numpy array containing image either in grayscale (1 byte per pixel) or BGR mode (3 bytes per pixel)
617
+ - a PIL Image
618
+ - a QtGui.QImage
619
+ - a zxingcpp.ImageView object, which is effectively a memory view but with custom strides and ImageFormat
620
+ :type formats: zxing.BarcodeFormat|zxing.BarcodeFormats
621
+ :param formats: the format(s) to decode. If ``None``, decode all formats.
622
+ :type try_rotate: bool
623
+ :param try_rotate: if ``True`` (the default), decoder searches for barcodes in any direction;
624
+ if ``False``, it will not search for 90° / 270° rotated barcodes.
625
+ :type try_downscale: bool
626
+ :param try_downscale: if ``True`` (the default), decoder also scans downscaled versions of the input;
627
+ if ``False``, it will only search in the resolution provided.
628
+ :type try_invert: bool
629
+ :param try_invert: if ``True`` (the default), decoder also tries inverted (light on dark) barcodes.
630
+ :type text_mode: zxing.TextMode
631
+ :param text_mode: specifies the TextMode that governs how the raw bytes content is transcoded to text.
632
+ Defaults to :py:attr:`zxing.TextMode.HRI`.:type binarizer: zxing.Binarizer
633
+ :param binarizer: the binarizer used to convert image before decoding barcodes.
634
+ Defaults to :py:attr:`zxing.Binarizer.LocalAverage`.:type is_pure: bool
635
+ :param is_pure: Set to True if the input contains nothing but a perfectly aligned barcode (generated image).
636
+ Speeds up detection in that case. Default is False.:type ean_add_on_symbol: zxing.EanAddOnSymbol
637
+ :param ean_add_on_symbol: Specify whether to Ignore, Read or Require EAN-2/5 add-on symbols while scanning
638
+ EAN/UPC codes. Default is ``Ignore``.
639
+ :type return_errors: bool
640
+ :param return_errors: Set to True to return the barcodes with errors as well (e.g. checksum errors); see ``Barcode.error``.
641
+ Default is False.:rtype: zxingcpp.Barcode
642
+ :return: a Barcode if found, None otherwise
643
+ """
644
+
645
+ def read_barcodes(image: object, formats: BarcodeFormats = ..., try_rotate: bool = True, try_downscale: bool = True, try_invert: bool = True, text_mode: TextMode = TextMode.HRI, binarizer: Binarizer = Binarizer.LocalAverage, is_pure: bool = False, ean_add_on_symbol: EanAddOnSymbol = EanAddOnSymbol.Ignore, return_errors: bool = False) -> list[Barcode]:
646
+ """
647
+ Read (decode) multiple barcodes from a numpy BGR or grayscale image array or from a PIL image.
648
+
649
+ :type image: buffer|numpy.ndarray|PIL.Image.Image
650
+ :param image: The image object to decode. The image can be either:
651
+ - a buffer with the correct shape, use .cast on memoryview to convert
652
+ - a numpy array containing image either in grayscale (1 byte per pixel) or BGR mode (3 bytes per pixel)
653
+ - a PIL Image
654
+ - a QtGui.QImage
655
+ - a zxingcpp.ImageView object, which is effectively a memory view but with custom strides and ImageFormat
656
+ :type formats: zxing.BarcodeFormat|zxing.BarcodeFormats
657
+ :param formats: the format(s) to decode. If ``None``, decode all formats.
658
+ :type try_rotate: bool
659
+ :param try_rotate: if ``True`` (the default), decoder searches for barcodes in any direction;
660
+ if ``False``, it will not search for 90° / 270° rotated barcodes.
661
+ :type try_downscale: bool
662
+ :param try_downscale: if ``True`` (the default), decoder also scans downscaled versions of the input;
663
+ if ``False``, it will only search in the resolution provided.
664
+ :type try_invert: bool
665
+ :param try_invert: if ``True`` (the default), decoder also tries inverted (light on dark) barcodes.
666
+ :type text_mode: zxing.TextMode
667
+ :param text_mode: specifies the TextMode that governs how the raw bytes content is transcoded to text.
668
+ Defaults to :py:attr:`zxing.TextMode.HRI`.:type binarizer: zxing.Binarizer
669
+ :param binarizer: the binarizer used to convert image before decoding barcodes.
670
+ Defaults to :py:attr:`zxing.Binarizer.LocalAverage`.:type is_pure: bool
671
+ :param is_pure: Set to True if the input contains nothing but a perfectly aligned barcode (generated image).
672
+ Speeds up detection in that case. Default is False.:type ean_add_on_symbol: zxing.EanAddOnSymbol
673
+ :param ean_add_on_symbol: Specify whether to Ignore, Read or Require EAN-2/5 add-on symbols while scanning
674
+ EAN/UPC codes. Default is ``Ignore``.
675
+ :type return_errors: bool
676
+ :param return_errors: Set to True to return the barcodes with errors as well (e.g. checksum errors); see ``Barcode.error``.
677
+ Default is False.
678
+ :rtype: list[zxingcpp.Barcode]
679
+ :return: a list of Barcodes, the list is empty if none is found
680
+ """
681
+
682
+ class Image:
683
+ def __buffer__(self, flags, /):
684
+ """
685
+ Return a buffer object that exposes the underlying memory of the object.
686
+ """
687
+
688
+ def __release_buffer__(self, buffer, /):
689
+ """
690
+ Release the buffer object that exposes the underlying memory of the object.
691
+ """
692
+
693
+ @property
694
+ def __array_interface__(self) -> dict: ...
695
+
696
+ @property
697
+ def shape(self) -> tuple: ...
698
+
699
+ def create_barcode(content: object, format: BarcodeFormat, **kwargs) -> Barcode: ...
700
+
701
+ def write_barcode_to_image(barcode: Barcode, scale: int = 1, add_hrt: bool = False, add_quiet_zones: bool = True) -> Image: ...
702
+
703
+ def write_barcode_to_svg(barcode: Barcode, scale: int = 1, add_hrt: bool = False, add_quiet_zones: bool = True) -> str: ...
704
+
705
+ class ImageView:
706
+ def __init__(self, buffer: Annotated[NDArray, dict(writable=False)], width: int, height: int, format: ImageFormat, row_stride: int = 0, pix_stride: int = 0) -> None: ...
707
+
708
+ def __buffer__(self, flags, /):
709
+ """
710
+ Return a buffer object that exposes the underlying memory of the object.
711
+ """
712
+
713
+ def __release_buffer__(self, buffer, /):
714
+ """
715
+ Release the buffer object that exposes the underlying memory of the object.
716
+ """
717
+
718
+ @property
719
+ def format(self) -> ImageFormat: ...
720
+
721
+ Bitmap: TypeAlias = Image
722
+
723
+ def write_barcode(format: BarcodeFormat, text: object, width: int = 0, height: int = 0, quiet_zone: int = -1, ec_level: int = -1) -> Image:
724
+ """
725
+ Write (encode) a text into a barcode and return 8-bit grayscale bitmap buffer
726
+
727
+ :type format: zxing.BarcodeFormat
728
+ :param format: format of the barcode to create
729
+ :type text: str|bytes
730
+ :param text: the text/content of the barcode. A str is encoded as utf8 text and bytes as binary data
731
+ :type width: int
732
+ :param width: width (in pixels) of the barcode to create. If undefined (or set to 0), barcode will be
733
+ created with the minimum possible width
734
+ :type height: int
735
+ :param height: height (in pixels) of the barcode to create. If undefined (or set to 0), barcode will be
736
+ created with the minimum possible height
737
+ :type quiet_zone: int
738
+ :param quiet_zone: minimum size (in pixels) of the quiet zone around barcode. If undefined (or set to -1),
739
+ the minimum quiet zone of respective barcode is used.:type ec_level: int
740
+ :param ec_level: error correction level of the barcode (Used for Aztec, PDF417, and QRCode only).
741
+ :rtype: zxingcpp.Bitmap
742
+ """