最快的访问3通道图像像素点的方法。直接地址访问。
for(int y = 0; y < pImg3->height; y++)
{
uchar *ptr=(uchar *)(pImg3->imageData+y*pImg3->widthStep);
for(int x = 0; x < pImg3->width; x++)
{
//green G
ptr[3*x+1]=0;
//red R
ptr[3*x+2]=255;
//blue B
ptr[3*x+3]=0;
}
}