MCPcopy Create free account
hub / github.com/crownengine/crown / imageParse

Function imageParse

3rdparty/bimg/src/image_decode.cpp:890–923  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

888 }
889
890 ImageContainer* imageParse(bx::AllocatorI* _allocator, const void* _data, uint32_t _size, TextureFormat::Enum _dstFormat, bx::Error* _err)
891 {
892 BX_ERROR_SCOPE(_err);
893
894 ImageContainer* input = imageParseDds (_allocator, _data, _size, _err) ;
895 input = NULL == input ? imageParseKtx (_allocator, _data, _size, _err) : input;
896 input = NULL == input ? imageParsePvr3 (_allocator, _data, _size, _err) : input;
897 input = NULL == input ? imageParseGnf (_allocator, _data, _size, _err) : input;
898 input = NULL == input ? imageParseLodePng (_allocator, _data, _size, _err) : input;
899 input = NULL == input ? imageParseTinyExr (_allocator, _data, _size, _err) : input;
900 input = NULL == input ? imageParseJpeg (_allocator, _data, _size, _err) : input;
901 input = NULL == input ? imageParseStbImage(_allocator, _data, _size, _err) : input;
902 input = NULL == input ? imageParseLibHeif (_allocator, _data, _size, _err) : input;
903
904 if (NULL == input)
905 {
906 return NULL;
907 }
908
909 _dstFormat = TextureFormat::Count == _dstFormat
910 ? input->m_format
911 : _dstFormat
912 ;
913
914 if (_dstFormat == input->m_format)
915 {
916 return input;
917 }
918
919 ImageContainer* output = imageConvert(_allocator, _dstFormat, *input);
920 imageFree(input);
921
922 return output;
923 }
924
925} // namespace bimg

Callers

nothing calls this directly

Calls 11

imageParseDdsFunction · 0.85
imageParseKtxFunction · 0.85
imageParsePvr3Function · 0.85
imageParseGnfFunction · 0.85
imageParseLodePngFunction · 0.85
imageParseTinyExrFunction · 0.85
imageParseJpegFunction · 0.85
imageParseStbImageFunction · 0.85
imageParseLibHeifFunction · 0.85
imageConvertFunction · 0.85
imageFreeFunction · 0.85

Tested by

no test coverage detected