diff options
| -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);              }          }      } | 
