summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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;
}