diff --git a/PVRTCEncoder/src/Compressor.cpp b/PVRTCEncoder/src/Compressor.cpp index 4b36bf6..8fea0ed 100644 --- a/PVRTCEncoder/src/Compressor.cpp +++ b/PVRTCEncoder/src/Compressor.cpp @@ -465,9 +465,11 @@ namespace PVRTCC { } #if 0 - static void DilateImage(CompressionLabel *labels, uint32 w, uint32 h) { + static void DilateImage(CompressionLabel *labels, const uint8 *inBuf, uint32 w, uint32 h) { for(uint32 j = 0; j < h; j++) for(uint32 i = 0; i < w; i++) { + ComputeLocalExtrema(labels, inBuf, i, j, w, h); + uint32 idx = j*w + i; uint32 minLowDist = labels[idx].lowLabel.distance == 0? 5 : labels[idx].lowLabel.distance - 1; @@ -963,6 +965,27 @@ namespace PVRTCC { DebugOutputImage("HighImg", labels, width, height, HighPixel); DebugOutputImage("LowImg", labels, width, height, LowPixel); + + Image outputHigh(width, height); + Image outputLow(width, height); + for(uint32 j = 0; j < height; j++) + for(uint32 i = 0; i < width; i++) { + uint32 idx = j*width + i; + if(labels[idx].highLabel.distance == 1) { + outputHigh(i, j).Unpack(gDbgPixels[idx]); + } else { + outputHigh(i, j).Unpack(0xFF000000U); + } + + if(labels[idx].lowLabel.distance == 1) { + outputLow(i, j).Unpack(gDbgPixels[idx]); + } else { + outputLow(i, j).Unpack(0xFF000000U); + } + } + + outputHigh.DebugOutput("HighPixels"); + outputLow.DebugOutput("LowPixels"); #endif // Then combine everything...