ImageToNRGBA takes a given `image.Image` and converts it into an `image.NRGBA`. Especially useful when transforming image.Uniform to something usable by `engo`.
(img image.Image, width, height int)
| 133 | // ImageToNRGBA takes a given `image.Image` and converts it into an `image.NRGBA`. Especially useful when transforming |
| 134 | // image.Uniform to something usable by `engo`. |
| 135 | func ImageToNRGBA(img image.Image, width, height int) *image.NRGBA { |
| 136 | newm := image.NewNRGBA(image.Rect(0, 0, width, height)) |
| 137 | draw.Draw(newm, newm.Bounds(), img, image.Point{0, 0}, draw.Src) |
| 138 | |
| 139 | return newm |
| 140 | } |
| 141 | |
| 142 | // ImageObject is a pure Go implementation of a `Drawable` |
| 143 | type ImageObject struct { |