版权声明:本文为博主原创文章,转载请标注转载网址:http://blog.csdn.net/frd2009041510 https://blog.csdn.net/FRD2009041510/article/details/79880409
基本的方法如下:
// the array with the BGRBGRBGR pixel data
byte[] source;
// the array with the BBBGGGRRR pixel data
byte[] result;
// the amount of pixels in one channel, width*height
int imageSize;
for (int i = 0; i < source.Length; i += 3)
{
result[i/3] = source[i + 0]; // B
result[i/3 + imageSize] = source[i + 1]; // G
result[i/3 + imageSize * 2] = source[i+2]; // R
}
具体的优化策略可以参考如下网址: