summaryrefslogtreecommitdiffhomepage
path: root/tracker-wii
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-01-07 11:01:19 +0100
committerStanislaw Halik <sthalik@misaki.pl>2019-01-16 07:48:46 +0100
commit22d3ded34963e663f289c181aa94b54f00693b34 (patch)
treeaad6c435cc1c04609315c8a03c3aa65e09451f26 /tracker-wii
parent442c6251669a387b1b8b75b9cb90eec6ee9a8b9b (diff)
tracker/{pt,wii}: allow float/double in cv/numeric
Diffstat (limited to 'tracker-wii')
-rw-r--r--tracker-wii/wii_camera.h2
-rw-r--r--tracker-wii/wii_frame.cpp2
-rw-r--r--tracker-wii/wii_frame.hpp2
-rw-r--r--tracker-wii/wii_point_extractor.cpp14
4 files changed, 10 insertions, 10 deletions
diff --git a/tracker-wii/wii_camera.h b/tracker-wii/wii_camera.h
index 729ad6c2..e7d93b83 100644
--- a/tracker-wii/wii_camera.h
+++ b/tracker-wii/wii_camera.h
@@ -41,7 +41,7 @@ struct WIICamera final : pt_camera
QString get_desired_name() const override;
QString get_active_name() const override;
- void set_fov(double value) override { (void)value; }
+ void set_fov(f value) override { (void)value; }
void show_camera_settings() override;
private:
diff --git a/tracker-wii/wii_frame.cpp b/tracker-wii/wii_frame.cpp
index 4c2c3904..4520fde4 100644
--- a/tracker-wii/wii_frame.cpp
+++ b/tracker-wii/wii_frame.cpp
@@ -78,7 +78,7 @@ QImage WIIPreview::get_bitmap()
QImage::Format_ARGB32);
}
-void WIIPreview::draw_head_center(double x, double y)
+void WIIPreview::draw_head_center(f x, f y)
{
auto [px_, py_] = to_pixel_pos(x, y, frame_copy.cols, frame_copy.rows);
diff --git a/tracker-wii/wii_frame.hpp b/tracker-wii/wii_frame.hpp
index 5b55bec8..8c4508b2 100644
--- a/tracker-wii/wii_frame.hpp
+++ b/tracker-wii/wii_frame.hpp
@@ -52,7 +52,7 @@ struct WIIPreview final : pt_preview
WIIPreview& operator=(const pt_frame& frame) override;
QImage get_bitmap() override;
- void draw_head_center(double x, double y) override;
+ void draw_head_center(f x, f y) override;
operator cv::Mat&() { return frame_copy; }
operator cv::Mat const&() const { return frame_copy; }
diff --git a/tracker-wii/wii_point_extractor.cpp b/tracker-wii/wii_point_extractor.cpp
index b73925bc..11b48d8f 100644
--- a/tracker-wii/wii_point_extractor.cpp
+++ b/tracker-wii/wii_point_extractor.cpp
@@ -44,8 +44,8 @@ void WIIPointExtractor::draw_point(cv::Mat& preview_frame, const vec2& p, const
{
static constexpr int len = 9;
- cv::Point p2(iround(p[0] * preview_frame.cols + preview_frame.cols / 2),
- iround(-p[1] * preview_frame.cols + preview_frame.rows / 2));
+ cv::Point p2(iround(p[0] * preview_frame.cols + preview_frame.cols / f{2}),
+ iround(-p[1] * preview_frame.cols + preview_frame.rows / f{2}));
cv::line(preview_frame,
cv::Point(p2.x - len, p2.y),
@@ -66,14 +66,14 @@ bool WIIPointExtractor::draw_points(cv::Mat& preview_frame, const struct wii_inf
points.reserve(4);
points.clear();
- for (unsigned index = 0; index < 4; index++)
+ for (unsigned index = 0; index < 4; index++) // NOLINT(modernize-loop-convert)
{
const struct wii_info_points &dot = wii.Points[index];
if (dot.bvis) {
//qDebug() << "wii:" << dot.RawX << "+" << dot.RawY;
//anti-clockwise rotate the 2D point
- const double RX = W - dot.ux;
- const double RY = H - dot.uy;
+ const f RX = W - dot.ux;
+ const f RY = H - dot.uy;
//vec2 dt((dot.RawX - W / 2.0f) / W, -(dot.RawY - H / 2.0f) / W);
//vec2 dt((RX - W / 2.0f) / W, -(RY - H / 2.0f) / W);
//vec2 dt((2.0f*RX - W) / W, -(2.0f*RY - H ) / W);
@@ -99,8 +99,8 @@ void WIIPointExtractor::draw_bg(cv::Mat& preview_frame, const struct wii_info& w
2);
//draw horizon
- int pdelta = iround((preview_frame.rows / 4.) * tan(((double)wii.Pitch)* pi / f(180)));
- int rdelta = iround((preview_frame.cols / 4.) * tan(((double)wii.Roll)* pi / f(180)));
+ int pdelta = iround((preview_frame.rows / f{4}) * tan(((double)wii.Pitch)* pi / f(180)));
+ int rdelta = iround((preview_frame.cols / f{4}) * tan(((double)wii.Roll)* pi / f(180)));
cv::line(preview_frame,
cv::Point(0, preview_frame.rows / 2 + rdelta - pdelta),