title: How do I create a CGImage with RGB data?
body: <p>Can anyone show me a clear example of how to use</p>
  
  <pre><code>CGImageRef CGImageCreate 
  (
     size_t width,
     size_t height,
     size_t bitsPerComponent,
     size_t bitsPerPixel,
     size_t bytesPerRow,
     CGColorSpaceRef colorspace,
     CGBitmapInfo bitmapInfo,
     CGDataProviderRef provider,
     const CGFloat decode[],
     bool shouldInterpolate,
     CGColorRenderingIntent intent
  );
  </code></pre>
  
  <p>I have a CGFloat dataBuffer [width * height * 3];</p>
  
  <p>It contains all of the RGB data of the image. Essentially, it goes from pixel R (0,0), G (0,0), B(0,0), R(0,1)... to R(width, height), G(width,height), B(width,height)</p>
  
  <p>I know the size of the image, width x height. How do I use the information that I have and create and CGImage??</p>
  
  <p>Please help, thanks</p>
  
  <p><strong>I posted another question that encompasses the above question. It was answered correctly by nschmidt, here is the link</strong></p>
  
  <p><a href="https://stackoverflow.com/questions/1579631/converting-rgb-data-into-a-bitmap-in-objective-c-cocoa">Converting RGB data into a bitmap in Objective-C++ Cocoa</a></p>