| 250 | } |
| 251 | |
| 252 | uint8_t *LoadImageFile(string_view fn, int2 &dim) { |
| 253 | string fbuf; |
| 254 | if (LoadFile(fn, &fbuf) < 0) return nullptr; |
| 255 | int comp; |
| 256 | return stbi_load_from_memory((uint8_t *)fbuf.c_str(), (int)fbuf.length(), &dim.x, &dim.y, |
| 257 | &comp, 4); |
| 258 | } |
| 259 | |
| 260 | void FreeImageFromFile(uint8_t *img) { |
| 261 | stbi_image_free(img); |
no test coverage detected