| 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 |
nothing calls this directly
no test coverage detected