Leaked source code of windows server 2003
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.

130 lines
3.5 KiB

  1. /*****************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORPORATION, 2000
  4. *
  5. * TITLE: StillPrc.h
  6. *
  7. * VERSION: 1.0
  8. *
  9. * AUTHOR: OrenR
  10. *
  11. * DATE: 2000/10/27
  12. *
  13. * DESCRIPTION: Handles the Still Image processing
  14. *
  15. *****************************************************************************/
  16. #ifndef _STILLPRC_H_
  17. #define _STILLPRC_H_
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CStillProcessor
  20. class CStillProcessor
  21. {
  22. public:
  23. ///////////////////////////////
  24. // SnapshotCallbackParam_t
  25. //
  26. typedef struct tagSnapshotCallbackParam_t
  27. {
  28. class CStillProcessor *pStillProcessor;
  29. } SnapshotCallbackParam_t;
  30. ///////////////////////////////
  31. // Constructor
  32. //
  33. CStillProcessor();
  34. ///////////////////////////////
  35. // Destructor
  36. //
  37. virtual ~CStillProcessor();
  38. ///////////////////////////////
  39. // Init
  40. //
  41. HRESULT Init(class CPreviewGraph *pPreviewGraph);
  42. ///////////////////////////////
  43. // Term
  44. //
  45. HRESULT Term();
  46. ///////////////////////////////
  47. // CreateImageDir
  48. //
  49. HRESULT CreateImageDir(const CSimpleString *pstrImageDirectory);
  50. ///////////////////////////////
  51. // RegisterStillProcessor
  52. //
  53. HRESULT RegisterStillProcessor(IStillSnapshot *pFilterOnCapturePin,
  54. IStillSnapshot *pFilterOnStillPin);
  55. ///////////////////////////////
  56. // WaitForNewImage
  57. //
  58. HRESULT WaitForNewImage(UINT uiTimeout,
  59. CSimpleString *pstrNewImageFullPath);
  60. ///////////////////////////////
  61. // ProcessImage
  62. //
  63. HRESULT ProcessImage(HGLOBAL hDIB);
  64. ///////////////////////////////
  65. // SetTakePicturePending
  66. //
  67. HRESULT SetTakePicturePending(BOOL bPending);
  68. ///////////////////////////////
  69. // IsTakePicturePending
  70. //
  71. BOOL IsTakePicturePending();
  72. ///////////////////////////////
  73. // SnapshotCallback
  74. //
  75. // This function is called by the
  76. // WIA StreamSnapshot Filter
  77. // in wiasf.ax. It delivers to us
  78. // the newly captured still image.
  79. //
  80. static BOOL SnapshotCallback(HGLOBAL hDIB, LPARAM lParam);
  81. private:
  82. HRESULT CreateFileName(CSimpleString *pstrJPEG,
  83. CSimpleString *pstrBMP);
  84. BOOL DoesDirectoryExist(LPCTSTR pszDirectoryName);
  85. BOOL RecursiveCreateDirectory(const CSimpleString *pstrDirectoryName);
  86. HRESULT ConvertToJPEG(LPCTSTR pszInputFilename,
  87. LPCTSTR pszOutputFilename);
  88. HRESULT SaveToFile(HGLOBAL hDib,
  89. const CSimpleString *pstrJPEG,
  90. const CSimpleString *pstrBMP);
  91. SnapshotCallbackParam_t m_CaptureCallbackParams;
  92. SnapshotCallbackParam_t m_StillCallbackParams;
  93. CSimpleString m_strImageDir;
  94. CSimpleString m_strLastSavedFile;
  95. HANDLE m_hSnapshotReadyEvent;
  96. class CPreviewGraph *m_pPreviewGraph;
  97. // TRUE when caller calls TakePicture on CPreviewGraph
  98. // If image appears asynchronously, as in the case of a hardware
  99. // pushbutton event, this will be FALSE.
  100. BOOL m_bTakePicturePending;
  101. UINT m_uiFileNumStartPoint;
  102. };
  103. #endif // _STILLPRC_H_