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.

86 lines
2.5 KiB

8 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
8 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
8 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __VIDEO_THUMB_WIDGET_HEADER__
  2. #define __VIDEO_THUMB_WIDGET_HEADER__
  3. #ifndef __linux__
  4. #include <winsock2.h>
  5. #include <ws2tcpip.h>
  6. #endif
  7. #include <vector>
  8. #include <opencv2/opencv.hpp>
  9. #include "../../components/base/basicLIBAV.h"
  10. #include "../../components/base/basicMediaDestination.h"
  11. //#include "../../components/base/basicMediaViewer.h"
  12. #include "../../components/base/basicMutex.h"
  13. #include "../guiClass.h"
  14. class DialogSettingsCamera;
  15. class VideoSourceChooser;
  16. class basicCamera;
  17. class VideoThumbWidget : public QWidget, public basicMediaDestination {
  18. //class VideoThumbWidget : public QWidget, public basicMediaViewer{
  19. private:
  20. U8 m_bStatus;
  21. int m_nMouseX;
  22. int m_nMouseY;
  23. bool m_bMouseActive;
  24. bool m_bSelected;
  25. int m_nMenuActivityCounter;
  26. bool m_bGrayScale;
  27. bool m_bEnhanced;
  28. bool m_bErrorMode;
  29. CSTR m_pErrorMsg;
  30. bool m_bDirectDrawing;
  31. basicCamera *m_pSignalParameter;
  32. VideoSourceChooser *m_pParent;
  33. DialogSettingsCamera *m_pSettingsDialog;
  34. FrameAspectRatio m_eWidgetAspectRatio;
  35. FrameAspectRatio m_eStreamAspectRatio;
  36. basicLogCollection *m_pLog;
  37. IplImage *m_pGraber;
  38. cv::Mat *m_mFrame;
  39. cv::Mat *m_mOutput;
  40. //basicVideoSource *m_pCapture;
  41. basicMutex *m_pPropertiesProtectorMutex;
  42. basicMutex *m_pWidgetProtectorMutex;
  43. void m_fThreadProc(void);
  44. protected:
  45. QPixmap *m_pPixmap;
  46. QPixmap *m_pOverlayPixmap;
  47. public:
  48. explicit VideoThumbWidget(QWidget *parent = NULL);
  49. ~VideoThumbWidget();
  50. virtual void render(QPainter *painter);
  51. bool init( void );
  52. virtual void pushFrame(cv::Mat *Frame, void *src = NULL);
  53. void setSignalParameter(VideoSourceChooser *P, basicCamera *A){ m_pParent = P; m_pSignalParameter = A; };
  54. void showSettingsWindow( bool doModal );
  55. void setSourceType(int Type);
  56. void setError( bool AAA, CSTR Message = NULL );
  57. signals:
  58. void selected(void *P);
  59. public slots:
  60. void setGrayScale();
  61. void setEnhanced();
  62. void showCameraSettings();
  63. void removeThisCamera();
  64. void renderLater();
  65. void renderNow();
  66. void ShowContextMenu(const QPoint &pos);
  67. protected:
  68. bool event(QEvent *event);
  69. //void resizeEvent(QResizeEvent *event);
  70. void exposeEvent(QExposeEvent *event);
  71. void paintEvent(QPaintEvent *event);
  72. //void drawContents(QPainter * p, const QRectF & rect = QRectF());
  73. private:
  74. bool m_bUpdateIsPending;
  75. QTimer *m_pTimer;
  76. };
  77. #endif