| 83 | } |
| 84 | |
| 85 | static void DrawModeMessage(BitMatrix& matrix, bool compact, int matrixSize, const BitArray& modeMessage) |
| 86 | { |
| 87 | int center = matrixSize / 2; |
| 88 | if (compact) { |
| 89 | for (int i = 0; i < 7; i++) { |
| 90 | int offset = center - 3 + i; |
| 91 | if (modeMessage.get(i)) { |
| 92 | matrix.set(offset, center - 5); |
| 93 | } |
| 94 | if (modeMessage.get(i + 7)) { |
| 95 | matrix.set(center + 5, offset); |
| 96 | } |
| 97 | if (modeMessage.get(20 - i)) { |
| 98 | matrix.set(offset, center + 5); |
| 99 | } |
| 100 | if (modeMessage.get(27 - i)) { |
| 101 | matrix.set(center - 5, offset); |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | else { |
| 106 | for (int i = 0; i < 10; i++) { |
| 107 | int offset = center - 5 + i + i / 5; |
| 108 | if (modeMessage.get(i)) { |
| 109 | matrix.set(offset, center - 7); |
| 110 | } |
| 111 | if (modeMessage.get(i + 10)) { |
| 112 | matrix.set(center + 7, offset); |
| 113 | } |
| 114 | if (modeMessage.get(29 - i)) { |
| 115 | matrix.set(offset, center + 7); |
| 116 | } |
| 117 | if (modeMessage.get(39 - i)) { |
| 118 | matrix.set(center - 7, offset); |
| 119 | } |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | ZXING_EXPORT_TEST_ONLY |
| 125 | void StuffBits(const BitArray& bits, int wordSize, BitArray& out) |