标签:printf avg log ref return logs color class int
COLORREF AvgBGRData(BYTE *bgr,int size) { int r = 0,g = 0,b = 0; for(int i=0;i<size;i+=3) { b += bgr[i]; g += bgr[i+1]; r += bgr[i+2]; } r = r/(size/3); r = r>255?255:r; r = r<0?0:r; g = g/(size/3); g = g>255?255:g; g = g<0?0:g; b = b/(size/3); b = b>255?255:b; b = b<0?0:b; printf("%d %d %d\n",r,g,b); return RGB(r,g,b); }
标签:printf avg log ref return logs color class int
原文地址:http://www.cnblogs.com/hatsusakana/p/7799649.html