3 ms·
Writing to a (non memory-mapped) file takes a call to write(), whereas setting pixels in a framebuffer might just be a memcpy(). I think, given the post we are
by theoh 8y ago
Writing to a (non memory-mapped) file takes a call to write(), whereas setting pixels in a framebuffer might just be a memcpy().
I think, given the post we are commenting on, it is OK to distinguish these things. Historically, framebuffers are packed arrays of pixel values, and files aren't necessarily even seekable. These are well established norms.
You could argue that the real interface for writing to an image/screen should involve two-dimensional locations, instead of a linear offset. This is what Plan 9's draw facility proposed, along with alpha compositing operators. That is certainly also a question of interface, but one at a higher level.
So I don't agree that "write X at offset Y" is the ultimate, universal highest-level abstract standard for drawing on a raw raster image. It's more like an implementation detail from my point of view, actually :D