summaryrefslogtreecommitdiffhomepage
path: root/pose-widget/pose-widget.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-01-10 03:09:07 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-01-10 03:37:41 +0100
commitb603abda8b736b4d3e45bc9e66cc3566c0deffe8 (patch)
tree69c2905edaeba5289f91b5a58026dd709c639680 /pose-widget/pose-widget.cpp
parentb9f9a013a9abe8a34e371f63abb54af347c2cd27 (diff)
pose-widget: drop alpha calculation
We don't have 8-bit alpha in Qt anyway.
Diffstat (limited to 'pose-widget/pose-widget.cpp')
-rw-r--r--pose-widget/pose-widget.cpp23
1 files changed, 6 insertions, 17 deletions
diff --git a/pose-widget/pose-widget.cpp b/pose-widget/pose-widget.cpp
index c25ad3eb..5b8fdbbf 100644
--- a/pose-widget/pose-widget.cpp
+++ b/pose-widget/pose-widget.cpp
@@ -375,24 +375,13 @@ void pose_transform::project_quad_texture()
#endif
const unsigned pos = y * dest_pitch + x * const_depth;
- const float a = orig[orig_pos + 3] * (1.f/255.f);
- for (int k = 0; k < 3; k++)
- {
-#if defined BILINEAR_FILTER
- const uc i = orig[orig_pos + k];
- const uc i_ = orig[orig_pos_ + k];
- const uc i__ = orig[orig_pos__ + k];
- const uc i___ = orig[orig_pos___ + k];
-
- unsigned c((i * ax + i__ * ax_) * ay + (i___ * ax + i_ * ax_) * ay_);
-
- dest[pos + k] = (unsigned char) bgcolor(k)*(1-a) + c*a;
-#else
- const uc c = orig[orig_pos + k];
- dest[pos + k] = (unsigned char) bgcolor(k)*(1-a) + c*a;
-#endif
- }
+ if (orig[orig_pos + 3] == uc(255)) // alpha
+ for (int k = 0; k < 3; k++)
+ dest[pos + k] = orig[orig_pos + k];
+ else
+ for (int k = 0; k < 3; k++)
+ dest[pos + k] = bgcolor(k);
}
}
}