MCPcopy
hub / github.com/skip2/go-qrcode / addFormatInfo

Method addFormatInfo

regular_symbol.go:183–216  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

181}
182
183func (m *regularSymbol) addFormatInfo() {
184 fpSize := finderPatternSize
185 l := formatInfoLengthBits - 1
186
187 f := m.version.formatInfo(m.mask)
188
189 // Bits 0-7, under the top right finder pattern.
190 for i := 0; i <= 7; i++ {
191 m.symbol.set(m.size-i-1, fpSize+1, f.At(l-i))
192 }
193
194 // Bits 0-5, right of the top left finder pattern.
195 for i := 0; i <= 5; i++ {
196 m.symbol.set(fpSize+1, i, f.At(l-i))
197 }
198
199 // Bits 6-8 on the corner of the top left finder pattern.
200 m.symbol.set(fpSize+1, fpSize, f.At(l-6))
201 m.symbol.set(fpSize+1, fpSize+1, f.At(l-7))
202 m.symbol.set(fpSize, fpSize+1, f.At(l-8))
203
204 // Bits 9-14 on the underside of the top left finder pattern.
205 for i := 9; i <= 14; i++ {
206 m.symbol.set(14-i, fpSize+1, f.At(l-i))
207 }
208
209 // Bits 8-14 on the right side of the bottom left finder pattern.
210 for i := 8; i <= 14; i++ {
211 m.symbol.set(fpSize+1, m.size-fpSize+i-8, f.At(l-i))
212 }
213
214 // Always dark symbol.
215 m.symbol.set(fpSize+1, m.size-fpSize-1, true)
216}
217
218func (m *regularSymbol) addVersionInfo() {
219 fpSize := finderPatternSize

Callers 1

buildRegularSymbolFunction · 0.95

Calls 3

formatInfoMethod · 0.80
setMethod · 0.80
AtMethod · 0.80

Tested by

no test coverage detected