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

📄 pgrcamera.h

📁 VideoMan is a very easy image acquisition library. It is able to manage many video inputs at the sam
💻 H
字号:
#pragma once
#include <windows.h>

#include <string>
#include <vector>

//=============================================================================
// PGR Includes
//=============================================================================
#include "CameraInput.h"

#include "pgrflycapture.h"
#include "pgrflycaptureplus.h"
#include "pgrcameragui.h"

#include "..\others\VideoWriterZlib.h"
#include "..\others\FrameWriter.h"

#define PGR_PROJECT_NAME "VideoMan"
#define PGR_FILE_NAME    "$RCSfile: PGRCamera.h,v $"
#define PGR_FILE_VERSION "$Revision: 1.2 $"

#define BUFFERS_NUM 200

friend class PGRController;

/*
	SUPPORTED FORMATS:
	640X320:
		-RGB24
		-GREY16
		-GREY8
		-YUV422
		-YUV411 problems!
		-RAW8
	320X240:
		-YUV422
*/

class PGRCamera : 
	public CameraInput
{
public:
	PGRCamera(void);
	virtual ~PGRCamera(void);

	bool initCamera( unsigned long aSerialNumber, VideoManInputFormat *aFormat = NULL );
	
			
	/** \brief  Get the a new frame			
		\return the frame of the video
	*/
	inline char *getFrame( bool wait );

	void showPropertyPage();

	VideoManInputController *getController();
	void setController( VideoManInputController *aController );
	
	// Start grabbing 
	void startGrabRecord();
	
	// Stop grabbing 
	void stopGrabRecord();
	int getNumberOfLostFrames();
	
	bool setRegister( unsigned long reg, unsigned long value );
	bool setRegisterBroadcast( unsigned long reg, unsigned long value );

	FlyCaptureContext &getContext();

	//bool start(unsigned long serialNumber, VideoManInputFormat *format);

private:
	
	// Helper code to handle a FlyCapture error.
	bool checkCaptureError( FlyCaptureError error, std::string message );
	// Helper code to handle a Gui error.
	bool checkGuiError( CameraGUIError error, std::string message );
	
	bool resolveFormat( FlyCaptureVideoMode videoMode, FlyCaptureFrameRate frameRate, VideoManInputFormat &format );

	void processAvi( std::string &rawFileName, std::string &outputFileName );

	void initializeConvertedImage();

	static void getAvailableDevices( std::vector<inputIdentification> &deviceList );

    FlyCaptureContext context;  
	CameraGUIContext  guiContext;

	FlyCaptureImage imageG;
	FlyCaptureImagePlus image;
	FlyCaptureImage imageConverted;
		
	FlyCaptureVideoMode videoMode;
	FlyCaptureFrameRate frameRate;

	//Variables for record videos
	bool recording; //If we are recording images	
	int lastRecordedFrame; //The sequence id of the last recorded frame
	int lostFrames; //The number of frames that we have lost during the record process
	int numRecordedFrames; //The number of recorded frames
	VideoWriter *videoWriter;
	FrameWriter *frameWriter;
	IndexQueue indexQueue;

	PGRController *controller;

	unsigned int act; //index of the actual locked frame
	bool started;  //If the camera has benn started or not
	unsigned long serialNumber; //The serial number of the camera
	unsigned int uiBusIndex; //The index on the bus of the camera
	bool convertForTheRenderer; //If we must convert each frame
};

⌨️ 快捷键说明

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