origami-docspring 2.2.0 → 2.3.0

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.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/examples/attachments/attachment.rb +7 -8
  4. data/examples/attachments/nested_document.rb +6 -5
  5. data/examples/encryption/encryption.rb +5 -4
  6. data/examples/events/events.rb +7 -6
  7. data/examples/flash/flash.rb +10 -9
  8. data/examples/forms/javascript.rb +14 -13
  9. data/examples/forms/xfa.rb +67 -66
  10. data/examples/javascript/hello_world.rb +6 -5
  11. data/examples/javascript/js_emulation.rb +26 -26
  12. data/examples/loop/goto.rb +12 -11
  13. data/examples/loop/named.rb +17 -16
  14. data/examples/signature/signature.rb +11 -11
  15. data/examples/uri/javascript.rb +25 -24
  16. data/examples/uri/open-uri.rb +5 -4
  17. data/examples/uri/submitform.rb +11 -10
  18. data/lib/origami/3d.rb +330 -334
  19. data/lib/origami/acroform.rb +267 -268
  20. data/lib/origami/actions.rb +266 -278
  21. data/lib/origami/annotations.rb +659 -670
  22. data/lib/origami/array.rb +192 -196
  23. data/lib/origami/boolean.rb +66 -70
  24. data/lib/origami/catalog.rb +360 -363
  25. data/lib/origami/collections.rb +132 -133
  26. data/lib/origami/compound.rb +125 -129
  27. data/lib/origami/destinations.rb +226 -237
  28. data/lib/origami/dictionary.rb +155 -154
  29. data/lib/origami/encryption.rb +967 -923
  30. data/lib/origami/extensions/fdf.rb +270 -275
  31. data/lib/origami/extensions/ppklite.rb +323 -328
  32. data/lib/origami/filespec.rb +170 -173
  33. data/lib/origami/filters/ascii.rb +162 -167
  34. data/lib/origami/filters/ccitt/tables.rb +248 -252
  35. data/lib/origami/filters/ccitt.rb +309 -312
  36. data/lib/origami/filters/crypt.rb +31 -34
  37. data/lib/origami/filters/dct.rb +47 -50
  38. data/lib/origami/filters/flate.rb +57 -60
  39. data/lib/origami/filters/jbig2.rb +50 -53
  40. data/lib/origami/filters/jpx.rb +40 -43
  41. data/lib/origami/filters/lzw.rb +151 -155
  42. data/lib/origami/filters/predictors.rb +250 -255
  43. data/lib/origami/filters/runlength.rb +111 -115
  44. data/lib/origami/filters.rb +319 -325
  45. data/lib/origami/font.rb +173 -177
  46. data/lib/origami/functions.rb +62 -66
  47. data/lib/origami/graphics/colors.rb +203 -208
  48. data/lib/origami/graphics/instruction.rb +79 -81
  49. data/lib/origami/graphics/path.rb +141 -144
  50. data/lib/origami/graphics/patterns.rb +156 -160
  51. data/lib/origami/graphics/render.rb +51 -47
  52. data/lib/origami/graphics/state.rb +144 -142
  53. data/lib/origami/graphics/text.rb +185 -188
  54. data/lib/origami/graphics/xobject.rb +818 -804
  55. data/lib/origami/graphics.rb +25 -26
  56. data/lib/origami/header.rb +63 -65
  57. data/lib/origami/javascript.rb +718 -651
  58. data/lib/origami/linearization.rb +284 -285
  59. data/lib/origami/metadata.rb +156 -135
  60. data/lib/origami/name.rb +98 -100
  61. data/lib/origami/null.rb +49 -51
  62. data/lib/origami/numeric.rb +133 -135
  63. data/lib/origami/obfuscation.rb +180 -182
  64. data/lib/origami/object.rb +634 -631
  65. data/lib/origami/optionalcontent.rb +147 -149
  66. data/lib/origami/outline.rb +46 -48
  67. data/lib/origami/outputintents.rb +76 -77
  68. data/lib/origami/page.rb +637 -596
  69. data/lib/origami/parser.rb +214 -221
  70. data/lib/origami/parsers/fdf.rb +44 -45
  71. data/lib/origami/parsers/pdf/lazy.rb +147 -154
  72. data/lib/origami/parsers/pdf/linear.rb +104 -109
  73. data/lib/origami/parsers/pdf.rb +109 -107
  74. data/lib/origami/parsers/ppklite.rb +44 -46
  75. data/lib/origami/pdf.rb +886 -896
  76. data/lib/origami/reference.rb +116 -120
  77. data/lib/origami/signature.rb +617 -625
  78. data/lib/origami/stream.rb +560 -558
  79. data/lib/origami/string.rb +366 -368
  80. data/lib/origami/template/patterns.rb +50 -52
  81. data/lib/origami/template/widgets.rb +111 -114
  82. data/lib/origami/trailer.rb +153 -157
  83. data/lib/origami/tree.rb +55 -57
  84. data/lib/origami/version.rb +19 -19
  85. data/lib/origami/webcapture.rb +87 -90
  86. data/lib/origami/xfa/config.rb +409 -414
  87. data/lib/origami/xfa/connectionset.rb +113 -117
  88. data/lib/origami/xfa/datasets.rb +38 -42
  89. data/lib/origami/xfa/localeset.rb +33 -37
  90. data/lib/origami/xfa/package.rb +49 -52
  91. data/lib/origami/xfa/pdf.rb +54 -59
  92. data/lib/origami/xfa/signature.rb +33 -37
  93. data/lib/origami/xfa/sourceset.rb +34 -38
  94. data/lib/origami/xfa/stylesheet.rb +35 -39
  95. data/lib/origami/xfa/template.rb +1630 -1634
  96. data/lib/origami/xfa/xdc.rb +33 -37
  97. data/lib/origami/xfa/xfa.rb +132 -123
  98. data/lib/origami/xfa/xfdf.rb +34 -38
  99. data/lib/origami/xfa/xmpmeta.rb +34 -38
  100. data/lib/origami/xfa.rb +50 -53
  101. data/lib/origami/xreftable.rb +462 -462
  102. data/lib/origami.rb +37 -38
  103. data/test/test_actions.rb +22 -20
  104. data/test/test_annotations.rb +54 -52
  105. data/test/test_forms.rb +23 -21
  106. data/test/test_native_types.rb +82 -78
  107. data/test/test_object_tree.rb +25 -24
  108. data/test/test_pages.rb +43 -41
  109. data/test/test_pdf.rb +2 -0
  110. data/test/test_pdf_attachment.rb +23 -21
  111. data/test/test_pdf_create.rb +16 -15
  112. data/test/test_pdf_encrypt.rb +69 -66
  113. data/test/test_pdf_parse.rb +131 -129
  114. data/test/test_pdf_parse_lazy.rb +53 -53
  115. data/test/test_pdf_sign.rb +67 -67
  116. data/test/test_streams.rb +145 -143
  117. data/test/test_xrefs.rb +46 -45
  118. metadata +64 -8
