MCPcopy Create free account
hub / github.com/devilsen/CZXing / ParseECIValue

Function ParseECIValue

czxing/src/main/cpp/zxing/src/maxicode/MCDecoder.cpp:177–193  ·  view source on GitHub ↗

* See ISO/IEC 16023:2000 Section 4.6 Table 3 */

Source from the content-addressed store, hash-verified

175 * See ISO/IEC 16023:2000 Section 4.6 Table 3
176 */
177static ZXing::ECI ParseECIValue(const ByteArray& bytes, int& i)
178{
179 int firstByte = bytes[++i];
180 if ((firstByte & 0x20) == 0)
181 return ZXing::ECI(firstByte);
182
183 int secondByte = bytes[++i];
184 if ((firstByte & 0x10) == 0)
185 return ZXing::ECI(((firstByte & 0x0F) << 6) | secondByte);
186
187 int thirdByte = bytes[++i];
188 if ((firstByte & 0x08) == 0)
189 return ZXing::ECI(((firstByte & 0x07) << 12) | (secondByte << 6) | thirdByte);
190
191 int fourthByte = bytes[++i];
192 return ZXing::ECI(((firstByte & 0x03) << 18) | (secondByte << 12) | (thirdByte << 6) | fourthByte);
193}
194
195/**
196 * See ISO/IEC 16023:2000 Section 4.9.1 Table 5

Callers 1

GetMessageFunction · 0.70

Calls 1

ECIEnum · 0.50

Tested by

no test coverage detected