| 373 | } |
| 374 | |
| 375 | static void EncodeChar(int pattern, int len, BarcodeRow& logic) |
| 376 | { |
| 377 | int map = 1 << (len - 1); |
| 378 | bool last = (pattern & map) != 0; //Initialize to inverse of first bit |
| 379 | int width = 0; |
| 380 | for (int i = 0; i < len; i++) { |
| 381 | bool black = (pattern & map) != 0; |
| 382 | if (last == black) { |
| 383 | width++; |
| 384 | } |
| 385 | else { |
| 386 | logic.addBar(last, width); |
| 387 | |
| 388 | last = black; |
| 389 | width = 1; |
| 390 | } |
| 391 | map >>= 1; |
| 392 | } |
| 393 | logic.addBar(last, width); |
| 394 | } |
| 395 | |
| 396 | static BarcodeMatrix EncodeLowLevel(const std::vector<int>& fullCodewords, int c, int r, int errorCorrectionLevel, bool compact) |
| 397 | { |
no test coverage detected