本程序是2005年参加中国机器人大赛的比赛程序

源代码在线查看: cg400-32.h

软件大小: 343 K
上传用户: jellylihui
关键词: 2005 程序 机器人 大赛
下载地址: 免注册下载 普通下载 VIP

相关代码

				/*
				*-----------------------------------------------------------------------------
				*       Name            CG400-32.H
				*       Purpose         Device API for Win32s
				*       Image karte		DH-CG400
				*       Development Kit Microsoft Win32 SDK, Visual C++ 6.00 
				*       Author          Zhang Ce
				*       Date          	Mar/02
				*
				*
				*       Description
				*
				*       
				*-----------------------------------------------------------------------------
				*/
				
				/* By C++ language compiler */
				#ifdef __cplusplus
				extern "C" {
				#endif
				        
				typedef DWORD HCG400;
				   
				#define DISABLE	FALSE
				#define ENABLE	TRUE
				
				#define AD_SOURCE			0
				#define AD_BRIGHTNESS		1
				#define AD_CONTRAST			2
				#define AD_HUE				3
				#define AD_SATURATION		4 
				
				//	Video Output
				#define VOUT_MODE			0
				#define VOUT_SOURCE			1
				#define VOUT_CYCLE_LENGTH	2
				#define VOUT_CYCLE_SOURCE	3
				
				//	Board Informations
				#define BOARD_TYPE			0
				#define BOARD_SERIALNUM		1
				
				#define PAL		0
				#define NTSC	1
				
				#define	FIELD	1
				#define FRAME	0         
				
				#define YUV422		0
				#define RGB888		1
				#define RGB565		2
				#define RGB555		3
				#define RGB8888		4
				#define All8Bit		5
				#define Limited8Bit	6
				                        
				#define TopField	0
				#define BottomField	1
				
				#define HorDir		0
				#define VerDir		1
				
				#define LUMA_CHROMA_TRAP	0
				
				#define NO_GAMMACORR		0
				#define Y_GAMMACORR			1
				#define UV_GAMMACORR		2
				#define YUV_GAMMACORR		3
				
				// Functions of CG400 device driver
				HCG400 __stdcall BeginCG400(int iImageDevice);
				int __stdcall EndCG400(HCG400 hcg400);
				int __stdcall CG400Capture(HCG400 hcg400, BOOL Enable);
				int __stdcall CG400Snap(HCG400 hcg400);
				int __stdcall CG400SetInpVideoWindow(HCG400 hcg400,
														int Left, int Top, int Width, int Height);
				int __stdcall CG400SetDispWindow(HCG400 hcg400,
													int Left, int Top, int Width, int Height);
				int __stdcall CG400SetADParam(HCG400 hcg400, BYTE Param, BYTE Value);
				int __stdcall CG400SetColorSpace(HCG400 hcg400, BYTE Space);
				int __stdcall CG400LumaControl(HCG400 hcg400, BYTE Param, BYTE Value);
				int __stdcall CG400GammaCorrControl(HCG400 hcg400, BYTE Value);
				int __stdcall CG400SetGammaCorrCoef(HCG400 hcg400, BYTE *pBuf);
				int __stdcall CG400SetVideoStandard(HCG400 hcg400, WORD Mode);
				int __stdcall CG400SetDelay(HCG400 hcg400, WORD XDelay, WORD YDelay);
				int __stdcall CG400SetDispMode(HCG400 hcg400, BOOL Mode);
				int __stdcall CG400EnableOverlay(HCG400 hcg400, BOOL Enable);
				int __stdcall CG400SetMask(HCG400 hcg400, BYTE Param, DWORD Address);
				int __stdcall CG400EnableVideoMirror(HCG400 hcg400, BYTE Param, BOOL Enable);
				int __stdcall CG400SetVideoOutput(HCG400 hcg400, BYTE Param, WORD Value);
				int __stdcall CG400LoadCFGFile(HCG400 hcg400, char *pFileName);
				int __stdcall CG400WaitEvenVSync(HCG400 hcg400);
				int __stdcall CG400WaitOddVSync(HCG400 hcg400);
				int __stdcall CG400WaitVSync(HCG400 hcg400);
				int __stdcall CG400GetBoardInfos(HCG400 hcg400, BYTE Param, char *pInfo);
				int __stdcall CG400Check(HCG400 hcg400, BYTE Param1, BYTE Param2, BYTE Param3, BYTE Param4);
				int __stdcall ReadDispWindow(HDC hdc,
												int Left, int Top, int Width, int Height,
												BYTE *lpDestBuf, BOOL VerFlip);
				int __stdcall SetStaticMemAlloc(DWORD Pages);
				int __stdcall StaticMemAlloc(DWORD *pPages, DWORD *pPhysAddr,DWORD *pHandle,DWORD *pLineAddr);
				int __stdcall CG400CaptureToMem(HCG400 hcg400, DWORD MemPhysAddr, DWORD MemSize,
												WORD IntervVSyncs, DWORD bFrmMode, WORD Sum);
				int __stdcall CG400SnapOneToMem(HCG400 hcg400, DWORD MemAddr, DWORD MemSize,
												DWORD bFrmMode);
				int __stdcall CG400GetSnappingStatus( HCG400 hcg400, int *pFlag);
				int __stdcall CG400SnapToMem(HCG400 hcg400, DWORD MemAddr, DWORD MemSize,
												DWORD bFrmMode, WORD Sum);
				int __stdcall CG400GetSnapToMemNumber( HCG400 hcg400, int *pNum);
				int __stdcall CG400ReadFromMem(HCG400 hcg400, char *lpSourBuf, DWORD BufSize,
												WORD Number, char *lpDestBuf, BOOL VerFlip);
				int __stdcall CG400CopyFromMem(HCG400 hcg400, char *pDestBuf, char *pSrcBuf, DWORD Length);
				int __stdcall CG400CopyToMem(HCG400 hcg400, char *pDestBuf, char *pSrcBuf, DWORD Length);
				int __stdcall CG400FillToMem(HCG400 hcg400, char *pDestBuf, DWORD Length, char Value);
				
				/* extren "C" { */
				#ifdef __cplusplus
				}
				#endif
				
							

相关资源