MCPcopy Create free account
hub / github.com/carbonengine/trinity / ExtractBlockDXT5N

Function ExtractBlockDXT5N

trinity/Tr2DxtCompressor.cpp:217–232  ·  view source on GitHub ↗

Extract a block, but blank out blue, and swap red and alpha, on the fly.

Source from the content-addressed store, hash-verified

215
216// Extract a block, but blank out blue, and swap red and alpha, on the fly.
217void ExtractBlockDXT5N( const uint8_t* inPtr, const int width, uint8_t* colorBlock )
218{
219 for( int j = 0; j != 4; ++j )
220 {
221 const uint8_t* src = inPtr;
222 for( int i = 0; i != 4; ++i, src += 4 )
223 {
224 *colorBlock++ = 0;
225 *colorBlock++ = src[1];
226 *colorBlock++ = src[3];
227 *colorBlock++ = src[2];
228 }
229
230 inPtr += width * 4;
231 }
232}
233
234void GetMinMaxYCoCg( uint8_t* colorBlock, uint8_t* minColor, uint8_t* maxColor )
235{

Callers 1

CompressNormalMapDXT5Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected