It's very slow for this. Here's an example (it takes around 1 minute for a 720x480 image):
// image processing test
console_hide();
click(PLAY);
sleep(1);
// 5D Mark II only
// for others, look in platform/YOUR.CAMERA/consts.h for YUV422_LV_BUFFER_DISPLAY_ADDR
short * buf = *(short**)0x2900;
for (int i = 0; i < 480; i++)
{
for (int j = 0; j < 720; j++)
{
// for each pixel, keep chroma, set luma to 0x80
buf[i*720+j] = (buf[i*720+j] & 0x00FF) | 0x8000;
}
}
So... consider using plain C. It's useful only for previewing, like fisheye correction, or averaging two images, or brightening/darkening.