我正在尝试创建一个3通道 CVOpenGLESTexture
in iOS.
我可以成功创建一个单通道通过指定纹理kCVPixelFormatType_OneComponent8
in CVPixelBufferCreate()
and GL_LUMINANCE
对彼此而言format
and internalFormat
in CVOpenGLESTextureCacheCreateTextureFromImage()
.
同样,我可以成功创建一个4通道通过指定RGBA纹理kCVPixelFormatType_32BGRA
in CVPixelBufferCreate()
and GL_RGBA
对彼此而言format
and internalFormat
in CVOpenGLESTextureCacheCreateTextureFromImage()
.
我需要创建3通道、24 位、RGB(或 BGR)纹理,具有可访问的像素。
我似乎找不到正确的参数(或其组合)CVPixelBufferCreate()
and CVOpenGLESTextureCacheCreateTextureFromImage()
这不会导致他们中的任何一个失败。
附加信息
支持的 FOURCC 格式类型reported https://developer.apple.com/library/mac/qa/qa1501/_index.html by CVPixelFormatDescriptionArrayCreateWithAllPixelFormatTypes()
在我的设备上:
32
, 24
, 16
, L565
, 5551
, L555
, 2vuy
, 2vuf
, yuvs
, yuvf
, 40
, L008
, L010
, 2C08
, r408
, v408
, y408
, y416
, BGRA
, b64a
, b48r
, b32a
, b16g
, R10k
, v308
, v216
, v210
, v410
, r4fl
, grb4
, rgg4
, bgg4
, gbr4
, 420v
, 420f
, 411v
, 411f
, 422v
, 422f
, 444v
, 444f
, y420
, f420
, a2vy
, L00h
, L00f
, 2C0h
, 2C0f
, RGhA
, RGfA
, w30r
, w40a
, w40m
, x420
, x422
, x444
, x44p
, xf20
, xf22
, xf44
, xf4p
, x22p
, xf2p
, b3a8
.
有趣的是,其中一些值没有定义在CVPixelBuffer.h
.
当我经过时kCVPixelFormatType_24RGB
(24 == 0x18
) to CVPixelBufferCreate()
它成功了,但是随后CVOpenGLESTextureCacheCreateTextureFromImage()
失败了错误代码-6683 https://developer.apple.com/library/ios/qa/qa1781/_index.html:kCVReturnPixelBufferNotOpenGLCompatible
.