views:

305

answers:

1

How can I write a YUV frame data into a CGContext?

A: 

Convert it to RGB, then create a CGImage with it, then draw that into the context.

Alternatively, create a CGColorSpace that maps YUV into RGB, then create a CGImage with it, then draw that into the context. (I have no idea whether this is possible, but you may want to look into it.)

Peter Hosey
I know how to convert YUV to RGB, how do you convert RGB to CGImage?
ReachConnection
That's not a conversion. You create a CGImage object with the RGB data, using `CGImageCreate`: http://developer.apple.com/mac/library/documentation/GraphicsImaging/Reference/CGImage/Reference/reference.html#//apple_ref/c/func/CGImageCreate
Peter Hosey