C API: add equivalent of playdate.datastore.writeImage()

In my app, I'd like to write images generated by my C code to disk for later use, but I'm unaware of any way to do this directly from C without reimplementing the .pdi format. Currently, since the C code is being called from Lua, I'm able to push the LCDBitmap to stack, then use playdate.datastore.writeImage() from Lua in order to accomplish the task, but I can't imagine this is optimal for performance. Ideally, a similar function would exist in the C API. For context, I'm building a music player app in Lua and C, and I want to process and save resized and dithered album art at startup.


Thanks for the feedback! It does seem like we should have some way to persist images to disk.