Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
2.6 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: DDVideoWnd.h
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of DDVideoWnd.h
  13. //----------------------------------------------------------------------------
  14. #ifndef __DIRECT__DRAW__VIDEO__WND__H__INCLUDED__
  15. #define __DIRECT__DRAW__VIDEO__WND__H__INCLUDED__
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif
  19. #include "VideoCaptureWnd.h"
  20. #include "..\..\lglib\video\DirectShowVideo.h"
  21. #include "..\..\lglib\directdraw\LgDirectDrawVideo.h"
  22. #include "SensorArray.h"
  23. #define WM_UPDATE_BITMAP (WM_USER+876)
  24. #define WM_VIDEO_SAMPLE (WM_USER+877)
  25. class CDDVideoWnd :
  26. public CVideoCaptureWnd,
  27. public CDirectShowVideo,
  28. public CLgDirectDrawVideo
  29. {
  30. friend class CDSVideoProcessor;
  31. public:
  32. CDDVideoWnd( CSensorArray *pSensorArray );
  33. virtual ~CDDVideoWnd();
  34. public:
  35. BOOL Create( CWnd *pParentWnd, int x, int y, int nWidth, int nHeight, CDSVideoProcessor *pDSVideoProcessor, int nInput = -1 );
  36. public:
  37. virtual BOOL Capture( LPBITMAPINFO *pBitmapInfo, LPBYTE *ppBytes, HBITMAP *pBitmap, DWORD dwPreviewTime = 0 );
  38. virtual BOOL AssignVideoCamera( CVideoCamera *pVideoCamera );
  39. public:
  40. void SetWindowText( LPCTSTR lpString );
  41. public:
  42. //{{AFX_VIRTUAL(CDDVideoWnd)
  43. virtual BOOL DestroyWindow();
  44. //}}AFX_VIRTUAL
  45. protected:
  46. //{{AFX_MSG(CDDVideoWnd)
  47. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  48. afx_msg void OnSize( UINT nType, int cx, int cy );
  49. afx_msg void OnDestroy();
  50. //}}AFX_MSG
  51. LRESULT OnUpdateBitmap( WPARAM, LPARAM );
  52. LRESULT OnVideoSample( WPARAM, LPARAM );
  53. DECLARE_MESSAGE_MAP()
  54. public:
  55. virtual CLgImageDIB& GetDirectDrawVideoDIB() { return GetDirectShowDIB(); }
  56. protected:
  57. virtual void OnDraw( CDC *pDC );
  58. virtual void OnPaint();
  59. private:
  60. HFONT m_hFont;
  61. TCHAR m_pVideoText[MAX_PATH];
  62. INT m_nVideoText;
  63. private:
  64. virtual void OnVideoSample( double SampleTime );
  65. public:
  66. void OnChangeSettings();
  67. void SetSensorArray(CSensorArray *pSensorArray) { m_pSensorArray = pSensorArray; }
  68. private:
  69. CSensorArray *m_pSensorArray;
  70. private:
  71. enum
  72. {
  73. MAX_PREVIEW_IMAGE_COUNT = 10,
  74. MAX_PREVIEW_IMAGE_INTERVAL = 500UL
  75. };
  76. CLgImageDIB m_pPreviewDIB[MAX_PREVIEW_IMAGE_COUNT];
  77. INT m_nPreviewDIBCount;
  78. INT m_nPreviewDIBCurrent;
  79. DWORD m_dwPreviewDIBTime;
  80. CLgCriticalSection m_PreviewLock;
  81. };
  82. #endif