//---------------------------------------------------------------------------- // Laser Guard Ltd. // Copyright © 2000-2002. All Rights Reserved. // Version 1.0 01/01/2000 // Last modification: 08/10/2003 // PROJECT: // SUBSYSTEM: // FILE: DDVideoWnd.h // AUTHOR: Sergey Chizhevskiy // OVERVIEW // ~~~~~~~~ // Header file of DDVideoWnd.h //---------------------------------------------------------------------------- #ifndef __DIRECT__DRAW__VIDEO__WND__H__INCLUDED__ #define __DIRECT__DRAW__VIDEO__WND__H__INCLUDED__ #if _MSC_VER > 1000 #pragma once #endif #include "VideoCaptureWnd.h" #include "..\..\lglib\video\DirectShowVideo.h" #include "..\..\lglib\directdraw\LgDirectDrawVideo.h" #include "SensorArray.h" #define WM_UPDATE_BITMAP (WM_USER+876) #define WM_VIDEO_SAMPLE (WM_USER+877) class CDDVideoWnd : public CVideoCaptureWnd, public CDirectShowVideo, public CLgDirectDrawVideo { friend class CDSVideoProcessor; public: CDDVideoWnd( CSensorArray *pSensorArray ); virtual ~CDDVideoWnd(); public: BOOL Create( CWnd *pParentWnd, int x, int y, int nWidth, int nHeight, CDSVideoProcessor *pDSVideoProcessor, int nInput = -1 ); public: virtual BOOL Capture( LPBITMAPINFO *pBitmapInfo, LPBYTE *ppBytes, HBITMAP *pBitmap, DWORD dwPreviewTime = 0 ); virtual BOOL AssignVideoCamera( CVideoCamera *pVideoCamera ); public: void SetWindowText( LPCTSTR lpString ); public: //{{AFX_VIRTUAL(CDDVideoWnd) virtual BOOL DestroyWindow(); //}}AFX_VIRTUAL protected: //{{AFX_MSG(CDDVideoWnd) afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnSize( UINT nType, int cx, int cy ); afx_msg void OnDestroy(); //}}AFX_MSG LRESULT OnUpdateBitmap( WPARAM, LPARAM ); LRESULT OnVideoSample( WPARAM, LPARAM ); DECLARE_MESSAGE_MAP() public: virtual CLgImageDIB& GetDirectDrawVideoDIB() { return GetDirectShowDIB(); } protected: virtual void OnDraw( CDC *pDC ); virtual void OnPaint(); private: HFONT m_hFont; TCHAR m_pVideoText[MAX_PATH]; INT m_nVideoText; private: virtual void OnVideoSample( double SampleTime ); public: void OnChangeSettings(); void SetSensorArray(CSensorArray *pSensorArray) { m_pSensorArray = pSensorArray; } private: CSensorArray *m_pSensorArray; private: enum { MAX_PREVIEW_IMAGE_COUNT = 10, MAX_PREVIEW_IMAGE_INTERVAL = 500UL }; CLgImageDIB m_pPreviewDIB[MAX_PREVIEW_IMAGE_COUNT]; INT m_nPreviewDIBCount; INT m_nPreviewDIBCurrent; DWORD m_dwPreviewDIBTime; CLgCriticalSection m_PreviewLock; }; #endif