summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/camera.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-10-19 14:44:43 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-10-19 14:46:33 +0200
commit0a518ad7d0aa94df529af2c39c2b34457b6d1015 (patch)
tree0f846576925b5677e51ea6a7aa99c8824eb86dfd /tracker-pt/camera.h
parentef5b07efe3517713e0343e01c806149a0a20b873 (diff)
compat, tracker/pt: add warn_unused_result compat macro
Diffstat (limited to 'tracker-pt/camera.h')
-rw-r--r--tracker-pt/camera.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/tracker-pt/camera.h b/tracker-pt/camera.h
index 323ea647..be7d35c4 100644
--- a/tracker-pt/camera.h
+++ b/tracker-pt/camera.h
@@ -7,6 +7,8 @@
#pragma once
+#include "compat/util.hpp"
+
#include <opencv2/core/core.hpp>
#include <memory>
#include <opencv2/videoio.hpp>
@@ -41,16 +43,15 @@ public:
void set_res(int x_res, int y_res);
// gets a frame from the camera, dt: time since last call in seconds
- bool get_frame(double dt, cv::Mat* frame);
+ DEFUN_WARN_UNUSED bool get_frame(double dt, cv::Mat* frame);
// WARNING: returned references are valid as long as object
- bool get_info(CamInfo &ret);
+ DEFUN_WARN_UNUSED bool get_info(CamInfo &ret);
CamInfo get_desired() const { return cam_desired; }
-
QString get_desired_name() const;
protected:
// get a frame from the camera
- virtual bool _get_frame(cv::Mat* frame) = 0;
+ DEFUN_WARN_UNUSED virtual bool _get_frame(cv::Mat* frame) = 0;
// update the camera using cam_desired, write res and f to cam_info if successful
virtual void _set_device_index() = 0;
@@ -66,11 +67,10 @@ protected:
int desired_index;
int active_index;
};
-inline Camera::~Camera() {}
// ----------------------------------------------------------------------------
// camera based on OpenCV's videoCapture
-class CVCamera : public Camera
+class CVCamera final : public Camera
{
public:
CVCamera() : cap(NULL) {}
@@ -80,7 +80,6 @@ public:
void stop() override;
operator cv::VideoCapture*() { return cap; }
-
protected:
bool _get_frame(cv::Mat* frame) override;
void _set_fps() override;