From ea68f3a138a1400ebe9a7becb2147e0938e008c6 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Tue, 24 Sep 2013 14:00:14 -0400 Subject: [PATCH] PVRTC image quality of life improvements. --- PVRTCEncoder/src/Image.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PVRTCEncoder/src/Image.cpp b/PVRTCEncoder/src/Image.cpp index ced773e..7a7581a 100644 --- a/PVRTCEncoder/src/Image.cpp +++ b/PVRTCEncoder/src/Image.cpp @@ -352,7 +352,7 @@ void Image::ContentAwareDownscale(uint32 xtimes, uint32 ytimes, Iysq * Iyy[c][idx]) / denom; } float scale = static_cast((1 << bitDepth[c]) - 1); - result.Component(c) = static_cast(Clamp(I0 + 0.25f*It, 0.0f, 1.0f) * scale + 0.5); + result.Component(c) = static_cast(Clamp(I0 + 0.25f*It, 0.0f, 1.0f) * scale + 0.5f); } downscaledPixels[j * newHeight + i] = result; @@ -469,6 +469,8 @@ void Image::DebugOutput(const char *filename) const { uint32 idx = j * GetWidth() + i; Pixel p = m_Pixels[idx]; p.ChangeBitDepth(fullDepth); + p.A() = 255; + outPixels[idx] = p.PackRGBA(); } }