title: How to get a part of an UnsafeMutableBufferPointer as a new UnsafeMutableBufferPointer
body: <p>I'm playing around with image manipulation in swift.</p>
  
  <p>Using <a href="https://github.com/mhorga/ImageProcessing/blob/master/demo.playground/Sources/RGBA.swift" rel="nofollow noreferrer">this</a> code to access image pixels.</p>
  
  <p>The image pixels are pointed at with an <code>UnsafeMutableBufferPointer</code>.</p>
  
  <p>All pixels are in one list of data and every pixel location needs to be calculated with:</p>
  
  <pre><code>let index = y * rgba.width + x
  let pixel = pixels[index]
  </code></pre>
  
  <p>I'm trying to add a <code>subscript</code> so for the get </p>
  
  <pre><code>public subscript(index: Int) -&gt; [Pixel] {
      get {
          var column = [Pixel]()
          for i in 0..&lt;height {
              column.append(pixels[index*height + i])
          }
  
          return column
      }
  }
  </code></pre>
  
  <p>So is there a way of returning an <code>UnsafeMutableBufferPointer</code> pointing to right column? instead of an array?</p>
  
  <p>I'm trying to avoid more memory allocation.</p>
  
  <p>Thanks</p>