@@ -1,267 +1,263 @@
1
- =begin
1
+ # frozen_string_literal: true
2
2
 
3
- This file is part of Origami, PDF manipulation framework for Ruby
4
- Copyright (C) 2016 Guillaume Delugré.
5
-
6
- Origami is free software: you can redistribute it and/or modify
7
- it under the terms of the GNU Lesser General Public License as published by
8
- the Free Software Foundation, either version 3 of the License, or
9
- (at your option) any later version.
10
-
11
- Origami is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU Lesser General Public License for more details.
15
-
16
- You should have received a copy of the GNU Lesser General Public License
17
- along with Origami. If not, see <http://www.gnu.org/licenses/>.
18
-
19
- =end
3
+ #
4
+ # This file is part of Origami, PDF manipulation framework for Ruby
5
+ # Copyright (C) 2016 Guillaume Delugré.
6
+ #
7
+ # Origami is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU Lesser General Public License as published by
9
+ # the Free Software Foundation, either version 3 of the License, or
10
+ # (at your option) any later version.
11
+ #
12
+ # Origami is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU Lesser General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU Lesser General Public License
18
+ # along with Origami. If not, see <http://www.gnu.org/licenses/>.
19
+ #
20
20
 
21
21
  module Origami
22
+ module Filter
23
+ class CCITTFax
24
+ def self.codeword(str) # :nodoc:
25
+ [str.to_i(2), str.length]
26
+ end
22
27
 
