title: C++ NDI SDK get Red Green Blue values
body: <p>Please bear with me. I haven't done any C++ before.
  I've been experimenting with the NDI SDK and I'm trying to get the RGB values from an NDI source. I've been using this code to produce pixel data:</p>
  
  <pre><code>unsigned char *pixels = new unsigned char[video_frame.xres * video_frame.yres * 4];
  ofxNDIutils::CopyImage((const unsigned char *)video_frame.p_data, pixels, video_frame.xres, video_frame.yres, (unsigned int)video_frame.line_stride_in_bytes, false, false);
  </code></pre>
  
  <p>and I'm attempting to get the values with this:</p>
  
  <pre><code>for (int y = 0; y &lt; video_frame.yres; y++)
  {
      for (int x = 0; x &lt; video_frame.xres; x++)
      {
          printf("r:%d g:%d b:%d a:%d", pixels[4 * x * y + 0],pixels[4 * x * y + 1],pixels[4 * x * y + 2],pixels[4 * x * y + 3]);
      }
  }
  </code></pre>
  
  <p>I'm getting values but when I use them to construct an image it doesn't look right. Any help would be appreciated.</p>