MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / DecompressAlphaDxt3

Function DecompressAlphaDxt3

Engine/lib/squish/alpha.cpp:74–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74void DecompressAlphaDxt3( u8* rgba, void const* block )
75{
76 u8 const* bytes = reinterpret_cast< u8 const* >( block );
77
78 // unpack the alpha values pairwise
79 for( int i = 0; i < 8; ++i )
80 {
81 // quantise down to 4 bits
82 u8 quant = bytes[i];
83
84 // unpack the values
85 u8 lo = quant & 0x0f;
86 u8 hi = quant & 0xf0;
87
88 // convert back up to bytes
89 rgba[8*i + 3] = lo | ( lo << 4 );
90 rgba[8*i + 7] = hi | ( hi >> 4 );
91 }
92}
93
94static void FixRange( int& min, int& max, int steps )
95{

Callers 1

DecompressFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected