diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-10-02 07:53:49 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-10-02 07:54:24 +0200 |
commit | 5c2627ec26aeae563cbaaaa7e5b68caf6f2e929f (patch) | |
tree | abdd4418b90913fa6b0d64a9ae34639fb03100fa /pose-widget/pose-widget.hpp | |
parent | 146cf358925c433e1b9af022cab8e915160467f5 (diff) |
pose-widget: only draw needed octopus size
Diffstat (limited to 'pose-widget/pose-widget.hpp')
-rw-r--r-- | pose-widget/pose-widget.hpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/pose-widget/pose-widget.hpp b/pose-widget/pose-widget.hpp index ba94e233..cdbcdeb8 100644 --- a/pose-widget/pose-widget.hpp +++ b/pose-widget/pose-widget.hpp @@ -7,17 +7,19 @@ #pragma once -#include <QtGlobal> -#include <QWidget> -#include <QThread> -#include <QPixmap> #include "api/plugin-api.hpp" #include "compat/euler.hpp" +#include <tuple> #include <mutex> #include <atomic> #include <vector> +#include <QtGlobal> +#include <QWidget> +#include <QThread> +#include <QPixmap> + #ifdef BUILD_POSE_WIDGET # define POSE_WIDGET_EXPORT Q_DECL_EXPORT #else @@ -29,6 +31,8 @@ namespace pose_widget_impl { using num = float; using vec3 = Mat<num, 3, 1>; using vec2 = Mat<num, 2, 1>; +using vec2i = Mat<int, 2, 1>; +using vec2u = Mat<int, 2, 1>; using rmat = Mat<num, 3, 3>; @@ -62,6 +66,7 @@ struct pose_transform final : QThread vec2 project(const vec3& point); vec3 project2(const vec3& point); void project_quad_texture(); + std::pair<vec2i, vec2i> get_bounds(const vec2& size); template<typename F> inline void with_image_lock(F&& fun); |