00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date: $ 00006 Version: $Revision: -1 $ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #ifndef QmitkOpenCVVideoControls_h 00019 #define QmitkOpenCVVideoControls_h 00020 00021 #include <cv.h> 00022 #include <ui_QmitkOpenCVVideoControls.h> 00023 #include <mitkOpenCVVideoSupportUIExports.h> 00024 00025 class QmitkStdMultiWidget; 00026 class QmitkVideoBackground; 00027 namespace mitk 00028 { 00029 class VideoSource; 00030 class OpenCVVideoSource; 00031 } 00032 00038 class MITK_OPENCVVIDEOSUPPORTUI_EXPORT QmitkOpenCVVideoControls : public QWidget 00039 { 00040 Q_OBJECT 00041 00042 public: 00046 QmitkOpenCVVideoControls(QmitkVideoBackground* _VideoBackground, QmitkStdMultiWidget* _MultiWidget 00047 , QWidget * parent = 0, Qt::WindowFlags f = 0); 00048 00052 virtual ~QmitkOpenCVVideoControls(); 00053 00057 void SetStdMultiWidget(QmitkStdMultiWidget* _MultiWidget); 00058 00062 QmitkStdMultiWidget* GetStdMultiWidget() const; 00063 00067 void SetVideoBackground(QmitkVideoBackground* _VideoBackground); 00068 00072 QmitkVideoBackground* GetVideoBackground() const; 00073 signals: 00077 void NewOpenCVFrameAvailable(const IplImage*); 00078 00079 protected slots: 00080 void on_UseGrabbingDeviceButton_clicked(bool checked=false); 00081 void on_UseVideoFileButton_clicked(bool checked=false); 00082 void on_VideoProgressSlider_sliderPressed(); 00083 void on_VideoProgressSlider_sliderReleased(); 00084 void on_RepeatVideoButton_clicked( bool checked=false ); 00085 void on_PlayButton_clicked(bool checked=false); 00086 void on_StopButton_clicked(bool checked=false); 00087 void Stop(); 00088 void Reset(); 00089 void SwitchPlayButton(bool paused); 00090 void QObjectDestroyed( QObject * obj = 0 ); 00091 00092 void NewFrameAvailable(mitk::VideoSource* videoSource); 00093 protected: 00094 QmitkVideoBackground* m_VideoBackground; 00095 QmitkStdMultiWidget* m_MultiWidget; 00096 mitk::OpenCVVideoSource* m_VideoSource; 00097 Ui::QmitkOpenCVVideoControls* m_Controls; 00098 bool m_SliderCurrentlyMoved; 00099 }; 00100 00101 #endif