| 78 | using ComObject = Microsoft::WRL::ComPtr<T>; |
| 79 | |
| 80 | void WICFileIONative::Load(std::string const& filename, uint32_t& outFormat, |
| 81 | size_t& outWidth, size_t& outHeight, std::vector<uint8_t>& outTexels) |
| 82 | { |
| 83 | auto const* bytesPerTexel = msBytesPerTexel.data(); |
| 84 | |
| 85 | TextureCreator creator = [&outFormat, &outWidth, &outHeight, &outTexels, &bytesPerTexel]( |
| 86 | uint32_t format, size_t width, size_t height) |
| 87 | { |
| 88 | outFormat = format; |
| 89 | outWidth = width; |
| 90 | outHeight = height; |
| 91 | outTexels.resize(width * height * bytesPerTexel[format]); |
| 92 | return reinterpret_cast<uint8_t*>(outTexels.data()); |
| 93 | }; |
| 94 | |
| 95 | WICFileIONative::Load(filename, creator); |
| 96 | } |
| 97 | |
| 98 | void WICFileIONative::Load(std::string const& filename, TextureCreator const& creator) |
| 99 | { |
nothing calls this directly
no test coverage detected