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.

72 lines
1.8 KiB

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