MCPcopy Create free account
hub / github.com/cococry/leif / lf_load_texture_data_from_memory

Function lf_load_texture_data_from_memory

leif.c:2119–2126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2117 }
2118
2119unsigned char* lf_load_texture_data_from_memory(const void* data, size_t size, int32_t* width, int32_t* height, int32_t* channels, bool flip) {
2120 stbi_set_flip_vertically_on_load(!flip);
2121 unsigned char* image = stbi_load_from_memory(data, size, width, height, channels, 0);
2122 if (!image) {
2123 return NULL;
2124 }
2125 return image;
2126}
2127
2128unsigned char* lf_load_texture_data_from_memory_resized(const void* data, size_t size, int32_t* channels, int32_t* o_w, int32_t* o_h, bool flip, uint32_t w, uint32_t h) {
2129 int32_t width, height;

Calls

no outgoing calls

Tested by

no test coverage detected