MCPcopy Create free account
hub / github.com/aardappel/lobster / LoadImageFile

Function LoadImageFile

dev/src/gltexture.cpp:252–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252uint8_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
260void FreeImageFromFile(uint8_t *img) {
261 stbi_image_free(img);

Callers 1

AddCubeGenFunction · 0.85

Calls 4

LoadFileFunction · 0.70
stbi_load_from_memoryFunction · 0.50
c_strMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected