diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-10 03:09:07 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-10 03:37:41 +0100 |
commit | b603abda8b736b4d3e45bc9e66cc3566c0deffe8 (patch) | |
tree | 69c2905edaeba5289f91b5a58026dd709c639680 | |
parent | b9f9a013a9abe8a34e371f63abb54af347c2cd27 (diff) |
pose-widget: drop alpha calculation
We don't have 8-bit alpha in Qt anyway.
-rw-r--r-- | pose-widget/pose-widget.cpp | 23 |
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); } } } |