title: Convert from YUV to RGB in c++ (android-ndk)
body: <p>Im developing in android, and want to convert the byte-array from the camera's previewCallback, which is in YUV-format, to rgb-format.</p>
  
  <p>I have used the function given in this answer: <a href="https://stackoverflow.com/questions/1893072/getting-frames-from-video-image-in-android">Getting frames from Video Image in Android</a></p>
  
  <p>It works perfectly in java, but my problem is that I want to make the function in c++ (I'm using the ndk, and not very familiar with c++).</p>
  
  <p>I have tried to create the function in c++, but it always makes strange results (eg the picture is all green).</p>
  
  <p>Does anyone have a similar function or this function working in c++? </p>
  
  <p>Thanks.</p>