I would like to get a memory buffer for the Canvas.
For example, if I create:
val surface = Surface.makeRasterN32Premul(width, height)
val canvas = surface.canvas
how can I get a pixel matrix i.e. pixel array, where I can set pixel colors directly in memory? So I can write something likeraw[x*width + y]=0xff00ff00. Is there anything similar?
If not possible: how can I set individual pixel at some coordinate? Why there is no bitmap.setPixel?
I would like to get a memory buffer for the Canvas.
For example, if I create:
how can I get a pixel matrix i.e. pixel array, where I can set pixel colors directly in memory? So I can write something like
raw[x*width + y]=0xff00ff00
. Is there anything similar?If not possible: how can I set individual pixel at some coordinate? Why there is no
bitmap.setPixel
?