BGR packed转换位BGR planar方法及其优化

版权声明:本文为博主原创文章,转载请标注转载网址: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
}

具体的优化策略可以参考如下网址:

http://www.howtobuildsoftware.com/index.php/how-do/b649/c-arrays-image-processing-intrinsics-pixelformat-speed-up-pixel-format-conversion-bgr-packed-to-rgb-planar

猜你喜欢

转载自blog.csdn.net/FRD2009041510/article/details/79880409