diff options
Diffstat (limited to 'src/profile.cpp')
| -rw-r--r-- | src/profile.cpp | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/profile.cpp b/src/profile.cpp index 64ba091..3ed11ba 100644 --- a/src/profile.cpp +++ b/src/profile.cpp @@ -11,33 +11,35 @@ Profile::Profile( const CalibrationTablePtr calibrationTableX) : m_counters(pixels.counters) { - if (!calibrationTableZ || !calibrationTableX) - { - std::cerr << __func__ << ": got invalid calibration tables" - << std::endl; + // if (!calibrationTableZ || !calibrationTableX) { + // std::cerr << __func__ << ": got invalid calibration tables" << std::endl; - return; - } + // return; + // } static bool done{false}; - if (!done) { - for (size_t i = 9471; i < 9472; i++) { - std::cout << __func__ << ": row #" << i << ": "; + // if (!done) { + // // for (size_t i = 9471; i < 9472; i++) { + // for (size_t i = 0; i < calibrationTableHeight; i++) { + // std::cout << __func__ << ": row #" << i << ": "; - for (size_t j = 0; j < img_width; ++j) { - const auto& x = calibrationTableX->at(j).at(i); - const auto& z = calibrationTableZ->at(j).at(i); - std::cout << "Profile: table: " << x << ' ' << z << std::endl; - } + // for (size_t j = 0; j < img_width; ++j) { + // const auto &x = calibrationTableX ? calibrationTableX->at(j).at(i) : j; + // const auto &z = calibrationTableZ->at(j).at(i); + // std::cout << "Profile: table: " << x << ' ' << z << std::endl; + // } - std::cout << std::endl; - } - } + // std::cout << std::endl; + // } + // } for (size_t i = 0; i < img_width; ++i) { try { const auto& pixel = pixels.pixels[i]; + if (!qFuzzyIsNull(pixel)) { + qt_noop(); + } const auto pixelDiscrete = pixel * discretesInRage / img_height; if (Q_UNLIKELY(pixel >= sizeof(CalibrationColumn) / sizeof(float))) { qWarning() << "got invalid calibration pixel at" << i << ":" @@ -79,8 +81,7 @@ Profile::Profile( // TODO: use only NaN (or zero?) everywhere // NOTE: QJsonValue converts NaN to zero if (qFuzzyIsNull(z) || std::isnan(z)) { - // qDebug() << "got nan z for discrete" << pixelDiscrete << leftMmZ - // << rightMmZ; + // qDebug() << "got nan z for discrete" << pixelDiscrete << leftMmZ << rightMmZ; m_pointsMm.at(i) = {std::nan(""), std::nan("")}; continue; } |