23
- module Filter
24
-
25
- class CCITTFax
26
-
27
- def self.codeword(str) #:nodoc:
28
- [ str.to_i(2), str.length ]
29
- end
30
-
31
- WHITE_TERMINAL_ENCODE_TABLE =
32
- {
33
- 0 => '00110101',
34
- 1 => '000111',
35
- 2 => '0111',
36
- 3 => '1000',
37
- 4 => '1011',
38
- 5 => '1100',
39
- 6 => '1110',
40
- 7 => '1111',
41
- 8 => '10011',
42
- 9 => '10100',
43
- 10 => '00111',
44
- 11 => '01000',
45
- 12 => '001000',
46
- 13 => '000011',
47
- 14 => '110100',
48
- 15 => '110101',
49
- 16 => '101010',
50
- 17 => '101011',
51
- 18 => '0100111',
52
- 19 => '0001100',
53
- 20 => '0001000',
54
- 21 => '0010111',
55
- 22 => '0000011',
56
- 23 => '0000100',
57
- 24 => '0101000',
58
- 25 => '0101011',
59
- 26 => '0010011',
60
- 27 => '0100100',
61
- 28 => '0011000',
62
- 29 => '00000010',
63
- 30 => '00000011',
64
- 31 => '00011010',
65
- 32 => '00011011',
66
- 33 => '00010010',
67
- 34 => '00010011',
68
- 35 => '00010100',
69
- 36 => '00010101',
70
- 37 => '00010110',
71
- 38 => '00010111',
72
- 39 => '00101000',
73
- 40 => '00101001',
74
- 41 => '00101010',
75
- 42 => '00101011',
76
- 43 => '00101100',
77
- 44 => '00101101',
78
- 45 => '00000100',
79
- 46 => '00000101',
80
- 47 => '00001010',
81
- 48 => '00001011',
82
- 49 => '01010010',
83
- 50 => '01010011',
84
- 51 => '01010100',
85
- 52 => '01010101',
86
- 53 => '00100100',
87
- 54 => '00100101',
88
- 55 => '01011000',
89
- 56 => '01011001',
90
- 57 => '01011010',
91
- 58 => '01011011',
92
- 59 => '01001010',
93
- 60 => '01001011',
94
- 61 => '00110010',
95
- 62 => '00110011',
96
- 63 => '00110100'
97
- }.map {|length, bits| [length, codeword(bits)]}.to_h
98
-
99
- WHITE_TERMINAL_DECODE_TABLE = WHITE_TERMINAL_ENCODE_TABLE.invert
28
+ WHITE_TERMINAL_ENCODE_TABLE =
29
+ {
30
+ 0 => '00110101',
31
+ 1 => '000111',
32
+ 2 => '0111',
33
+ 3 => '1000',
34
+ 4 => '1011',
35
+ 5 => '1100',
36
+ 6 => '1110',
37
+ 7 => '1111',
38
+ 8 => '10011',
39
+ 9 => '10100',
40
+ 10 => '00111',
41
+ 11 => '01000',
42
+ 12 => '001000',
43
+ 13 => '000011',
44
+ 14 => '110100',
45
+ 15 => '110101',
46
+ 16 => '101010',
47
+ 17 => '101011',
48
+ 18 => '0100111',
49
+ 19 => '0001100',
50
+ 20 => '0001000',
51
+ 21 => '0010111',
52
+ 22 => '0000011',
53
+ 23 => '0000100',
54
+ 24 => '0101000',
55
+ 25 => '0101011',
56
+ 26 => '0010011',
57
+ 27 => '0100100',
58
+ 28 => '0011000',
59
+ 29 => '00000010',
60
+ 30 => '00000011',
61
+ 31 => '00011010',
62
+ 32 => '00011011',
63
+ 33 => '00010010',
64
+ 34 => '00010011',
65
+ 35 => '00010100',
66
+ 36 => '00010101',
67
+ 37 => '00010110',
68
+ 38 => '00010111',
69
+ 39 => '00101000',
70
+ 40 => '00101001',
71
+ 41 => '00101010',
72
+ 42 => '00101011',
73
+ 43 => '00101100',
74
+ 44 => '00101101',
75
+ 45 => '00000100',
76
+ 46 => '00000101',
77
+ 47 => '00001010',
78
+ 48 => '00001011',
79
+ 49 => '01010010',
80
+ 50 => '01010011',
81
+ 51 => '01010100',
82
+ 52 => '01010101',
83
+ 53 => '00100100',
84
+ 54 => '00100101',
85
+ 55 => '01011000',
86
+ 56 => '01011001',
87
+ 57 => '01011010',
88
+ 58 => '01011011',
89
+ 59 => '01001010',
90
+ 60 => '01001011',
91
+ 61 => '00110010',
92
+ 62 => '00110011',
93
+ 63 => '00110100'
94
+ }.map { |length, bits| [length, codeword(bits)] }.to_h
100
95
 
