title: How to generate an OpenGL texture from non-continous data?
body: <p>My goal is to create a texture from a webcam image. I get the image via OpenCV's new <em>VideoCapture</em> interface from a <em>Logitech QuickCam for Notebooks</em> webcam. The problem is that I get <em>non-continuos</em> data this way, which means that each row of the matrix holding my image data has a gap at the end.</p>
  
  <p>The layout of my image data is as following:</p>
  
  <pre><code>width = frame.cols * frame.elemSize(); // 640 * 3 = 1920 byte
  step = frame.step[0]; // 2560 byte
  gap = step - width; // 640 byte
  </code></pre>
  
  <p>However, I did not find a way to tell OpenGL to skip the last 640 byte of every row when loading the texture. I wonder if there is a way doing that? If I just load the data as texture anyway, the image does not show correct (no surprise here). See <a href="http://picasaweb.google.com/103165673068768416583/Opencv#5562843683120979026" rel="nofollow">http://picasaweb.google.com/103165673068768416583/Opencv#5562843683120979026</a></p>
  
  <p>The best solution would be to get continuos data in the first place, but again I could not find out how to do this (with OpenCV). If I copy the data to a continuos matrix, it is displayed correctly (see <a href="http://picasaweb.google.com/103165673068768416583/Opencv#5562843692435711522" rel="nofollow">http://picasaweb.google.com/103165673068768416583/Opencv#5562843692435711522</a>).</p>
  
  <p>However, I don't want to copy data if I dont have to. Any ideas?</p>