纹理转PixelBuffer 调试用
来源:互联网 发布:天刀客户端网络异常 编辑:程序博客网 时间:2024/06/14 07:02
-(CVPixelBufferRef)createPixelBufferWithSize:(CGSize)size { const void *keys[] = { kCVPixelBufferOpenGLESCompatibilityKey, kCVPixelBufferIOSurfacePropertiesKey, }; const void *values[] = { (__bridge const void *)([NSNumber numberWithBool:YES]), (__bridge const void *)([NSDictionary dictionary]) }; OSType bufferPixelFormat = kCVPixelFormatType_32BGRA; CFDictionaryRef optionsDictionary = CFDictionaryCreate(NULL, keys, values, 2, NULL, NULL); CVPixelBufferRef pixelBuffer = NULL; CVPixelBufferCreate(kCFAllocatorDefault, size.width, size.height, bufferPixelFormat, optionsDictionary, &pixelBuffer); CFRelease(optionsDictionary); return pixelBuffer;}
CVPixelBufferRef pixelBuffer1 = [self createPixelBufferWithSize: CGSizeMake(540, 960)]; static CIContext *_ciContext; CIImage *outputImage = [CIImage imageWithTexture:textureId size:CGSizeMake(540, 960) flipped:YES colorSpace:NULL]; if( outputImage != nil) { if( _ciContext == nil) { _ciContext = [CIContext contextWithEAGLContext: [EAGLContext currentContext] options:@{kCIContextWorkingColorSpace : [NSNull null]} ]; } [_ciContext render: outputImage toCVPixelBuffer: pixelBuffer1 bounds:[outputImage extent] colorSpace:NULL]; }
阅读全文
0 0
- 纹理转PixelBuffer 调试用
- OPENGL的纹理(转)
- Ogre动态纹理(转)
- o3d纹理映射(转)
- Opengl纹理映射(转)
- [转] opengl ---- 纹理贴图
- 纹理
- 纹理
- 纹理
- 纹理
- 纹理
- 纹理
- 纹理
- 纹理
- 纹理
- 纹理
- 纹理
- 纹理
- 分享:使用Ctrlbox项目管理软件经验(五)——干系人沟通
- 前端面试题2017/11/08
- python单元测试unittest
- python访问csv文件
- iOS开发tips-UINavigationBar的切换
- 纹理转PixelBuffer 调试用
- plupload上传组件chrome浏览器打开卡顿问题
- Sbt仓库设置
- android Luban 图片压缩
- 机器学习introduction
- virtualenv、virtualenvwrapper安装使用
- Win7提示未授予用户在此计算机上的请求登录类型
- table标签下实现内容自动换行
- Fragment里面如何使用Toast?