move Qr code lib to phonelibs (#19871)
parent
d4489fbf91
commit
e54db636f7
|
@ -174,6 +174,7 @@ env = Environment(
|
||||||
"#phonelibs/linux/include",
|
"#phonelibs/linux/include",
|
||||||
"#phonelibs/snpe/include",
|
"#phonelibs/snpe/include",
|
||||||
"#phonelibs/nanovg",
|
"#phonelibs/nanovg",
|
||||||
|
"#phonelibs/qrcode",
|
||||||
"#selfdrive/boardd",
|
"#selfdrive/boardd",
|
||||||
"#selfdrive/common",
|
"#selfdrive/common",
|
||||||
"#selfdrive/camerad",
|
"#selfdrive/camerad",
|
||||||
|
|
|
@ -349,7 +349,7 @@ QrCode::QrCode(int ver, Ecc ecl, const vector<uint8_t> &dataCodewords, int msk)
|
||||||
applyMask(i); // Undoes the mask due to XOR
|
applyMask(i); // Undoes the mask due to XOR
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (msk < 0 || msk > 7)//lgtm [cpp/constant-comparison]
|
if (msk < 0 || msk > 7)
|
||||||
throw std::logic_error("Assertion error");
|
throw std::logic_error("Assertion error");
|
||||||
this->mask = msk;
|
this->mask = msk;
|
||||||
applyMask(msk); // Apply the final choice of mask
|
applyMask(msk); // Apply the final choice of mask
|
||||||
|
@ -635,12 +635,12 @@ long QrCode::getPenaltyScore() const {
|
||||||
} else {
|
} else {
|
||||||
finderPenaltyAddHistory(runX, runHistory);
|
finderPenaltyAddHistory(runX, runHistory);
|
||||||
if (!runColor)
|
if (!runColor)
|
||||||
result += finderPenaltyCountPatterns(runHistory) * PENALTY_N3;//lgtm [cpp/integer-multiplication-cast-to-long]
|
result += finderPenaltyCountPatterns(runHistory) * PENALTY_N3;
|
||||||
runColor = module(x, y);
|
runColor = module(x, y);
|
||||||
runX = 1;
|
runX = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result += finderPenaltyTerminateAndCount(runColor, runX, runHistory) * PENALTY_N3;//lgtm [cpp/integer-multiplication-cast-to-long]
|
result += finderPenaltyTerminateAndCount(runColor, runX, runHistory) * PENALTY_N3;
|
||||||
}
|
}
|
||||||
// Adjacent modules in column having same color, and finder-like patterns
|
// Adjacent modules in column having same color, and finder-like patterns
|
||||||
for (int x = 0; x < size; x++) {
|
for (int x = 0; x < size; x++) {
|
||||||
|
@ -657,12 +657,12 @@ long QrCode::getPenaltyScore() const {
|
||||||
} else {
|
} else {
|
||||||
finderPenaltyAddHistory(runY, runHistory);
|
finderPenaltyAddHistory(runY, runHistory);
|
||||||
if (!runColor)
|
if (!runColor)
|
||||||
result += finderPenaltyCountPatterns(runHistory) * PENALTY_N3;//lgtm [cpp/integer-multiplication-cast-to-long]
|
result += finderPenaltyCountPatterns(runHistory) * PENALTY_N3;
|
||||||
runColor = module(x, y);
|
runColor = module(x, y);
|
||||||
runY = 1;
|
runY = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result += finderPenaltyTerminateAndCount(runColor, runY, runHistory) * PENALTY_N3;//lgtm [cpp/integer-multiplication-cast-to-long]
|
result += finderPenaltyTerminateAndCount(runColor, runY, runHistory) * PENALTY_N3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2*2 blocks of modules having same color
|
// 2*2 blocks of modules having same color
|
|
@ -441,6 +441,9 @@ phonelibs/json11/json11.hpp
|
||||||
|
|
||||||
phonelibs/qpoases/**
|
phonelibs/qpoases/**
|
||||||
|
|
||||||
|
phonelibs/qrcode/*.cc
|
||||||
|
phonelibs/qrcode/*.hpp
|
||||||
|
|
||||||
phonelibs/libyuv/include/**
|
phonelibs/libyuv/include/**
|
||||||
phonelibs/libyuv/lib/**
|
phonelibs/libyuv/lib/**
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ else:
|
||||||
|
|
||||||
widgets = qt_env.Library("qt_widgets",
|
widgets = qt_env.Library("qt_widgets",
|
||||||
["qt/qt_window.cc", "qt/qt_sound.cc", "qt/widgets/keyboard.cc", "qt/widgets/input_field.cc", "qt/widgets/drive_stats.cc",
|
["qt/qt_window.cc", "qt/qt_sound.cc", "qt/widgets/keyboard.cc", "qt/widgets/input_field.cc", "qt/widgets/drive_stats.cc",
|
||||||
"qt/offroad/wifi.cc", "qt/offroad/wifiManager.cc", "qt/widgets/toggle.cc", "qt/widgets/offroad_alerts.cc", "qt/widgets/setup.cc", "qt/widgets/QrCode.cc"],
|
"qt/offroad/wifi.cc", "qt/offroad/wifiManager.cc", "qt/widgets/toggle.cc", "qt/widgets/offroad_alerts.cc", "qt/widgets/setup.cc"],
|
||||||
LIBS=qt_libs)
|
LIBS=qt_libs)
|
||||||
qt_libs.append(widgets)
|
qt_libs.append(widgets)
|
||||||
|
|
||||||
|
@ -29,8 +29,7 @@ else:
|
||||||
del qt_libs[qt_libs.index('OpenCL')]
|
del qt_libs[qt_libs.index('OpenCL')]
|
||||||
qt_env['FRAMEWORKS'] += ['OpenCL']
|
qt_env['FRAMEWORKS'] += ['OpenCL']
|
||||||
|
|
||||||
qt_src = ["qt/ui.cc", "qt/window.cc", "qt/home.cc", "qt/api.cc", "qt/offroad/settings.cc", "qt/offroad/onboarding.cc"] + src
|
qt_src = ["qt/ui.cc", "qt/window.cc", "qt/home.cc", "qt/api.cc", "qt/offroad/settings.cc", "qt/offroad/onboarding.cc", "#phonelibs/qrcode/QrCode.cc"] + src
|
||||||
|
|
||||||
qt_env.Program("_ui", qt_src, LIBS=qt_libs)
|
qt_env.Program("_ui", qt_src, LIBS=qt_libs)
|
||||||
|
|
||||||
# spinner and text window
|
# spinner and text window
|
||||||
|
|
Loading…
Reference in New Issue