-
Notifications
You must be signed in to change notification settings - Fork 94
Description
I am working on an application that uses Piet for backend-agnostic graphics. Occasionally, I need to capture a region of the canvas and pass the raw bitmap to another part of the application. Unfortunately, as far as I can tell the only use of a piet::Image is to pass it back to the context for drawing.
Currently, I am relying on knowledge of the backend to (very unsafely) transmute the Image to the underlying backend's Image implementation, which exposes methods to get the raw bytes of the bitmap.
It would be useful for Image to expose a method like this itself, so that this can be obtained safely. This would effectively be the reverse of ImageBuf::to_image. I understand that Image is intended to be a backend-specific optimized bitmap representation, so this conversion would be documented as potentially being expensive.