Michael Paus
12/03/2021, 5:33 PMval buffer = IntArray(width * height)
// do some processing on buffer.
val outputImage = ImageBitmap(width, height, ImageBitmapConfig.Argb8888, true, ColorSpaces.Srgb)
outputImage.asAndroidBitmap().setPixels(buffer, 0, width, 0, 0, width, height)
Ideally there should be an ImageBitmap
constructor which directly takes an IntArray
as an argument. Or am I just missing something. If you can get such a buffer via readPixels
from an ImageBitmap
why is there then no way to feed that back into an image?