#ifndef _CVIDEOPRO_H_ #define _CVIDEOPRO_H_ #include #include "vpptools.h" #include "vpx.h" /* * This class is the harware interface for * the image processor. * The image processor instantiates This class * to begin communicating with the framegrabber */ class CVideoPro { public: //Constructor for the class CVideoPro(); //Destructor for the class ~CVideoPro(); //Get one frame from the camera void grabFrame(void); //Grab a snapshot void snapshot(void); //Free all allocated buffers void freeBuffs(void); //Get the brightness int getBrightness(void); //Set the Brighness BOOL setBrightness(int val); //Get the contrast int getContrast(void); //Set the contrast BOOL setContrast(int val); //Get saturation int getSaturation(void); //Set the saturation BOOL setSaturation(int val); //Get the height of the image int getHeight(void); //Set the height of the image BOOL setHeight(int val); //Get the width of the image int getWidth(void); //Set the width of the image BOOL setWidth(int val); //Get the bit depth int getBitDepth(void); //Set the bit depth BOOL setBitDepth(int val); //Get the decimation int getDecimation(void); //Set the decimation BOOL setDecimation(int val); //Set the frame buffer //This allocates a DIB to store //the frame in. BOOL setFrameBuf(void); //Get frame unsigned char* getFrameBuf(void); //Set the background buffer BOOL setBGBuf(void); //Get the background unsigned char* getBGBuf(void); //Set the difference buffer BOOL setDiffBuf(void); //Get the difference buffer unsigned char* getDiffBuf(void); void display(CDC *pDC); //Check the return values of the the //VideoPro library functions void check(VPP_Errno); BITMAPINFO* getFramebmi(); DWORD getFramebmiSize(); //Location and size of the frame where //the images will be drawn CRect frameRect; CRect bgRect; CRect diffRect; BOOL shouldDisplayFrame; BOOL shouldDisplayBG; BOOL shouldDisplayDiff; protected: // This structure define in vpx.h // stores all the configuration // params for the framegrabber. VPX_Config cfg; //Storage space for the frame HGLOBAL hScanDIB; //Storage space for the difference HGLOBAL hDiffDIB; //Storage space for the background HGLOBAL hBackDIB; //Bitmap parameter used by the functions // that allocate buffer space HGLOBAL *phDIB; HGLOBAL hglb; BYTE VPP_far *linebuf; BYTE *bitmappos; BITMAPINFO VPP_far *pbmiScan, *pbmiDiff, *pbmiBG; VPP_Word linelength; WORD ncolors; WORD bitsPerPixel; DWORD headerSize; VPP_SnapData VPP_far *snapData; //The first frame grabbed from the //card after the card is initialized //involves more work than the rest BOOL isFirstFrame; }; #endif //_CVIDEOPRO_H_