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

Method findBoundingBox

czxing/src/main/cpp/zxing/src/BitMatrix.cpp:72–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72bool
73BitMatrix::findBoundingBox(int &left, int& top, int& width, int& height, int minSize) const
74{
75 int right, bottom;
76 if (!getTopLeftOnBit(left, top) || !getBottomRightOnBit(right, bottom) || bottom - top + 1 < minSize)
77 return false;
78
79 for (int y = top; y <= bottom; y++ ) {
80 for (int x = 0; x < left; ++x)
81 if (get(x, y)) {
82 left = x;
83 break;
84 }
85 for (int x = _width-1; x > right; x--)
86 if (get(x, y)) {
87 right = x;
88 break;
89 }
90 }
91
92 width = right - left + 1;
93 height = bottom - top + 1;
94 return width >= minSize && height >= minSize;
95}
96
97static auto isSet = [](auto v) { return bool(v); };
98

Callers 6

DetectPureFunction · 0.80
ExtractPureBitsFunction · 0.80
DetectPureQRFunction · 0.80
DetectPureMQRFunction · 0.80
FindPureFinderPatternFunction · 0.80
DecodePureFunction · 0.80

Calls 1

getFunction · 0.50

Tested by

no test coverage detected