summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/pt-api.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-01-21 09:37:13 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-01-21 09:37:13 +0100
commit1ccc6bb7888865b38fcd6234040345a0be66ec1d (patch)
tree9392da03fe704ffb328b1419794149a069e0a26c /tracker-pt/pt-api.hpp
parentd9bef40680c5613397b61cae213f616d3e09f2f1 (diff)
tracker/pt-base: add static pt_camera_info::get_focal_length
For the Wiimote tracker. Adjust usages in tracker/pt. Issue: #718
Diffstat (limited to 'tracker-pt/pt-api.hpp')
-rw-r--r--tracker-pt/pt-api.hpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/tracker-pt/pt-api.hpp b/tracker-pt/pt-api.hpp
index f2a200d6..1b50bc15 100644
--- a/tracker-pt/pt-api.hpp
+++ b/tracker-pt/pt-api.hpp
@@ -17,8 +17,10 @@
struct OTR_PT_EXPORT pt_camera_info final
{
+ using f = typename types::f;
+
pt_camera_info();
- virtual double get_focal_length() const;
+ static double get_focal_length(f fov, int res_x, int res_y);
double fov = 0;
double fps = 0;
@@ -30,7 +32,13 @@ struct OTR_PT_EXPORT pt_camera_info final
enum pt_camera_open_status : unsigned { cam_open_error, cam_open_ok_no_change, cam_open_ok_change };
-struct OTR_PT_EXPORT pt_frame
+struct OTR_PT_EXPORT pt_pixel_pos_mixin
+{
+ static std::tuple<double, double> to_pixel_pos(double x, double y, int w, int h);
+ static std::tuple<double, double> to_screen_pos(double px, double py, int w, int h);
+};
+
+struct OTR_PT_EXPORT pt_frame : pt_pixel_pos_mixin
{
pt_frame();
virtual ~pt_frame();
@@ -51,13 +59,7 @@ struct OTR_PT_EXPORT pt_frame
}
};
-struct OTR_PT_EXPORT pt_pixel_pos_mixin
-{
- static std::tuple<double, double> to_pixel_pos(double x, double y, int w, int h);
- static std::tuple<double, double> to_screen_pos(double px, double py, int w, int h);
-};
-
-struct OTR_PT_EXPORT pt_preview : pt_frame, pt_pixel_pos_mixin
+struct OTR_PT_EXPORT pt_preview : pt_frame
{
virtual pt_preview& operator=(const pt_frame&) = 0;
virtual QImage get_bitmap() = 0;