summaryrefslogtreecommitdiffhomepage
path: root/pose-widget
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-12-24 18:54:34 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-12-24 19:32:10 +0100
commita88e34b21b07f70123926fcb5c505d6afdf99807 (patch)
tree905059194dcc64c7c163b8912947d8173fd4cc91 /pose-widget
parent5bf85412e4eacf92acc936b6e74bce0e2b1055d9 (diff)
style/quality only
No functional changes. - add `override' everywhere where missing - almost pass clang's `-Wweak-vtables' - avoid some float/double conversions - remove unused private members - make signedness conversions explicit - put stuff in right namespaces to aid analysis
Diffstat (limited to 'pose-widget')
-rw-r--r--pose-widget/pose-widget.cpp8
-rw-r--r--pose-widget/pose-widget.hpp7
2 files changed, 7 insertions, 8 deletions
diff --git a/pose-widget/pose-widget.cpp b/pose-widget/pose-widget.cpp
index b10578d9..d9b563e9 100644
--- a/pose-widget/pose-widget.cpp
+++ b/pose-widget/pose-widget.cpp
@@ -182,7 +182,7 @@ bool Triangle::barycentric_coords(const vec2& px, vec2& uv, int& i) const
std::pair<vec2i, vec2i> pose_transform::get_bounds(const vec2& size)
{
- const int x = size.x(), y = size.y();
+ const num x = size.x(), y = size.y();
const vec3 corners[] = {
{ -x, -y, 0 },
@@ -350,8 +350,8 @@ void pose_transform::project_quad_texture()
const unsigned px_ = fx + 1;
const unsigned py_ = fy + 1;
#endif
- const unsigned px = fx;
- const unsigned py = fy;
+ const unsigned px = (unsigned)fx;
+ const unsigned py = (unsigned)fy;
const unsigned orig_pos = py * orig_pitch + px * const_depth;
#if defined BILINEAR_FILTER
@@ -380,7 +380,7 @@ void pose_transform::project_quad_texture()
dest[pos + k] = orig[orig_pos + k];
else
for (int k = 0; k < 3; k++)
- dest[pos + k] = bgcolor(k);
+ dest[pos + k] = (unsigned char)bgcolor(k);
}
}
}
diff --git a/pose-widget/pose-widget.hpp b/pose-widget/pose-widget.hpp
index fa956b47..4a97b789 100644
--- a/pose-widget/pose-widget.hpp
+++ b/pose-widget/pose-widget.hpp
@@ -48,7 +48,7 @@ public:
struct pose_transform final : QThread
{
pose_transform(QWidget* dst);
- ~pose_transform();
+ ~pose_transform() override;
void rotate_async(double xAngle, double yAngle, double zAngle, double x, double y, double z);
void rotate_sync(double xAngle, double yAngle, double zAngle, double x, double y, double z);
@@ -76,14 +76,13 @@ struct pose_transform final : QThread
QImage front, back;
QImage image, image2;
- struct uv_
+ struct uv_ // NOLINT(cppcoreguidelines-pro-type-member-init)
{
vec2 coords;
int i;
};
std::vector<uv_> uv_vec;
-
std::atomic<bool> fresh;
static constexpr inline int w = 320, h = 240;
@@ -93,7 +92,7 @@ class OTR_POSE_WIDGET_EXPORT pose_widget final : public QWidget
{
public:
pose_widget(QWidget *parent = nullptr);
- ~pose_widget();
+ ~pose_widget() override;
void rotate_async(double xAngle, double yAngle, double zAngle, double x, double y, double z);
void rotate_sync(double xAngle, double yAngle, double zAngle, double x, double y, double z);