Convert UIImage to CVImageBufferRef

后端 未结 6 718
旧时难觅i
旧时难觅i 2020-12-28 18:09

This code mostly works, but the resulting data seems to loose a color channel (is what I am thinking) as the resulting image data when displayed is tinted blue!

Here

6条回答
  •  清歌不尽
    2020-12-28 19:09

    I encounter the same problem and find some samples: http://www.cakesolutions.net/teamblogs/2014/03/08/cmsamplebufferref-from-cgimageref
    try to change

    CGBitmapInfo  bitmapInfo = (CGBitmapInfo)kCGBitmapByteOrder32Little |
                      kCGImageAlphaPremultipliedFirst)
    

提交回复
热议问题