title: Get a pixel array from from golang image.Image
body: <p>I need to get a pixel array in the form of <code>[]byte</code> to be passed to the <code>texImage2D</code> method of a <a href="https://godoc.org/golang.org/x/mobile/gl#Context">Contex</a> from the <a href="https://godoc.org/golang.org/x/mobile/gl">/mobile/gl</a> package.</p>
  
  <p>It needs a pixel array where rgba values of each pixel is appended in the order of pixels left to right, top to bottom. Currently I have an image loaded from a file.</p>
  
  <pre><code>a, err := asset.Open("key.jpeg")
  if err != nil {
      log.Fatal(err)
  }
  defer a.Close()
  
  img, _, err := image.Decode(a)
  if err != nil {
      log.Fatal(err)
  }
  </code></pre>
  
  <p>I am looking for something like <code>img.Pixels()</code></p>