diff options
Diffstat (limited to 'pose-widget/pose-widget.hpp')
-rw-r--r-- | pose-widget/pose-widget.hpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/pose-widget/pose-widget.hpp b/pose-widget/pose-widget.hpp index fc606e13..7bc66cd2 100644 --- a/pose-widget/pose-widget.hpp +++ b/pose-widget/pose-widget.hpp @@ -16,6 +16,7 @@ #include <mutex> #include <atomic> +#include <vector> #ifdef BUILD_POSE_WIDGET # define POSE_WIDGET_EXPORT Q_DECL_EXPORT @@ -37,6 +38,14 @@ using lock_guard = std::unique_lock<std::mutex>; class pose_widget; +class Triangle { + num dot00, dot01, dot11, invDenom; + vec2 v0, v1, origin; +public: + Triangle(const vec2& p1, const vec2& p2, const vec2& p3); + bool barycentric_coords(const vec2& px, vec2& uv, int& i) const; +}; + struct pose_transform final : private QThread { pose_transform(QWidget* dst); @@ -67,6 +76,14 @@ struct pose_transform final : private QThread QImage front, back; QImage image, image2; + struct uv_ + { + vec2 coords; + int i; + }; + + std::vector<uv_> uv_vec; + std::atomic<bool> fresh; static constexpr int w = 320, h = 240; |