101
- BLACK_TERMINAL_ENCODE_TABLE =
102
- {
103
- 0 => '0000110111',
104
- 1 => '010',
105
- 2 => '11',
106
- 3 => '10',
107
- 4 => '011',
108
- 5 => '0011',
109
- 6 => '0010',
110
- 7 => '00011',
111
- 8 => '000101',
112
- 9 => '000100',
113
- 10 => '0000100',
114
- 11 => '0000101',
115
- 12 => '0000111',
116
- 13 => '00000100',
117
- 14 => '00000111',
118
- 15 => '000011000',
119
- 16 => '0000010111',
120
- 17 => '0000011000',
121
- 18 => '0000001000',
122
- 19 => '00001100111',
123
- 20 => '00001101000',
124
- 21 => '00001101100',
125
- 22 => '00000110111',
126
- 23 => '00000101000',
127
- 24 => '00000010111',
128
- 25 => '00000011000',
129
- 26 => '000011001010',
130
- 27 => '000011001011',
131
- 28 => '000011001100',
132
- 29 => '000011001101',
133
- 30 => '000001101000',
134
- 31 => '000001101001',
135
- 32 => '000001101010',
136
- 33 => '000001101011',
137
- 34 => '000011010010',
138
- 35 => '000011010011',
139
- 36 => '000011010100',
140
- 37 => '000011010101',
141
- 38 => '000011010110',
142
- 39 => '000011010111',
143
- 40 => '000001101100',
144
- 41 => '000001101101',
145
- 42 => '000011011010',
146
- 43 => '000011011011',
147
- 44 => '000001010100',
148
- 45 => '000001010101',
149
- 46 => '000001010110',
150
- 47 => '000001010111',
151
- 48 => '000001100100',
152
- 49 => '000001100101',
153
- 50 => '000001010010',
154
- 51 => '000001010011',
155
- 52 => '000000100100',
156
- 53 => '000000110111',
157
- 54 => '000000111000',
158
- 55 => '000000100111',
159
- 56 => '000000101000',
160
- 57 => '000001011000',
161
- 58 => '000001011001',
162
- 59 => '000000101011',
163
- 60 => '000000101100',
164
- 61 => '000001011010',
165
- 62 => '000001100110',
166
- 63 => '000001100111'
167
- }.map {|length, bits| [length, codeword(bits)]}.to_h
96
+ WHITE_TERMINAL_DECODE_TABLE = WHITE_TERMINAL_ENCODE_TABLE.invert
168
97
 
169
- BLACK_TERMINAL_DECODE_TABLE = BLACK_TERMINAL_ENCODE_TABLE.invert
98
+ BLACK_TERMINAL_ENCODE_TABLE =
99
+ {
100
+ 0 => '0000110111',
101
+ 1 => '010',
102
+ 2 => '11',
103
+ 3 => '10',
104
+ 4 => '011',
105
+ 5 => '0011',
106
+ 6 => '0010',
107
+ 7 => '00011',
108
+ 8 => '000101',
109
+ 9 => '000100',
110
+ 10 => '0000100',
111
+ 11 => '0000101',
112
+ 12 => '0000111',
113
+ 13 => '00000100',
114
+ 14 => '00000111',
115
+ 15 => '000011000',
116
+ 16 => '0000010111',
117
+ 17 => '0000011000',
118
+ 18 => '0000001000',
119
+ 19 => '00001100111',
120
+ 20 => '00001101000',
121
+ 21 => '00001101100',
122
+ 22 => '00000110111',
123
+ 23 => '00000101000',
124
+ 24 => '00000010111',
125
+ 25 => '00000011000',
126
+ 26 => '000011001010',
127
+ 27 => '000011001011',
128
+ 28 => '000011001100',
129
+ 29 => '000011001101',
130
+ 30 => '000001101000',
131
+ 31 => '000001101001',
132
+ 32 => '000001101010',
133
+ 33 => '000001101011',
134
+ 34 => '000011010010',
135
+ 35 => '000011010011',
136
+ 36 => '000011010100',
137
+ 37 => '000011010101',
138
+ 38 => '000011010110',
139
+ 39 => '000011010111',
140
+ 40 => '000001101100',
141
+ 41 => '000001101101',
142
+ 42 => '000011011010',
143
+ 43 => '000011011011',
144
+ 44 => '000001010100',
145
+ 45 => '000001010101',
146
+ 46 => '000001010110',
147
+ 47 => '000001010111',
148
+ 48 => '000001100100',
149
+ 49 => '000001100101',
150
+ 50 => '000001010010',
151
+ 51 => '000001010011',
152
+ 52 => '000000100100',
153
+ 53 => '000000110111',
154
+ 54 => '000000111000',
155
+ 55 => '000000100111',
156
+ 56 => '000000101000',
157
+ 57 => '000001011000',
158
+ 58 => '000001011001',
159
+ 59 => '000000101011',
160
+ 60 => '000000101100',
161
+ 61 => '000001011010',
162
+ 62 => '000001100110',
163
+ 63 => '000001100111'
164
+ }.map { |length, bits| [length, codeword(bits)] }.to_h
170
165
 
