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

Function BcDecompress

trinityal/BcDecompress.cpp:241–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241bool BcDecompress( uint32_t width, uint32_t height, uint32_t depth, PixelFormat format, const Tr2SubresourceData& src, std::unique_ptr<uint8_t[]>& decompressed )
242{
243 if( !decompressed )
244 {
245 decompressed.reset( new uint8_t[width * height * depth * 4] );
246 }
247 switch( format )
248 {
249 case PIXEL_FORMAT_BC1_TYPELESS:
250 case PIXEL_FORMAT_BC1_UNORM:
251 case PIXEL_FORMAT_BC1_UNORM_SRGB:
252 DecompressBc1( width, height, depth, src, decompressed.get() );
253 return true;
254
255 case PIXEL_FORMAT_BC2_TYPELESS:
256 case PIXEL_FORMAT_BC2_UNORM:
257 case PIXEL_FORMAT_BC2_UNORM_SRGB:
258 DecompressBc2( width, height, depth, src, decompressed.get() );
259 return true;
260
261 case PIXEL_FORMAT_BC3_TYPELESS:
262 case PIXEL_FORMAT_BC3_UNORM:
263 case PIXEL_FORMAT_BC3_UNORM_SRGB:
264 DecompressBc3( width, height, depth, src, decompressed.get() );
265 return true;
266
267 default:
268 return false;
269 }
270}

Callers

nothing calls this directly

Calls 5

DecompressBc1Function · 0.85
DecompressBc2Function · 0.85
DecompressBc3Function · 0.85
resetMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected