title: Initialize an OpenCV Mat with pixel data in RGBA channel order
body: <p>Hel lo,</p>
  <p>I am writing an effect plug-in for Adobe After Effects in C++, and I need to create a <code>cv::Mat</code> using pixel data that's already in memory. However, when I initialize it using:</p>
  <pre><code>cv::Mat in_frame_mat(height, width, CV_8UC4, input-&gt;data);
  </code></pre>
  <p>(input-&gt;data is a pointer to the first byte), the output is all blue.<br />
  I think this is because AE stores pixel data RGBA or ARGB while OpenCV assumes BGRA or ABGR (not sure which).</p>
  <p>I know that I could iterate through every pixel and create a new space in memory to store a BGRA representation of the image, then initialize a <code>cv::Mat</code> with <em>that</em>, but this is really performance constrained and I don't want to add unnecessary compute time.</p>
  <p>Is there a way to create a <code>cv::Mat</code> using existing pixel data that is stored RGBA?</p>
  <p>Thanks!</p>