一: mipi raw10转 raw 10
//b1,b2,b3,b4,b5分别为连续读出的五个uint8类型的数据,p1,p2,p3,p4为四个像素点的像素值,那么
p1 = (b1 << 2) + ((b5 ) & 0x3); // & 0x3表示获取低两位
P2 = (b2 << 2) + ((b5 >> 2) & 0x3);
P3 = (b3 << 2) + ((b5 >> 4) & 0x3);
P4 = (b4 << 2) + ((b5 >> 6) & 0x3);
二: raw10 转raw 8
void MainWindow::Raw10toRaw8(BYTE *pIn, long number)
{
//raw10转Raw8
BYTE *pTemp = pIn;
BYTE *pOut = pIn;
for (long i = 0; i < number; i = i + 5)
{
*pOut++ = pTemp[i];
*pOut++ = pTemp[i + 1];
*pOut++ = pTemp[i + 2];
*pOut++ = pTemp[i + 3];
}
}
三: mipiRaw12 转raw 8
void MainWindow::MipiRaw12ToRaw8(BYTE *