comparison mupdf-source/thirdparty/zint/backend/rss.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 /* rss.h - Data tables for Reduced Space Symbology */
2 /*
3 libzint - the open source barcode library
4 Copyright (C) 2007-2024 Robin Stuart <rstuart114@gmail.com>
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions
8 are met:
9
10 1. Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
15 3. Neither the name of the project nor the names of its contributors
16 may be used to endorse or promote products derived from this software
17 without specific prior written permission.
18
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
23 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 SUCH DAMAGE.
30 */
31 /* SPDX-License-Identifier: BSD-3-Clause */
32
33 #ifndef Z_RSS_H
34 #define Z_RSS_H
35
36 /* RSS-14 Tables */
37 static const unsigned short dbar_g_sum_table[9] = {
38 0, 161, 961, 2015, 2715, 0, 336, 1036, 1516
39 };
40
41 static const char dbar_t_table[9] = {
42 1, 10, 34, 70, 126, 4, 20, 48, 81
43 };
44
45 static const char dbar_modules_odd[9] = {
46 12, 10, 8, 6, 4, 5, 7, 9, 11
47 };
48
49 static const char dbar_modules_even[9] = {
50 4, 6, 8, 10, 12, 10, 8, 6, 4
51 };
52
53 static const char dbar_widest_odd[9] = {
54 8, 6, 4, 3, 1, 2, 4, 6, 8
55 };
56
57 static const char dbar_widest_even[9] = {
58 1, 3, 5, 6, 8, 7, 5, 3, 1
59 };
60
61 static const char dbar_finder_pattern[45] = {
62 3, 8, 2, 1, 1,
63 3, 5, 5, 1, 1,
64 3, 3, 7, 1, 1,
65 3, 1, 9, 1, 1,
66 2, 7, 4, 1, 1,
67 2, 5, 6, 1, 1,
68 2, 3, 8, 1, 1,
69 1, 5, 7, 1, 1,
70 1, 3, 9, 1, 1
71 };
72
73 /* Table 5 */
74 static const char dbar_checksum_weight[32] = {
75 1, 3, 9, 27, 2, 6, 18, 54,
76 4, 12, 36, 29, 8, 24, 72, 58,
77 16, 48, 65, 37, 32, 17, 51, 74,
78 64, 34, 23, 69, 49, 68, 46, 59
79 };
80
81 /* RSS Limited Tables */
82 static const unsigned short dbar_ltd_t_even[7] = {
83 28, 728, 6454, 203, 2408, 1, 16632
84 };
85
86 static const char dbar_ltd_modules_odd[7] = {
87 17, 13, 9, 15, 11, 19, 7
88 };
89
90 static const char dbar_ltd_modules_even[7] = {
91 9, 13, 17, 11, 15, 7, 19
92 };
93
94 static const char dbar_ltd_widest_odd[7] = {
95 6, 5, 3, 5, 4, 8, 1
96 };
97
98 static const char dbar_ltd_widest_even[7] = {
99 3, 4, 6, 4, 5, 1, 8
100 };
101
102 /* Table 7 */
103 static const char dbar_ltd_checksum_weight[28] = {
104 1, 3, 9, 27, 81, 65, 17, 51, 64, 14, 42, 37, 22, 66,
105 20, 60, 2, 6, 18, 54, 73, 41, 34, 13, 39, 28, 84, 74
106 };
107
108 static const char dbar_ltd_finder_pattern[1246] = {
109 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1,
110 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 1, 1,
111 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1,
112 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 3, 2, 1, 1,
113 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 3, 1, 1, 1,
114 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 1,
115 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 3, 2, 1, 1,
116 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 3, 1, 1, 1,
117 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 3, 1, 1, 1,
118 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 1,
119 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1,
120 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1,
121 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 3, 1, 1, 1,
122 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 3, 1, 1, 1,
123 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1,
124 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1,
125 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1,
126 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 3, 1, 1, 1,
127 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 3, 1, 1, 1,
128 1, 2, 1, 2, 1, 1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SS Expanded Tables */
201 static const unsigned short dbar_exp_g_sum[5] = {
202 0, 348, 1388, 2948, 3988
203 };
204
205 static const unsigned char dbar_exp_t_even[5] = {
206 4, 20, 52, 104, 204
207 };
208
209 static const char dbar_exp_modules_odd[5] = {
210 12, 10, 8, 6, 4
211 };
212
213 static const char dbar_exp_modules_even[5] = {
214 5, 7, 9, 11, 13
215 };
216
217 static const char dbar_exp_widest_odd[5] = {
218 7, 5, 4, 3, 1
219 };
220
221 static const char dbar_exp_widest_even[5] = {
222 2, 4, 5, 6, 8
223 };
224
225 /* Table 14 */
226 static const unsigned char dbar_exp_checksum_weight[184] = {
227 1, 3, 9, 27, 81, 32, 96, 77,
228 20, 60, 180, 118, 143, 7, 21, 63,
229 189, 145, 13, 39, 117, 140, 209, 205,
230 193, 157, 49, 147, 19, 57, 171, 91,
231 62, 186, 136, 197, 169, 85, 44, 132,
232 185, 133, 188, 142, 4, 12, 36, 108,
233 113, 128, 173, 97, 80, 29, 87, 50,
234 150, 28, 84, 41, 123, 158, 52, 156,
235 46, 138, 203, 187, 139, 206, 196, 166,
236 76, 17, 51, 153, 37, 111, 122, 155,
237 43, 129, 176, 106, 107, 110, 119, 146,
238 16, 48, 144, 10, 30, 90, 59, 177,
239 109, 116, 137, 200, 178, 112, 125, 164,
240 70, 210, 208, 202, 184, 130, 179, 115,
241 134, 191, 151, 31, 93, 68, 204, 190,
242 148, 22, 66, 198, 172, 94, 71, 2,
243 6, 18, 54, 162, 64, 192, 154, 40,
244 120, 149, 25, 75, 14, 42, 126, 167,
245 79, 26, 78, 23, 69, 207, 199, 175,
246 103, 98, 83, 38, 114, 131, 182, 124,
247 161, 61, 183, 127, 170, 88, 53, 159,
248 55, 165, 73, 8, 24, 72, 5, 15,
249 45, 135, 194, 160, 58, 174, 100, 89
250 };
251
252 /* Table 15 */
253 static const char dbar_exp_finder_pattern[60] = {
254 1, 8, 4, 1, 1,
255 1, 1, 4, 8, 1,
256 3, 6, 4, 1, 1,
257 1, 1, 4, 6, 3,
258 3, 4, 6, 1, 1,
259 1, 1, 6, 4, 3,
260 3, 2, 8, 1, 1,
261 1, 1, 8, 2, 3,
262 2, 6, 5, 1, 1,
263 1, 1, 5, 6, 2,
264 2, 2, 9, 1, 1,
265 1, 1, 9, 2, 2
266 };
267
268 /* Table 16 */
269 static const char dbar_exp_finder_sequence[198] = {
270 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
271 1, 4, 3, 0, 0, 0, 0, 0, 0, 0, 0,
272 1, 6, 3, 8, 0, 0, 0, 0, 0, 0, 0,
273 1, 10, 3, 8, 5, 0, 0, 0, 0, 0, 0,
274 1, 10, 3, 8, 7, 12, 0, 0, 0, 0, 0,
275 1, 10, 3, 8, 9, 12, 11, 0, 0, 0, 0,
276 1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 0,
277 1, 2, 3, 4, 5, 6, 7, 10, 9, 0, 0,
278 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 0,
279 1, 2, 3, 4, 5, 8, 7, 10, 9, 12, 11
280 };
281
282 static const char dbar_exp_weight_rows[210] = {
283 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
284 0, 5, 6, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
285 0, 9, 10, 3, 4, 13, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
286 0, 17, 18, 3, 4, 13, 14, 7, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
287 0, 17, 18, 3, 4, 13, 14, 11, 12, 21, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
288 0, 17, 18, 3, 4, 13, 14, 15, 16, 21, 22, 19, 20, 0, 0, 0, 0, 0, 0, 0, 0,
289 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, 0, 0, 0, 0, 0,
290 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 17, 18, 15, 16, 0, 0, 0, 0,
291 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 17, 18, 19, 20, 21, 22, 0, 0,
292 0, 1, 2, 3, 4, 5, 6, 7, 8, 13, 14, 11, 12, 17, 18, 15, 16, 21, 22, 19, 20
293 };
294
295 /* vim: set ts=4 sw=4 et : */
296 #endif /* Z_RSS_H */