171
- WHITE_CONFIGURATION_ENCODE_TABLE =
172
- {
173
- 64 => '11011',
174
- 128 => '10010',
175
- 192 => '010111',
176
- 256 => '0110111',
177
- 320 => '00110110',
178
- 384 => '00110111',
179
- 448 => '01100100',
180
- 512 => '01100101',
181
- 576 => '01101000',
182
- 640 => '01100111',
183
- 704 => '011001100',
184
- 768 => '011001101',
185
- 832 => '011010010',
186
- 896 => '011010011',
187
- 960 => '011010100',
188
- 1024 => '011010101',
189
- 1088 => '011010110',
190
- 1152 => '011010111',
191
- 1216 => '011011000',
192
- 1280 => '011011001',
193
- 1344 => '011011010',
194
- 1408 => '011011011',
195
- 1472 => '010011000',
196
- 1536 => '010011001',
197
- 1600 => '010011010',
198
- 1664 => '011000',
199
- 1728 => '010011011',
166
+ BLACK_TERMINAL_DECODE_TABLE = BLACK_TERMINAL_ENCODE_TABLE.invert
200
167
 
201
- 1792 => '00000001000',
202
- 1856 => '00000001100',
203
- 1920 => '00000001001',
204
- 1984 => '000000010010',
205
- 2048 => '000000010011',
206
- 2112 => '000000010100',
207
- 2176 => '000000010101',
208
- 2240 => '000000010110',
209
- 2340 => '000000010111',
210
- 2368 => '000000011100',
211
- 2432 => '000000011101',
212
- 2496 => '000000011110',
213
- 2560 => '000000011111'
214
- }.map {|length, bits| [length, codeword(bits)]}.to_h
168
+ WHITE_CONFIGURATION_ENCODE_TABLE =
169
+ {
170
+ 64 => '11011',
171
+ 128 => '10010',
172
+ 192 => '010111',
173
+ 256 => '0110111',
174
+ 320 => '00110110',
175
+ 384 => '00110111',
176
+ 448 => '01100100',
177
+ 512 => '01100101',
178
+ 576 => '01101000',
179
+ 640 => '01100111',
180
+ 704 => '011001100',
181
+ 768 => '011001101',
182
+ 832 => '011010010',
183
+ 896 => '011010011',
184
+ 960 => '011010100',
185
+ 1024 => '011010101',
186
+ 1088 => '011010110',
187
+ 1152 => '011010111',
188
+ 1216 => '011011000',
189
+ 1280 => '011011001',
190
+ 1344 => '011011010',
191
+ 1408 => '011011011',
192
+ 1472 => '010011000',
193
+ 1536 => '010011001',
194
+ 1600 => '010011010',
195
+ 1664 => '011000',
196
+ 1728 => '010011011',
215
197
 
216
- WHITE_CONFIGURATION_DECODE_TABLE = WHITE_CONFIGURATION_ENCODE_TABLE.invert
198
+ 1792 => '00000001000',
199
+ 1856 => '00000001100',
200
+ 1920 => '00000001001',
201
+ 1984 => '000000010010',
202
+ 2048 => '000000010011',
203
+ 2112 => '000000010100',
204
+ 2176 => '000000010101',
205
+ 2240 => '000000010110',
206
+ 2340 => '000000010111',
207
+ 2368 => '000000011100',
208
+ 2432 => '000000011101',
209
+ 2496 => '000000011110',
210
+ 2560 => '000000011111'
211
+ }.map { |length, bits| [length, codeword(bits)] }.to_h
217
212
 
