fogleman / gg

Go Graphics - 2D rendering in Go with a simple API.
https://godoc.org/github.com/fogleman/gg
MIT License
4.37k stars 354 forks source link

How to copy to framebuffer? such as memcpy #135

Closed Leadrive closed 3 years ago

Leadrive commented 3 years ago

Hi, I use gg in ARM linux, the image.Draw is very slow. I want to know how to copy the data to framebuffer direct, such as C memcpy. Thank you!

Leadrive commented 3 years ago

gg add a function RGBA() func (dc Context) RGBA() image.RGBA { return dc.im } copy(framebuffer.Pixels[0:], dc.RGBA().Pix[0:])