Duplicate / Copy CVPixelBufferRef with CVPixelBufferCreate
<p>I need to create a copy of a <code>CVPixelBufferRef</code> in order to be able to manipulate the original pixel buffer in a bit-wise fashion using the values from the copy. I cannot seem to achieve this with <code>CVPixelBufferCreate</code>, or with <code>CVPixelBufferCreateWithBytes</code>.</p>

<p>According to <a href="https://stackoverflow.com/questions/10677107/cloning-cvpixelbuffer-how-to">this question</a>, it could possibly also be done with memcpy(). However, there is no explanation on how this would be achieved, and which Core Video library calls would be needed regardless.</p>