【发布时间】:2013-08-16 01:08:55
【问题描述】:
- (void)processPixelBuffer: (CVImageBufferRef)pixelBuffer
{
CVPixelBufferLockBaseAddress( pixelBuffer, 0 );
int bufferWidth = CVPixelBufferGetWidth(pixelBuffer);
int bufferHeight = CVPixelBufferGetHeight(pixelBuffer);
unsigned char *pixel = (unsigned char *)CVPixelBufferGetBaseAddress(pixelBuffer);
for( int row = 0; row < bufferHeight; row++ ) {
for( int column = 0; column < bufferWidth; column++ ) {
pixel[1] = 0; // it sets the green element of each pixel to zero, which gives the entire frame a purple tint.
pixel += 4;
}
}
CVPixelBufferUnlockBaseAddress( pixelBuffer, 0 );
}
我的问题是如何操作像素,使所有亮色变为黄色,所有暗色变为蓝色
非常感谢你
【问题讨论】:
标签: iphone ios image-processing