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

Function ToInt

czxing/src/main/cpp/zxing/src/BitArray.h:113–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111
112template <typename ARRAY, typename = std::enable_if_t<std::is_integral_v<typename ARRAY::value_type>>>
113int ToInt(const ARRAY& a)
114{
115 assert(Reduce(a) <= 32);
116
117 int pattern = 0;
118 for (int i = 0; i < Size(a); i++)
119 pattern = (pattern << a[i]) | ~(0xffffffff << a[i]) * (~i & 1);
120 return pattern;
121}
122
123template <typename T = int, typename = std::enable_if_t<std::is_integral_v<T>>>
124T ToInt(const BitArray& bits, int pos = 0, int count = 8 * sizeof(T))

Callers 1

ToIntsFunction · 0.70

Calls 5

ReduceFunction · 0.85
iterAtMethod · 0.80
SizeFunction · 0.70
minFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected