#include <windows.h>
#include <malloc.h>
#include <string>
using namespace std;
#define clip(min, x, max) x=(x < min) ? min : (x > max) ? max : x
//
// Construction/Destruction
//
CUYVY2BMP::CUYVY2BMP(int width, int height)
{
m_nWidth = width;
m_nHeight = height;
}
CUYVY2BMP::~CUYVY2BMP()
{
}
///accessor
int CUYVY2BMP::GetHeight()
{
return m_nHeight;
}
int CUYVY2BMP::GetWidth()
{
return m_nWidth;
}
void CUYVY2BMP::MakeConversionTable()
{
for (long j = 0; j < 256; ++j)
{
table_UYVY2rgb.YtoR[j] = table_UYVY2rgb.YtoG[j]
= table_UYVY2rgb.YtoB[j] = (unsigned short)(j << 7);
table_UYVY2rgb.VtoR[j] = j * 180; //180=1.402*128
table_UYVY2rgb.VtoG[j] = j * 91;
table_UYVY2rgb.UtoG[j] = j * 44; //0.3437 = 44/128
table_UYVY2rgb.UtoB[j] = j * 226; //1.772
UYVY视频格式转为BMP图片
最新推荐文章于 2021-11-30 18:01:09 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)