218
- BLACK_CONFIGURATION_ENCODE_TABLE =
219
- {
220
- 64 => '0000001111',
221
- 128 => '000011001000',
222
- 192 => '000011001001',
223
- 256 => '000001011011',
224
- 320 => '000000110011',
225
- 384 => '000000110100',
226
- 448 => '000000110101',
227
- 512 => '0000001101100',
228
- 576 => '0000001101101',
229
- 640 => '0000001001010',
230
- 704 => '0000001001011',
231
- 768 => '0000001001100',
232
- 832 => '0000001001101',
233
- 896 => '0000001110010',
234
- 960 => '0000001110011',
235
- 1024 => '0000001110100',
236
- 1088 => '0000001110101',
237
- 1152 => '0000001110110',
238
- 1216 => '0000001110111',
239
- 1280 => '0000001010010',
240
- 1344 => '0000001010011',
241
- 1408 => '0000001010100',
242
- 1472 => '0000001010101',
243
- 1536 => '0000001011010',
244
- 1600 => '0000001011011',
245
- 1664 => '0000001100100',
246
- 1728 => '0000001100101',
213
+ WHITE_CONFIGURATION_DECODE_TABLE = WHITE_CONFIGURATION_ENCODE_TABLE.invert
247
214
 
248
- 1792 => '00000001000',
249
- 1856 => '00000001100',
250
- 1920 => '00000001001',
251
- 1984 => '000000010010',
252
- 2048 => '000000010011',
253
- 2112 => '000000010100',
254
- 2176 => '000000010101',
255
- 2240 => '000000010110',
256
- 2340 => '000000010111',
257
- 2368 => '000000011100',
258
- 2432 => '000000011101',
259
- 2496 => '000000011110',
260
- 2560 => '000000011111'
261
- }.map {|length, bits| [length, codeword(bits)]}.to_h
215
+ BLACK_CONFIGURATION_ENCODE_TABLE =
216
+ {
217
+ 64 => '0000001111',
218
+ 128 => '000011001000',
219
+ 192 => '000011001001',
220
+ 256 => '000001011011',
221
+ 320 => '000000110011',
222
+ 384 => '000000110100',
223
+ 448 => '000000110101',
224
+ 512 => '0000001101100',
225
+ 576 => '0000001101101',
226
+ 640 => '0000001001010',
227
+ 704 => '0000001001011',
228
+ 768 => '0000001001100',
229
+ 832 => '0000001001101',
230
+ 896 => '0000001110010',
231
+ 960 => '0000001110011',
232
+ 1024 => '0000001110100',
233
+ 1088 => '0000001110101',
234
+ 1152 => '0000001110110',
235
+ 1216 => '0000001110111',
236
+ 1280 => '0000001010010',
237
+ 1344 => '0000001010011',
238
+ 1408 => '0000001010100',
239
+ 1472 => '0000001010101',
240
+ 1536 => '0000001011010',
241
+ 1600 => '0000001011011',
242
+ 1664 => '0000001100100',
243
+ 1728 => '0000001100101',
262
244
 
263
- BLACK_CONFIGURATION_DECODE_TABLE = BLACK_CONFIGURATION_ENCODE_TABLE.invert
264
- end
245
+ 1792 => '00000001000',
246
+ 1856 => '00000001100',
247
+ 1920 => '00000001001',
248
+ 1984 => '000000010010',
249
+ 2048 => '000000010011',
250
+ 2112 => '000000010100',
251
+ 2176 => '000000010101',
252
+ 2240 => '000000010110',
253
+ 2340 => '000000010111',
254
+ 2368 => '000000011100',
255
+ 2432 => '000000011101',
256
+ 2496 => '000000011110',
257
+ 2560 => '000000011111'
258
+ }.map { |length, bits| [length, codeword(bits)] }.to_h
265
259
 
260
+ BLACK_CONFIGURATION_DECODE_TABLE = BLACK_CONFIGURATION_ENCODE_TABLE.invert
266
261
  end
262
+ end
267
263
  end