convert.h

来自「DRAWYUV程序是用于摄像头的数据回放,用了directshow,可以用在VC」· C头文件 代码 · 共 62 行

H
62
字号
/*
 * Convert.h
 *
 * Convert colorspace
 *
 * DirectDraw YUV420P project
 *
 * Copyright (c) 2004-2005 for Cyansoft Studio.
 * All Rights Reserved.
 *
 * Contributor(s): ______________________________________.
 *
 * $Log: Convert.h,v $
 * Revision 1.1  2005/01/17 13:42:59  jin.bai
 * Initial revision
 *
 *
 */
#ifndef _CONVERT_INC_
#define _CONVERT_INC_

typedef struct
{
	DWORD vfWidth;
	DWORD vfHeight;
	DWORD vfBitCount;
	DWORD vfFourCC;
}  VIDEO_FORMAT_T, *PVIDEO_FORMAT_T;

typedef void (convert_yuv)(unsigned char *puc_y, int stride_y,
						   unsigned char *puc_u, unsigned char *puc_v, int stride_uv,
						   unsigned char *bmp, int width_y, int height_y,
						   unsigned int stride_out);

typedef convert_yuv *pConvert_yuv;

//
// Convert class
//
class Converter
{
public:
	Converter();
	~Converter();

	BOOL Create(PVIDEO_FORMAT_T pVfSource, PVIDEO_FORMAT_T pVfDest);
	BOOL Convert(LPBYTE lpSourceBuffer, LPBYTE *lppDestBuffer);

protected:
	BOOL AllocBuffer(PVIDEO_FORMAT_T pVidFormat);

private:
	VIDEO_FORMAT_T m_vfSource;
	VIDEO_FORMAT_T m_vfDest;
	LPBYTE m_lpBuffer;
	DWORD m_dwVideoType;

	pConvert_yuv m_pConvert;
};

#endif // _CONVERT_INC_
// End of File /////////////////////////////////////////////////////////////

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?