From dbc77986557cc95d2de972666a11e7325e0b70df Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Mon, 30 Sep 2013 11:08:51 -0400 Subject: [PATCH] Add modulation image debug output. --- PVRTCEncoder/src/Compressor.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/PVRTCEncoder/src/Compressor.cpp b/PVRTCEncoder/src/Compressor.cpp index 56183b7..c104f24 100644 --- a/PVRTCEncoder/src/Compressor.cpp +++ b/PVRTCEncoder/src/Compressor.cpp @@ -243,6 +243,22 @@ namespace PVRTCC { } } + Image modulationImg(dcj.height, dcj.width); + for(uint32 j = 0; j < dcj.height; j++) { + for(uint32 i = 0; i < dcj.width; i++) { + uint32 idx = j * dcj.width + i; + uint8 modVal = static_cast((static_cast(modValues[idx]) / 3.0f) * 255.0f); + + Pixel p; + for(uint32 c = 1; c < 4; c++) { + p.Component(c) = modVal; + } + p.A() = 255; + modulationImg(j, i) = p; + } + } + modulationImg.DebugOutput("Modulation"); + // Pack everything into a PVRTC blocks. assert(imgA.GetHeight() == blocksH); assert(imgA.GetWidth() == blocksW);