BayerToRGB.h //原作者:Vojtech Pavlik //2010-10-23 23:25:16 冷却 整理、封装以及测试 #pragma once typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned long uint32_t; #define u8 uint8_t #define u32 uint32_t #define R(x,y) m_pRGB24[0 + 3 * ((x) + m_ulWidth * (y))] #define G(x,y) m_pRGB24[1 + 3 * ((x) + m_ulWidth * (y))] #define B(x,y) m_pRGB24[2 + 3 * ((x) + m_ulWidth * (y))] #define Bay(x,y) m_pBay[(x) + m_ulWidth * (y)] class BayerToRGB { public: BayerToRGB(); public: //函数名称:Bayer8ToRgb24 //描述:将8位Bayer原始数据转换为24位RGB格式数据 //注意:该函数不可重入 /* * 要求的Bayer数据排列格式如下(GBRG): * * G B G B G B G B... * R G R G R G R G... * G B G B G B G B... * R G R G R G R G... * G B G B G B G B... * R G R G R G R G... * G B G B G B G B... * R G R G R G R G... * .................. * .................. */ static HRESULT Bayer8ToRgb24(PBYTE pbBayer, DWORD dwWidth