renderToBitmap

external fun renderToBitmap(target: Bitmap): Result<Unit>

Renders the stored image into a caller-provided mutable ARGB_8888 Bitmap.

If the bitmap's dimensions differ from the source image, the image is rescaled (INTER_AREA) directly into the bitmap's locked pixels. The bitmap must be mutable and use Bitmap.Config.ARGB_8888. This avoids allocating a new bitmap on every call and is intended for reusable bitmaps backing drawables/views.