summaryrefslogtreecommitdiffhomepage
path: root/cv
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-06-26 22:25:22 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-06-26 23:05:21 +0200
commitd65936200a2756e6619a109fa6fa673b91df802e (patch)
tree80b6b6fc7ba9023cbe47290b8ae1bc5468a19bb1 /cv
parent4046773c41ee3c0f65840828ab983cfd13451c85 (diff)
modernize C++ syntax
No visible changes (hopefully).
Diffstat (limited to 'cv')
-rw-r--r--cv/affine.cpp6
-rw-r--r--cv/translation-calibrator.hpp2
-rw-r--r--cv/video-property-page.cpp2
-rw-r--r--cv/video-widget.cpp5
4 files changed, 8 insertions, 7 deletions
diff --git a/cv/affine.cpp b/cv/affine.cpp
index 1b37305c..4ec63e57 100644
--- a/cv/affine.cpp
+++ b/cv/affine.cpp
@@ -15,17 +15,17 @@ Affine::Affine(const mat33& R, const vec3& t) : R(R),t(t) {}
Affine operator*(const Affine& X, const Affine& Y)
{
- return Affine(X.R*Y.R, X.R*Y.t + X.t);
+ return { X.R*Y.R, X.R*Y.t + X.t };
}
Affine operator*(const mat33& X, const Affine& Y)
{
- return Affine(X*Y.R, X*Y.t);
+ return { X*Y.R, X*Y.t };
}
Affine operator*(const Affine& X, const mat33& Y)
{
- return Affine(X.R*Y, X.t);
+ return { X.R*Y, X.t };
}
vec3 operator*(const Affine& X, const vec3& v)
diff --git a/cv/translation-calibrator.hpp b/cv/translation-calibrator.hpp
index c1f6d2ec..774bc7cb 100644
--- a/cv/translation-calibrator.hpp
+++ b/cv/translation-calibrator.hpp
@@ -47,5 +47,5 @@ private:
static constexpr inline double pitch_spacing_in_degrees = 1.5;
static constexpr inline double roll_spacing_in_degrees = 3.5;
- unsigned yaw_rdof, pitch_rdof, roll_rdof, nsamples;
+ unsigned yaw_rdof, pitch_rdof, roll_rdof, nsamples = 0;
};
diff --git a/cv/video-property-page.cpp b/cv/video-property-page.cpp
index 7d94bbc2..e76f8bc3 100644
--- a/cv/video-property-page.cpp
+++ b/cv/video-property-page.cpp
@@ -37,7 +37,7 @@ bool video_property_page::show_from_capture(cv::VideoCapture& cap, int /*index *
struct prop_settings_worker final : QThread
{
- prop_settings_worker(int idx);
+ explicit prop_settings_worker(int idx);
~prop_settings_worker() override;
void _open_prop_page();
void run() override;
diff --git a/cv/video-widget.cpp b/cv/video-widget.cpp
index fd4fe350..d93429cb 100644
--- a/cv/video-widget.cpp
+++ b/cv/video-widget.cpp
@@ -8,6 +8,7 @@
#include "video-widget.hpp"
#include "compat/check-visible.hpp"
+#include "compat/math.hpp"
#include <cstring>
@@ -88,8 +89,8 @@ void cv_video_widget::paintEvent(QPaintEvent*)
double dpr = devicePixelRatioF();
- int W = int(QWidget::width() * dpr);
- int H = int(QWidget::height() * dpr);
+ int W = iround(QWidget::width() * dpr);
+ int H = iround(QWidget::height() * dpr);
painter.drawImage(rect(), texture);