PVRTC image quality of life improvements.

This commit is contained in:
Pavel Krajcevski 2013-09-24 14:00:14 -04:00
parent e9a9988a56
commit ea68f3a138

View file

@ -352,7 +352,7 @@ void Image::ContentAwareDownscale(uint32 xtimes, uint32 ytimes,
Iysq * Iyy[c][idx]) / denom; Iysq * Iyy[c][idx]) / denom;
} }
float scale = static_cast<float>((1 << bitDepth[c]) - 1); float scale = static_cast<float>((1 << bitDepth[c]) - 1);
result.Component(c) = static_cast<uint8>(Clamp(I0 + 0.25f*It, 0.0f, 1.0f) * scale + 0.5); result.Component(c) = static_cast<uint8>(Clamp(I0 + 0.25f*It, 0.0f, 1.0f) * scale + 0.5f);
} }
downscaledPixels[j * newHeight + i] = result; downscaledPixels[j * newHeight + i] = result;
@ -469,6 +469,8 @@ void Image::DebugOutput(const char *filename) const {
uint32 idx = j * GetWidth() + i; uint32 idx = j * GetWidth() + i;
Pixel p = m_Pixels[idx]; Pixel p = m_Pixels[idx];
p.ChangeBitDepth(fullDepth); p.ChangeBitDepth(fullDepth);
p.A() = 255;
outPixels[idx] = p.PackRGBA(); outPixels[idx] = p.PackRGBA();
} }
} }