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

Function EncodeChar

czxing/src/main/cpp/zxing/src/pdf417/PDFEncoder.cpp:375–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

373}
374
375static 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
396static BarcodeMatrix EncodeLowLevel(const std::vector<int>& fullCodewords, int c, int r, int errorCorrectionLevel, bool compact)
397{

Callers 1

EncodeLowLevelFunction · 0.70

Calls 1

addBarMethod · 0.80

Tested by

no test coverage detected