【发布时间】:2014-12-09 21:00:31
【问题描述】:
我正在通过QTCaptureDecompressedVideoOutput 从相机(Macbook Air,OSX 10.9.5)捕获视频并对其进行处理,但我需要缩放传入的图像。无论出于何种原因,传回给我的图像不是我的大小设置像素缓冲区属性时请求:
[mVideoOutput setPixelBufferAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithDouble:width], (id)kCVPixelBufferWidthKey,
[NSNumber numberWithDouble:height], (id)kCVPixelBufferHeightKey,
[NSNumber numberWithUnsignedInt:kCVPixelFormatType_32ARGB], (id)kCVPixelBufferPixelFormatTypeKey,
nil]];
我得到的图片尺寸是我请求的两倍。
将图像缩小到一半大小的最有效方法是什么?
甚至更好....
为什么 setPixelBufferAttributes 不能正常工作?
【问题讨论】:
标签: objective-c cocoa core-graphics nsimage quartz-core