⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cameracode.h

📁 学习嵌入式LINUX的好东西
💻 H
字号:
#pragma once
#include <windows.h>				// For all that Windows stuff
#include <winioctl.h>				// Needed for CTLCODE macro
#include "mjpeg2bmp.h"				// Routines for converting MJPEG frames
#include "webcamsdk.h"			// WebCam IOCTLs and structures

typedef struct {
	HANDLE h;
	PBYTE p;
} MMOBJSTRUCT, *PMMOBJSTRUCT;



#define NUMBUFFS       6
#define PREBUFFSIZE  512 
class CCameraCode
{
public:
	CCameraCode(void);
	~CCameraCode(void);
public:
// Call first before anything else
int InitCamera ();

// Call after last call to camera library
int ShutdownCamera ();

// Returns the video formats supported on the device
int GetVideoFormats (PFORMATPROPS pFormats, int *pnCnt);

// Returns the still image formats supported on the device
int GetStillFormats (PFORMATPROPS pFormats, int *pnCount);

// Returns a string labeling a given feature ID
LPCTSTR GetFeatureText (DWORD dwFeatureID);

// Queries a feature value
int GetFeatureSetting (DWORD dwFeature, DWORD *pdwVal);

// Sets a feature value
int SetFeatureSetting (DWORD dwFeature, DWORD dwVal);

// Returns information on a given format
int GetFormatInformation (WORD wFormat, WORD wFrame, PFORMATPROPS pFmt);

// Returns the list of features supported by the phone
int GetFeatureList (PFEATUREPROPS pFeatures, DWORD *pdwSize);

// Start streaming to an HDC
int StartStreaming (HDC hdc, RECT *prect, WORD wFormat, WORD wFrame, DWORD dwInterval);

// Stop streaming
int StopStreaming ();

// Capture a still image from the cameras
int GetStillImage (WORD wFormat, WORD wFrame, PFORMATPROPS pFmt, PBYTE *ppData, DWORD *pdwSize);

// Writes an MJPEG frame as a JPEG file
int WriteJPEG (LPTSTR lpszName, PBYTE pData, int nSize);
int AllocMMObject (int nSize, PMMOBJSTRUCT obj);
int FreeMMObject (PMMOBJSTRUCT obj);
static DWORD WINAPI ReadFrameThread (PVOID pArg);

public:
	BOOL fCont ;
	HANDLE hCam ;
	HANDLE hThread;
	CMjpeg2bmp *pMjpe2bmp;
	BOOL fDraw;
};

⌨️ 快捷键说明

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