summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-12-18 03:55:37 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-12-18 03:55:37 +0100
commitf502b3823222c204110484bc2d27c40775ff4b36 (patch)
tree09b7f6fa20d093b0fccc9b3bba675921bce6723a
parentf795b06001ac9281f42d2565add85d0c3ea1cf15 (diff)
pose-widget: also bilinear interpolation of alpha value
-rw-r--r--pose-widget/glwidget.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/pose-widget/glwidget.cpp b/pose-widget/glwidget.cpp
index 9b350010..1b30e585 100644
--- a/pose-widget/glwidget.cpp
+++ b/pose-widget/glwidget.cpp
@@ -203,6 +203,7 @@ void GLWidget::project_quad_texture() {
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;
@@ -211,7 +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 + a2 + a3)/3;
+ dest[pos + 3] = (a1 * ax + a3 * ax_) * ay + (a4 * ax + a2 * ax_) * ay_;
break;
}