stb
stb copied to clipboard
stb_image: read image into a buffer allocated outside of stbi
It could be implemented to output into a preallocated buffer like in stb_image_resize or with the ability to set a custom allocator for output buffer alloc/free. I am not interested in using custom allocator for internal, temporary buffers but others might find that useful too.
The current STBI_MALLOC in stb_image v2.0 is good enough for me. Thanks for adding it. So If you don't plan to modify the interface to add a preallocated buffer for output this issue can be closed.
I still want to add that.
Great. Thanks.
I mentioned this in #435 but I'll repeat it here for prosperity
Providing a row stride with the buffer would then be very nice addition for the APIs that require aligned rows.
I'm also interested in this, for reasons already mentioned in #435 (namely non-trivial row stride). Is this still on the todo list, or maybe available in a fork already somewhere?
I'd be interested in this addition, too.
I'm also interested in this. My game engine uses custom allocators everywhere and while I've done some hacks to STB image in order to accommodate, I think it would be nicer if it was exposed as part of the header by default.
Adding my voice to the "I'm interested in this" as well. Really interested!
This feature would be nice in Vulkan so that you may decode directly to the ppData
parameter in vkMapMemory for a VkBuffer. This would reduce the amount of processing required. Otherwise the end-user will be forced to copy all data themselves to the mapped memory.