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

Method addLayer

czxing/src/main/cpp/zxing/src/ReadBarcode.cpp:53–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51
52 template<int N>
53 void addLayer()
54 {
55 auto siv = layers.back();
56 buffers.emplace_back(siv.width() / N, siv.height() / N);
57 layers.push_back(buffers.back());
58 auto& div = buffers.back();
59 auto* d = div.data();
60
61 for (int dy = 0; dy < div.height(); ++dy)
62 for (int dx = 0; dx < div.width(); ++dx) {
63 int sum = (N * N) / 2;
64 for (int ty = 0; ty < N; ++ty)
65 for (int tx = 0; tx < N; ++tx)
66 sum += *siv.data(dx * N + tx, dy * N + ty);
67 *d++ = sum / (N * N);
68 }
69 }
70
71 void addLayer(int factor)
72 {

Callers

nothing calls this directly

Calls 5

backMethod · 0.80
widthMethod · 0.45
heightMethod · 0.45
push_backMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected