Open J-Cake opened 3 years ago
I don't think it's possible to do this directly, at least not portably. The framebuffer being written into is up to the GPU renderer to manage, and I don't think there's a well-defined way to make the GPU and file mmap both use the same RAM. Also, you would end up with a series of pixel color values with no width/height information, not an image file in a readable image format.
The most relevant example code I can find is here, but it only writes to a regular file (using image
's functionality of choosing file format by file extension): https://github.com/servo/pathfinder/blob/master/demo/common/src/renderer.rs#L271-L289
I don't need to worry about width and height, as I'm pulling that information from elsewhere, In fact, I'm actually looking for a byte-wise solution, so an uncompressed bitmap image.
What you pointed out is almost exactly what I'm looking for, anyway, except that (I'm assuming here) it's compressed.
Hi, I'm looking to draw an image into an
mmap
ped file, I'm not entirely sure where to go.Is this too vague or can someone explain how I'd go about this? Thanks in advance