MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / imageDecodeToR8

Function imageDecodeToR8

Source/3rdParty/bimg/src/image.cpp:4514–4537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4512 }
4513
4514 void imageDecodeToR8(bx::AllocatorI* _allocator, void* _dst, const void* _src, uint32_t _width, uint32_t _height, uint32_t _depth, uint32_t _dstPitch, TextureFormat::Enum _srcFormat)
4515 {
4516 const uint8_t* src = (const uint8_t*)_src;
4517 uint8_t* dst = (uint8_t*)_dst;
4518
4519 const uint32_t srcBpp = s_imageBlockInfo[_srcFormat].bitsPerPixel;
4520 const uint32_t srcPitch = _width*srcBpp/8;
4521
4522 for (uint32_t zz = 0; zz < _depth; ++zz, src += _height*srcPitch, dst += _height*_dstPitch)
4523 {
4524 if (isCompressed(_srcFormat))
4525 {
4526 uint32_t size = imageGetSize(NULL, uint16_t(_width), uint16_t(_height), 0, false, false, 1, TextureFormat::RGBA8);
4527 void* temp = bx::alloc(_allocator, size);
4528 imageDecodeToRgba8(_allocator, temp, _src, _width, _height, _width*4, _srcFormat);
4529 imageConvert(_allocator, dst, TextureFormat::R8, temp, TextureFormat::RGBA8, _width, _height, 1, _width*4, _dstPitch);
4530 bx::free(_allocator, temp);
4531 }
4532 else
4533 {
4534 imageConvert(_allocator, dst, TextureFormat::R8, src, _srcFormat, _width, _height, 1, srcPitch, _dstPitch);
4535 }
4536 }
4537 }
4538
4539 void imageDecodeToBgra8(bx::AllocatorI* _allocator, void* _dst, const void* _src, uint32_t _width, uint32_t _height, uint32_t _dstPitch, TextureFormat::Enum _srcFormat)
4540 {

Callers

nothing calls this directly

Calls 6

isCompressedFunction · 0.85
imageGetSizeFunction · 0.85
imageDecodeToRgba8Function · 0.85
imageConvertFunction · 0.85
allocFunction · 0.50
freeFunction · 0.50

Tested by

no test coverage detected