summaryrefslogtreecommitdiffhomepage
path: root/pose-widget
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-01-06 20:07:13 +0100
committerStanislaw Halik <sthalik@misaki.pl>2016-01-06 20:16:18 +0100
commit82f3d7373234cc0db79a22d476cb54b5eda7a0ea (patch)
tree65ee0194ad064cc470f95f7ca8efd533b089ca96 /pose-widget
parent7e3807d048c5e0a8e0aa64fb49807bf5dfd11fc1 (diff)
parentf02baa0868f219076a641634625f7c032d3a9eef (diff)
Merge branch 'unstable' into trackhat
* unstable: (140 commits) tracker/pt: increase auto threshold bucket size again tracker/pt: limit max amount of extracted blobs gui: don't update main window if we're minimized tracker/pt: only show widget if the frame is visible tracker/pt: don't resize twice in widget freetrack/games: regen contrib/make-csv: perl sort isn't stable, don't ignore case tracker/pt: avoid widget temp QImage allocation spline-widget: oops, pass by reference tracker/pt: don't allocate temporary dynamic size arrays tracker/pt: don't copy points array needlessly tracker/pt: don't allocate temporary frame tracker/pt: cv::Mat::at<T> is slow, use cv::Mat::ptr tracker/pt: avoid widget malloc when able tracker/pt: optimize widget tracker/pt: update video widget at 40 -> 50 ms cmake/mingw-w64: update tracker/pt: reduce mutex contention gui: fix left margin tracker/pt: remove krap tracker/pt: move ctor out of the loop tracker/pt: nix unused tracker/pt: don't fill mask on frame pose-widget: also bilinear interpolation of alpha value ui: adjust margin ui: make more compact glwidget: use transparent octopus background api/mat: fix typos/breakage api/joy: refresh only manually on certain events pt: histogram more granular 6 -> 8 cmake/api: link with strmiids.lib on win32 tracker/pt: reduce auto thresholding histogram bucket size api/keys: prevent idempotent keys api/joy: move from header api/joy: prevent idempotent keypressed passed to receiver compat/options: get rid of std::string usage compat/options: move from header gui/settings: set parent, otherwise not modal gui/settings: don't forget to show a modal dialog before executing gui/main: don't raise a new window, it's enough to set visible api/joy: speed up poll_axis path api/joy: nix static, now that we're not a singleton tracker/joy: adapt to non-singleton joy worker joystick: no longer singleton, use fake window handle api/keys: use a fake window for DirectInput handle gui/keys: allow for pausing global keystrokes for options dialog api/keys: nix tautological #ifdef contrib/aruco: oops, right extension contrib/aruco: use @frost555's marker image api/camera-names: move to compat/ ...
Diffstat (limited to 'pose-widget')
-rw-r--r--pose-widget/CMakeLists.txt2
-rw-r--r--pose-widget/glwidget.cpp24
-rw-r--r--pose-widget/glwidget.h2
-rwxr-xr-xpose-widget/images/side1.pngbin4100 -> 4039 bytes
-rwxr-xr-xpose-widget/images/side6.pngbin4100 -> 4039 bytes
5 files changed, 17 insertions, 11 deletions
diff --git a/pose-widget/CMakeLists.txt b/pose-widget/CMakeLists.txt
index 66cafef7..e48660d7 100644
--- a/pose-widget/CMakeLists.txt
+++ b/pose-widget/CMakeLists.txt
@@ -1 +1 @@
-opentrack_boilerplate(opentrack-pose-widget NO-LINKER-SCRIPT)
+opentrack_boilerplate(opentrack-pose-widget NO-LINKER-SCRIPT LINKAGE)
diff --git a/pose-widget/glwidget.cpp b/pose-widget/glwidget.cpp
index 3ee480a1..1b30e585 100644
--- a/pose-widget/glwidget.cpp
+++ b/pose-widget/glwidget.cpp
@@ -98,16 +98,18 @@ inline GLWidget::vec3 GLWidget::normal(const vec3& p1, const vec3& p2, const vec
void GLWidget::project_quad_texture() {
const int sx = width(), sy = height();
- vec2 pt[4];
+ const int ow = front.width(), oh = front.height();
const vec3 corners[] = {
- vec3(0., 0, 0),
- vec3(sx-1, 0, 0),
- vec3(0, sy-1, 0),
- vec3(sx-1, sy-1, 0.)
+ vec3(-ow/2., -oh/2, 0),
+ vec3(ow/2, -oh/2, 0),
+ vec3(-ow/2, oh/2, 0),
+ vec3(ow/2, oh/2, 0.)
};
+ vec2 pt[4];
+ vec2 sz((sx-ow)/2, (sy-oh)/2);
for (int i = 0; i < 4; i++)
- pt[i] = project(vec3(corners[i].x() - sx/2, corners[i].y() - sy/2, 0)) + vec2(sx/2, sy/2);
+ pt[i] = project(corners[i]) + vec2(sx/2, sy/2);
vec3 normal1(0, 0, 1);
vec3 normal2;
@@ -122,9 +124,7 @@ void GLWidget::project_quad_texture() {
QImage& tex = dir < 0 ? back : front;
- int ow = tex.width(), oh = tex.height();
-
- QImage texture(QSize(sx, sy), QImage::Format_RGB888);
+ QImage texture(QSize(sx, sy), QImage::Format_RGBA8888);
QColor bgColor = palette().color(QPalette::Current, QPalette::Window);
texture.fill(bgColor);
@@ -199,6 +199,11 @@ void GLWidget::project_quad_texture() {
const unsigned char r___ = orig[orig_pos___ + 2];
const unsigned char g___ = orig[orig_pos___ + 1];
const unsigned char b___ = orig[orig_pos___ + 0];
+
+ const unsigned char a1 = orig[orig_pos + 3];
+ const unsigned char a2 = orig[orig_pos_ + 3];
+ const unsigned char a3 = orig[orig_pos__ + 3];
+ const unsigned char a4 = orig[orig_pos___ + 3];
const int pos = y * dest_pitch + x * dest_depth;
@@ -207,6 +212,7 @@ void GLWidget::project_quad_texture() {
dest[pos + 0] = (r * ax + r__ * ax_) * ay + (r___ * ax + r_ * ax_) * ay_;
dest[pos + 1] = (g * ax + g__ * ax_) * ay + (g___ * ax + g_ * ax_) * ay_;
dest[pos + 2] = (b * ax + b__ * ax_) * ay + (b___ * ax + b_ * ax_) * ay_;
+ dest[pos + 3] = (a1 * ax + a3 * ax_) * ay + (a4 * ax + a2 * ax_) * ay_;
break;
}
diff --git a/pose-widget/glwidget.h b/pose-widget/glwidget.h
index fca3502d..8896a3cf 100644
--- a/pose-widget/glwidget.h
+++ b/pose-widget/glwidget.h
@@ -13,7 +13,7 @@
#include "opentrack/plugin-api.hpp"
#include "opentrack/simple-mat.hpp"
-#ifdef BUILD_opentrack_pose_widget
+#ifdef BUILD_pose_widget
# define POSE_WIDGET_EXPORT Q_DECL_EXPORT
#else
# define POSE_WIDGET_EXPORT Q_DECL_IMPORT
diff --git a/pose-widget/images/side1.png b/pose-widget/images/side1.png
index 1424faa3..e85a3205 100755
--- a/pose-widget/images/side1.png
+++ b/pose-widget/images/side1.png
Binary files differ
diff --git a/pose-widget/images/side6.png b/pose-widget/images/side6.png
index 1424faa3..e85a3205 100755
--- a/pose-widget/images/side6.png
+++ b/pose-widget/images/side6.png
Binary files differ